stageflow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/agent/activity.d.ts +76 -0
  4. package/dist/agent/activity.js +89 -0
  5. package/dist/agent/activityObserver.d.ts +17 -0
  6. package/dist/agent/activityObserver.js +66 -0
  7. package/dist/agent/cursorExtension.d.ts +12 -0
  8. package/dist/agent/cursorExtension.js +88 -0
  9. package/dist/agent/cursorProvider.d.ts +14 -0
  10. package/dist/agent/cursorProvider.js +139 -0
  11. package/dist/agent/fakeAgent.d.ts +29 -0
  12. package/dist/agent/fakeAgent.js +295 -0
  13. package/dist/agent/oauthSessionManager.d.ts +33 -0
  14. package/dist/agent/oauthSessionManager.js +214 -0
  15. package/dist/agent/piAdapter.d.ts +128 -0
  16. package/dist/agent/piAdapter.js +967 -0
  17. package/dist/agent/port.d.ts +63 -0
  18. package/dist/agent/port.js +46 -0
  19. package/dist/agent/providerAuth.d.ts +101 -0
  20. package/dist/agent/providerAuth.js +282 -0
  21. package/dist/agent/providerSupport.d.ts +28 -0
  22. package/dist/agent/providerSupport.js +19 -0
  23. package/dist/cli/providersCommand.d.ts +11 -0
  24. package/dist/cli/providersCommand.js +275 -0
  25. package/dist/cli/terminalAuthInteraction.d.ts +8 -0
  26. package/dist/cli/terminalAuthInteraction.js +65 -0
  27. package/dist/cli/terminalSecret.d.ts +2 -0
  28. package/dist/cli/terminalSecret.js +67 -0
  29. package/dist/cli/validateCommand.d.ts +11 -0
  30. package/dist/cli/validateCommand.js +81 -0
  31. package/dist/cli/validateOutput.d.ts +8 -0
  32. package/dist/cli/validateOutput.js +75 -0
  33. package/dist/cli.d.ts +2 -0
  34. package/dist/cli.js +273 -0
  35. package/dist/config/createPipeline.d.ts +31 -0
  36. package/dist/config/createPipeline.js +255 -0
  37. package/dist/config/createStage.d.ts +25 -0
  38. package/dist/config/createStage.js +181 -0
  39. package/dist/config/listConfig.d.ts +33 -0
  40. package/dist/config/listConfig.js +195 -0
  41. package/dist/config/listExtensions.d.ts +26 -0
  42. package/dist/config/listExtensions.js +50 -0
  43. package/dist/config/listSkills.d.ts +29 -0
  44. package/dist/config/listSkills.js +55 -0
  45. package/dist/config/loadOutcome.d.ts +27 -0
  46. package/dist/config/loadOutcome.js +6 -0
  47. package/dist/config/loadPipeline.d.ts +25 -0
  48. package/dist/config/loadPipeline.js +196 -0
  49. package/dist/config/loadStage.d.ts +4 -0
  50. package/dist/config/loadStage.js +127 -0
  51. package/dist/config/loadTask.d.ts +7 -0
  52. package/dist/config/loadTask.js +69 -0
  53. package/dist/config/readYamlObject.d.ts +1 -0
  54. package/dist/config/readYamlObject.js +5 -0
  55. package/dist/config/resolvePipelineDag.d.ts +12 -0
  56. package/dist/config/resolvePipelineDag.js +282 -0
  57. package/dist/config/validateCatalog.d.ts +36 -0
  58. package/dist/config/validateCatalog.js +322 -0
  59. package/dist/envelope/check.d.ts +3 -0
  60. package/dist/envelope/check.js +52 -0
  61. package/dist/envelope/payloadSchema.d.ts +10 -0
  62. package/dist/envelope/payloadSchema.js +91 -0
  63. package/dist/hitl/qaTrail.d.ts +31 -0
  64. package/dist/hitl/qaTrail.js +65 -0
  65. package/dist/index.d.ts +13 -0
  66. package/dist/index.js +7 -0
  67. package/dist/mcp/projectRun.d.ts +37 -0
  68. package/dist/mcp/projectRun.js +57 -0
  69. package/dist/mcp/readArtifact.d.ts +2 -0
  70. package/dist/mcp/readArtifact.js +46 -0
  71. package/dist/mcp/server.d.ts +7 -0
  72. package/dist/mcp/server.js +26 -0
  73. package/dist/mcp/tools.d.ts +9 -0
  74. package/dist/mcp/tools.js +96 -0
  75. package/dist/package-meta.d.ts +1 -0
  76. package/dist/package-meta.js +1 -0
  77. package/dist/prompt/priorEnvelope.d.ts +2 -0
  78. package/dist/prompt/priorEnvelope.js +5 -0
  79. package/dist/runstore/catalog.d.ts +8 -0
  80. package/dist/runstore/catalog.js +16 -0
  81. package/dist/runstore/createStore.d.ts +15 -0
  82. package/dist/runstore/createStore.js +23 -0
  83. package/dist/runstore/disk/DiskRunStore.d.ts +30 -0
  84. package/dist/runstore/disk/DiskRunStore.js +238 -0
  85. package/dist/runstore/disk/catalogHelpers.d.ts +11 -0
  86. package/dist/runstore/disk/catalogHelpers.js +102 -0
  87. package/dist/runstore/layout.d.ts +22 -0
  88. package/dist/runstore/layout.js +58 -0
  89. package/dist/runstore/paths.d.ts +7 -0
  90. package/dist/runstore/paths.js +60 -0
  91. package/dist/runstore/pipelineDagSnapshot.d.ts +5 -0
  92. package/dist/runstore/pipelineDagSnapshot.js +43 -0
  93. package/dist/runstore/port.d.ts +146 -0
  94. package/dist/runstore/port.js +28 -0
  95. package/dist/runstore/runProjection.d.ts +6 -0
  96. package/dist/runstore/runProjection.js +102 -0
  97. package/dist/runstore/sqlite/SqliteRunStore.d.ts +48 -0
  98. package/dist/runstore/sqlite/SqliteRunStore.js +460 -0
  99. package/dist/runstore/sqlite/migrateFromDisk.d.ts +5 -0
  100. package/dist/runstore/sqlite/migrateFromDisk.js +108 -0
  101. package/dist/runstore/sqlite/schema.d.ts +1 -0
  102. package/dist/runstore/sqlite/schema.js +59 -0
  103. package/dist/runstore/stageExecution.d.ts +13 -0
  104. package/dist/runstore/stageExecution.js +22 -0
  105. package/dist/runstore/stageSnapshot.d.ts +2 -0
  106. package/dist/runstore/stageSnapshot.js +46 -0
  107. package/dist/runstore/syntheticStageSnapshot.d.ts +2 -0
  108. package/dist/runstore/syntheticStageSnapshot.js +10 -0
  109. package/dist/runstore/trackProjection.d.ts +7 -0
  110. package/dist/runstore/trackProjection.js +94 -0
  111. package/dist/runstore/workspaceLayout.d.ts +31 -0
  112. package/dist/runstore/workspaceLayout.js +172 -0
  113. package/dist/runtime/answerResume.d.ts +16 -0
  114. package/dist/runtime/answerResume.js +22 -0
  115. package/dist/runtime/credentialBinding.d.ts +16 -0
  116. package/dist/runtime/credentialBinding.js +80 -0
  117. package/dist/runtime/dagTraversal.d.ts +3 -0
  118. package/dist/runtime/dagTraversal.js +26 -0
  119. package/dist/runtime/envelopeRouting.d.ts +20 -0
  120. package/dist/runtime/envelopeRouting.js +59 -0
  121. package/dist/runtime/hitlSeams.d.ts +38 -0
  122. package/dist/runtime/hitlSeams.js +2 -0
  123. package/dist/runtime/pipelineRunner.d.ts +77 -0
  124. package/dist/runtime/pipelineRunner.js +141 -0
  125. package/dist/runtime/pipelineScheduler.d.ts +90 -0
  126. package/dist/runtime/pipelineScheduler.js +494 -0
  127. package/dist/runtime/pipelineValidationError.d.ts +6 -0
  128. package/dist/runtime/pipelineValidationError.js +8 -0
  129. package/dist/runtime/resumeReconstruct.d.ts +33 -0
  130. package/dist/runtime/resumeReconstruct.js +144 -0
  131. package/dist/runtime/runManager.d.ts +129 -0
  132. package/dist/runtime/runManager.js +818 -0
  133. package/dist/runtime/runRetryCoordinator.d.ts +85 -0
  134. package/dist/runtime/runRetryCoordinator.js +372 -0
  135. package/dist/runtime/settingsFile.d.ts +17 -0
  136. package/dist/runtime/settingsFile.js +88 -0
  137. package/dist/runtime/stageAttemptBootstrap.d.ts +40 -0
  138. package/dist/runtime/stageAttemptBootstrap.js +82 -0
  139. package/dist/runtime/stageAttemptContext.d.ts +11 -0
  140. package/dist/runtime/stageAttemptContext.js +26 -0
  141. package/dist/runtime/stageConcurrency.d.ts +10 -0
  142. package/dist/runtime/stageConcurrency.js +51 -0
  143. package/dist/runtime/stageHitl.d.ts +95 -0
  144. package/dist/runtime/stageHitl.js +198 -0
  145. package/dist/runtime/stageProcessLauncher.d.ts +45 -0
  146. package/dist/runtime/stageProcessLauncher.js +199 -0
  147. package/dist/runtime/stageRecovery.d.ts +10 -0
  148. package/dist/runtime/stageRecovery.js +43 -0
  149. package/dist/runtime/stageRoots.d.ts +22 -0
  150. package/dist/runtime/stageRoots.js +93 -0
  151. package/dist/runtime/stageRunner.d.ts +59 -0
  152. package/dist/runtime/stageRunner.js +221 -0
  153. package/dist/runtime/stageWorker.d.ts +6 -0
  154. package/dist/runtime/stageWorker.js +109 -0
  155. package/dist/runtime/stageWorkerProtocol.d.ts +27 -0
  156. package/dist/runtime/stageWorkerProtocol.js +16 -0
  157. package/dist/runtime/taskInput.d.ts +15 -0
  158. package/dist/runtime/taskInput.js +38 -0
  159. package/dist/server/http.d.ts +31 -0
  160. package/dist/server/http.js +561 -0
  161. package/dist/server/providerRoutes.d.ts +15 -0
  162. package/dist/server/providerRoutes.js +186 -0
  163. package/dist/tools/askOperator.d.ts +185 -0
  164. package/dist/tools/askOperator.js +409 -0
  165. package/dist/tools/emitStageEnvelope.d.ts +42 -0
  166. package/dist/tools/emitStageEnvelope.js +61 -0
  167. package/dist/tools/writeStageArtifact.d.ts +26 -0
  168. package/dist/tools/writeStageArtifact.js +103 -0
  169. package/dist/types/envelope.d.ts +12 -0
  170. package/dist/types/envelope.js +6 -0
  171. package/dist/types/pipeline.d.ts +25 -0
  172. package/dist/types/pipeline.js +1 -0
  173. package/dist/types/stage.d.ts +12 -0
  174. package/dist/types/stage.js +6 -0
  175. package/dist/types/task.d.ts +7 -0
  176. package/dist/types/task.js +1 -0
  177. package/dist/ui/assets/index-Cry0Tpfx.js +118 -0
  178. package/dist/ui/assets/index-DCsDopak.css +1 -0
  179. package/dist/ui/index.html +21 -0
  180. package/package.json +72 -0
