import type { QueuedInlineWorkflowExecutionStart } from './engine-internal-types.ts'; import type { EngineInternals } from './internals.ts'; export type InlineLaunchQueueCallbacks = { processPendingUpdatesAfterInlineAdvance: (workflowId: string) => Promise; swallowPromiseRejection: (promise: Promise | undefined) => Promise; }; /** Queue a new inline workflow start and schedule a flush if one is not already scheduled. */ export declare function queueInlineWorkflowExecutionStart(internals: EngineInternals, start: QueuedInlineWorkflowExecutionStart, callbacks: InlineLaunchQueueCallbacks): void; export declare function flushQueuedInlineWorkflowStarts(internals: EngineInternals, callbacks: InlineLaunchQueueCallbacks, options?: { abortStartedWorkflows?: boolean; }): Promise; /** Used by scheduler-driven direct backfill flushes. Clears the scheduled flag first. */ export declare function flushQueuedInlineWorkflowStartsDirectly(internals: EngineInternals, callbacks: InlineLaunchQueueCallbacks): Promise; /** * Drain every pending inline launch before engine teardown. Called from * `[Symbol.asyncDispose]` *before* `disposeEngine` aborts the signal, so the * flush actually executes the queued starts (the abort check in * {@link flushQueuedInlineWorkflowStarts} would otherwise discard them). This * turns a deferred-launch macrotask into work that completes before * `asyncDispose` returns, so a disposed engine leaves no dangling pending * launch — the fix for the test-runner macrotask-starvation footgun. * * A queued start that was already aborted (signal set before this is reached) * is left for the synchronous `disposeQueuedInlineWorkflowStarts` path, which * discards it and settles its `defer: false` awaiter. */ export declare function drainQueuedInlineWorkflowStarts(internals: EngineInternals, callbacks: InlineLaunchQueueCallbacks, options?: { abortStartedWorkflows?: boolean; }): Promise; export declare function dropQueuedInlineWorkflowStart(internals: EngineInternals, workflowId: string): boolean; export declare function disposeQueuedInlineWorkflowStarts(internals: EngineInternals): void; export declare function hasQueuedInlineWorkflowStart(internals: EngineInternals, workflowId: string): boolean; export declare function hasQueuedOrLaunchingInlineWorkflowStart(internals: EngineInternals, workflowId: string): boolean; export declare function isInlineWorkflowLocallyOwned(internals: EngineInternals, workflowId: string, workflowStatus: string): boolean; export declare function hasLocalCheckpointOwnership(internals: EngineInternals, workflowId: string, workflowStatus: string): boolean;