import type { Storage as WeftStorage } from '../../storage/interface.ts'; import { ActivityWorkerDispatcher } from '../../workers/activity-worker-dispatcher.ts'; import type { ComposedWorkflowInterceptor, Interceptor } from '../interceptor.ts'; import { type AnyActivityDefinition, type AnyWorkflowDefinition, type RegisteredWorkflowDefinition } from '../types.ts'; import type { WorkflowLogRecord } from '../types/workflow-log.ts'; import type { EngineConstructorOptions, ExecutionStrategyBundle, RegistrationEntry, ResolvedOptions } from './engine-internal-types.ts'; export type KnownWorkflowNames = Extract; declare const emptyWorkflowDefinitions: unique symbol; declare const emptyActivityDefinitions: unique symbol; export type EmptyWorkflowDefinitions = Record & { readonly [emptyWorkflowDefinitions]: true; }; export type EmptyActivityDefinitions = Record & { readonly [emptyActivityDefinitions]: true; }; export type EngineCreateRuntimeOptions = EngineConstructorOptions & { activities?: Record | undefined; workflows?: Record | undefined; recover?: boolean | undefined; acknowledgeUnknownWorkflowTypes?: boolean | undefined; startScheduler?: boolean | undefined; }; export type NormalizedWorkerExecutionConfiguration = { mode: 'inline'; workerExecution: null; } | { mode: 'worker'; workerExecution: NonNullable; workflowTurnTimeoutMs: number; maxProtocolMessageBytes: number; requireProtocolVersion: true; discardOnCancel: true; }; export declare function definitionEntries(definitions: Record | undefined): Array<[string, TDefinition]>; export declare function typedEngineView(engine: object): never; export declare function readEnvironmentVariableFromSources(name: string, sources: { bunEnv?: Record | undefined; processEnv?: Record | undefined; }): string | undefined; /** Test-only reset of the one-shot MemoryStorage-fallback warning latch. */ export declare function resetMemoryStorageFallbackWarningForTesting(): void; export declare function resolveEngineStorage(options?: EngineConstructorOptions): WeftStorage; export declare function resolveEngineInterceptors(options?: EngineConstructorOptions): Interceptor[]; export declare function copyWorkflowDefinition(type: string, registration: RegistrationEntry): RegisteredWorkflowDefinition; export declare function resolveEngineOptions(storage: WeftStorage, options: EngineConstructorOptions | undefined, getNow: () => number): ResolvedOptions; export declare function normalizeWorkerExecutionConfiguration(options: EngineConstructorOptions | undefined): NormalizedWorkerExecutionConfiguration; export declare function createExecutionStrategyBundle(parameters: { options: EngineConstructorOptions | undefined; getNow: () => number; maxNestingDepth: number; development: boolean; broadcastEvents: boolean; getRegistration: (workflowType: string, workflowId: string) => RegistrationEntry | undefined; /** Live accessor for registered workflow type names (WFT-28); registrations are still empty here. */ listRegisteredWorkflowTypes: () => Iterable; getComposedWorkflowInterceptor?: () => ComposedWorkflowInterceptor | null; resolveWorkflowType: (target: string | Function) => string; registerCancelHandler?: (workflowId: string, handler: () => Promise | void) => () => void; recordFinalizerState?: (workflowId: string, value: unknown) => void; getWorkflowServices?: (workflowId: string) => unknown; getLogSink?: () => ((record: WorkflowLogRecord) => void) | undefined; }): ExecutionStrategyBundle; export declare function createActivityWorkerDispatcher(activityExecution: EngineConstructorOptions['activityExecution']): ActivityWorkerDispatcher | null; export {};