import { z } from 'zod'; import type { WorkflowDefinition } from '../../core/types.ts'; import type { AccessPolicy } from '../authorization.ts'; import type { AuthorizationDecision, OperationContext, OperationDefinition, TransportAvailability, UnknownKeyPolicy } from './types.ts'; declare const StartHandleSchema: z.ZodObject<{ workflowId: z.ZodString; status: z.ZodString; }, z.core.$strip>; type StartHandle = z.infer; type CatalogWorkflowRegistrationMetadata = Pick, 'description' | 'inputSchema' | 'tags'>; /** * Options accepted by {@link catalogWorkflow}. * * `mcpExposable` is REQUIRED. There is no default. The plan's MCP-readiness * ratchet enforces explicit per-operation declaration of MCP exposability * (see `mcp-readiness.test.ts`); the adapter forwards the caller's choice * verbatim so cataloged workflows participate in the same ratchet. * * No `engine` field. The engine instance comes from the runtime dispatch * context (the same `Engine` that runs `executeOperation`). Binding the * adapter to a specific engine instance was a footgun: an adapter created * for engine A could be dispatched by engine B and silently start the * workflow on the wrong engine. The dispatch context is the single source * of truth. * * No `outputSchema` field. The response shape is fixed at * `{ workflowId, status }` — the workflow's own result schema belongs on a * future `getResult`-shaped operation. * * No `mode` field. v1 ships start-only semantics. */ export type CatalogWorkflowOptions = { readonly name: string; readonly mcpExposable: boolean; readonly workflowType: string; readonly summary?: string; readonly tags?: ReadonlyArray; readonly inputSchema?: z.ZodObject; readonly registration?: CatalogWorkflowRegistrationMetadata; readonly access: AccessPolicy; readonly transports: TransportAvailability; readonly unknownKeyPolicy: UnknownKeyPolicy; readonly authorize?: (context: OperationContext) => Promise; }; /** * `catalogWorkflow()` — wrap a registered workflow as a typed * `OperationDefinition`. Produces one cataloged `start` operation per * workflow. Always returns the start handle ({ workflowId, status }); * never blocks awaiting the workflow result. * * Schemas are opt-in for v1; required when the operation is later flagged * as MCP-exposable (see `mcpExposable` ratchet in PR 6). */ export declare function catalogWorkflow(options: CatalogWorkflowOptions): OperationDefinition; export {};