bothy-sdk
    Preparing search index...

    Class RecordingHandler

    An AgentHandler that records its calls and can block in prepare or execute.

    let release = (): void => undefined;
    const gate = new Promise<void>((r) => (release = r));
    const handler = new RecordingHandler({ blockPrepare: gate });
    // ... later
    release();
    handler.count("execute"); // 1 once the run started

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    autocompleteChoices: readonly {}[] = []

    The choices onAutocomplete returns.

    autocompleteDelayMs: number = 0

    The wait of onAutocomplete on RecordingHandler.clock, in milliseconds.

    billing: string | undefined

    The actual billing mode; undefined follows the token's claim.

    blockExecute: PromiseLike<void> | undefined

    When set, execute waits for it.

    blockPrepare: PromiseLike<void> | undefined

    When set, prepare waits for it.

    calls: [string, string | undefined][] = []

    Every call as [name, runId], in order.

    changed: boolean = false

    true once any call was recorded (Python's changed event, as a flag).

    clock: Clock | undefined

    The clock of the autocomplete wait (the scenarios set the server's clock).

    events: Envelope[] = []

    The envelopes onEvent received, in order.

    handles: Map<string, RunHandle> = ...

    The handle of each run seen in prepare or execute.

    invocations: Invocation[] = []

    The invocations prepare received, in order.

    toolClass: "host" | "chat" | "scoped"

    The actual tool class.

    Methods

    • Returns how often name was called (for runId when given).

      Parameters

      • name: string

        prepare, execute, onFollowup, ...

      • OptionalrunId: string

        The run to count for.

      Returns number

      The count.