UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

71 lines (70 loc) 1.79 kB
import type { ToolCall } from '../../../types/ToolCall'; import type { ParsedCitation } from './parseCitationsFromContent'; /** * Origin metadata for a tool call or citation executed by a teammate. * * @private utility of `<Chat/>` */ export type ToolCallOrigin = { /** * Human-readable label for the teammate. */ label: string; /** * Optional teammate URL. */ url?: string; /** * Optional tool name for the teammate. */ toolName?: string; }; /** * Tool call data enriched with its teammate origin. * * @private utility of `<Chat/>` */ export type TransitiveToolCall = { /** * Tool call executed by the teammate. */ toolCall: ToolCall; /** * Teammate origin metadata for the tool call. */ origin: ToolCallOrigin; }; /** * Citation data enriched with its teammate origin. * * @private utility of `<Chat/>` */ export type TransitiveCitation = ParsedCitation & { /** * Teammate origin metadata for the citation. */ origin: ToolCallOrigin; }; /** * Aggregated teammate tool calls and citations derived from TEAM tool results. * * @private utility of `<Chat/>` */ export type TeamToolCallSummary = { /** * Tool calls executed by teammates, flattened transitively. */ toolCalls: TransitiveToolCall[]; /** * Citations referenced by teammates, flattened transitively. */ citations: TransitiveCitation[]; }; /** * Collects tool calls and citations from TEAM tool call results, resolving nested teammate chains. * * @param toolCalls - Tool calls from the top-level agent message. * * @private utility of `<Chat/>` */ export declare function collectTeamToolCallSummary(toolCalls: ReadonlyArray<ToolCall> | undefined): TeamToolCallSummary;