@@ -0,0 +1,77 @@
1
+ import type { AgentPort } from "../agent/port.js";
2
+ import type { RunStore } from "../runstore/port.js";
3
+ import type { StageEnvelope } from "../types/envelope.js";
4
+ import type { StageHitlController } from "./stageHitl.js";
5
+ import type { LoadedPipeline } from "../types/pipeline.js";
6
+ import type { TaskFile } from "../types/task.js";
7
+ import { type StageExecutionMode } from "./stageConcurrency.js";
8
+ import { StageProcessLauncher } from "./stageProcessLauncher.js";
9
+ import type { OperatorCatalog } from "./stageAttemptBootstrap.js";
10
+ export { PipelineValidationError } from "./pipelineValidationError.js";
11
+ export type PipelineRunResult = {
12
+ ok: boolean;
13
+ runDir: string;
14
+ runId: string;
15
+ reason?: string;
16
+ };
17
+ export type StartedPipeline = {
18
+ runId: string;
19
+ runDir: string;
20
+ done: Promise<PipelineRunResult>;
21
+ };
22
+ export type PreparedPipeline = {
23
+ task: TaskFile;
24
+ loaded: LoadedPipeline;
25
+ run: {
26
+ runId: string;
27
+ workspaceDir: string;
28
+ };
29
+ agent: AgentPort;
30
+ store: RunStore;
31
+ cwd: string;
32
+ checkoutRoot?: string;
33
+ hitl?: StageHitlController;
34
+ executionMode?: StageExecutionMode;
35
+ stageProcessLauncher?: StageProcessLauncher;
36
+ operatorCatalog?: OperatorCatalog;
37
+ };
38
+ export type ExecuteStagesOptions = {
39
+ maxActiveStagesPerRun?: number;
40
+ resumeFromStageId?: string;
41
+ initialPrior?: StageEnvelope | null;
42
+ /** @deprecated Linear pipelines only — use resumeFromStageId for DAG resume. */
43
+ startAtStageIndex?: number;
44
+ executionMode?: StageExecutionMode;
45
+ stageProcessLauncher?: StageProcessLauncher;
46
+ };
47
+ export declare function executeStages(prepared: PreparedPipeline, options?: ExecuteStagesOptions): Promise<PipelineRunResult>;
48
+ export declare function runPipeline(options: {
49
+ agent: AgentPort;
50
+ store: RunStore;
51
+ taskPath?: string;
52
+ taskYaml?: string;
53
+ pipeline: string;
54
+ cwd?: string;
55
+ checkoutOverride?: string;
56
+ hitl?: StageHitlController;
57
+ maxActiveStagesPerRun?: number;
58
+ executionMode?: StageExecutionMode;
59
+ stageProcessLauncher?: StageProcessLauncher;
60
+ operatorCatalog?: OperatorCatalog;
61
+ }): Promise<PipelineRunResult>;
62
+ /** Create the run immediately, then execute stages in the returned promise. */
63
+ export declare function startPipeline(options: {
64
+ agent: AgentPort;
65
+ store: RunStore;
66
+ taskPath?: string;
67
+ taskYaml?: string;
68
+ pipeline: string;
69
+ cwd?: string;
70
+ checkoutOverride?: string;
71
+ hitl?: StageHitlController;
72
+ maxActiveStagesPerRun?: number;
73
+ executionMode?: StageExecutionMode;
74
+ stageProcessLauncher?: StageProcessLauncher;
75
+ operatorCatalog?: OperatorCatalog;
76
+ }): Promise<StartedPipeline>;
77
+ export declare function resolveTaskPath(taskArg: string, cwd?: string): string;
@@ -0,0 +1,141 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { loadPipelineValidated } from "../config/loadPipeline.js";
4
+ import { loadTaskFromYaml } from "../config/loadTask.js";
5
+ import { buildValidationResult } from "../config/validateCatalog.js";
6
+ import { resolveAndValidateCheckout } from "./stageRoots.js";
7
+ import { buildPipelineDagSnapshotFromLoaded } from "../runstore/pipelineDagSnapshot.js";
8
+ import { runPipelineDag } from "./pipelineScheduler.js";
9
+ import { readMaxActiveStagesPerRun, readStageExecutionMode, } from "./stageConcurrency.js";
10
+ import { StageProcessLauncher } from "./stageProcessLauncher.js";
11
+ import { PipelineValidationError } from "./pipelineValidationError.js";
12
+ export { PipelineValidationError } from "./pipelineValidationError.js";
13
+ let defaultStageProcessLauncher;
14
+ function resolveStageProcessLauncher(executionMode, override) {
15
+ if (executionMode !== "process") {
16
+ return undefined;
17
+ }
18
+ if (override !== undefined) {
19
+ return override;
20
+ }
21
+ if (defaultStageProcessLauncher === undefined) {
22
+ defaultStageProcessLauncher = new StageProcessLauncher();
23
+ }
24
+ return defaultStageProcessLauncher;
25
+ }
26
+ async function preparePipeline(options) {
27
+ const loadResult = await loadPipelineValidated(options.pipeline, {
28
+ cwd: options.cwd,
29
+ validateStages: true,
30
+ });
31
+ if (!loadResult.ok) {
32
+ throw new PipelineValidationError(buildValidationResult("pipeline", loadResult.findings, false));
33
+ }
34
+ const loaded = loadResult.loaded;
35
+ const taskYaml = options.taskYaml ??
36
+ (options.taskPath
37
+ ? await readFile(options.taskPath, "utf8")
38
+ : (() => {
39
+ throw new Error("taskPath or taskYaml is required");
40
+ })());
41
+ const label = options.taskPath ?? "task.yaml";
42
+ const task = loadTaskFromYaml(taskYaml, `task file ${label}`);
43
+ const checkoutRoot = await resolveAndValidateCheckout(task, options.checkoutOverride, options.cwd);
44
+ const run = await options.store.createRun({
45
+ pipelineId: loaded.pipeline.id,
46
+ taskYaml,
47
+ taskId: task.id,
48
+ checkoutRoot,
49
+ pipelineDag: buildPipelineDagSnapshotFromLoaded(loaded),
50
+ });
51
+ const executionMode = readStageExecutionMode(process.env, options.executionMode);
52
+ const stageProcessLauncher = resolveStageProcessLauncher(executionMode, options.stageProcessLauncher);
53
+ return {
54
+ task,
55
+ loaded,
56
+ run,
57
+ agent: options.agent,
58
+ store: options.store,
59
+ cwd: options.cwd,
60
+ checkoutRoot,
61
+ hitl: options.hitl,
62
+ executionMode,
63
+ stageProcessLauncher,
64
+ operatorCatalog: options.operatorCatalog,
65
+ };
66
+ }
67
+ export async function executeStages(prepared, options) {
68
+ const maxActiveStagesPerRun = readMaxActiveStagesPerRun(process.env, options?.maxActiveStagesPerRun);
69
+ const executionMode = options?.executionMode ??
70
+ prepared.executionMode ??
71
+ readStageExecutionMode(process.env);
72
+ const stageProcessLauncher = resolveStageProcessLauncher(executionMode, options?.stageProcessLauncher ?? prepared.stageProcessLauncher);
73
+ return runPipelineDag({
74
+ prepared,
75
+ maxActiveStagesPerRun,
76
+ resumeFromStageId: options?.resumeFromStageId,
77
+ initialPrior: options?.initialPrior,
78
+ startAtStageIndex: options?.startAtStageIndex,
79
+ executionMode,
80
+ stageProcessLauncher,
81
+ });
82
+ }
83
+ export async function runPipeline(options) {
84
+ const cwd = options.cwd ?? process.cwd();
85
+ const prepared = await preparePipeline({
86
+ agent: options.agent,
87
+ store: options.store,
88
+ taskPath: options.taskPath,
89
+ taskYaml: options.taskYaml,
90
+ pipeline: options.pipeline,
91
+ cwd,
92
+ checkoutOverride: options.checkoutOverride,
93
+ hitl: options.hitl,
94
+ executionMode: options.executionMode,
95
+ stageProcessLauncher: options.stageProcessLauncher,
96
+ operatorCatalog: options.operatorCatalog,
97
+ });
98
+ return executeStages(prepared, {
99
+ maxActiveStagesPerRun: options.maxActiveStagesPerRun,
100
+ executionMode: prepared.executionMode,
101
+ stageProcessLauncher: prepared.stageProcessLauncher,
102
+ });
103
+ }
104
+ /** Create the run immediately, then execute stages in the returned promise. */
105
+ export async function startPipeline(options) {
106
+ const cwd = options.cwd ?? process.cwd();
107
+ const prepared = await preparePipeline({
108
+ agent: options.agent,
109
+ store: options.store,
110
+ taskPath: options.taskPath,
111
+ taskYaml: options.taskYaml,
112
+ pipeline: options.pipeline,
113
+ cwd,
114
+ checkoutOverride: options.checkoutOverride,
115
+ hitl: options.hitl,
116
+ executionMode: options.executionMode,
117
+ stageProcessLauncher: options.stageProcessLauncher,
118
+ operatorCatalog: options.operatorCatalog,
119
+ });
120
+ const done = executeStages(prepared, {
121
+ maxActiveStagesPerRun: options.maxActiveStagesPerRun,
122
+ executionMode: prepared.executionMode,
123
+ stageProcessLauncher: prepared.stageProcessLauncher,
124
+ }).catch(async (err) => {
125
+ await prepared.store.updateRunStatus(prepared.run.runId, "failed").catch(() => undefined);
126
+ return {
127
+ ok: false,
128
+ runDir: prepared.run.workspaceDir,
129
+ runId: prepared.run.runId,
130
+ reason: err instanceof Error ? err.message : String(err),
131
+ };
132
+ });
133
+ return {
134
+ runId: prepared.run.runId,
135
+ runDir: prepared.run.workspaceDir,
136
+ done,
137
+ };
138
+ }
139
+ export function resolveTaskPath(taskArg, cwd = process.cwd()) {
140
+ return path.resolve(cwd, taskArg);
141
+ }
@@ -0,0 +1,90 @@
1
+ import type { AgentPort } from "../agent/port.js";
2
+ import type { RunStore, StageSnapshot } from "../runstore/port.js";
3
+ import type { StageEnvelope } from "../types/envelope.js";
4
+ import type { LoadedPipeline, ResolvedPipelineDag } from "../types/pipeline.js";
5
+ import type { TaskFile } from "../types/task.js";
6
+ import type { PipelineRunResult } from "./pipelineRunner.js";
7
+ import type { StageProcessLauncher } from "./stageProcessLauncher.js";
8
+ import type { StageExecutionMode } from "./stageConcurrency.js";
9
+ import type { StageHitlController } from "./stageHitl.js";
10
+ import type { OperatorCatalog } from "./stageAttemptBootstrap.js";
11
+ type SchedulerPreparedPipeline = {
12
+ task: TaskFile;
13
+ loaded: LoadedPipeline;
14
+ run: {
15
+ runId: string;
16
+ workspaceDir: string;
17
+ };
18
+ agent: AgentPort;
19
+ store: RunStore;
20
+ cwd: string;
21
+ checkoutRoot?: string;
22
+ hitl?: StageHitlController;
23
+ operatorCatalog?: OperatorCatalog;
24
+ };
25
+ export type { SchedulerPreparedPipeline };
26
+ type RetryContext = {
27
+ retryRoots: Map<string, number>;
28
+ };
29
+ export type RetryMutationQueue = {
30
+ enqueue(stageId: string, attempt: number): Promise<void>;
31
+ drainPending(apply: (stageId: string, attempt: number) => void): void;
32
+ pendingStageIds(): ReadonlySet<string>;
33
+ };
34
+ export type RetryRootTerminalOutcome = "succeeded" | "failed" | "skipped";
35
+ export type OnRetryRootTerminal = (stageId: string, attempt: number, outcome: RetryRootTerminalOutcome) => void;
36
+ type HasWorkOutsideBranchContext = {
37
+ retryRoots?: ReadonlyMap<string, number>;
38
+ pendingDeltaStageIds?: ReadonlySet<string>;
39
+ };
40
+ type StageScheduleState = "pending" | "active" | "waiting" | "succeeded" | "failed" | "skipped";
41
+ export type HydratedSchedule = {
42
+ states: Map<string, StageScheduleState>;
43
+ completedEnvelopes: Map<string, StageEnvelope>;
44
+ schedulingHalted: boolean;
45
+ firstFailureReason: string | undefined;
46
+ };
47
+ export declare function snapshotToScheduleState(snap: {
48
+ status: StageSnapshot["status"];
49
+ }, overrides: ReadonlyMap<string, StageScheduleState>, stageId: string, executionMode?: StageExecutionMode): StageScheduleState;
50
+ export declare function hydrateScheduleFromStore(store: RunStore, runId: string, dag: ResolvedPipelineDag, executionMode?: StageExecutionMode): Promise<HydratedSchedule>;
51
+ export declare function hydrateScheduleForRetryRoots(store: RunStore, runId: string, dag: ResolvedPipelineDag, retryStageIds: string[]): Promise<HydratedSchedule>;
52
+ export declare function hydrateScheduleForRetry(store: RunStore, runId: string, dag: ResolvedPipelineDag, retryStageId: string): Promise<HydratedSchedule>;
53
+ export type ResumeRunOptions = {
54
+ prepared: SchedulerPreparedPipeline;
55
+ maxActiveStagesPerRun: number;
56
+ resumeFromStageId: string;
57
+ initialPrior?: StageEnvelope | null;
58
+ executionMode?: StageExecutionMode;
59
+ stageProcessLauncher?: StageProcessLauncher;
60
+ };
61
+ export declare function resumeRun(options: ResumeRunOptions): Promise<PipelineRunResult>;
62
+ export type RunPipelineDagOptions = {
63
+ prepared: SchedulerPreparedPipeline;
64
+ maxActiveStagesPerRun: number;
65
+ resumeFromStageId?: string;
66
+ initialPrior?: StageEnvelope | null;
67
+ /** @deprecated Linear pipelines only — skips stages before this declaration index. */
68
+ startAtStageIndex?: number;
69
+ executionMode?: StageExecutionMode;
70
+ stageProcessLauncher?: StageProcessLauncher;
71
+ initialSchedule?: HydratedSchedule;
72
+ retryContext?: RetryContext;
73
+ mutationQueue?: RetryMutationQueue;
74
+ onLoopTick?: () => void | Promise<void>;
75
+ onRetryRootTerminal?: OnRetryRootTerminal;
76
+ };
77
+ export type RetryRunOptions = {
78
+ prepared: SchedulerPreparedPipeline;
79
+ retryRoots: Map<string, number>;
80
+ maxActiveStagesPerRun: number;
81
+ executionMode?: StageExecutionMode;
82
+ stageProcessLauncher?: StageProcessLauncher;
83
+ mutationQueue?: RetryMutationQueue;
84
+ onLoopTick?: () => void | Promise<void>;
85
+ onRetryRootTerminal?: OnRetryRootTerminal;
86
+ };
87
+ export declare function retryRun(options: RetryRunOptions): Promise<PipelineRunResult>;
88
+ export declare function applyRetryRootDelta(dag: ResolvedPipelineDag, states: Map<string, StageScheduleState>, completedEnvelopes: Map<string, StageEnvelope>, retryRoots: Map<string, number>, stageId: string, attempt: number, clearSchedulingHalt?: () => void): void;
89
+ export declare function hasWorkOutsideBranch(dag: ResolvedPipelineDag, branchRootId: string, states: Map<string, StageScheduleState>, ctx?: HasWorkOutsideBranchContext): boolean;
90
+ export declare function runPipelineDag(options: RunPipelineDagOptions): Promise<PipelineRunResult>;