stageflow 0.33.0 → 0.36.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 (379) hide show
  1. package/README.md +3 -3
  2. package/dist/agent/adapterSpill.d.ts +14 -0
  3. package/dist/agent/adapterSpill.js +83 -0
  4. package/dist/agent/agentBackend.d.ts +2 -2
  5. package/dist/agent/agentBackend.js +2 -2
  6. package/dist/agent/claudeAdapter.d.ts +13 -2
  7. package/dist/agent/claudeAdapter.js +56 -6
  8. package/dist/agent/cursorProvider.d.ts +3 -0
  9. package/dist/agent/cursorProvider.js +23 -6
  10. package/dist/agent/fakeAgent.d.ts +3 -3
  11. package/dist/agent/piAdapter.d.ts +2 -2
  12. package/dist/agent/piAdapter.js +125 -15
  13. package/dist/agent/piIsolatedMcp.d.ts +1 -0
  14. package/dist/agent/piIsolatedMcp.js +19 -1
  15. package/dist/agent/piIsolatedMcpProbe.d.ts +11 -0
  16. package/dist/agent/piIsolatedMcpProbe.js +20 -0
  17. package/dist/agent/port.d.ts +4 -2
  18. package/dist/agent/providerAuth.js +36 -3
  19. package/dist/agent/{resolveAgentPort.d.ts → resolveStagePort.d.ts} +8 -8
  20. package/dist/agent/{resolveAgentPort.js → resolveStagePort.js} +11 -11
  21. package/dist/agent/stageTurnDriver.d.ts +33 -0
  22. package/dist/agent/stageTurnDriver.js +64 -0
  23. package/dist/agent/toolOutputBudget.d.ts +46 -0
  24. package/dist/agent/toolOutputBudget.js +97 -0
  25. package/dist/agent/toolOutputBudgetExtension.d.ts +22 -0
  26. package/dist/agent/toolOutputBudgetExtension.js +141 -0
  27. package/dist/agent/toolOutputSpill.d.ts +34 -0
  28. package/dist/agent/toolOutputSpill.js +85 -0
  29. package/dist/browser/agentBrowserLiveViewRelay.d.ts +41 -0
  30. package/dist/browser/agentBrowserLiveViewRelay.js +801 -0
  31. package/dist/browser/anchor.d.ts +2 -0
  32. package/dist/browser/anchor.js +2 -1
  33. package/dist/browser/auditSink.d.ts +8 -0
  34. package/dist/browser/browserHost.d.ts +29 -0
  35. package/dist/browser/browserSweep.d.ts +4 -1
  36. package/dist/browser/browserSweep.js +7 -0
  37. package/dist/browser/browserTeardown.d.ts +1 -0
  38. package/dist/browser/browserTeardown.js +32 -2
  39. package/dist/browser/containerBrowserEndpoint.d.ts +11 -0
  40. package/dist/browser/containerBrowserEndpoint.js +57 -0
  41. package/dist/browser/containerBrowserHost.d.ts +24 -0
  42. package/dist/browser/containerBrowserHost.js +147 -0
  43. package/dist/browser/dockerSandboxOrchestrator.d.ts +26 -0
  44. package/dist/browser/dockerSandboxOrchestrator.js +142 -0
  45. package/dist/browser/fakeLiveViewRelay.d.ts +15 -0
  46. package/dist/browser/fakeLiveViewRelay.js +94 -0
  47. package/dist/browser/fakeLiveViewSource.d.ts +6 -0
  48. package/dist/browser/fakeLiveViewSource.js +16 -0
  49. package/dist/browser/fakeRemoteBrowserHost.d.ts +2 -1
  50. package/dist/browser/fakeRemoteBrowserHost.js +2 -1
  51. package/dist/browser/fakeSandboxOrchestrator.d.ts +9 -0
  52. package/dist/browser/fakeSandboxOrchestrator.js +44 -0
  53. package/dist/browser/gateHandoff.d.ts +0 -2
  54. package/dist/browser/gateHandoff.js +5 -11
  55. package/dist/browser/hostCapabilities.d.ts +23 -0
  56. package/dist/browser/hostCapabilities.js +23 -0
  57. package/dist/browser/humanLogin.d.ts +2 -2
  58. package/dist/browser/humanLogin.js +11 -2
  59. package/dist/browser/liveViewPersisted.d.ts +11 -0
  60. package/dist/browser/liveViewPersisted.js +22 -0
  61. package/dist/browser/liveViewRelay.d.ts +76 -0
  62. package/dist/browser/liveViewRelay.js +1 -0
  63. package/dist/browser/liveViewSessions.d.ts +25 -0
  64. package/dist/browser/liveViewSessions.js +139 -0
  65. package/dist/browser/liveViewSource.d.ts +25 -0
  66. package/dist/browser/liveViewSource.js +7 -0
  67. package/dist/browser/liveViewTickets.d.ts +46 -0
  68. package/dist/browser/liveViewTickets.js +122 -0
  69. package/dist/browser/localBrowserHost.d.ts +10 -0
  70. package/dist/browser/localBrowserHost.js +53 -7
  71. package/dist/browser/ownerScope.d.ts +10 -0
  72. package/dist/browser/ownerScope.js +6 -0
  73. package/dist/browser/profileStore.d.ts +5 -2
  74. package/dist/browser/profileStore.js +3 -5
  75. package/dist/browser/sandboxOrchestrator.d.ts +60 -0
  76. package/dist/browser/sandboxOrchestrator.js +8 -0
  77. package/dist/browser/sessionApiSandboxOrchestrator.d.ts +34 -0
  78. package/dist/browser/sessionApiSandboxOrchestrator.js +108 -0
  79. package/dist/browser/stageBrowserEnv.d.ts +7 -0
  80. package/dist/browser/stageBrowserEnv.js +53 -15
  81. package/dist/browser/stageHandoff.d.ts +47 -0
  82. package/dist/browser/stageHandoff.js +101 -0
  83. package/dist/browser/stageProfileLock.d.ts +1 -0
  84. package/dist/browser/stageProfileLock.js +1 -3
  85. package/dist/browser/volumeProfileStore.d.ts +7 -0
  86. package/dist/browser/volumeProfileStore.js +35 -0
  87. package/dist/channels/config.d.ts +11 -0
  88. package/dist/channels/config.js +95 -0
  89. package/dist/channels/configWriter.d.ts +40 -0
  90. package/dist/channels/configWriter.js +148 -0
  91. package/dist/channels/connectionEdits.d.ts +34 -0
  92. package/dist/channels/connectionEdits.js +53 -0
  93. package/dist/channels/errorInfo.d.ts +18 -0
  94. package/dist/channels/errorInfo.js +71 -0
  95. package/dist/channels/errors.d.ts +12 -0
  96. package/dist/channels/errors.js +13 -0
  97. package/dist/channels/health.d.ts +41 -0
  98. package/dist/channels/health.js +99 -0
  99. package/dist/channels/host.d.ts +55 -0
  100. package/dist/channels/host.js +185 -0
  101. package/dist/channels/http.d.ts +31 -0
  102. package/dist/channels/http.js +79 -0
  103. package/dist/channels/index.d.ts +10 -0
  104. package/dist/channels/index.js +9 -0
  105. package/dist/channels/ledger.d.ts +37 -0
  106. package/dist/channels/ledger.js +95 -0
  107. package/dist/channels/providers/agentmail.d.ts +26 -0
  108. package/dist/channels/providers/agentmail.js +81 -0
  109. package/dist/channels/providers/kit.d.ts +40 -0
  110. package/dist/channels/providers/kit.js +78 -0
  111. package/dist/channels/providers/photonImessage.d.ts +45 -0
  112. package/dist/channels/providers/photonImessage.js +152 -0
  113. package/dist/channels/providers/photonWhatsapp.d.ts +49 -0
  114. package/dist/channels/providers/photonWhatsapp.js +146 -0
  115. package/dist/channels/providers/slack.d.ts +25 -0
  116. package/dist/channels/providers/slack.js +101 -0
  117. package/dist/channels/providers/telegram.d.ts +21 -0
  118. package/dist/channels/providers/telegram.js +100 -0
  119. package/dist/channels/providers.d.ts +5 -0
  120. package/dist/channels/providers.js +22 -0
  121. package/dist/channels/registry.d.ts +54 -0
  122. package/dist/channels/registry.js +186 -0
  123. package/dist/channels/secretStore.d.ts +21 -0
  124. package/dist/channels/secretStore.js +75 -0
  125. package/dist/channels/secrets.d.ts +15 -0
  126. package/dist/channels/secrets.js +50 -0
  127. package/dist/channels/service.d.ts +54 -0
  128. package/dist/channels/service.js +307 -0
  129. package/dist/channels/stageChannels.d.ts +45 -0
  130. package/dist/channels/stageChannels.js +110 -0
  131. package/dist/channels/types.d.ts +142 -0
  132. package/dist/channels/types.js +1 -0
  133. package/dist/cli/browserCommand.d.ts +3 -1
  134. package/dist/cli/browserCommand.js +25 -20
  135. package/dist/cli/doctorCommand.js +3 -1
  136. package/dist/cli/resolveCliProjectRoot.d.ts +7 -0
  137. package/dist/cli/resolveCliProjectRoot.js +27 -0
  138. package/dist/cli/runCommand.d.ts +1 -1
  139. package/dist/cli/runCommand.js +59 -17
  140. package/dist/cli/skillsCommand.d.ts +20 -0
  141. package/dist/cli/skillsCommand.js +74 -31
  142. package/dist/cli/validateCommand.d.ts +1 -1
  143. package/dist/cli/validateCommand.js +22 -4
  144. package/dist/cli.js +4 -4
  145. package/dist/config/browseCatalog.d.ts +2 -0
  146. package/dist/config/browseCatalog.js +6 -0
  147. package/dist/config/catalogRelativePath.d.ts +4 -0
  148. package/dist/config/catalogRelativePath.js +37 -9
  149. package/dist/config/createStage.d.ts +1 -0
  150. package/dist/config/createStage.js +11 -2
  151. package/dist/config/createTask.d.ts +30 -0
  152. package/dist/config/createTask.js +161 -0
  153. package/dist/config/createTrigger.d.ts +15 -0
  154. package/dist/config/createTrigger.js +32 -25
  155. package/dist/config/draftPackage.d.ts +42 -0
  156. package/dist/config/draftPackage.js +220 -23
  157. package/dist/config/ensureCatalogScanRoot.d.ts +2 -1
  158. package/dist/config/ensureCatalogScanRoot.js +6 -2
  159. package/dist/config/findTaskInCatalog.d.ts +33 -0
  160. package/dist/config/findTaskInCatalog.js +69 -0
  161. package/dist/config/hostConfig.d.ts +21 -0
  162. package/dist/config/hostConfig.js +114 -1
  163. package/dist/config/importTask.d.ts +19 -0
  164. package/dist/config/importTask.js +133 -0
  165. package/dist/config/installSkillRequest.d.ts +40 -0
  166. package/dist/config/installSkillRequest.js +286 -0
  167. package/dist/config/loadOutcome.d.ts +11 -6
  168. package/dist/config/loadPipeline.js +27 -4
  169. package/dist/config/loadStage.js +17 -0
  170. package/dist/config/loadStageflowManifest.js +4 -1
  171. package/dist/config/loadTask.js +2 -0
  172. package/dist/config/loadTrigger.js +2 -0
  173. package/dist/config/mergePipelineIncludes.d.ts +3 -0
  174. package/dist/config/mergePipelineIncludes.js +30 -0
  175. package/dist/config/normalizePipelineStageEntry.js +10 -1
  176. package/dist/config/pipelineStageKeys.js +1 -0
  177. package/dist/config/printTargetYaml.js +0 -1
  178. package/dist/config/publishDraftPackage.d.ts +5 -1
  179. package/dist/config/publishDraftPackage.js +4 -1
  180. package/dist/config/resolveCatalogRoots.d.ts +4 -1
  181. package/dist/config/resolveCatalogRoots.js +18 -1
  182. package/dist/config/skillUsageIndex.d.ts +6 -0
  183. package/dist/config/skillUsageIndex.js +39 -0
  184. package/dist/config/stageBrowser.js +13 -0
  185. package/dist/config/triggerAdapterStatus.d.ts +11 -0
  186. package/dist/config/triggerAdapterStatus.js +90 -0
  187. package/dist/config/triggerCatalog.d.ts +41 -2
  188. package/dist/config/triggerCatalog.js +107 -15
  189. package/dist/config/updateTask.d.ts +30 -0
  190. package/dist/config/updateTask.js +119 -0
  191. package/dist/config/updateTrigger.d.ts +38 -0
  192. package/dist/config/updateTrigger.js +220 -0
  193. package/dist/config/validateCatalog.d.ts +9 -2
  194. package/dist/config/validateCatalog.js +71 -7
  195. package/dist/config/workshopCatalogFilenames.d.ts +37 -0
  196. package/dist/config/workshopCatalogFilenames.js +125 -0
  197. package/dist/config/workshopCatalogRepair.d.ts +7 -0
  198. package/dist/config/workshopCatalogRepair.js +144 -0
  199. package/dist/config/yamlParsePosition.d.ts +4 -0
  200. package/dist/config/yamlParsePosition.js +9 -0
  201. package/dist/errors/codes.d.ts +1 -1
  202. package/dist/errors/codes.js +1 -0
  203. package/dist/hosted/runtime.d.ts +2 -2
  204. package/dist/hosted/types.d.ts +1 -1
  205. package/dist/hosted/types.js +1 -1
  206. package/dist/index.d.ts +3 -2
  207. package/dist/index.js +2 -1
  208. package/dist/mcp/catalogTools.js +1 -0
  209. package/dist/mcp/getStartedTool.js +15 -6
  210. package/dist/mcp/triggerTools.js +2 -8
  211. package/dist/operatorAgent/agentPort.d.ts +11 -0
  212. package/dist/operatorAgent/agentPort.js +12 -0
  213. package/dist/operatorAgent/index.d.ts +1 -0
  214. package/dist/operatorAgent/index.js +1 -0
  215. package/dist/operatorAgent/piModel.js +26 -6
  216. package/dist/operatorAgent/profiles/workshopAuthorPlaybook.d.ts +1 -1
  217. package/dist/operatorAgent/profiles/workshopAuthorPlaybook.js +4 -2
  218. package/dist/operatorAgent/profiles/workshopAuthorTools.js +103 -16
  219. package/dist/package-meta.d.ts +1 -1
  220. package/dist/package-meta.js +1 -1
  221. package/dist/preflight/channelChecks.d.ts +17 -0
  222. package/dist/preflight/channelChecks.js +106 -0
  223. package/dist/preflight/pipelinePreflight.d.ts +9 -2
  224. package/dist/preflight/pipelinePreflight.js +9 -1
  225. package/dist/project/ensureProjectRootsFromEnv.d.ts +3 -0
  226. package/dist/project/ensureProjectRootsFromEnv.js +22 -0
  227. package/dist/project/globalHome.d.ts +1 -0
  228. package/dist/project/globalHome.js +18 -0
  229. package/dist/project/workspaceCatalog.d.ts +10 -0
  230. package/dist/project/workspaceCatalog.js +91 -0
  231. package/dist/runstore/backup.js +14 -4
  232. package/dist/runstore/port.d.ts +11 -1
  233. package/dist/runstore/restore.js +5 -2
  234. package/dist/runstore/sqlite/SqliteRunStore.d.ts +8 -0
  235. package/dist/runstore/sqlite/SqliteRunStore.js +29 -9
  236. package/dist/runstore/sqlite/migrations/012-trigger-fires.d.ts +7 -0
  237. package/dist/runstore/sqlite/migrations/012-trigger-fires.js +18 -0
  238. package/dist/runstore/sqlite/migrations/index.js +2 -0
  239. package/dist/runstore/stageSnapshot.d.ts +3 -1
  240. package/dist/runstore/stageSnapshot.js +19 -0
  241. package/dist/runstore/workspaceLayout.js +27 -0
  242. package/dist/runstore/writeContainedArtifact.d.ts +1 -0
  243. package/dist/runstore/writeContainedArtifact.js +52 -0
  244. package/dist/runtime/credentialBinding.js +14 -6
  245. package/dist/runtime/emailSource.js +20 -28
  246. package/dist/runtime/githubPollSource.js +20 -28
  247. package/dist/runtime/pipelineRunner.d.ts +4 -4
  248. package/dist/runtime/pipelineRunner.js +3 -1
  249. package/dist/runtime/pipelineScheduler.d.ts +2 -2
  250. package/dist/runtime/pipelineScheduler.js +3 -0
  251. package/dist/runtime/repositoryMaterialize.d.ts +1 -1
  252. package/dist/runtime/resumeReconstruct.d.ts +2 -2
  253. package/dist/runtime/resumeTimedOut.d.ts +2 -2
  254. package/dist/runtime/runManager.d.ts +18 -2
  255. package/dist/runtime/runManager.js +99 -31
  256. package/dist/runtime/runRetryCoordinator.d.ts +2 -2
  257. package/dist/runtime/scheduleSource.js +15 -24
  258. package/dist/runtime/stageAttemptBootstrap.d.ts +2 -2
  259. package/dist/runtime/stageAttemptBootstrap.js +26 -1
  260. package/dist/runtime/stageProcessLauncher.js +33 -3
  261. package/dist/runtime/stageRoots.js +8 -1
  262. package/dist/runtime/stageRunner.d.ts +2 -2
  263. package/dist/runtime/stageRunner.js +8 -2
  264. package/dist/runtime/stageWorker.js +2 -2
  265. package/dist/runtime/triggerPort.d.ts +5 -3
  266. package/dist/runtime/triggerRunner.d.ts +1 -0
  267. package/dist/runtime/triggerRunner.js +27 -20
  268. package/dist/runtime/webhookAccept.d.ts +25 -0
  269. package/dist/runtime/webhookAccept.js +56 -0
  270. package/dist/server/bootstrap.d.ts +10 -2
  271. package/dist/server/bootstrap.js +19 -1
  272. package/dist/server/channelRoutes.d.ts +9 -0
  273. package/dist/server/channelRoutes.js +88 -0
  274. package/dist/server/controlToken.d.ts +1 -1
  275. package/dist/server/controlToken.js +18 -2
  276. package/dist/server/healthSurfaces.d.ts +12 -0
  277. package/dist/server/healthSurfaces.js +27 -6
  278. package/dist/server/http.d.ts +19 -10
  279. package/dist/server/http.js +616 -85
  280. package/dist/server/liveViewPath.d.ts +9 -0
  281. package/dist/server/liveViewPath.js +8 -0
  282. package/dist/server/liveViewRoutes.d.ts +58 -0
  283. package/dist/server/liveViewRoutes.js +565 -0
  284. package/dist/server/mcpHost.d.ts +4 -2
  285. package/dist/server/mcpHost.js +2 -0
  286. package/dist/server/readCatalogFile.d.ts +29 -0
  287. package/dist/server/readCatalogFile.js +215 -0
  288. package/dist/server/triggerRoutes.d.ts +1 -0
  289. package/dist/server/triggerRoutes.js +200 -73
  290. package/dist/tools/sendMessage.d.ts +21 -0
  291. package/dist/tools/sendMessage.js +25 -0
  292. package/dist/tools/writeStageArtifact.d.ts +9 -0
  293. package/dist/tools/writeStageArtifact.js +2 -47
  294. package/dist/types/pipeline.d.ts +5 -2
  295. package/dist/types/stage.d.ts +14 -1
  296. package/dist/types/stageflowManifest.d.ts +1 -1
  297. package/dist/ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  298. package/dist/ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  299. package/dist/ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  300. package/dist/ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  301. package/dist/ui/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  302. package/dist/ui/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  303. package/dist/ui/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  304. package/dist/ui/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  305. package/dist/ui/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  306. package/dist/ui/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  307. package/dist/ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  308. package/dist/ui/assets/index-BOhqnPNg.js +260 -0
  309. package/dist/ui/assets/{index-Bv4p1aPK.css → index-Clv4sJpU.css} +1 -1
  310. package/dist/ui/index.html +4 -4
  311. package/dist/workshop/autosave.d.ts +2 -2
  312. package/dist/workshop/autosave.js +4 -6
  313. package/dist/workshop/buildStore.d.ts +2 -0
  314. package/dist/workshop/chatAttachments.d.ts +27 -0
  315. package/dist/workshop/chatAttachments.js +98 -0
  316. package/dist/workshop/chatTurn.d.ts +5 -2
  317. package/dist/workshop/chatTurn.js +22 -18
  318. package/dist/workshop/sessionMutations.d.ts +17 -0
  319. package/dist/workshop/sessionMutations.js +107 -0
  320. package/dist/workshop/sessionStore.d.ts +10 -0
  321. package/dist/workshop/sessionStore.js +52 -0
  322. package/dist/workshop/workshopPin.d.ts +4 -3
  323. package/dist/workshop/workshopPin.js +26 -6
  324. package/dist/workshop/workshopTranscriptTurn.d.ts +8 -0
  325. package/dist/workshop/workshopTranscriptTurn.js +46 -0
  326. package/examples/README.md +1 -1
  327. package/examples/archify-on-pr/README.md +1 -1
  328. package/examples/archify-on-pr/archify-on-pr.pipeline.yaml +0 -1
  329. package/examples/archify-on-pr/author-diagrams.yaml +1 -0
  330. package/examples/channels-smoke/README.md +12 -0
  331. package/examples/channels-smoke/channels-smoke.pipeline.yaml +11 -0
  332. package/examples/channels-smoke/channels-smoke.task.yaml +3 -0
  333. package/examples/channels-smoke/send-email.yaml +32 -0
  334. package/examples/channels-smoke/send-text.yaml +31 -0
  335. package/examples/conditional-fork/branch-a.yaml +1 -1
  336. package/examples/conditional-fork/decide.yaml +2 -1
  337. package/examples/feature-loop/{implement.yaml → feature-implement.yaml} +1 -1
  338. package/examples/feature-loop/feature-loop.pipeline.yaml +10 -10
  339. package/examples/feature-loop/{plan.yaml → feature-plan.yaml} +1 -1
  340. package/examples/feature-loop/{review.yaml → feature-review.yaml} +1 -1
  341. package/examples/feedback-loop/{implement.yaml → feedback-implement.yaml} +1 -1
  342. package/examples/feedback-loop/feedback-loop-wait-human.pipeline.yaml +9 -9
  343. package/examples/feedback-loop/feedback-loop.pipeline.yaml +9 -9
  344. package/examples/feedback-loop/{plan.yaml → feedback-plan.yaml} +1 -1
  345. package/examples/feedback-loop/{review.yaml → feedback-review.yaml} +1 -1
  346. package/examples/generic-fan-in/{research.yaml → fan-in-research.yaml} +1 -1
  347. package/examples/generic-fan-in/generic-fan-in-accepted.pipeline.yaml +3 -3
  348. package/examples/generic-fan-in/generic-fan-in.pipeline.yaml +3 -3
  349. package/examples/hello-world/{research.yaml → hello-research.yaml} +1 -1
  350. package/examples/hello-world/hello.pipeline.yaml +2 -2
  351. package/examples/mcp-hitl-tour/{review.yaml → mcp-hitl-review.yaml} +1 -1
  352. package/examples/mcp-hitl-tour/mcp-hitl-tour.pipeline.yaml +3 -3
  353. package/examples/oss-issue-contribution/oss-explain-fix.yaml +1 -0
  354. package/examples/oss-issue-contribution/oss-explain-issue.yaml +1 -0
  355. package/examples/oss-issue-contribution/oss-issue-contribution.pipeline.yaml +0 -2
  356. package/examples/stageflow.yaml +6 -0
  357. package/examples/triggers/sample-github-pr.trigger.yaml +12 -0
  358. package/examples/triggers/sample-inbox-email.trigger.yaml +14 -0
  359. package/examples/triggers/sample-manual-hello.trigger.yaml +5 -0
  360. package/examples/triggers/sample-nightly-hello.trigger.yaml +8 -0
  361. package/examples/triggers/sample-signed-webhook.trigger.yaml +11 -0
  362. package/examples/triggers-readiness/README.md +48 -0
  363. package/examples/triggers-readiness/readiness-emit.yaml +18 -0
  364. package/examples/triggers-readiness/readiness.pipeline.yaml +4 -0
  365. package/examples/triggers-readiness/readiness.task.yaml +6 -0
  366. package/examples/triggers-readiness/stageflow.yaml +13 -0
  367. package/examples/triggers-readiness/triggers/readiness-dynamic-manual.trigger.yaml +4 -0
  368. package/examples/triggers-readiness/triggers/readiness-email.trigger.yaml +12 -0
  369. package/examples/triggers-readiness/triggers/readiness-github-pr.trigger.yaml +12 -0
  370. package/examples/triggers-readiness/triggers/readiness-manual.trigger.yaml +5 -0
  371. package/examples/triggers-readiness/triggers/readiness-schedule.trigger.yaml +8 -0
  372. package/examples/triggers-readiness/triggers/readiness-webhook.trigger.yaml +11 -0
  373. package/package.json +8 -3
  374. package/skills/stageflow/references/control-surface.md +1 -1
  375. package/skills/stageflow-author/references/catalog-write-conventions.md +2 -2
  376. package/skills/stageflow-run/SKILL.md +1 -1
  377. package/skills/stageflow-run/references/mcp-call.md +1 -1
  378. package/skills/stageflow-setup/SKILL.md +1 -1
  379. package/dist/ui/assets/index-59cjF0OA.js +0 -133
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Open-source runtime for **configurable multi-stage agent workflows** with typed handoffs, DAG execution, human gates, MCP, CI, and a local operator console.
4
4
 
