import type { AgencyFunction } from "../runtime/agencyFunction.js"; import type { InterruptEffect } from "../symbolTable.js"; import type { ServedInvocationOutcome } from "../runtime/invocationUsage.js"; import type { InvocationOptions } from "../runtime/invocationOptions.js"; export type ExportedFunction = { kind: "function"; name: string; description: string; /** Names of the function's parameters, in declaration order — mirrors * `ExportedNode.parameters` so the manifest describes both the same way. */ parameters: Array<{ name: string; }>; agencyFunction: AgencyFunction; interruptEffects: InterruptEffect[]; /** * Invoke the function for a single request and return its raw value, or throw * the identical error. Unchanged public contract — the member host apps that * construct/consume `ExportedFunction` directly depend on. */ invoke: (namedArgs: Record) => Promise; }; export type ExportedNode = { kind: "node"; name: string; parameters: Array<{ name: string; }>; /** Positional args → raw `RunNodeResult`, or throw. Unchanged public contract. */ invoke: (...args: unknown[]) => Promise; interruptEffects: InterruptEffect[]; }; export type ExportedItem = ExportedFunction | ExportedNode; export type ServedExportedFunction = ExportedFunction & { invokeServed: (namedArgs: Record, invocation?: InvocationOptions) => Promise>; }; export type ServedExportedNode = ExportedNode & { invokeServed: (data: Record, invocation?: InvocationOptions) => Promise>; }; export type ServedExportedItem = ServedExportedFunction | ServedExportedNode;