/** * The tool-call record's server-row discipline, shared by every writer of * server rows (the tool converter and the subagent bridge): issue before the * body runs, settle in `finally`, and never settle a park. */ import { type ToolCallOrigin } from "@b4run/sdk"; /** * Where the current tool call is being issued from, read off the subagent * stack the bridge carries in `config.metadata.b4.subagent_stack`: the top * entry's route key and the `task` call that launched it. `undefined` at the * root, and for a stack entry written before route keys were stacked. */ export declare function readCallOrigin(config: unknown): ToolCallOrigin | undefined; /** * Run `body` as one recorded server tool call. With no server-call recorder on * `config`, or no provider tool-call id, the body runs untouched. Otherwise * `issue` runs first, with the call's `origin` (the issuing subagent route and * its launching `task` call; absent at the root) forwarded untouched — a call * the server cannot account for must not run, so an issue failure is the * call's error — and `settle` runs in `finally` for a return (a refusal * returned as text included), a throw and an abort, but NOT for a * `GraphInterrupt`: a park is not completion. The resumed re-execution issues * again (a no-op on the key) and settles when the body really returns or * throws. A settle failure is warned * and swallowed: the body already ran, and an unsettled server row is never * answerable and only delays pruning. */ export declare function recordToolCall(config: unknown, call: { readonly toolCallId: string; readonly toolName: string; readonly origin?: ToolCallOrigin; }, body: () => Promise): Promise; //# sourceMappingURL=tool-call-recording.d.ts.map