@threadplane/ag-uiFunctionv0.3.7

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, with args undefined.
  • 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, or error when the record carries an error.
  • A call without a record is running while the session runs and pending once 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 an error.
  • 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 · required
Projectable
previous · optional
readonly ToolCall[]

Returns

readonly ToolCall[]