import { type ApprovalId, type Json, type RunContext, type ToolCall, type ToolDescriptor, type ToolOutcome, type ToolRegistry } from "@vendoai/core"; import { type AppDocument } from "../../contract/index.js"; /** * The name half of core's 01 §8 `fn:` grammar, bounded at 64 characters * — the documented bound for `POST /fn/`, and the one the manifest parser * and the HTTP wire route already enforce. Unbounded here meant a long name * dispatched in-process and 400'd over the wire. */ export declare const FN_NAME_PATTERN: RegExp; /** 06-apps §4.1 — internal execution surface shared by open() and call(). */ export interface AppCaller { call(app: AppDocument, ref: string, args: Json, ctx: RunContext): Promise; callFn(app: AppDocument, name: string, args: Json, ctx: RunContext): Promise; callQuery(app: AppDocument, ref: string, args: Json, ctx: RunContext): Promise; } /** * W0 — hooks the runtime attaches to capture the exact parked call. When a * mutating in-app ACTION (call(), not a read query) parks on an approval, the * runtime records the byte-exact call + context so it can re-dispatch it when * the owner approves (see parked-action.ts). Only actions resume, because only * actions have an effect to land — a parked QUERY is satisfied by the surface's * own refetch riding the approval, which is what `queryCallId` below is for. */ export interface AppCallerHooks { onParkedAction(app: AppDocument, call: ToolCall, ctx: RunContext, approvalId: ApprovalId): Promise; } /** The teaching error for a unit mismatch this seam can PROVE, or undefined. * Walks the args against the tool's input schema (nested objects included). */ export declare const amountUnitIssue: (descriptor: ToolDescriptor, args: Json) => string | undefined; export declare const fnOutcome: (name: string) => ToolOutcome; /** 06-apps §4.1 — resolve fn: references and guard-bound host tools. */ export declare const createAppCaller: (tools: ToolRegistry, hooks?: AppCallerHooks) => AppCaller; //# sourceMappingURL=call.d.ts.map