projectToolCalls
Display only: projects the root transcript's tool calls into core tool calls,
in transcript order, for the toolCalls of a core snapshot. The identifiers
match toolCallIds and toolCallId on the messages from projectMessages.
- A call appears once its arguments are final (see
selectCalls). Empty argument text is a call without input, withargsundefined. - A call with a root tool record is
complete, with the record's text parsed as JSON when it is JSON and kept as text otherwise, orerrorwhen the record carries an error. - A call without a record is
runningwhile the session runs andpendingonce it stops, which is where a call waiting for a decision or a client tool sits. Final arguments that are not JSON make the call anerror. - Calls owned by a child-attributed record are not projected.
previous is an optional identity hint, as in projectMessages.
import { projectToolCalls } from '@threadplane/ag-ui';Declaration · overload 1
export declare function projectToolCalls(snapshot: Projectable, previous?: readonly ToolCall[]): readonly ToolCall[];Parameters
snapshot· requiredProjectableprevious· optionalreadonly ToolCall[]
Returns
readonly ToolCall[]