5
- [![Site](https://stage-flow.dev)](stage-flow.dev)
5
+ [![Website](https://img.shields.io/badge/website-stage--flow.dev-111111)](https://stage-flow.dev)
6
6
  [![npm version](https://img.shields.io/npm/v/stageflow)](https://www.npmjs.com/package/stageflow)
7
7
  [![npm downloads](https://img.shields.io/npm/dm/stageflow)](https://www.npmjs.com/package/stageflow)
8
8
  ![Node >=20](https://img.shields.io/badge/node-%3E%3D20-339933?logo=node.js&logoColor=white)
@@ -46,7 +46,7 @@ The same pipeline runs three ways without rewriting anything:
46
46
 
47
47
  ![Stageflow architecture: pipeline definitions and operator interfaces drive the orchestration runtime, which coordinates agent execution and persisted state](docs/img/stageflow-architecture.svg)
48
48
 
49
- The scheduler owns orchestration semantics: DAG readiness, bounded parallelism, fan-out/join, conditional routing, retries, skipped branches, and resumable human gates. Agent execution sits behind `AgentPort`; Pi supplies the current coding-agent session, while Stageflow owns pipeline state, stage workspaces, handoff validation, and the interfaces used by the CLI, console, MCP, and CI.
49
+ The scheduler owns orchestration semantics: DAG readiness, bounded parallelism, fan-out/join, conditional routing, retries, skipped branches, and resumable human gates. Agent execution sits behind `StagePort`; Pi supplies the current coding-agent session, while Stageflow owns pipeline state, stage workspaces, handoff validation, and the interfaces used by the CLI, console, MCP, and CI.
50
50
 
51
51
  See [Architecture](docs/architecture.md) for component boundaries, execution flow, persistence, recovery behavior, and the tradeoffs behind fresh sessions and explicit handoffs.
52
52
 
@@ -101,7 +101,7 @@ sf run --pipeline pipelines/hello.pipeline.yaml --task tasks/hello.task.yaml
101
101
 
102
102
  Expanded walkthrough: [docs/quickstart.md](docs/quickstart.md)
103
103
 
104
- **Docker Compose** (UI + MCP in one Host): copy [`.env.example`](.env.example) → `.env`, set `STAGEFLOW_CONTROL_TOKEN`, then `docker compose up --build -d`. Checklist: [docs/docker.md](docs/docker.md#local-try-compose).
104
+ **Docker Compose** (UI + MCP in one Host): copy [`.env.example`](.env.example) → `.env`, then `docker compose up --build -d`. The shipped compose file publishes port 3847 on localhost only and does not require a control token. Checklist: [docs/docker.md](docs/docker.md#local-try-compose).
105
105
 
106
106
  ## Connect a model provider
107
107
 
@@ -0,0 +1,14 @@
1
+ export type AdapterSpill = {
2
+ kind: "none";
3
+ } | {
4
+ kind: "full";
5
+ text: string;
6
+ sourcePath: string;
7
+ } | {
8
+ kind: "lost";
9
+ reason: string;
10
+ };
11
+ export declare function acceptedAdapterSpillPath(candidate: string): Promise<string | undefined>;
12
+ export declare function readAdapterSpill(text: string, details: unknown): Promise<AdapterSpill>;
13
+ /** Removes a vetted spill file and its now-empty `pi-mcp-output-*` dir. */
14
+ export declare function discardAdapterSpill(sourcePath: string): Promise<void>;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * pi-mcp-adapter cuts MCP text output at its output-guard limit and writes the
3
+ * full text to `<tmpdir>/pi-mcp-output-*\/output-<hex>.txt`. When that happens
4
+ * the visible result is only a head preview, so the tool output budget reads
5
+ * the full body from the spill file instead. Only real files inside the OS
6
+ * temp dir with the adapter's naming are accepted.
7
+ */
8
+ import { lstat, readFile, realpath, rmdir, unlink } from "node:fs/promises";
9
+ import { tmpdir } from "node:os";
10
+ import path from "node:path";
11
+ import { isInsideDir } from "../runstore/workspaceLayout.js";
12
+ const SPILL_DIR = /^pi-mcp-output-[A-Za-z0-9]+$/;
13
+ const SPILL_FILE = /^output-[0-9a-f]{8}\.txt$/;
14
+ const SAVED_NOTICE = /Full text saved to: (\S+) —/;
15
+ function outputGuardOf(details) {
16
+ if (details === null || typeof details !== "object")
17
+ return undefined;
18
+ const guard = details.outputGuard;
19
+ return guard !== null && typeof guard === "object"
20
+ ? guard
21
+ : undefined;
22
+ }
23
+ export async function acceptedAdapterSpillPath(candidate) {
24
+ if (candidate.includes("\0") || !path.isAbsolute(candidate))
25
+ return undefined;
26
+ let real;
27
+ try {
28
+ const linked = await lstat(candidate);
29
+ if (!linked.isFile() && !linked.isSymbolicLink())
30
+ return undefined;
31
+ real = await realpath(candidate);
32
+ if (!(await lstat(real)).isFile())
33
+ return undefined;
34
+ }
35
+ catch {
36
+ return undefined;
37
+ }
38
+ const tempRoot = await realpath(tmpdir());
39
+ if (!isInsideDir(real, tempRoot))
40
+ return undefined;
41
+ if (!SPILL_DIR.test(path.basename(path.dirname(real))))
42
+ return undefined;
43
+ if (!SPILL_FILE.test(path.basename(real)))
44
+ return undefined;
45
+ return real;
46
+ }
47
+ export async function readAdapterSpill(text, details) {
48
+ const guard = outputGuardOf(details);
49
+ if (guard?.truncated !== true) {
50
+ return { kind: "none" };
51
+ }
52
+ const candidates = [
53
+ typeof guard?.fullOutputPath === "string" ? guard.fullOutputPath : undefined,
54
+ SAVED_NOTICE.exec(text)?.[1],
55
+ ].filter((candidate) => candidate !== undefined);
56
+ for (const candidate of new Set(candidates)) {
57
+ const source = await acceptedAdapterSpillPath(candidate);
58
+ if (source === undefined)
59
+ continue;
60
+ try {
61
+ return { kind: "full", text: await readFile(source, "utf8"), sourcePath: source };
62
+ }
63
+ catch {
64
+ continue;
65
+ }
66
+ }
67
+ return {
68
+ kind: "lost",
69
+ reason: typeof guard?.writeError === "string"
70
+ ? guard.writeError
71
+ : "the MCP adapter's full-output file was not available",
72
+ };
73
+ }
74
+ /** Removes a vetted spill file and its now-empty `pi-mcp-output-*` dir. */
75
+ export async function discardAdapterSpill(sourcePath) {
76
+ try {
77
+ await unlink(sourcePath);
78
+ await rmdir(path.dirname(sourcePath));
79
+ }
80
+ catch {
81
+ // best-effort cleanup
82
+ }
83
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Known AgentPort backend ids, and the config-hierarchy gate.
2
+ * Known StagePort backend ids, and the config-hierarchy gate.
3
3
  *
4
4
  * Kept dependency-free (no adapter imports) so config loaders can validate
5
5
  * `agent:` fields without pulling in the actual SDKs.
@@ -25,7 +25,7 @@ export type ParsedAgentField = {
25
25
  export declare function parseAgentField(raw: unknown): ParsedAgentField;
26
26
  /**
27
27
  * Stage-level `agent` overrides are parsed and stored on StageConfig, but
28
- * intentionally not consulted by resolveAgentBackend while this is false.
28
+ * intentionally not consulted by resolveStageBackend while this is false.
29
29
  * Flip to true once per-stage selection is ready to ship; no other change
30
30
  * needed to light it up.
31
31
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Known AgentPort backend ids, and the config-hierarchy gate.
2
+ * Known StagePort backend ids, and the config-hierarchy gate.
3
3
  *
4
4
  * Kept dependency-free (no adapter imports) so config loaders can validate
5
5
  * `agent:` fields without pulling in the actual SDKs.
@@ -31,7 +31,7 @@ export function parseAgentField(raw) {
31
31
  }
32
32
  /**
33
33
  * Stage-level `agent` overrides are parsed and stored on StageConfig, but
34
- * intentionally not consulted by resolveAgentBackend while this is false.
34
+ * intentionally not consulted by resolveStageBackend while this is false.
35
35
  * Flip to true once per-stage selection is ready to ship; no other change
36
36
  * needed to light it up.
37
37
  */
@@ -1,5 +1,16 @@
1
- import { type AgentPort, type StageHandle, type StageRunInput, type StageRunResult } from "./port.js";
2
- export declare class ClaudeAgentAdapter implements AgentPort {
1
+ import { type StagePort, type StageHandle, type StageRunInput, type StageRunResult } from "./port.js";
2
+ /**
3
+ * Provider error carried by a query() `result` message: an API error on a "success" result
4
+ * (`is_error` with the error text in `result`) or an error subtype with `errors`.
5
+ */
6
+ export declare function claudeResultError(message: {
7
+ subtype?: unknown;
8
+ is_error?: unknown;
9
+ result?: unknown;
10
+ errors?: unknown;
11
+ api_error_status?: unknown;
12
+ }): string | undefined;
13
+ export declare class ClaudeAgentAdapter implements StagePort {
3
14
  openStage(input: StageRunInput): StageHandle;
4
15
  runStage(input: StageRunInput): Promise<StageRunResult>;
5
16
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Claude Agent SDK implementation of AgentPort.
2
+ * Claude Agent SDK implementation of StagePort.
3
3
  *
4
4
  * One turn = one streaming-input `query()` call, spawned as a subprocess by
5
5
  * the SDK. The session is sealed the same way Pi's sealed stage session is:
@@ -43,6 +43,7 @@ import { isAdvancingEnvelope } from "../envelope/check.js";
43
43
  import { assertAnswerMatchesPrompt, parseAskOperatorAnswer, summarizeAnswer, } from "../tools/askOperator.js";
44
44
  import { buildStageflowMcpServer, EMIT_STAGE_ENVELOPE_TOOL_NAME, STAGEFLOW_MCP_SERVER_NAME, WRITE_STAGE_ARTIFACT_TOOL_NAME, ASK_OPERATOR_TOOL_NAME, } from "./claudeTools.js";
45
45
  import { createClaudeActivityMapper } from "./claudeActivity.js";
46
+ import { DEFAULT_EMIT_REMINDERS, emitReminderPrompt, formatProviderError } from "./stageTurnDriver.js";
46
47
  import { readActivityVerbose } from "./activity.js";
47
48
  import { composeStageUserPrompt } from "./piAdapter.js";
48
49
  import { claudeSessionMarkerPath, clearClaudeSessionMarker, readClaudeSessionMarker, writeClaudeSessionMarker, } from "./claudeSession.js";
@@ -77,9 +78,18 @@ function preflight(input) {
77
78
  reason: `stage declares skill "${input.stage.skill}"; the claude agent backend does not support skills yet`,
78
79
  };
79
80
  }
81
+ if (input.stage.channels?.length) {
82
+ return {
83
+ ok: false,
84
+ reason: "stage declares channels; the claude agent backend does not provide send_message yet, so the stage would run without it",
85
+ };
86
+ }
80
87
  return resolveClaudeModel(input.stage.model);
81
88
  }
82
- function resultFromCapture(capture) {
89
+ function resultFromCapture(capture, providerError) {
90
+ if (providerError !== undefined && !capture.envelope) {
91
+ return { ok: false, reason: `provider error: ${providerError}` };
92
+ }
83
93
  if (capture.error && !capture.envelope) {
84
94
  return { ok: false, reason: capture.error };
85
95
  }
@@ -105,6 +115,20 @@ function failedPassedMcpConnect(resolved, listed) {
105
115
  }
106
116
  return undefined;
107
117
  }
118
+ /**
119
+ * Provider error carried by a query() `result` message: an API error on a "success" result
120
+ * (`is_error` with the error text in `result`) or an error subtype with `errors`.
121
+ */
122
+ export function claudeResultError(message) {
123
+ if (message.subtype === "success") {
124
+ if (message.is_error !== true)
125
+ return undefined;
126
+ const status = typeof message.api_error_status === "number" ? ` (HTTP ${message.api_error_status})` : "";
127
+ return formatProviderError(`${typeof message.result === "string" ? message.result : ""}${status}`);
128
+ }
129
+ const errors = Array.isArray(message.errors) ? message.errors.filter((e) => typeof e === "string") : [];
130
+ return formatProviderError(errors.length > 0 ? errors.join("; ") : String(message.subtype ?? "error"));
131
+ }
108
132
  /** Merge one query() call's per-model totals (this call's own turns only) into the stage-level accumulator. */
109
133
  function mergeClaudeModelUsage(usage, modelUsage) {
110
134
  if (!modelUsage)
@@ -184,6 +208,7 @@ async function runTurn(input, model, markerPath, promptText, resumeSessionId, us
184
208
  input.onActivity?.({ event: "agent_start" });
185
209
  input.onActivity?.({ event: "turn_start" });
186
210
  let sessionId = resumeSessionId;
211
+ let providerError;
187
212
  try {
188
213
  const mcpServer = buildStageflowMcpServer({
189
214
  capture: emitCapture,
@@ -266,6 +291,7 @@ async function runTurn(input, model, markerPath, promptText, resumeSessionId, us
266
291
  console.error(`[claudeAdapter] main loop saw result: modelUsage=${JSON.stringify(message.modelUsage)}`);
267
292
  }
268
293
  mergeClaudeModelUsage(usage, message.modelUsage);
294
+ providerError = claudeResultError(message);
269
295
  break;
270
296
  }
271
297
  }
@@ -285,7 +311,14 @@ async function runTurn(input, model, markerPath, promptText, resumeSessionId, us
285
311
  return { kind: "waiting", sessionId: resolvedSessionId, request: askCapture.prompt };
286
312
  }
287
313
  await clearClaudeSessionMarker(markerPath);
288
- return { kind: "completed", result: { ...resultFromCapture(emitCapture), usage } };
314
+ const remind = emitCapture.envelope === undefined && providerError === undefined && sessionId !== undefined
315
+ ? { sessionId, ...(emitCapture.error !== undefined ? { rejectedEmit: emitCapture.error } : {}) }
316
+ : undefined;
317
+ return {
318
+ kind: "completed",
319
+ result: { ...resultFromCapture(emitCapture, providerError), usage },
320
+ ...(remind !== undefined ? { remind } : {}),
321
+ };
289
322
  }
290
323
  catch (err) {
291
324
  if (askCapture.prompt !== undefined && sessionId !== undefined) {
@@ -350,6 +383,23 @@ export class ClaudeAgentAdapter {
350
383
  let waiting;
351
384
  let pendingAnswer;
352
385
  const usage = emptyStageUsage();
386
+ /**
387
+ * While a turn ends on its own without an envelope, resume the same session with a short
388
+ * reminder turn, up to DEFAULT_EMIT_REMINDERS times. A reminder turn may itself park on
389
+ * ask_operator; a closed handle stops the loop.
390
+ */
391
+ const withEmitReminders = async (first, model) => {
392
+ let outcome = first;
393
+ for (let attempt = 1; attempt <= DEFAULT_EMIT_REMINDERS; attempt++) {
394
+ if (closed || outcome.kind !== "completed" || outcome.remind === undefined)
395
+ break;
396
+ const reminder = emitReminderPrompt(EMIT_STAGE_ENVELOPE_TOOL_NAME, attempt, DEFAULT_EMIT_REMINDERS, outcome.remind.rejectedEmit);
397
+ // The Claude activity mapper does not echo prompts; show the reminder like Pi does.
398
+ input.onActivity?.({ event: "message", role: "user", text: reminder });
399
+ outcome = await runTurn(input, model, markerPath, reminder, outcome.remind.sessionId, usage);
400
+ }
401
+ return outcome;
402
+ };
353
403
  const applyOutcome = (outcome) => {
354
404
  if (outcome.kind === "waiting") {
355
405
  waiting = { sessionId: outcome.sessionId, prompt: outcome.request };
@@ -403,7 +453,7 @@ export class ClaudeAgentAdapter {
403
453
  return { status: "completed", result: { ok: false, reason: pre.reason } };
404
454
  }
405
455
  const outcome = await runTurn(input, pre.model, markerPath, resumePromptText(parsedAnswer), sessionId, usage);
406
- return applyOutcome(outcome);
456
+ return applyOutcome(await withEmitReminders(outcome, pre.model));
407
457
  }
408
458
  const pre = preflight(input);
409
459
  if (!pre.ok) {
@@ -421,10 +471,10 @@ export class ClaudeAgentAdapter {
421
471
  };
422
472
  }
423
473
  const outcome = await runTurn(input, pre.model, markerPath, composeTimeoutResumePrompt(), marker.sessionId, usage);
424
- return applyOutcome(outcome);
474
+ return applyOutcome(await withEmitReminders(outcome, pre.model));
425
475
  }
426
476
  const outcome = await runTurn(input, pre.model, markerPath, composeStageUserPrompt(input, EMIT_STAGE_ENVELOPE_TOOL_NAME, undefined, WRITE_STAGE_ARTIFACT_TOOL_NAME), undefined, usage);
427
- return applyOutcome(outcome);
477
+ return applyOutcome(await withEmitReminders(outcome, pre.model));
428
478
  },
429
479
  deliverAnswer(answer) {
430
480
  pendingAnswer = answer;
@@ -8,6 +8,9 @@ export declare function isCursorModelRef(modelRef: string): boolean;
8
8
  export declare function workshopCursorBridgeHint(toolNames: readonly string[]): string;
9
9
  export declare function cursorBridgePrompt(message: string, modelId: string | undefined, toolNames: readonly string[]): string;
10
10
  export declare const cursorProviderSupport: StageProviderSupport;
11
+ export declare function cursorCredentialMissingReason(): string;
12
+ /** Publish the credential-root Cursor key onto the process for a cursor/* model. */
13
+ export declare function bindCursorApiKey(modelId: string): (() => void) | undefined;
11
14
  export declare function readCursorApiKey(env?: NodeJS.ProcessEnv): string | undefined;
12
15
  export declare function getCursorHostStatus(env?: NodeJS.ProcessEnv): {
13
16
  cursorSdkReady: boolean;
@@ -9,9 +9,8 @@ import { createRequire } from "node:module";
9
9
  import path from "node:path";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import { readSecretFromEnvOrFile } from "../config/secretFromEnvOrFile.js";
12
- import { globalStageflowHome } from "../project/globalHome.js";
12
+ import { globalCredentialRoot, globalStageflowHome, } from "../project/globalHome.js";
13
13
  import { registerProviderSupport, } from "./providerSupport.js";
14
- import { stageflowAgentAuthPath } from "../runtime/credentialBinding.js";
15
14
  const CURSOR_SETTING_SOURCES_ENV = "PI_CURSOR_SETTING_SOURCES";
16
15
  /**
17
16
  * Locate the pi-cursor-sdk extension entry without opening full global package
@@ -25,13 +24,13 @@ const CURSOR_SETTING_SOURCES_ENV = "PI_CURSOR_SETTING_SOURCES";
25
24
  * (`dist/index.js` for 0.3+, `src/index.ts` for older publishes)
26
25
  * 5. Sibling checkout at ../pi-cursor-sdk relative to this repo
27
26
  *
28
- * A stage worker's HOME is an empty attempt directory; the agent dir comes from
29
- * STAGEFLOW_AGENT_AUTH_PATH when the Host set it.
27
+ * A stage worker's HOME is an empty attempt directory. Package lookup uses
28
+ * $STAGEFLOW_HOME/agent, not the credential root.
30
29
  */
31
30
  const CURSOR_PACKAGE_ENTRIES = ["dist/index.js", "src/index.ts"];
32
31
  /** Stageflow agent dir ($STAGEFLOW_HOME/agent). Stage workers must not use os.homedir(): HOME is the attempt dir. */
33
32
  function piAgentDir() {
34
- return path.dirname(stageflowAgentAuthPath());
33
+ return path.join(globalStageflowHome(), "agent");
35
34
  }
36
35
  export function cursorExtensionEntryInPackage(packageRoot) {
37
36
  for (const rel of CURSOR_PACKAGE_ENTRIES) {
@@ -142,6 +141,24 @@ export const cursorProviderSupport = {
142
141
  },
143
142
  };
144
143
  const CURSOR_API_KEY_FILE_NAME = "cursor-api-key";
144
+ export function cursorCredentialMissingReason() {
145
+ return "Cursor API key is missing from the credential root. Configure credentials via `sf providers` / the operator console Providers page, then retry.";
146
+ }
147
+ /** Publish the credential-root Cursor key onto the process for a cursor/* model. */
148
+ export function bindCursorApiKey(modelId) {
149
+ if (!isCursorModelRef(modelId))
150
+ return undefined;
151
+ const key = readCursorApiKey();
152
+ if (!key) {
153
+ throw new Error(cursorCredentialMissingReason());
154
+ }
155
+ if (process.env.CURSOR_API_KEY?.trim())
156
+ return undefined;
157
+ process.env.CURSOR_API_KEY = key;
158
+ return () => {
159
+ delete process.env.CURSOR_API_KEY;
160
+ };
161
+ }
145
162
  export function readCursorApiKey(env = process.env) {
146
163
  let fromEnv;
147
164
  try {
@@ -153,7 +170,7 @@ export function readCursorApiKey(env = process.env) {
153
170
  if (fromEnv !== undefined && fromEnv.trim() !== "") {
154
171
  return fromEnv.trim();
155
172
  }
156
- const filePath = path.join(globalStageflowHome(), "agent", CURSOR_API_KEY_FILE_NAME);
173
+ const filePath = path.join(globalCredentialRoot(), "agent", CURSOR_API_KEY_FILE_NAME);
157
174
  if (!existsSync(filePath)) {
158
175
  return undefined;
159
176
  }
@@ -1,5 +1,5 @@
1
1
  import type { StageRoots } from "../runtime/stageRoots.js";
2
- import type { AgentPort, OpaqueAnswer, OpaqueWaitRequest, StageHandle, StageRunInput, StageRunResult } from "./port.js";
2
+ import type { StagePort, OpaqueAnswer, OpaqueWaitRequest, StageHandle, StageRunInput, StageRunResult } from "./port.js";
3
3
  export type FakeAgentBehavior = {
4
4
  type: "emit";
5
5
  envelope: unknown;
@@ -17,7 +17,7 @@ export type FakeAgentBehavior = {
17
17
  };
18
18
  export type RecordedStageRoots = StageRoots;
19
19
  export declare function fakeHitlResumePath(roots: Pick<StageRoots, "runWorkspaceDir">, stageId: string): string;
20
- export declare class FakeAgent implements AgentPort {
20
+ export declare class FakeAgent implements StagePort {
21
21
  private readonly behavior;
22
22
  lastRoots?: RecordedStageRoots;
23
23
  receivedAnswers: OpaqueAnswer[];
@@ -25,6 +25,6 @@ export declare class FakeAgent implements AgentPort {
25
25
  openStage(input: StageRunInput): StageHandle;
26
26
  runStage(input: StageRunInput): Promise<StageRunResult>;
27
27
  }
28
- export declare function scriptedFakeAgent(behaviors: FakeAgentBehavior[]): AgentPort & {
28
+ export declare function scriptedFakeAgent(behaviors: FakeAgentBehavior[]): StagePort & {
29
29
  recorded: RecordedStageRoots[];
30
30
  };
@@ -3,7 +3,7 @@ import type { StageRoots } from "../runtime/stageRoots.js";
3
3
  import { type AskOperatorPrompt, type AskOperatorWaitBridge } from "../tools/askOperator.js";
4
4
  import "./cursorProvider.js";
5
5
  import { type StageActivityObserver } from "./activityObserver.js";
6
- import type { AgentPort, OpaqueAnswer, StageHandle, StageHandleCloseOptions, StageRunInput, StageRunResult } from "./port.js";
6
+ import type { StagePort, OpaqueAnswer, StageHandle, StageHandleCloseOptions, StageRunInput, StageRunResult } from "./port.js";
7
7
  import type { StageGateKind } from "../types/stage.js";
8
8
  import { type StageUsage } from "../types/usage.js";
9
9
  import { STAGEFLOW_PATH_DENIED } from "../runstore/workspaceLayout.js";
@@ -133,7 +133,7 @@ export type ReconstructedStageSession = {
133
133
  * Does not auto-continue the model turn — U4 owns the yield loop.
134
134
  */
135
135
  export declare function reconstructStageSessionForAnswer(input: StageRunInput, answer: OpaqueAnswer): Promise<ReconstructedStageSession>;
136
- export declare class PiAgentAdapter implements AgentPort {
136
+ export declare class PiAgentAdapter implements StagePort {
137
137
  openStage(input: StageRunInput): StageHandle;
138
138
  runStage(input: StageRunInput): Promise<StageRunResult>;
139
139
  }