Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 230 additions & 2 deletions apps/website/content/docs/chat/api/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1821,6 +1821,12 @@
"description": "",
"optional": false
},
{
"name": "clientToolExecutionGuard",
"type": "InputSignal<ClientToolExecutionGuard | undefined>",
"description": "",
"optional": false
},
{
"name": "clientTools",
"type": "InputSignal<Readonly<Record<string, ClientToolDef>> | undefined>",
Expand Down Expand Up @@ -6309,6 +6315,12 @@
"description": "",
"optional": false
},
{
"name": "idempotent",
"type": "boolean",
"description": "",
"optional": true
},
{
"name": "kind",
"type": "\"function\"",
Expand Down Expand Up @@ -6688,6 +6700,134 @@
],
"examples": []
},
{
"name": "ClientToolExecutionGuard",
"kind": "interface",
"description": "Opt-in guard configuration for claim-before-execute client tools.",
"properties": [
{
"name": "store",
"type": "ClientToolExecutionStore",
"description": "",
"optional": false
},
{
"name": "threadId",
"type": "string",
"description": "",
"optional": false
}
],
"examples": []
},
{
"name": "ClientToolExecutionKey",
"kind": "interface",
"description": "Durable identity for one client-tool execution on one thread.",
"properties": [
{
"name": "threadId",
"type": "string",
"description": "",
"optional": false
},
{
"name": "toolCallId",
"type": "string",
"description": "",
"optional": false
}
],
"examples": []
},
{
"name": "ClientToolExecutionOptions",
"kind": "interface",
"description": "Execution policy options for browser-executed function tools.",
"properties": [
{
"name": "idempotent",
"type": "boolean",
"description": "True when the handler may safely re-run and should skip durable pre-claims.",
"optional": true
}
],
"examples": []
},
{
"name": "ClientToolExecutionStore",
"kind": "interface",
"description": "Structural store contract for guarded browser client-tool execution.",
"properties": [],
"methods": [
{
"name": "claim",
"signature": "claim(key: ClientToolExecutionKey): Promise<\"claimed\" | ClientToolExecutionRecord>",
"description": "Atomically claim a tool-call execution. Returns prior state when present.",
"params": [
{
"name": "key",
"type": "ClientToolExecutionKey",
"description": "",
"optional": false
}
]
},
{
"name": "lookup",
"signature": "lookup(threadId: string, toolCallIds: readonly string[]): Promise<Record<string, ClientToolExecutionRecord>>",
"description": "Lookup prior execution states for pending tool calls on a thread.",
"params": [
{
"name": "threadId",
"type": "string",
"description": "",
"optional": false
},
{
"name": "toolCallIds",
"type": "readonly string[]",
"description": "",
"optional": false
}
]
},
{
"name": "record",
"signature": "record(key: ClientToolExecutionKey, result: ClientToolResult): Promise<void>",
"description": "Record the final client-tool result for a claimed execution.",
"params": [
{
"name": "key",
"type": "ClientToolExecutionKey",
"description": "",
"optional": false
},
{
"name": "result",
"type": "ClientToolResult",
"description": "",
"optional": false
}
]
}
],
"examples": []
},
{
"name": "ClientToolExecutorOptions",
"kind": "interface",
"description": "Options for wiring automatic browser function-tool execution.",
"properties": [
{
"name": "executionGuard",
"type": "ClientToolExecutionGuard",
"description": "",
"optional": true
}
],
"examples": []
},
{
"name": "ClientToolsCapability",
"kind": "interface",
Expand Down Expand Up @@ -6980,6 +7120,12 @@
"description": "",
"optional": false
},
{
"name": "idempotent",
"type": "boolean",
"description": "",
"optional": true
},
{
"name": "kind",
"type": "\"function\"",
Expand Down Expand Up @@ -7979,6 +8125,13 @@
"signature": "AnyFunctionToolDef | ViewToolDef | AskToolDef",
"examples": []
},
{
"name": "ClientToolExecutionRecord",
"kind": "type",
"description": "Prior durable execution state returned by a client-tool execution store.",
"signature": "object | object | object",
"examples": []
},
{
"name": "ClientToolRegistry",
"kind": "type",
Expand Down Expand Up @@ -8158,7 +8311,7 @@
"name": "action",
"kind": "function",
"description": "Declare an async function tool the model can call; its resolved return value\nbecomes the tool result shipped back to the model.",
"signature": "action(description: string, schema: S, handler: (args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>): FunctionToolDef<S, R>",
"signature": "action(description: string, schema: S, handler: (args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>, options: ClientToolExecutionOptions): FunctionToolDef<S, R>",
"params": [
{
"name": "description",
Expand All @@ -8177,6 +8330,12 @@
"type": "(args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>",
"description": "Runs in the browser when the model calls the tool. The second\n argument carries an `AbortSignal`; its return type `R` is carried on the\n resulting FunctionToolDef.",
"optional": false
},
{
"name": "options",
"type": "ClientToolExecutionOptions",
"description": "Execution policy options, including `idempotent: true` to skip\n durable pre-execution claims when a guard is configured.",
"optional": true
}
],
"returns": {
Expand Down Expand Up @@ -8302,6 +8461,31 @@
},
"examples": []
},
{
"name": "clientToolGuardFailureResult",
"kind": "function",
"description": "Default fail-closed result when the execution guard itself cannot be reached.",
"signature": "clientToolGuardFailureResult(toolCallId: string, error: unknown): ClientToolResult",
"params": [
{
"name": "toolCallId",
"type": "string",
"description": "",
"optional": false
},
{
"name": "error",
"type": "unknown",
"description": "",
"optional": false
}
],
"returns": {
"type": "ClientToolResult",
"description": ""
},
"examples": []
},
{
"name": "createA2uiSurfaceStore",
"kind": "function",
Expand Down Expand Up @@ -8391,6 +8575,25 @@
},
"examples": []
},
{
"name": "defaultInterruptedClientToolResult",
"kind": "function",
"description": "Default fail-closed result for a stale in-progress client-tool execution.",
"signature": "defaultInterruptedClientToolResult(toolCallId: string): ClientToolResult",
"params": [
{
"name": "toolCallId",
"type": "string",
"description": "",
"optional": false
}
],
"returns": {
"type": "ClientToolResult",
"description": ""
},
"examples": []
},
{
"name": "deriveDomain",
"kind": "function",
Expand Down Expand Up @@ -8966,11 +9169,30 @@
},
"examples": []
},
{
"name": "shouldClaimBeforeExecute",
"kind": "function",
"description": "Return whether this function tool should claim before browser execution.",
"signature": "shouldClaimBeforeExecute(def: AnyFunctionToolDef): boolean",
"params": [
{
"name": "def",
"type": "AnyFunctionToolDef",
"description": "",
"optional": false
}
],
"returns": {
"type": "boolean",
"description": ""
},
"examples": []
},
{
"name": "startClientToolExecutor",
"kind": "function",
"description": "Watches the agent's pending client tool calls and auto-runs FUNCTION tools,\nresolving each with its result. View/ask (component) tools are handled by the\nrendering layer, not here. No-op if the agent lacks the clientTools\ncapability. MUST be called in an injection context (sets up an effect).",
"signature": "startClientToolExecutor(agent: Agent<>, registry: ClientToolRegistry): void",
"signature": "startClientToolExecutor(agent: Agent<>, registry: ClientToolRegistry, options: ClientToolExecutorOptions): void",
"params": [
{
"name": "agent",
Expand All @@ -8983,6 +9205,12 @@
"type": "ClientToolRegistry",
"description": "",
"optional": false
},
{
"name": "options",
"type": "ClientToolExecutorOptions",
"description": "",
"optional": true
}
],
"returns": {
Expand Down
Loading
Loading