@suluk/chat - v0.2.1
    Preparing search index...

    Interface RunAgentOptions

    interface RunAgentOptions {
        messages: ChatMessage[];
        tools: McpTool[];
        clientTools?: ClientToolDef[];
        exec: (op: McpOp, args: Record<string, unknown>) => Promise<unknown>;
        complete: (
            messages: ChatMessage[],
            tools: OpenAITool[],
            onText: (d: string) => void | Promise<void>,
        ) => Promise<ChatMessage>;
        system?: string;
        maxSteps?: number;
        maxResultChars?: number;
    }
    Index

    Properties

    messages: ChatMessage[]

    Conversation so far (user/assistant turns); the system prompt is prepended from system.

    tools: McpTool[]
    clientTools?: ClientToolDef[]

    Browser-executed tool definitions (no handler) — surfaced to the model, dispatched to the widget by name.

    exec: (op: McpOp, args: Record<string, unknown>) => Promise<unknown>

    Execute a SERVER tool call against the store (e.g. appExec bound to the request).

    complete: (
        messages: ChatMessage[],
        tools: OpenAITool[],
        onText: (d: string) => void | Promise<void>,
    ) => Promise<ChatMessage>

    One streamed model completion: stream text via onText, resolve to the final assistant message.

    system?: string
    maxSteps?: number

    max model round-trips before forcing a stop (default 6).

    maxResultChars?: number

    cap each tool result's serialized length fed back to the model (default 8000 chars).