import type { ContextOperationRequest } from '../context.ts'; import type { ComposedWorkflowInterceptor } from '../interceptor.ts'; import type { StartOptions, WorkflowState } from '../types.ts'; import type { WorkflowHandle } from './handles.ts'; import type { EngineInternals } from './internals.ts'; type ChildWorkflowOperation = Extract; export type ChildWorkflowOperationCallbacks = { runOperationWithResult: (workflowId: string, operation: ChildWorkflowOperation, execute: () => Promise) => Promise; /** * `skipAdmissionIdCheck` (WFT-95, internal only) is threaded straight through * to `startWorkflow`'s parameter of the same name — see its doc comment. It * is NEVER part of the public `StartOptions` a caller passes; only * `dispatchChildWorkflowStart`'s crash-reattach retry sets it, and only * after confirming a matching persisted child record already exists for * `childWorkflowId`. This retry always passes the literal `'reattach-only'`, * not `true`: the confirming read here is separate from * `startWorkflow`'s own atomic re-check, so `'reattach-only'` fences the * bypass to that re-check actually finding a match to reattach to (see * `startWorkflow`'s doc comment for the full TOCTOU race this closes). */ start: (type: string, input: unknown, options?: StartOptions, skipAdmissionIdCheck?: boolean | 'reattach-only') => Promise; loadWorkflowState: (workflowId: string) => Promise; getHandle: (workflowId: string) => WorkflowHandle; getComposedWorkflowInterceptor: () => ComposedWorkflowInterceptor | null; }; export declare function processChildWorkflowOperation(internals: EngineInternals, workflowId: string, operation: ChildWorkflowOperation, callbacks: ChildWorkflowOperationCallbacks): Promise; export declare function assertChildWorkflowNestingDepth(internals: EngineInternals, workflowId: string): number; export declare function getWorkflowNestingDepth(internals: EngineInternals, workflowId: string): number; export declare function executeChildWorkflow(internals: EngineInternals, workflowId: string, operation: ChildWorkflowOperation, currentDepth: number, callbacks: Pick): Promise; export {};