/** * jsm_call — invoke one operation from the code API. * * This is the tool that makes the other ninety-four unnecessary in the tool * list. The whole catalogue is reachable through it, so a client pays for one * description instead of ninety-four schemas, and an operation nobody calls * costs nothing. * * Read-only by construction. Writes go through jsm_apply, one per call, so a * client sees and can approve each one by name — see the note there for why one * dispatcher holding all thirty-seven destructive operations behind a single * approval would be worse than the tools it replaced. */ import { type AnyToolDefinition } from "../define.js"; import { type CallContext } from "./context.js"; import type { Dispatcher } from "./dispatch.js"; import type { CodeLimits } from "./limits.js"; import type { OperationRegistry } from "./registry.js"; export interface CodeToolDependencies { registry: OperationRegistry; dispatcher: Dispatcher; limits: CodeLimits; /** Builds a fresh per-invocation context. Supplied so tests can fix the clock. */ newContext: (allowWrites?: string[]) => CallContext; } /** * Turns whatever went wrong into one message the model can act on. * * Every code-mode error carries a `kind`, and the kinds have different fixes — * a dispatch refusal means change the call, a budget means narrow the work, an * operation error means read the API's own advice. Flattening them to "it * failed" is how a model retries the same broken call three times. */ export declare function describeFailure(invocationId: string, error: unknown): string; export declare function createCallTool(dependencies: CodeToolDependencies): AnyToolDefinition; //# sourceMappingURL=call.d.ts.map