import type { ContextOperationRequest } from '../context.ts'; import type { EngineInternals } from './internals.ts'; import { type ActivityFunctionWithMetadata, type ActivityOperationCallbacks } from './operations-activity.ts'; import type { OperationWithCallerStack } from './operations-router.ts'; import type { SpeculativeExecutionState } from './speculative-execution-state.ts'; type WaitSignalOperation = Extract; type ParallelOperation = Extract; type RaceOperation = Extract; type RunAllOperation = Extract; /** * Reject a `ctx.race` / `ctx.all` whose branches wait on the SAME signal name, * recursively through nested `race` / `parallel` branches. Sibling wait-signal * branches share the `${workflowId}:${signalName}` waiter key, so two anywhere in * the coordination tree would clobber each other at registration, leaving one * branch permanently unreachable (the run would hang). Reject the meaningless * shape deterministically rather than silently dropping a branch. Distinct names * (the event-or-close idiom) are unaffected. */ export declare function assertSupportedSignalBranches(operations: readonly ContextOperationRequest[]): void; export type CoordinationOperationCallbacks = { completeOperation: (workflowId: string, value: unknown) => void; runOperationWithResult: (workflowId: string, operation: OperationWithCallerStack, execute: () => Promise) => Promise; executeSubOperation: (workflowId: string, operation: ContextOperationRequest, signal?: AbortSignal, speculativeState?: SpeculativeExecutionState) => Promise; getActivityOperationCallbacks: () => ActivityOperationCallbacks; }; export declare function processWaitSignalOperation(internals: EngineInternals, workflowId: string, operation: WaitSignalOperation, callbacks: Pick): Promise; export declare function processParallelOperation(internals: EngineInternals, workflowId: string, operation: ParallelOperation, callbacks: Pick): Promise; export declare function processRaceOperation(internals: EngineInternals, workflowId: string, operation: RaceOperation, callbacks: Pick): Promise; export declare function assertValidRaceBranchNames(operation: RaceOperation): void; export declare function wrapRaceWinner(operation: RaceOperation, winnerIndex: number, value: unknown): unknown; export declare function executeRaceSubOperations(internals: EngineInternals, workflowId: string, operations: readonly ContextOperationRequest[], execute: (operation: ContextOperationRequest, signal: AbortSignal) => Promise, parentSignal?: AbortSignal, wrapWinner?: (winnerIndex: number, value: unknown) => unknown, observeWinner?: (winnerIndex: number, error?: unknown) => void): Promise; export declare function processRunAllOperation(internals: EngineInternals, workflowId: string, operation: RunAllOperation, callbacks: Pick): Promise; export declare function isConfiguredInlineActivity(fn: Function): fn is RunAllOperation['branches'][string][0] & ActivityFunctionWithMetadata; /** * Used by `executeSubOperation`'s `'run-all'` case (nested run-all inside * another sub-operation). Speculative-execution path retained for * `ctx.speculate` callers that need verification/compensation tracking. * * This path does NOT write a partial cache entry — it's only invoked for * nested run-alls whose results live inside the outer parent's slot. The * outer parent's partial-persistence handles durability. */ export declare function executeRunAllOperationResult(internals: EngineInternals, workflowId: string, operation: RunAllOperation, callbacks: Pick, speculativeState?: SpeculativeExecutionState): Promise>; export {};