@threadplane/coreInterfacev0.3.7

AgentClientTools

Optional session capability for tools the caller declares and runs itself, after the session exists. The calls waiting for a result are listed in the snapshot's pendingClientTools; this object carries only the commands.

A session created with a fixed handler map runs its tools itself and may leave this capability undefined.

import type { AgentClientTools } from '@threadplane/core';

Declaration

export interface AgentClientTools  {
  flush?(): void | Promise<void>;
  resolve(toolCallId: string, result: ClientToolResult): void;
  setCatalog(specs: readonly ClientToolSpec[]): void;
  settle?(toolCallId: string, result: ClientToolResult): void;
}

Members

flush · overload 1

Optional: makes every result recorded through settle durable on the backend without continuing the run. Does nothing on a session whose settle is already durable. A session that buffers results clears the buffer only after a successful write, so a failure leaves them for a later flush or submission.

flush?(): void | Promise<void>;

Returns

void | Promise<void>

resolve · overload 1

Records one call's result and continues the run. Throws when no pending call has that id.

resolve(toolCallId: string, result: ClientToolResult): void;

Parameters

toolCallId · required
string
result · required
ClientToolResult

Returns

void

setCatalog · overload 1

Replaces the catalog sent to the model with each later run. May be called any number of times; an empty list declares no tools.

setCatalog(specs: readonly ClientToolSpec[]): void;

Parameters

specs · required
readonly ClientToolSpec[]

Returns

void

settle · overload 1

Optional: records one call's result without continuing the run. The call leaves pendingClientTools. Throws when no pending call has that id.

settle?(toolCallId: string, result: ClientToolResult): void;

Parameters

toolCallId · required
string
result · required
ClientToolResult

Returns

void