@bastani/atomic 0.9.74-alpha.1 → 0.9.75-alpha.1

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 (383) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/builtin/intercom/package.json +2 -2
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  5. package/dist/builtin/subagents/package.json +3 -3
  6. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +8 -10
  7. package/dist/builtin/subagents/skills/agent-desktop/SKILL.md +9 -5
  8. package/dist/builtin/subagents/src/extension/index.bundle.mjs +7 -1
  9. package/dist/builtin/web-access/package.json +2 -2
  10. package/dist/builtin/workflows/CHANGELOG.md +48 -0
  11. package/dist/builtin/workflows/README.md +5 -2
  12. package/dist/builtin/workflows/builtin/{chunk-m8eg152f.js → chunk-89we7r4p.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-a4fdm2cw.js → chunk-8yfssw01.js} +1 -1
  14. package/dist/builtin/workflows/builtin/{chunk-774myqzs.js → chunk-v8mb0005.js} +366 -45
  15. package/dist/builtin/workflows/builtin/{chunk-d5cxskkp.js → chunk-wh2p4qjg.js} +2 -2
  16. package/dist/builtin/workflows/builtin/goal.js +2 -2
  17. package/dist/builtin/workflows/builtin/index.d.ts +10 -0
  18. package/dist/builtin/workflows/builtin/index.js +4 -4
  19. package/dist/builtin/workflows/builtin/open-claude-design.d.ts +12 -0
  20. package/dist/builtin/workflows/builtin/open-claude-design.js +1 -1
  21. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  22. package/dist/builtin/workflows/package.json +2 -2
  23. package/dist/builtin/workflows/skills/impeccable/SKILL.md +4 -4
  24. package/dist/builtin/workflows/skills/impeccable/reference/android.md +1 -1
  25. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -2
  26. package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +1 -1
  27. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +1 -1
  28. package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +4 -4
  29. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +2 -2
  30. package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +3 -2
  31. package/dist/builtin/workflows/skills/impeccable/reference/distill.md +3 -3
  32. package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +1 -1
  33. package/dist/builtin/workflows/skills/impeccable/reference/document.md +3 -3
  34. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +19 -0
  35. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +15 -8
  36. package/dist/builtin/workflows/skills/impeccable/reference/init.md +2 -0
  37. package/dist/builtin/workflows/skills/impeccable/reference/live.md +8 -6
  38. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +4 -4
  39. package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +0 -1
  40. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +1 -1
  41. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
  42. package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +2 -2
  43. package/dist/builtin/workflows/skills/impeccable/scripts/engine-checksums.txt +9 -0
  44. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +98 -44
  45. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +101 -34
  46. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-ignores.js +6 -2
  47. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +4 -1
  48. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +444 -144
  49. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +3 -1
  50. package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +2 -2
  51. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +13 -11
  52. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +10 -8
  53. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_2.md +143 -0
  54. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +11 -7
  55. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +3 -3
  56. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +6 -2
  57. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +7 -7
  58. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +2 -2
  59. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5_5.md +3 -3
  60. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +2 -2
  61. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +2 -2
  62. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +6 -5
  63. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_sol.md +4 -4
  64. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_terra.md +2 -2
  65. package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -3
  66. package/dist/builtin/workflows/skills/skill-creator/scripts/aggregate_benchmark.py +0 -0
  67. package/dist/builtin/workflows/skills/skill-creator/scripts/generate_report.py +0 -0
  68. package/dist/builtin/workflows/skills/skill-creator/scripts/improve_description.py +0 -0
  69. package/dist/builtin/workflows/skills/skill-creator/scripts/package_skill.py +0 -0
  70. package/dist/builtin/workflows/skills/skill-creator/scripts/quick_validate.py +0 -0
  71. package/dist/builtin/workflows/skills/skill-creator/scripts/run_eval.py +0 -0
  72. package/dist/builtin/workflows/skills/skill-creator/scripts/run_loop.py +0 -0
  73. package/dist/builtin/workflows/skills/unslop/SKILL.md +15 -34
  74. package/dist/builtin/workflows/src/durable/journal/memory-run-journal.d.ts +1 -0
  75. package/dist/builtin/workflows/src/durable/journal/values.d.ts +2 -0
  76. package/dist/builtin/workflows/src/extension/index.bundle.mjs +809 -410
  77. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +695 -305
  78. package/dist/builtin/workflows/src/index.js +685 -295
  79. package/dist/builtin/workflows/src/local-worker-entry.mjs +695 -305
  80. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -6
  81. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +2 -2
  82. package/dist/builtin/workflows/src/shared/serializable-error-families.d.ts +2 -0
  83. package/dist/bun/app-host-modules.d.ts +1 -1
  84. package/dist/bun/app-host-modules.d.ts.map +1 -1
  85. package/dist/bun/app-host-modules.js.map +1 -1
  86. package/dist/bun/internal-workflow-worker.d.ts +2 -0
  87. package/dist/bun/internal-workflow-worker.d.ts.map +1 -1
  88. package/dist/bun/internal-workflow-worker.js +2 -1
  89. package/dist/bun/internal-workflow-worker.js.map +1 -1
  90. package/dist/codemode-worker.js +2 -0
  91. package/dist/config.d.ts +8 -0
  92. package/dist/config.d.ts.map +1 -1
  93. package/dist/config.js +14 -0
  94. package/dist/config.js.map +1 -1
  95. package/dist/core/agent-session-bash.d.ts.map +1 -1
  96. package/dist/core/agent-session-bash.js +2 -1
  97. package/dist/core/agent-session-bash.js.map +1 -1
  98. package/dist/core/agent-session-blueprint-environment.d.ts +10 -0
  99. package/dist/core/agent-session-blueprint-environment.d.ts.map +1 -0
  100. package/dist/core/agent-session-blueprint-environment.js +28 -0
  101. package/dist/core/agent-session-blueprint-environment.js.map +1 -0
  102. package/dist/core/agent-session-events.d.ts.map +1 -1
  103. package/dist/core/agent-session-events.js +2 -0
  104. package/dist/core/agent-session-events.js.map +1 -1
  105. package/dist/core/agent-session-methods.d.ts +1 -0
  106. package/dist/core/agent-session-methods.d.ts.map +1 -1
  107. package/dist/core/agent-session-methods.js.map +1 -1
  108. package/dist/core/agent-session-retry.d.ts.map +1 -1
  109. package/dist/core/agent-session-retry.js +14 -4
  110. package/dist/core/agent-session-retry.js.map +1 -1
  111. package/dist/core/agent-session-runtime.d.ts +20 -0
  112. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  113. package/dist/core/agent-session-runtime.js +55 -6
  114. package/dist/core/agent-session-runtime.js.map +1 -1
  115. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  116. package/dist/core/agent-session-tool-registry.js +2 -1
  117. package/dist/core/agent-session-tool-registry.js.map +1 -1
  118. package/dist/core/agent-session.d.ts +2 -0
  119. package/dist/core/agent-session.d.ts.map +1 -1
  120. package/dist/core/agent-session.js +2 -0
  121. package/dist/core/agent-session.js.map +1 -1
  122. package/dist/core/async-scope.d.ts +13 -0
  123. package/dist/core/async-scope.d.ts.map +1 -0
  124. package/dist/core/async-scope.js +20 -0
  125. package/dist/core/async-scope.js.map +1 -0
  126. package/dist/core/cache-warmer.d.ts +3 -14
  127. package/dist/core/cache-warmer.d.ts.map +1 -1
  128. package/dist/core/cache-warmer.js +8 -60
  129. package/dist/core/cache-warmer.js.map +1 -1
  130. package/dist/core/extensions/extension-work.js +2 -2
  131. package/dist/core/extensions/extension-work.js.map +1 -1
  132. package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
  133. package/dist/core/extensions/loader-host-modules.js +3 -1
  134. package/dist/core/extensions/loader-host-modules.js.map +1 -1
  135. package/dist/core/extensions/ui-types.d.ts +2 -1
  136. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  137. package/dist/core/extensions/ui-types.js.map +1 -1
  138. package/dist/core/extensions/workflow-events.d.ts +1 -1
  139. package/dist/core/extensions/workflow-events.d.ts.map +1 -1
  140. package/dist/core/extensions/workflow-events.js.map +1 -1
  141. package/dist/core/extensions/workflow-run-control.d.ts +4 -2
  142. package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
  143. package/dist/core/extensions/workflow-run-control.js.map +1 -1
  144. package/dist/core/model-fallback-failures.d.ts +6 -0
  145. package/dist/core/model-fallback-failures.d.ts.map +1 -1
  146. package/dist/core/model-fallback-failures.js +10 -1
  147. package/dist/core/model-fallback-failures.js.map +1 -1
  148. package/dist/core/preferred-providers.d.ts +19 -0
  149. package/dist/core/preferred-providers.d.ts.map +1 -0
  150. package/dist/core/preferred-providers.js +25 -0
  151. package/dist/core/preferred-providers.js.map +1 -0
  152. package/dist/core/provider-alias.d.ts.map +1 -1
  153. package/dist/core/provider-alias.js +4 -0
  154. package/dist/core/provider-alias.js.map +1 -1
  155. package/dist/core/provider-composer.d.ts.map +1 -1
  156. package/dist/core/provider-composer.js +1 -0
  157. package/dist/core/provider-composer.js.map +1 -1
  158. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  159. package/dist/core/remote-catalog-provider.js +3 -0
  160. package/dist/core/remote-catalog-provider.js.map +1 -1
  161. package/dist/core/resume/blueprint/action-expressions.d.ts +32 -0
  162. package/dist/core/resume/blueprint/action-expressions.d.ts.map +1 -0
  163. package/dist/core/resume/blueprint/action-expressions.js +389 -0
  164. package/dist/core/resume/blueprint/action-expressions.js.map +1 -0
  165. package/dist/core/resume/blueprint/actions.d.ts +90 -0
  166. package/dist/core/resume/blueprint/actions.d.ts.map +1 -0
  167. package/dist/core/resume/blueprint/actions.js +818 -0
  168. package/dist/core/resume/blueprint/actions.js.map +1 -0
  169. package/dist/core/resume/blueprint/build.d.ts +102 -0
  170. package/dist/core/resume/blueprint/build.d.ts.map +1 -0
  171. package/dist/core/resume/blueprint/build.js +535 -0
  172. package/dist/core/resume/blueprint/build.js.map +1 -0
  173. package/dist/core/resume/blueprint/context.d.ts +11 -0
  174. package/dist/core/resume/blueprint/context.d.ts.map +1 -0
  175. package/dist/core/resume/blueprint/context.js +106 -0
  176. package/dist/core/resume/blueprint/context.js.map +1 -0
  177. package/dist/core/resume/blueprint/envrc.d.ts +19 -0
  178. package/dist/core/resume/blueprint/envrc.d.ts.map +1 -0
  179. package/dist/core/resume/blueprint/envrc.js +77 -0
  180. package/dist/core/resume/blueprint/envrc.js.map +1 -0
  181. package/dist/core/resume/blueprint/errors.d.ts +179 -0
  182. package/dist/core/resume/blueprint/errors.d.ts.map +1 -0
  183. package/dist/core/resume/blueprint/errors.js +169 -0
  184. package/dist/core/resume/blueprint/errors.js.map +1 -0
  185. package/dist/core/resume/blueprint/ledger.d.ts +51 -0
  186. package/dist/core/resume/blueprint/ledger.d.ts.map +1 -0
  187. package/dist/core/resume/blueprint/ledger.js +119 -0
  188. package/dist/core/resume/blueprint/ledger.js.map +1 -0
  189. package/dist/core/resume/blueprint/notices.d.ts +14 -0
  190. package/dist/core/resume/blueprint/notices.d.ts.map +1 -0
  191. package/dist/core/resume/blueprint/notices.js +44 -0
  192. package/dist/core/resume/blueprint/notices.js.map +1 -0
  193. package/dist/core/resume/blueprint/process.d.ts +44 -0
  194. package/dist/core/resume/blueprint/process.d.ts.map +1 -0
  195. package/dist/core/resume/blueprint/process.js +142 -0
  196. package/dist/core/resume/blueprint/process.js.map +1 -0
  197. package/dist/core/resume/blueprint/resume.d.ts +73 -0
  198. package/dist/core/resume/blueprint/resume.d.ts.map +1 -0
  199. package/dist/core/resume/blueprint/resume.js +206 -0
  200. package/dist/core/resume/blueprint/resume.js.map +1 -0
  201. package/dist/core/resume/blueprint/schema.d.ts +26 -0
  202. package/dist/core/resume/blueprint/schema.d.ts.map +1 -0
  203. package/dist/core/resume/blueprint/schema.js +243 -0
  204. package/dist/core/resume/blueprint/schema.js.map +1 -0
  205. package/dist/core/resume/blueprint/steps.d.ts +54 -0
  206. package/dist/core/resume/blueprint/steps.d.ts.map +1 -0
  207. package/dist/core/resume/blueprint/steps.js +155 -0
  208. package/dist/core/resume/blueprint/steps.js.map +1 -0
  209. package/dist/core/resume/blueprint/types.d.ts +63 -0
  210. package/dist/core/resume/blueprint/types.d.ts.map +1 -0
  211. package/dist/core/resume/blueprint/types.js +2 -0
  212. package/dist/core/resume/blueprint/types.js.map +1 -0
  213. package/dist/core/resume/errors.d.ts +7 -35
  214. package/dist/core/resume/errors.d.ts.map +1 -1
  215. package/dist/core/resume/errors.js +1 -21
  216. package/dist/core/resume/errors.js.map +1 -1
  217. package/dist/core/resume/index.d.ts +12 -4
  218. package/dist/core/resume/index.d.ts.map +1 -1
  219. package/dist/core/resume/index.js +11 -4
  220. package/dist/core/resume/index.js.map +1 -1
  221. package/dist/core/resume/run-setup.d.ts +36 -15
  222. package/dist/core/resume/run-setup.d.ts.map +1 -1
  223. package/dist/core/resume/run-setup.js +70 -54
  224. package/dist/core/resume/run-setup.js.map +1 -1
  225. package/dist/core/resume/session-resume.d.ts +34 -20
  226. package/dist/core/resume/session-resume.d.ts.map +1 -1
  227. package/dist/core/resume/session-resume.js +244 -106
  228. package/dist/core/resume/session-resume.js.map +1 -1
  229. package/dist/core/retry-policy.d.ts +19 -1
  230. package/dist/core/retry-policy.d.ts.map +1 -1
  231. package/dist/core/retry-policy.js +26 -1
  232. package/dist/core/retry-policy.js.map +1 -1
  233. package/dist/core/sdk.js +1 -1
  234. package/dist/core/sdk.js.map +1 -1
  235. package/dist/core/session-cwd.d.ts +56 -1
  236. package/dist/core/session-cwd.d.ts.map +1 -1
  237. package/dist/core/session-cwd.js +94 -4
  238. package/dist/core/session-cwd.js.map +1 -1
  239. package/dist/core/session-manager-core.d.ts +1 -1
  240. package/dist/core/session-manager-core.d.ts.map +1 -1
  241. package/dist/core/session-manager-core.js +10 -5
  242. package/dist/core/session-manager-core.js.map +1 -1
  243. package/dist/core/session-worktree-snapshots.d.ts +11 -0
  244. package/dist/core/session-worktree-snapshots.d.ts.map +1 -1
  245. package/dist/core/session-worktree-snapshots.js +10 -4
  246. package/dist/core/session-worktree-snapshots.js.map +1 -1
  247. package/dist/core/settings-defaults.d.ts +1 -1
  248. package/dist/core/settings-defaults.d.ts.map +1 -1
  249. package/dist/core/settings-defaults.js +1 -1
  250. package/dist/core/settings-defaults.js.map +1 -1
  251. package/dist/core/settings-manager-basic-accessors.d.ts +3 -2
  252. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  253. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  254. package/dist/core/settings-schema.d.ts.map +1 -1
  255. package/dist/core/settings-schema.js +2 -1
  256. package/dist/core/settings-schema.js.map +1 -1
  257. package/dist/core/slash-commands.d.ts.map +1 -1
  258. package/dist/core/slash-commands.js +4 -0
  259. package/dist/core/slash-commands.js.map +1 -1
  260. package/dist/core/storage/write-ahead-log.d.ts +2 -1
  261. package/dist/core/storage/write-ahead-log.d.ts.map +1 -1
  262. package/dist/core/storage/write-ahead-log.js +27 -6
  263. package/dist/core/storage/write-ahead-log.js.map +1 -1
  264. package/dist/core/system-prompt.d.ts.map +1 -1
  265. package/dist/core/system-prompt.js +10 -0
  266. package/dist/core/system-prompt.js.map +1 -1
  267. package/dist/core/tools/file-tool-errors.d.ts +1 -1
  268. package/dist/core/tools/file-tool-errors.js +1 -1
  269. package/dist/core/tools/file-tool-errors.js.map +1 -1
  270. package/dist/core/tools/find.d.ts.map +1 -1
  271. package/dist/core/tools/find.js +52 -26
  272. package/dist/core/tools/find.js.map +1 -1
  273. package/dist/core/tools/grep.d.ts +2 -0
  274. package/dist/core/tools/grep.d.ts.map +1 -1
  275. package/dist/core/tools/grep.js.map +1 -1
  276. package/dist/core/tools/powershell.d.ts.map +1 -1
  277. package/dist/core/tools/powershell.js +10 -2
  278. package/dist/core/tools/powershell.js.map +1 -1
  279. package/dist/core/tools/tool-concurrency.d.ts.map +1 -1
  280. package/dist/core/tools/tool-concurrency.js +2 -2
  281. package/dist/core/tools/tool-concurrency.js.map +1 -1
  282. package/dist/index.d.ts +3 -2
  283. package/dist/index.d.ts.map +1 -1
  284. package/dist/index.js +2 -1
  285. package/dist/index.js.map +1 -1
  286. package/dist/main-session.d.ts +12 -4
  287. package/dist/main-session.d.ts.map +1 -1
  288. package/dist/main-session.js +28 -4
  289. package/dist/main-session.js.map +1 -1
  290. package/dist/main.d.ts.map +1 -1
  291. package/dist/main.js +6 -8
  292. package/dist/main.js.map +1 -1
  293. package/dist/modes/interactive/components/chat-session-host.d.ts +5 -1
  294. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  295. package/dist/modes/interactive/components/chat-session-host.js +6 -1
  296. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  297. package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
  298. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  299. package/dist/modes/interactive/components/oauth-selector.js +34 -13
  300. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  301. package/dist/modes/interactive/components/provider-brand.d.ts +16 -0
  302. package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
  303. package/dist/modes/interactive/components/provider-brand.js +67 -0
  304. package/dist/modes/interactive/components/provider-brand.js.map +1 -0
  305. package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
  306. package/dist/modes/interactive/interactive-auth-routing.js +8 -6
  307. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  308. package/dist/modes/interactive/interactive-extension-dialogs.js +4 -3
  309. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  310. package/dist/modes/interactive/interactive-extension-runtime.js +8 -3
  311. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  312. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  313. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  314. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  315. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  316. package/dist/modes/interactive/interactive-mode-surface.d.ts +12 -2
  317. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  318. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  319. package/dist/modes/interactive/interactive-session-routing.js +59 -21
  320. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  321. package/dist/modes/interactive/interactive-slash-commands.js +23 -12
  322. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  323. package/dist/modes/interactive/login-provider-options.d.ts.map +1 -1
  324. package/dist/modes/interactive/login-provider-options.js +2 -1
  325. package/dist/modes/interactive/login-provider-options.js.map +1 -1
  326. package/dist/modes/interactive-engine/isolated-runtime.d.ts +2 -0
  327. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  328. package/dist/modes/interactive-engine/isolated-runtime.js +8 -3
  329. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  330. package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
  331. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  332. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  333. package/dist/modes/rpc/rpc-client.d.ts +0 -1
  334. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  335. package/dist/modes/rpc/rpc-client.js +2 -18
  336. package/dist/modes/rpc/rpc-client.js.map +1 -1
  337. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  338. package/dist/modes/rpc/rpc-command-handler.js +8 -2
  339. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  340. package/dist/modes/rpc/rpc-error-decoding.d.ts +7 -0
  341. package/dist/modes/rpc/rpc-error-decoding.d.ts.map +1 -0
  342. package/dist/modes/rpc/rpc-error-decoding.js +25 -0
  343. package/dist/modes/rpc/rpc-error-decoding.js.map +1 -0
  344. package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
  345. package/dist/modes/rpc/rpc-responses.js +12 -0
  346. package/dist/modes/rpc/rpc-responses.js.map +1 -1
  347. package/dist/modes/rpc/rpc-types.d.ts +11 -0
  348. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  349. package/dist/modes/rpc/rpc-types.js.map +1 -1
  350. package/dist/package-manager-cli.d.ts.map +1 -1
  351. package/dist/package-manager-cli.js +12 -3
  352. package/dist/package-manager-cli.js.map +1 -1
  353. package/docs/background-tasks.md +1 -1
  354. package/docs/codemode.md +22 -0
  355. package/docs/extensions/api-reference.md +27 -1
  356. package/docs/extensions/authoring.md +1 -1
  357. package/docs/extensions/ui.md +1 -1
  358. package/docs/getting-started/first-session.md +1 -1
  359. package/docs/guides/resume-on-any-machine.md +72 -19
  360. package/docs/models/evals.md +85 -17
  361. package/docs/models/reference.md +1 -1
  362. package/docs/providers.md +38 -5
  363. package/docs/reference/cli.md +2 -0
  364. package/docs/rpc/protocol.md +11 -1
  365. package/docs/sdk/reference.md +36 -4
  366. package/docs/sdk.md +2 -2
  367. package/docs/sessions.md +11 -1
  368. package/docs/settings.md +7 -2
  369. package/docs/skills.md +3 -3
  370. package/docs/storage.md +1 -1
  371. package/docs/tools.md +3 -1
  372. package/docs/workflows/api-reference.md +14 -12
  373. package/docs/workflows/authoring.md +29 -1
  374. package/docs/workflows/builtins.md +9 -1
  375. package/docs/workflows/operations.md +8 -8
  376. package/docs/worktree-snapshots.md +3 -2
  377. package/npm-shrinkwrap.json +83 -67
  378. package/package.json +7 -7
  379. package/schemas/settings.schema.json +3 -2
  380. package/dist/core/resume/setup-hook.d.ts +0 -69
  381. package/dist/core/resume/setup-hook.d.ts.map +0 -1
  382. package/dist/core/resume/setup-hook.js +0 -261
  383. package/dist/core/resume/setup-hook.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { AsyncLocalStorage } from "node:async_hooks";
1
+ import { asyncScope } from "../async-scope.js";
2
2
  import { withBuiltinDiagnostics } from "../builtin-diagnostics.js";
3
3
  import { drainSessionWork, hasCallingSessionWork, sessionLifetime, trackSessionWork, } from "../session-lifecycle-work.js";
4
4
  import { hostInputError } from "./host-input.js";
@@ -9,7 +9,7 @@ const workBinding = Symbol.for("atomic.extension-work.v1");
9
9
  export function bindExtensionWork(runtime, owner) {
10
10
  runtime[workBinding] ??= {
11
11
  sealed: false,
12
- cleanup: new AsyncLocalStorage(),
12
+ cleanup: asyncScope(),
13
13
  run: (operation) => trackSessionWork(owner, () => trackSessionWork(runtime, operation)),
14
14
  drain: () => drainSessionWork(runtime),
15
15
  signal: () => sessionLifetime(owner),
@@ -1 +1 @@
1
- {"version":3,"file":"extension-work.js","sourceRoot":"","sources":["../../../src/core/extensions/extension-work.ts"],"names":[],"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BAAwB,CAAC,OAAyB;IACjE,MAAM,OAAO,GAAI,OAAwB,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO;QAAE,OAAO;IACxC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IACvB,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,OAAO,CAAC,YAAY,GAAG,GAAG,EAAE;QAC3B,YAAY,EAAE,CAAC;QACf,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC3F,CAAC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAI,OAAyB,EAAE,SAA2B;IAClG,MAAM,OAAO,GAAI,OAAwB,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC;QACJ,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACpD,CAAC;YAAS,CAAC;QACV,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;AACF,CAAC","sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport { withBuiltinDiagnostics } from \"../builtin-diagnostics.ts\";\nimport {\n\tdrainSessionWork,\n\thasCallingSessionWork,\n\tsessionLifetime,\n\ttrackSessionWork,\n} from \"../session-lifecycle-work.ts\";\nimport { hostInputError } from \"./host-input.js\";\nimport { STALE_EXTENSION_CONTEXT_MESSAGE } from \"./stale-context.ts\";\nimport type { ExtensionRuntime } from \"./types.ts\";\n\n// Runtime objects can cross the built/source loader boundary. Keep the binding on\n// the actual generation, not in a module-local owner map or the shared event bus.\nconst workBinding = Symbol.for(\"atomic.extension-work.v1\");\ninterface WorkBinding {\n\tsealed: boolean;\n\tcleanup: AsyncLocalStorage<{ active: boolean }>;\n\trevoked?: boolean;\n\trun<T>(operation: () => Promise<T>): Promise<T>;\n\tdrain(): Promise<void>;\n\tsignal(): AbortSignal;\n}\ntype OwnedRuntime = ExtensionRuntime & { [workBinding]?: WorkBinding };\n\nexport function bindExtensionWork(runtime: ExtensionRuntime, owner: object): void {\n\t(runtime as OwnedRuntime)[workBinding] ??= {\n\t\tsealed: false,\n\t\tcleanup: new AsyncLocalStorage<{ active: boolean }>(),\n\t\trun: (operation) => trackSessionWork(owner, () => trackSessionWork(runtime, operation)),\n\t\tdrain: () => drainSessionWork(runtime),\n\t\tsignal: () => sessionLifetime(owner),\n\t};\n}\n\nexport function extensionSessionSignal(runtime: ExtensionRuntime): AbortSignal {\n\treturn (runtime as OwnedRuntime)[workBinding]?.signal() ?? sessionLifetime(runtime);\n}\n\nexport function sealExtensionWork(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (binding) binding.sealed = true;\n}\n\nexport function resumeExtensionWork(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (binding) binding.sealed = false;\n}\n\nexport function extensionWorkOpen(runtime: ExtensionRuntime): boolean {\n\treturn !(runtime as OwnedRuntime)[workBinding]?.sealed;\n}\n\nexport function trackExtensionWork<T>(runtime: ExtensionRuntime, operation: () => Promise<T>): Promise<T> {\n\treturn withBuiltinDiagnostics(\n\t\truntime,\n\t\t() => (runtime as OwnedRuntime)[workBinding]?.run(operation) ?? trackSessionWork(runtime, operation),\n\t);\n}\n\nexport async function drainExtensionWork(runtime: ExtensionRuntime): Promise<void> {\n\tawait ((runtime as OwnedRuntime)[workBinding]?.drain() ?? drainSessionWork(runtime));\n}\n\n/** Cleanup may inspect its retired resources, but cannot act on a successor. */\nexport function assertExtensionAction(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (binding?.revoked) throw new Error(STALE_EXTENSION_CONTEXT_MESSAGE);\n\tif (binding?.sealed && !binding.cleanup.getStore()?.active && !hasCallingSessionWork(runtime))\n\t\tthrow hostInputError(\"SessionClosed\");\n}\n\nexport function isRetiredExtensionCleanup(runtime: ExtensionRuntime): boolean {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\treturn !!binding?.revoked && !!binding.cleanup.getStore()?.active;\n}\n\n/** Revoke capabilities without releasing resources still owned by admitted callbacks. */\nexport function revokeExtensionAuthority(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (!binding || binding.revoked) return;\n\tbinding.revoked = true;\n\tconst assertActive = runtime.assertActive.bind(runtime);\n\truntime.assertActive = () => {\n\t\tassertActive();\n\t\tif (!binding.cleanup.getStore()?.active) throw new Error(STALE_EXTENSION_CONTEXT_MESSAGE);\n\t};\n}\n\nexport async function runExtensionCleanup<T>(runtime: ExtensionRuntime, operation: () => Promise<T>): Promise<T> {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (!binding) return operation();\n\tconst scope = { active: true };\n\ttry {\n\t\treturn await binding.cleanup.run(scope, operation);\n\t} finally {\n\t\tscope.active = false;\n\t}\n}\n"]}
1
+ {"version":3,"file":"extension-work.js","sourceRoot":"","sources":["../../../src/core/extensions/extension-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAGrE,kFAAkF;AAClF,kF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C,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC3F,CAAC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAI,OAAyB,EAAE,SAA2B;IAClG,MAAM,OAAO,GAAI,OAAwB,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC;QACJ,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACpD,CAAC;YAAS,CAAC;QACV,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;AACF,CAAC","sourcesContent":["import { type AsyncScope, asyncScope } from \"../async-scope.ts\";\nimport { withBuiltinDiagnostics } from \"../builtin-diagnostics.ts\";\nimport {\n\tdrainSessionWork,\n\thasCallingSessionWork,\n\tsessionLifetime,\n\ttrackSessionWork,\n} from \"../session-lifecycle-work.ts\";\nimport { hostInputError } from \"./host-input.js\";\nimport { STALE_EXTENSION_CONTEXT_MESSAGE } from \"./stale-context.ts\";\nimport type { ExtensionRuntime } from \"./types.ts\";\n\n// Runtime objects can cross the built/source loader boundary. Keep the binding on\n// the actual generation, not in a module-local owner map or the shared event bus.\nconst workBinding = Symbol.for(\"atomic.extension-work.v1\");\ninterface WorkBinding {\n\tsealed: boolean;\n\tcleanup: AsyncScope<{ active: boolean }>;\n\trevoked?: boolean;\n\trun<T>(operation: () => Promise<T>): Promise<T>;\n\tdrain(): Promise<void>;\n\tsignal(): AbortSignal;\n}\ntype OwnedRuntime = ExtensionRuntime & { [workBinding]?: WorkBinding };\n\nexport function bindExtensionWork(runtime: ExtensionRuntime, owner: object): void {\n\t(runtime as OwnedRuntime)[workBinding] ??= {\n\t\tsealed: false,\n\t\tcleanup: asyncScope<{ active: boolean }>(),\n\t\trun: (operation) => trackSessionWork(owner, () => trackSessionWork(runtime, operation)),\n\t\tdrain: () => drainSessionWork(runtime),\n\t\tsignal: () => sessionLifetime(owner),\n\t};\n}\n\nexport function extensionSessionSignal(runtime: ExtensionRuntime): AbortSignal {\n\treturn (runtime as OwnedRuntime)[workBinding]?.signal() ?? sessionLifetime(runtime);\n}\n\nexport function sealExtensionWork(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (binding) binding.sealed = true;\n}\n\nexport function resumeExtensionWork(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (binding) binding.sealed = false;\n}\n\nexport function extensionWorkOpen(runtime: ExtensionRuntime): boolean {\n\treturn !(runtime as OwnedRuntime)[workBinding]?.sealed;\n}\n\nexport function trackExtensionWork<T>(runtime: ExtensionRuntime, operation: () => Promise<T>): Promise<T> {\n\treturn withBuiltinDiagnostics(\n\t\truntime,\n\t\t() => (runtime as OwnedRuntime)[workBinding]?.run(operation) ?? trackSessionWork(runtime, operation),\n\t);\n}\n\nexport async function drainExtensionWork(runtime: ExtensionRuntime): Promise<void> {\n\tawait ((runtime as OwnedRuntime)[workBinding]?.drain() ?? drainSessionWork(runtime));\n}\n\n/** Cleanup may inspect its retired resources, but cannot act on a successor. */\nexport function assertExtensionAction(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (binding?.revoked) throw new Error(STALE_EXTENSION_CONTEXT_MESSAGE);\n\tif (binding?.sealed && !binding.cleanup.getStore()?.active && !hasCallingSessionWork(runtime))\n\t\tthrow hostInputError(\"SessionClosed\");\n}\n\nexport function isRetiredExtensionCleanup(runtime: ExtensionRuntime): boolean {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\treturn !!binding?.revoked && !!binding.cleanup.getStore()?.active;\n}\n\n/** Revoke capabilities without releasing resources still owned by admitted callbacks. */\nexport function revokeExtensionAuthority(runtime: ExtensionRuntime): void {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (!binding || binding.revoked) return;\n\tbinding.revoked = true;\n\tconst assertActive = runtime.assertActive.bind(runtime);\n\truntime.assertActive = () => {\n\t\tassertActive();\n\t\tif (!binding.cleanup.getStore()?.active) throw new Error(STALE_EXTENSION_CONTEXT_MESSAGE);\n\t};\n}\n\nexport async function runExtensionCleanup<T>(runtime: ExtensionRuntime, operation: () => Promise<T>): Promise<T> {\n\tconst binding = (runtime as OwnedRuntime)[workBinding];\n\tif (!binding) return operation();\n\tconst scope = { active: true };\n\ttry {\n\t\treturn await binding.cleanup.run(scope, operation);\n\t} finally {\n\t\tscope.active = false;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"loader-host-modules.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/loader-host-modules.ts"],"names":[],"mappings":"AAOA,KAAK,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD,iBAAS,yBAAyB,CAAC,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS5G;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA2F1E;AAED,eAAO,MAAM,0BAA0B;;CAAgC,CAAC;AAExE,0FAA0F;AAC1F,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAazE;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CACtD,MAAM,CAAC,iBAAiB,GAAG,yBAAyB,GAAG,gBAAgB,GAAG,8BAA8B,EAAE,MAAM,CAAC,CACjH,CAaA;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAIpF"}
1
+ {"version":3,"file":"loader-host-modules.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/loader-host-modules.ts"],"names":[],"mappings":"AAOA,KAAK,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD,iBAAS,yBAAyB,CAAC,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS5G;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA8F1E;AAED,eAAO,MAAM,0BAA0B;;CAAgC,CAAC;AAExE,0FAA0F;AAC1F,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAazE;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CACtD,MAAM,CAAC,iBAAiB,GAAG,yBAAyB,GAAG,gBAAgB,GAAG,8BAA8B,EAAE,MAAM,CAAC,CACjH,CAaA;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAIpF"}
@@ -23,7 +23,7 @@ export async function loadVirtualModules() {
23
23
  const atomicNatives = loadOptionalAtomicNatives(requireFromHost, isBunBinary
24
24
  ? join(getPackageDir(), "node_modules", "@bastani", "atomic-natives", "native", "index.js")
25
25
  : "@bastani/atomic-natives");
26
- const [typebox, typeboxCompile, typeboxValue, piAgentCore, piTui, piTuiLayout, piTuiLayoutNode, piAi, piAiOauth, piAiModels, piAiCloudflareGatewayBinding, piAiProviderEnv, piAiOauthPage, properLockfile, piCodingAgent, storage,] = await Promise.all([
26
+ const [typebox, typeboxCompile, typeboxValue, piAgentCore, piTui, piTuiLayout, piTuiLayoutNode, piAi, piAiOauth, piAiModels, piAiProviders, piAiCloudflareGatewayBinding, piAiProviderEnv, piAiOauthPage, properLockfile, piCodingAgent, storage,] = await Promise.all([
27
27
  import("typebox"),
28
28
  import("typebox/compile"),
29
29
  import("typebox/value"),
@@ -36,6 +36,7 @@ export async function loadVirtualModules() {
36
36
  import("@bastani/pi-ai/compat"),
37
37
  import("@bastani/pi-ai/oauth"),
38
38
  import("@bastani/pi-ai/models"),
39
+ import("@bastani/pi-ai/providers/all"),
39
40
  import("@bastani/pi-ai/api/cloudflare-gateway-binding"),
40
41
  import("@bastani/pi-ai/utils/provider-env"),
41
42
  import("@bastani/pi-ai/utils/oauth-page"),
@@ -61,6 +62,7 @@ export async function loadVirtualModules() {
61
62
  "@bastani/pi-ai/compat": piAi,
62
63
  "@bastani/pi-ai/oauth": piAiOauth,
63
64
  "@bastani/pi-ai/models": piAiModels,
65
+ "@bastani/pi-ai/providers/all": piAiProviders,
64
66
  "@bastani/pi-ai/api/cloudflare-gateway-binding": piAiCloudflareGatewayBinding,
65
67
  "@bastani/pi-ai/utils/provider-env": piAiProviderEnv,
66
68
  "@bastani/pi-ai/utils/oauth-page": piAiOauthPage,
@@ -1 +1 @@
1
- {"version":3,"file":"loader-host-modules.js","sourceRoot":"","sources":["../../../src/core/extensions/loader-host-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,IAAI,cAAc,GAAkC,IAAI,CAAC;AACzD,IAAI,qBAAqB,GAA2C,IAAI,CAAC;AAIzE,SAAS,yBAAyB,CAAC,eAAkC,EAAE,SAAiB;IACvF,IAAI,CAAC;QACJ,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACR,sEAAsE;QACtE,yEAAyE;QACzE,0CAA0C;QAC1C,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,U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EAAE,CAAC,IAAI,CAClD,CAAC,OAAO,EAAE,EAAE;QACX,cAAc,GAAG,OAAO,CAAC;QACzB,OAAO,OAAO,CAAC;IAChB,CAAC,EACD,CAAC,KAAY,EAAE,EAAE;QAChB,qBAAqB,GAAG,IAAI,CAAC;QAC7B,MAAM,KAAK,CAAC;IACb,CAAC,CACD,CAAC;IACF,OAAO,qBAAqB,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAG3C,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC5D,MAAM,CAAC,gBAAgB,CAAC;QACxB,MAAM,CAAC,qBAAqB,CAAC;QAC7B,MAAM,CAAC,uBAAuB,CAAC;QAC/B,MAAM,CAAC,8BAA8B,CAAC;KACtC,CAAC,CAAC;IACH,OAAO;QACN,iBAAiB,EAAE,MAAM;QACzB,yBAAyB,EAAE,OAAO;QAClC,gBAAgB,EAAE,IAAI;QACtB,8BAA8B,EAAE,SAAS;KACzC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B;IACjD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACpD,IAAI,CAAC,CAAC,WAAW,IAAI,cAAc,CAAC;QAAE,OAAO,EAAE,yBAAyB,EAAE,OAAO,EAAE,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAE,yBAAyB,EAAE,OAAO,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport { getPackageDir, isBunBinary, isBundledBuild } from \"../../config.js\";\nimport { createModuleRequire } from \"../../utils/module-require.ts\";\n\nlet virtualModules: Record<string, object> | null = null;\nlet virtualModulesPromise: Promise<Record<string, object>> | null = null;\n\ntype HostModuleRequire = (specifier: string) => object;\n\nfunction loadOptionalAtomicNatives(requireFromHost: HostModuleRequire, specifier: string): object | undefined {\n\ttry {\n\t\treturn requireFromHost(specifier);\n\t} catch {\n\t\t// Keep a missing or unloadable platform binding proportional: only an\n\t\t// extension that imports atomic-natives should fail, not every extension\n\t\t// waiting for the shared host-module map.\n\t\treturn undefined;\n\t}\n}\n\nexport async function loadVirtualModules(): Promise<Record<string, object>> {\n\t// Keep the native binding external to both the app sidecar and extension\n\t// bundles while sharing its process-global control plane through the bridge.\n\t// If the platform package is unavailable, omit only this registration so\n\t// unrelated builtins can still load.\n\tconst requireFromHost = createModuleRequire(import.meta.url);\n\tconst atomicNatives = loadOptionalAtomicNatives(\n\t\trequireFromHost,\n\t\tisBunBinary\n\t\t\t? join(getPackageDir(), \"node_modules\", \"@bastani\", \"atomic-natives\", \"native\", \"index.js\")\n\t\t\t: \"@bastani/atomic-natives\",\n\t);\n\tconst [\n\t\ttypebox,\n\t\ttypeboxCompile,\n\t\ttypeboxValue,\n\t\tpiAgentCore,\n\t\tpiTui,\n\t\tpiTuiLayout,\n\t\tpiTuiLayoutNode,\n\t\tpiAi,\n\t\tpiAiOauth,\n\t\tpiAiModels,\n\t\tpiAiCloudflareGatewayBinding,\n\t\tpiAiProviderEnv,\n\t\tpiAiOauthPage,\n\t\tproperLockfile,\n\t\tpiCodingAgent,\n\t\tstorage,\n\t] = await Promise.all([\n\t\timport(\"typebox\"),\n\t\timport(\"typebox/compile\"),\n\t\timport(\"typebox/value\"),\n\t\timport(\"@earendil-works/pi-agent-core\"),\n\t\timport(\"@earendil-works/pi-tui\"),\n\t\timport(\"@earendil-works/pi-tui/dist/layout.js\"),\n\t\timport(\"@earendil-works/pi-tui/dist/layout-node.js\"),\n\t\t// pi 0.80.2: the old global pi-ai API moved off the root entrypoint onto\n\t\t// `/compat` (a strict superset). Extensions still use the root specifier.\n\t\timport(\"@bastani/pi-ai/compat\"),\n\t\timport(\"@bastani/pi-ai/oauth\"),\n\t\timport(\"@bastani/pi-ai/models\"),\n\t\timport(\"@bastani/pi-ai/api/cloudflare-gateway-binding\"),\n\t\timport(\"@bastani/pi-ai/utils/provider-env\"),\n\t\timport(\"@bastani/pi-ai/utils/oauth-page\"),\n\t\t// Keep proper-lockfile in the compiled host so extensions share its live\n\t\t// CommonJS module state instead of evaluating it through jiti.\n\t\timport(\"proper-lockfile\"),\n\t\t// loader.ts exports are not re-exported from index.ts, avoiding a cycle.\n\t\timport(\"../../index.ts\"),\n\t\timport(\"../storage/index.js\"),\n\t]);\n\n\treturn {\n\t\ttypebox,\n\t\t\"typebox/compile\": typeboxCompile,\n\t\t\"typebox/value\": typeboxValue,\n\t\t\"@sinclair/typebox\": typebox,\n\t\t\"@sinclair/typebox/compile\": typeboxCompile,\n\t\t\"@sinclair/typebox/value\": typeboxValue,\n\t\t\"@earendil-works/pi-agent-core\": piAgentCore,\n\t\t\"@earendil-works/pi-tui\": piTui,\n\t\t\"@earendil-works/pi-tui/dist/layout.js\": piTuiLayout,\n\t\t\"@earendil-works/pi-tui/dist/layout-node.js\": piTuiLayoutNode,\n\t\t\"@bastani/pi-ai\": piAi,\n\t\t\"@bastani/pi-ai/compat\": piAi,\n\t\t\"@bastani/pi-ai/oauth\": piAiOauth,\n\t\t\"@bastani/pi-ai/models\": piAiModels,\n\t\t\"@bastani/pi-ai/api/cloudflare-gateway-binding\": piAiCloudflareGatewayBinding,\n\t\t\"@bastani/pi-ai/utils/provider-env\": piAiProviderEnv,\n\t\t\"@bastani/pi-ai/utils/oauth-page\": piAiOauthPage,\n\t\t\"@earendil-works/pi-ai\": piAi,\n\t\t\"@earendil-works/pi-ai/compat\": piAi,\n\t\t\"@earendil-works/pi-ai/oauth\": piAiOauth,\n\t\t\"@earendil-works/pi-ai/models\": piAiModels,\n\t\t\"@earendil-works/pi-ai/api/cloudflare-gateway-binding\": piAiCloudflareGatewayBinding,\n\t\t\"proper-lockfile\": properLockfile,\n\t\t...(atomicNatives ? { \"@bastani/atomic-natives\": atomicNatives } : {}),\n\t\t\"@bastani/atomic\": piCodingAgent,\n\t\t\"@bastani/atomic/storage\": storage,\n\t\t\"@earendil-works/pi-coding-agent\": piCodingAgent,\n\t\t\"@mariozechner/pi-coding-agent\": piCodingAgent,\n\t\t\"@mariozechner/pi-agent-core\": piAgentCore,\n\t\t\"@mariozechner/pi-tui\": piTui,\n\t\t\"@mariozechner/pi-tui/dist/layout.js\": piTuiLayout,\n\t\t\"@mariozechner/pi-ai\": piAi,\n\t\t\"@mariozechner/pi-ai/compat\": piAi,\n\t\t\"@mariozechner/pi-ai/oauth\": piAiOauth,\n\t\t\"@mariozechner/pi-ai/models\": piAiModels,\n\t\t\"@mariozechner/pi-ai/api/cloudflare-gateway-binding\": piAiCloudflareGatewayBinding,\n\t};\n}\n\nexport const loaderHostModulesTestHooks = { loadOptionalAtomicNatives };\n\n/** Live host modules shared with single-file builds and transformed extension reloads. */\nexport async function getVirtualModules(): Promise<Record<string, object>> {\n\tif (virtualModules) return virtualModules;\n\tvirtualModulesPromise ??= loadVirtualModules().then(\n\t\t(modules) => {\n\t\t\tvirtualModules = modules;\n\t\t\treturn modules;\n\t\t},\n\t\t(error: Error) => {\n\t\t\tvirtualModulesPromise = null;\n\t\t\tthrow error;\n\t\t},\n\t);\n\treturn virtualModulesPromise;\n}\n\nexport async function getWorkflowHostModules(): Promise<\n\tRecord<\"@bastani/atomic\" | \"@bastani/atomic/storage\" | \"@bastani/pi-ai\" | \"@bastani/pi-ai/providers/all\", object>\n> {\n\tconst [atomic, storage, piAi, providers] = await Promise.all([\n\t\timport(\"../../index.ts\"),\n\t\timport(\"../storage/index.js\"),\n\t\timport(\"@bastani/pi-ai/compat\"),\n\t\timport(\"@bastani/pi-ai/providers/all\"),\n\t]);\n\treturn {\n\t\t\"@bastani/atomic\": atomic,\n\t\t\"@bastani/atomic/storage\": storage,\n\t\t\"@bastani/pi-ai\": piAi,\n\t\t\"@bastani/pi-ai/providers/all\": providers,\n\t};\n}\n\n/**\n * Live host modules for storage adapter modules. Outside single-file builds `@bastani/atomic` resolves lazily through\n * the extension aliases instead, so a process that needs only storage, such as the Intercom broker, never evaluates\n * the whole host package.\n */\nexport async function getStorageAdapterHostModules(): Promise<Record<string, object>> {\n\tconst storage = await import(\"../storage/index.js\");\n\tif (!(isBunBinary || isBundledBuild)) return { \"@bastani/atomic/storage\": storage };\n\treturn { \"@bastani/atomic\": await import(\"../../index.ts\"), \"@bastani/atomic/storage\": storage };\n}\n"]}
1
+ {"version":3,"file":"loader-host-modules.js","sourceRoot":"","sources":["../../../src/core/extensions/loader-host-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,IAAI,cAAc,GAAkC,IAAI,CAAC;AACzD,IAAI,qBAAqB,GAA2C,IAAI,CAAC;AAIzE,SAAS,yBAAyB,CAAC,eAAkC,EAAE,SAAiB;IACvF,IAAI,CAAC;QACJ,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACR,sEAAsE;QACtE,yEAAyE;QACzE,0CAA0C;QAC1C,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACvC,yEAAyE;IACzE,6EAA6E;IAC7E,yEAAyE;IACzE,qCAAqC;IACrC,MAAM,eAAe,GAAG,mBAAmB,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7D,MAAM,aAAa,GAAG,yBAAyB,CAC9C,eAAe,EACf,WAAW;QACV,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,CAAC;QAC3F,CAAC,CAAC,yBAAyB,CAC5B,CAAC;IACF,MAAM,CACL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G3C,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC5D,MAAM,CAAC,gBAAgB,CAAC;QACxB,MAAM,CAAC,qBAAqB,CAAC;QAC7B,MAAM,CAAC,uBAAuB,CAAC;QAC/B,MAAM,CAAC,8BAA8B,CAAC;KACtC,CAAC,CAAC;IACH,OAAO;QACN,iBAAiB,EAAE,MAAM;QACzB,yBAAyB,EAAE,OAAO;QAClC,gBAAgB,EAAE,IAAI;QACtB,8BAA8B,EAAE,SAAS;KACzC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B;IACjD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACpD,IAAI,CAAC,CAAC,WAAW,IAAI,cAAc,CAAC;QAAE,OAAO,EAAE,yBAAyB,EAAE,OAAO,EAAE,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAE,yBAAyB,EAAE,OAAO,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport { getPackageDir, isBunBinary, isBundledBuild } from \"../../config.js\";\nimport { createModuleRequire } from \"../../utils/module-require.ts\";\n\nlet virtualModules: Record<string, object> | null = null;\nlet virtualModulesPromise: Promise<Record<string, object>> | null = null;\n\ntype HostModuleRequire = (specifier: string) => object;\n\nfunction loadOptionalAtomicNatives(requireFromHost: HostModuleRequire, specifier: string): object | undefined {\n\ttry {\n\t\treturn requireFromHost(specifier);\n\t} catch {\n\t\t// Keep a missing or unloadable platform binding proportional: only an\n\t\t// extension that imports atomic-natives should fail, not every extension\n\t\t// waiting for the shared host-module map.\n\t\treturn undefined;\n\t}\n}\n\nexport async function loadVirtualModules(): Promise<Record<string, object>> {\n\t// Keep the native binding external to both the app sidecar and extension\n\t// bundles while sharing its process-global control plane through the bridge.\n\t// If the platform package is unavailable, omit only this registration so\n\t// unrelated builtins can still load.\n\tconst requireFromHost = createModuleRequire(import.meta.url);\n\tconst atomicNatives = loadOptionalAtomicNatives(\n\t\trequireFromHost,\n\t\tisBunBinary\n\t\t\t? join(getPackageDir(), \"node_modules\", \"@bastani\", \"atomic-natives\", \"native\", \"index.js\")\n\t\t\t: \"@bastani/atomic-natives\",\n\t);\n\tconst [\n\t\ttypebox,\n\t\ttypeboxCompile,\n\t\ttypeboxValue,\n\t\tpiAgentCore,\n\t\tpiTui,\n\t\tpiTuiLayout,\n\t\tpiTuiLayoutNode,\n\t\tpiAi,\n\t\tpiAiOauth,\n\t\tpiAiModels,\n\t\tpiAiProviders,\n\t\tpiAiCloudflareGatewayBinding,\n\t\tpiAiProviderEnv,\n\t\tpiAiOauthPage,\n\t\tproperLockfile,\n\t\tpiCodingAgent,\n\t\tstorage,\n\t] = await Promise.all([\n\t\timport(\"typebox\"),\n\t\timport(\"typebox/compile\"),\n\t\timport(\"typebox/value\"),\n\t\timport(\"@earendil-works/pi-agent-core\"),\n\t\timport(\"@earendil-works/pi-tui\"),\n\t\timport(\"@earendil-works/pi-tui/dist/layout.js\"),\n\t\timport(\"@earendil-works/pi-tui/dist/layout-node.js\"),\n\t\t// pi 0.80.2: the old global pi-ai API moved off the root entrypoint onto\n\t\t// `/compat` (a strict superset). Extensions still use the root specifier.\n\t\timport(\"@bastani/pi-ai/compat\"),\n\t\timport(\"@bastani/pi-ai/oauth\"),\n\t\timport(\"@bastani/pi-ai/models\"),\n\t\timport(\"@bastani/pi-ai/providers/all\"),\n\t\timport(\"@bastani/pi-ai/api/cloudflare-gateway-binding\"),\n\t\timport(\"@bastani/pi-ai/utils/provider-env\"),\n\t\timport(\"@bastani/pi-ai/utils/oauth-page\"),\n\t\t// Keep proper-lockfile in the compiled host so extensions share its live\n\t\t// CommonJS module state instead of evaluating it through jiti.\n\t\timport(\"proper-lockfile\"),\n\t\t// loader.ts exports are not re-exported from index.ts, avoiding a cycle.\n\t\timport(\"../../index.ts\"),\n\t\timport(\"../storage/index.js\"),\n\t]);\n\n\treturn {\n\t\ttypebox,\n\t\t\"typebox/compile\": typeboxCompile,\n\t\t\"typebox/value\": typeboxValue,\n\t\t\"@sinclair/typebox\": typebox,\n\t\t\"@sinclair/typebox/compile\": typeboxCompile,\n\t\t\"@sinclair/typebox/value\": typeboxValue,\n\t\t\"@earendil-works/pi-agent-core\": piAgentCore,\n\t\t\"@earendil-works/pi-tui\": piTui,\n\t\t\"@earendil-works/pi-tui/dist/layout.js\": piTuiLayout,\n\t\t\"@earendil-works/pi-tui/dist/layout-node.js\": piTuiLayoutNode,\n\t\t\"@bastani/pi-ai\": piAi,\n\t\t\"@bastani/pi-ai/compat\": piAi,\n\t\t\"@bastani/pi-ai/oauth\": piAiOauth,\n\t\t\"@bastani/pi-ai/models\": piAiModels,\n\t\t\"@bastani/pi-ai/providers/all\": piAiProviders,\n\t\t\"@bastani/pi-ai/api/cloudflare-gateway-binding\": piAiCloudflareGatewayBinding,\n\t\t\"@bastani/pi-ai/utils/provider-env\": piAiProviderEnv,\n\t\t\"@bastani/pi-ai/utils/oauth-page\": piAiOauthPage,\n\t\t\"@earendil-works/pi-ai\": piAi,\n\t\t\"@earendil-works/pi-ai/compat\": piAi,\n\t\t\"@earendil-works/pi-ai/oauth\": piAiOauth,\n\t\t\"@earendil-works/pi-ai/models\": piAiModels,\n\t\t\"@earendil-works/pi-ai/api/cloudflare-gateway-binding\": piAiCloudflareGatewayBinding,\n\t\t\"proper-lockfile\": properLockfile,\n\t\t...(atomicNatives ? { \"@bastani/atomic-natives\": atomicNatives } : {}),\n\t\t\"@bastani/atomic\": piCodingAgent,\n\t\t\"@bastani/atomic/storage\": storage,\n\t\t\"@earendil-works/pi-coding-agent\": piCodingAgent,\n\t\t\"@mariozechner/pi-coding-agent\": piCodingAgent,\n\t\t\"@mariozechner/pi-agent-core\": piAgentCore,\n\t\t\"@mariozechner/pi-tui\": piTui,\n\t\t\"@mariozechner/pi-tui/dist/layout.js\": piTuiLayout,\n\t\t\"@mariozechner/pi-ai\": piAi,\n\t\t\"@mariozechner/pi-ai/compat\": piAi,\n\t\t\"@mariozechner/pi-ai/oauth\": piAiOauth,\n\t\t\"@mariozechner/pi-ai/models\": piAiModels,\n\t\t\"@mariozechner/pi-ai/api/cloudflare-gateway-binding\": piAiCloudflareGatewayBinding,\n\t};\n}\n\nexport const loaderHostModulesTestHooks = { loadOptionalAtomicNatives };\n\n/** Live host modules shared with single-file builds and transformed extension reloads. */\nexport async function getVirtualModules(): Promise<Record<string, object>> {\n\tif (virtualModules) return virtualModules;\n\tvirtualModulesPromise ??= loadVirtualModules().then(\n\t\t(modules) => {\n\t\t\tvirtualModules = modules;\n\t\t\treturn modules;\n\t\t},\n\t\t(error: Error) => {\n\t\t\tvirtualModulesPromise = null;\n\t\t\tthrow error;\n\t\t},\n\t);\n\treturn virtualModulesPromise;\n}\n\nexport async function getWorkflowHostModules(): Promise<\n\tRecord<\"@bastani/atomic\" | \"@bastani/atomic/storage\" | \"@bastani/pi-ai\" | \"@bastani/pi-ai/providers/all\", object>\n> {\n\tconst [atomic, storage, piAi, providers] = await Promise.all([\n\t\timport(\"../../index.ts\"),\n\t\timport(\"../storage/index.js\"),\n\t\timport(\"@bastani/pi-ai/compat\"),\n\t\timport(\"@bastani/pi-ai/providers/all\"),\n\t]);\n\treturn {\n\t\t\"@bastani/atomic\": atomic,\n\t\t\"@bastani/atomic/storage\": storage,\n\t\t\"@bastani/pi-ai\": piAi,\n\t\t\"@bastani/pi-ai/providers/all\": providers,\n\t};\n}\n\n/**\n * Live host modules for storage adapter modules. Outside single-file builds `@bastani/atomic` resolves lazily through\n * the extension aliases instead, so a process that needs only storage, such as the Intercom broker, never evaluates\n * the whole host package.\n */\nexport async function getStorageAdapterHostModules(): Promise<Record<string, object>> {\n\tconst storage = await import(\"../storage/index.js\");\n\tif (!(isBunBinary || isBundledBuild)) return { \"@bastani/atomic/storage\": storage };\n\treturn { \"@bastani/atomic\": await import(\"../../index.ts\"), \"@bastani/atomic/storage\": storage };\n}\n"]}
@@ -230,7 +230,8 @@ export interface ExtensionUIContext {
230
230
  setWorkingMessage(message?: string): void;
231
231
  /**
232
232
  * Show or hide the built-in row during the active Working lifecycle.
233
- * This customizes presentation only; it does not start or stop work.
233
+ * This customizes presentation only; it does not start or stop work, and it
234
+ * never hides the compaction indicator.
234
235
  */
235
236
  setWorkingVisible(visible: boolean): void;
236
237
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ui-types.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/ui-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,GAAG,EACH,gBAAgB,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wCAAwC;AACxC,MAAM,WAAW,wBAAwB;IACxC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,aAAa,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAC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/extensions/ui-types.ts"],"names":[],"mappings":"AAwFA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AAExE,6FAA6F;AAC7F,MAAM,UAAU,2BAA2B,CAAC,KAAwB;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAChG,CAAC;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG,aAAa,CAAC;AACzC,MAAM,0BAA0B,GAAG,uDAAuD,CAAC;AAE3F;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACxD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACvF,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProgramStatus,\n\tScrollViewScrollbar,\n\tTUI,\n\tWheelScrollLines,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ReadonlyFooterDataProvider } from \"../footer-data-provider.ts\";\nimport type { Keybinding, KeybindingsManager } from \"../keybindings.ts\";\nimport type { MarkdownTransformer, MessageRenderer } from \"./message-types.ts\";\nimport type { ToolRenderers } from \"./tool-types.ts\";\n\n/** Options for extension UI dialogs. */\nexport interface ExtensionUIDialogOptions {\n\t/** AbortSignal to programmatically dismiss the dialog. */\n\tsignal?: AbortSignal;\n\t/** Timeout in milliseconds. Dialog auto-dismisses with live countdown display. */\n\ttimeout?: number;\n}\n\n/** Placement for extension widgets. */\nexport type WidgetPlacement = \"aboveEditor\" | \"belowEditor\";\n\nexport interface WidgetScrollState {\n\tscrollTop: number;\n\tviewportHeight: number;\n\tcontentHeight: number;\n}\n\nexport interface WidgetScrollRequest {\n\t/** Increase when intentionally requesting a new position. */\n\tversion: number;\n\tscrollTop: number;\n}\n\nexport interface ScrollableWidgetComponent extends Component {\n\tgetScrollRequest?(): WidgetScrollRequest | undefined;\n\tonScroll?(state: WidgetScrollState): void;\n\tdispose?(): void;\n}\n\n/** Options for extension widgets. */\nexport interface ExtensionWidgetOptions {\n\t/** Where the widget is rendered. Defaults to \"aboveEditor\". */\n\tplacement?: WidgetPlacement;\n\t/** Opt in to a host-owned viewport. Height is a cap, not a guaranteed allocation. */\n\tscroll?: { maxHeight: number; maxHeightFraction?: number };\n}\n\n/** Raw terminal input listener for extensions. */\nexport type TerminalInputHandler = (data: string) => { consume?: boolean; data?: string } | undefined;\n\n/** Working indicator configuration for the interactive Working lifecycle. */\nexport interface WorkingIndicatorOptions {\n\t/** Animation frames. Use an empty array to hide the indicator entirely. Custom frames are rendered verbatim. */\n\tframes?: string[];\n\t/** Frame interval in milliseconds for animated indicators. */\n\tintervalMs?: number;\n}\n\n/** Wrap the current autocomplete provider with additional behavior. */\nexport type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;\n/**\n * Formats the host's configured keybindings for display.\n * Extensions should use these instead of importing `keyText`/`keyHint`: an import may resolve to another copy of\n * the coding-agent package, which does not see the host's keybindings.\n */\nexport interface KeybindingHints {\n\t/** Configured keys for a keybinding id, for example `\"ctrl+o\"`. Empty when the id has no keys. */\n\tkeyText(keybinding: Keybinding): string;\n\n\t/** Configured keys followed by a description, styled as a hint, for example `\"ctrl+o to expand\"`. */\n\tkeyHint(keybinding: Keybinding, description: string): string;\n}\n\nexport type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;\n/** Component returned by `ctx.ui.custom()`. Input handlers must report whether they consumed the key. */\nexport type ExtensionCustomComponent = Omit<Component, \"handleInput\"> & {\n\thandleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;\n\tdispose?(): void;\n};\n\n/**\n * Zero-width mark a custom component may embed in the line it most needs kept\n * on screen — the selected row of a list, say.\n *\n * A `reserveTranscriptRows` overlay is bounded against the terminal height, and\n * on a short terminal that bound has to drop rows. Without a mark the host can\n * only guess, and it guessed wrong: it kept a fixed number of rows from the top,\n * so on a 16-to-22-row terminal the selected option was cropped away and the\n * dialog looked frozen under the arrow keys. With the mark the host windows what\n * it keeps around that row instead.\n *\n * It is an APC sequence, so pi-tui's `visibleWidth` measures it as zero and\n * terminals ignore it — the same mechanism as pi-tui's own `CURSOR_MARKER`, but\n * private to Atomic. Embed it once per frame; the host uses the first line that\n * carries it.\n *\n * The terminator is ST (`ESC \\`), which is what ECMA-48 requires of an APC\n * string. A BEL terminator is accepted for OSC but not for APC, so terminals\n * that follow the spec — tmux among them — kept swallowing the rest of the line\n * as APC payload and drew whatever followed the mark at the wrong column. The\n * renderer strips the mark centrally in `applyLineResets` before painting, so\n * it does not reach the terminal at all; the conforming terminator is the\n * second layer, bounding the damage if a frame ever escapes that strip.\n */\nexport const OVERLAY_ACTIVE_ROW_MARKER = \"\\u001B_atomic:active\\u001B\\\\\";\n\n/** Remove every {@link OVERLAY_ACTIVE_ROW_MARKER} from `lines`, leaving widths untouched. */\nexport function stripOverlayActiveRowMarker(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OVERLAY_ACTIVE_ROW_MARKER) ? line.replaceAll(OVERLAY_ACTIVE_ROW_MARKER, \"\") : line,\n\t);\n}\n\nconst OSC133_PROMPT_MARK = \"\\u001B]133;\";\nconst OSC133_PROMPT_MARK_PATTERN = /\\u001B\\]133;[ABC][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)/g;\n\n/**\n * Remove every OSC 133 `A`/`B`/`C` shell-integration mark from `lines`, wherever it sits in the line.\n * Terminals treat `A` as a new shell prompt and drop the program's OSC 7501 status record, so a\n * fullscreen frame must never carry one. The marks are zero-width, so no column moves.\n */\nexport function stripOsc133Marks(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OSC133_PROMPT_MARK) ? line.replace(OSC133_PROMPT_MARK_PATTERN, \"\") : line,\n\t);\n}\n\nexport interface ChatRenderSettings {\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\ttoolOutputExpanded: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tmarkdownTransformers: readonly MarkdownTransformer[];\n\trenderLatex?: boolean;\n\t/** `fullscreenScrollbar`, for a transcript an overlay scrolls itself. */\n\tfullscreenScrollbar?: ScrollViewScrollbar;\n\t/** `fullscreenWheelScrollLines`, for a transcript an overlay scrolls itself. */\n\tfullscreenWheelScrollLines?: WheelScrollLines;\n\tgetToolDefinition(toolName: string): ToolRenderers | undefined;\n\tgetCustomMessageRenderer(customType: string): MessageRenderer | undefined;\n}\n\n/** Host-owned inline custom UI focus state exposed to overlays without prompt content. */\nexport interface HostCustomUiState {\n\t/** Number of active non-overlay host custom UI mounts. */\n\tblockingInlineCustomUiDepth: number;\n\t/** True when at least one non-overlay host custom UI is mounted and blocking. */\n\tblockingInlineCustomUiActive: boolean;\n\t/** True when the active inline custom UI is waiting behind an overlay that kept focus. */\n\tblockingInlineCustomUiFocusDeferred?: boolean;\n\t/** Distinguishes required prompts from navigation. Omitted when all mounts are prompts. */\n\tblockingInlineCustomUiNeedsInput?: boolean;\n}\n\nexport type HostCustomUiStateListener = (state: HostCustomUiState) => void;\n\n/** Supported field kinds for the host-native input form. */\nexport type HostInputFormFieldType = \"string\" | \"text\" | \"number\" | \"integer\" | \"boolean\" | \"select\";\n\n/** JSON-safe field descriptor for {@link ExtensionUIContext.hostInputForm}. */\nexport interface HostInputFormField {\n\tname: string;\n\ttype: HostInputFormFieldType;\n\tdescription?: string;\n\trequired?: boolean;\n\tchoices?: string[];\n\tplaceholder?: string;\n\t/** Raw, display-ready initial value. */\n\tinitialValue: string;\n}\n\n/** Request for a host-owned inline input form. */\nexport interface HostInputFormRequest {\n\ttitle: string;\n\tfields: HostInputFormField[];\n\t/** Panel heading label. Defaults to \"WORKFLOW INPUTS\". */\n\theading?: string;\n\t/** Submit button label. Defaults to \"[ Run workflow ]\". */\n\tsubmitLabel?: string;\n}\n\n/**\n * JSON-safe session-selector row for the host-native session picker.\n * Mirrors `SessionInfo` with `created`/`modified` flattened to epoch millis so\n * rows can cross the interactive-engine protocol without `Date` objects.\n */\nexport interface HostSessionPickerRow {\n\tpath: string;\n\tid: string;\n\tcwd: string;\n\t/** Creation time in epoch milliseconds. */\n\tcreatedAt: number;\n\t/** Last-modified time in epoch milliseconds. */\n\tmodifiedAt: number;\n\tmessageCount: number;\n\tfirstMessage: string;\n\t/** Generated resume summary. Absent when never generated, or stale against the latest message. */\n\tsummary?: string;\n\tallMessagesText?: string;\n\tname?: string;\n\t/** Optional semantic color for synthetic selector rows. */\n\tmessageColor?: \"success\" | \"warning\" | \"accent\" | \"error\";\n}\n\n/** Request for {@link ExtensionUIContext.hostSessionPicker}. */\nexport interface HostSessionPickerRequest {\n\t/** Rows shown in the first frame. Push later rows via the handle's `update()`. */\n\tsessions: HostSessionPickerRow[];\n\t/** Show the rename keybinding hint in the picker header. Defaults to false. */\n\tshowRenameHint?: boolean;\n\t/**\n\t * Invoked after the user confirms a Ctrl+D delete on a row. The host does\n\t * NOT remove the row; reply with `update()` (row removed) or `error()`.\n\t */\n\tonDelete?: (path: string) => void | Promise<void>;\n}\n\n/** Live control surface for an open host-native session picker. */\nexport interface HostSessionPickerHandle {\n\t/** Resolves with the selected row's `path`, or `undefined` on cancel/close. */\n\tresult: Promise<string | undefined>;\n\t/** Replace the picker rows (navigation/search state is preserved host-side). */\n\tupdate(sessions: HostSessionPickerRow[]): void;\n\t/** Surface a transient error message in the picker header. */\n\terror(message: string): void;\n\t/** Close the picker; `result` resolves `undefined`. Idempotent. */\n\tclose(): void;\n}\n\n/**\n * UI context for extensions to request interactive UI.\n * Each mode (interactive, RPC, print) provides its own implementation.\n */\nexport interface ExtensionUIContext {\n\t/** Show a selector and return the user's choice. */\n\tselect(title: string, options: string[], opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a confirmation dialog. */\n\tconfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\n\t/** Show a text input dialog. */\n\tinput(title: string, placeholder?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a notification to the user. */\n\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\n\t/** Request an interactive repaint after extension-owned state changes. */\n\trequestRender(): void;\n\n\t/** Get host-owned inline custom UI focus state, if the mode exposes it. */\n\tgetHostCustomUiState?(): HostCustomUiState;\n\n\t/** Observe host-owned inline custom UI focus state changes. Returns an unsubscribe function. */\n\tonHostCustomUiStateChange?(listener: HostCustomUiStateListener): () => void;\n\n\t/** Move focus to a mounted host-owned inline custom UI, if one is pending. */\n\tfocusHostInlineCustomUi?(): boolean;\n\n\t/** Listen to raw terminal input (interactive mode only). Returns an unsubscribe function. */\n\tonTerminalInput(handler: TerminalInputHandler): () => void;\n\n\t/** Set status text in the footer/status bar. Pass undefined to clear. */\n\tsetStatus(key: string, text: string | undefined): void;\n\n\t/**\n\t * Set the working/loading message presented during the active Working lifecycle,\n\t * from accepted prompt startup through the agent turn. This customizes\n\t * presentation only; it does not start work or emit pre-start events. Call with\n\t * no argument to restore the default.\n\t */\n\tsetWorkingMessage(message?: string): void;\n\n\t/**\n\t * Show or hide the built-in row during the active Working lifecycle.\n\t * This customizes presentation only; it does not start or stop work.\n\t */\n\tsetWorkingVisible(visible: boolean): void;\n\n\t/**\n\t * Configure the interactive indicator presented during the active Working\n\t * lifecycle, from accepted prompt startup through the agent turn. This\n\t * customizes presentation only; it does not start work or emit pre-start events.\n\t *\n\t * - Omit the argument to restore the default animated spinner.\n\t * - Use `frames: [\"●\"]` for a static indicator.\n\t * - Use `frames: []` to hide the indicator entirely.\n\t * - Custom frames are rendered as provided, so extensions must add their own colors.\n\t */\n\tsetWorkingIndicator(options?: WorkingIndicatorOptions): void;\n\n\t/** Set the label shown for hidden thinking blocks. Call with no argument to restore default. */\n\tsetHiddenThinkingLabel(label?: string): void;\n\n\t/** Set a widget to display above or below the editor. Accepts string array or component factory. */\n\tsetWidget(key: string, content: string[] | undefined, options?: ExtensionWidgetOptions): void;\n\tsetWidget(\n\t\tkey: string,\n\t\tcontent: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined,\n\t\toptions?: ExtensionWidgetOptions,\n\t): void;\n\n\t/** Observe host-driven widget release events for a key. Returns an unsubscribe function. */\n\tonWidgetRelease?(key: string, listener: () => void): () => void;\n\n\t/** Set a custom footer component, or undefined to restore the built-in footer.\n\t *\n\t * The factory receives a FooterDataProvider for data not otherwise accessible:\n\t * git branch and extension statuses from setStatus(). Context usage is on\n\t * ctx.getContextUsage(), token stats on ctx.sessionManager.getEntries(), and model info on ctx.model.\n\t */\n\tsetFooter(\n\t\tfactory:\n\t\t\t| ((tui: TUI, theme: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t| undefined,\n\t): void;\n\n\t/** Set a custom header component (shown at startup, above chat), or undefined to restore the built-in header. */\n\tsetHeader(factory: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;\n\n\t/** Set the terminal window/tab title. */\n\tsetTitle(title: string): void;\n\n\t/** Show a custom component with keyboard focus. */\n\tcustom<T>(\n\t\tfactory: (\n\t\t\ttui: TUI,\n\t\t\ttheme: Theme,\n\t\t\tkeybindings: KeybindingsManager,\n\t\t\tdone: (result: T) => void,\n\t\t) => ExtensionCustomComponent | Promise<ExtensionCustomComponent>,\n\t\toptions?: {\n\t\t\t/** Navigation does not emit approval-prompt events. Defaults to \"prompt\". */\n\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\toverlay?: boolean;\n\t\t\t/** Keep host inline custom UI pending in the background while this overlay is visible. */\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t/**\n\t\t\t * Declare that this component binds Ctrl+C itself (cancel, skip, close).\n\t\t\t * The host then forwards the first Ctrl+C to it instead of closing it.\n\t\t\t *\n\t\t\t * Leave it unset unless the component really handles the key: the host\n\t\t\t * closes an undeclared component on the first Ctrl+C so a component that\n\t\t\t * never resolves can never trap the keyboard.\n\t\t\t */\n\t\t\thandlesCtrlC?: boolean;\n\t\t\t/** Declare that this component claims internal UI actions such as the jump-to-bottom URL. */\n\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t/**\n\t\t\t * Overlay-only. Bound this overlay's height so a transcript strip stays\n\t\t\t * visible, and extend the transcript's scroll extent by the rows it\n\t\t\t * still covers, so every line of the scrollback can be brought above it.\n\t\t\t *\n\t\t\t * Set it for a blocking bottom-anchored dialog. Leave it unset for an\n\t\t\t * overlay that is meant to take the screen, such as a full-screen graph.\n\t\t\t */\n\t\t\treserveTranscriptRows?: boolean;\n\t\t\t/** AbortSignal to programmatically dismiss the custom UI. */\n\t\t\tsignal?: AbortSignal;\n\t\t\t/** Overlay positioning/sizing options. Can be static or a function for dynamic updates. */\n\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t/** Called with the overlay handle after the overlay is shown. Use to control visibility. */\n\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t/**\n\t\t\t * Report Atomic as blocked on user input (OSC 7501 program status) while this component waits for input.\n\t\t\t * Inline components report it while visible. Overlays report it until `done()` is called or `signal` aborts,\n\t\t\t * also while hidden with `setHidden()`.\n\t\t\t */\n\t\t\tblocked?: { kind: NonNullable<ProgramStatus[\"kind\"]>; message: string };\n\t\t},\n\t): Promise<T>;\n\n\t/**\n\t * Open a session-list picker that runs natively in the host terminal\n\t * process. Every interactive host implements it — non-isolated mode\n\t * mounts the selector directly (no IPC), isolated mode routes it over\n\t * the engine session-picker protocol channel — so callers use one\n\t * identical API. In both cases navigation and search never cross a\n\t * process boundary; only open/update/select/delete/cancel do. The\n\t * member is absent only on non-interactive surfaces (headless RPC,\n\t * print); callers should fail with an actionable error there rather\n\t * than degrade.\n\t */\n\thostSessionPicker?(request: HostSessionPickerRequest): HostSessionPickerHandle;\n\n\t/**\n\t * Open an inline form whose component, focus, and editing state live in the\n\t * terminal host. Resolves raw field values, or undefined on cancellation.\n\t */\n\thostInputForm?(request: HostInputFormRequest): Promise<Record<string, string> | undefined>;\n\n\t/**\n\t * Ask a whole `ask_user_question` questionnaire through the host, as one request, instead of rendering it in the\n\t * terminal. Resolves the user's answers, or undefined when the host can't ask right now, in which case the caller\n\t * renders the questionnaire itself.\n\t */\n\thostQuestionnaire?(\n\t\tparams: import(\"../tools/ask-user-question/tool/types.js\").QuestionParams,\n\t\tsignal?: AbortSignal,\n\t): Promise<import(\"../tools/ask-user-question/tool/types.js\").QuestionnaireResult | undefined>;\n\n\t/** Paste text into the editor, triggering paste handling (collapse for large content). */\n\tpasteToEditor(text: string): void;\n\n\t/** Set the text in the core input editor. */\n\tsetEditorText(text: string): void;\n\n\t/** Get the current text from the core input editor. */\n\tgetEditorText(): string;\n\n\t/**\n\t * Show a multi-line editor for text editing.\n\t *\n\t * `opts.signal` lets a host cancel the mount it owns — the isolated engine\n\t * bridge uses it to close dialogs belonging to a dead engine generation.\n\t */\n\teditor(title: string, prefill?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Stack additional autocomplete behavior on top of the built-in provider. */\n\taddAutocompleteProvider(factory: AutocompleteProviderFactory): void;\n\n\t/**\n\t * Set a custom editor component via factory function.\n\t * Pass undefined to restore the default editor.\n\t *\n\t * The factory receives:\n\t * - `theme`: EditorTheme for styling borders and autocomplete\n\t * - `keybindings`: KeybindingsManager for app-level keybindings\n\t *\n\t * For full app keybinding support (escape, ctrl+d, model switching, etc.),\n\t * extend `CustomEditor` from `@bastani/atomic` and return `super.handleInput(data)`\n\t * for keys you don't handle.\n\t *\n\t * @example\n\t * ```ts\n\t * import { CustomEditor } from \"@bastani/atomic\";\n\t *\n\t * class VimEditor extends CustomEditor {\n\t * private mode: \"normal\" | \"insert\" = \"insert\";\n\t *\n\t * handleInput(data: string): boolean {\n\t * if (this.mode === \"normal\") {\n\t * // Handle vim normal mode keys...\n\t * if (data === \"i\") { this.mode = \"insert\"; return true; }\n\t * }\n\t * return super.handleInput(data); // App keybindings + text editing\n\t * }\n\t * }\n\t *\n\t * ctx.ui.setEditorComponent((tui, theme, keybindings) =>\n\t * new VimEditor(tui, theme, keybindings)\n\t * );\n\t * ```\n\t */\n\tsetEditorComponent(factory: EditorFactory | undefined): void;\n\n\t/** Get the currently configured custom editor factory, or undefined when using the default editor. */\n\tgetEditorComponent(): EditorFactory | undefined;\n\n\t/** Get the built-in footer data provider so embedded extension UIs can reuse the core footer. */\n\tgetFooterDataProvider(): ReadonlyFooterDataProvider;\n\n\t/** Get the current theme for styling. */\n\treadonly theme: Theme;\n\n\t/** Get all available themes with their names and file paths. */\n\tgetAllThemes(): { name: string; path: string | undefined }[];\n\n\t/** Load a theme by name without switching to it. Returns undefined if not found. */\n\tgetTheme(name: string): Theme | undefined;\n\n\t/** Set the current theme by name or Theme object. */\n\tsetTheme(theme: string | Theme): { success: boolean; error?: string };\n\n\t/** Get current tool output expansion state. */\n\tgetToolsExpanded(): boolean;\n\n\t/** Set tool output expansion state. */\n\tsetToolsExpanded(expanded: boolean): void;\n\n\t/** Get current chat rendering preferences and extension renderers. */\n\tgetChatRenderSettings(): ChatRenderSettings;\n}\n"]}
1
+ {"version":3,"file":"ui-types.js","sourceRoot":"","sources":["../../../src/core/extensions/ui-types.ts"],"names":[],"mappings":"AAwFA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AAExE,6FAA6F;AAC7F,MAAM,UAAU,2BAA2B,CAAC,KAAwB;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAChG,CAAC;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG,aAAa,CAAC;AACzC,MAAM,0BAA0B,GAAG,uDAAuD,CAAC;AAE3F;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACxD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACvF,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProgramStatus,\n\tScrollViewScrollbar,\n\tTUI,\n\tWheelScrollLines,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ReadonlyFooterDataProvider } from \"../footer-data-provider.ts\";\nimport type { Keybinding, KeybindingsManager } from \"../keybindings.ts\";\nimport type { MarkdownTransformer, MessageRenderer } from \"./message-types.ts\";\nimport type { ToolRenderers } from \"./tool-types.ts\";\n\n/** Options for extension UI dialogs. */\nexport interface ExtensionUIDialogOptions {\n\t/** AbortSignal to programmatically dismiss the dialog. */\n\tsignal?: AbortSignal;\n\t/** Timeout in milliseconds. Dialog auto-dismisses with live countdown display. */\n\ttimeout?: number;\n}\n\n/** Placement for extension widgets. */\nexport type WidgetPlacement = \"aboveEditor\" | \"belowEditor\";\n\nexport interface WidgetScrollState {\n\tscrollTop: number;\n\tviewportHeight: number;\n\tcontentHeight: number;\n}\n\nexport interface WidgetScrollRequest {\n\t/** Increase when intentionally requesting a new position. */\n\tversion: number;\n\tscrollTop: number;\n}\n\nexport interface ScrollableWidgetComponent extends Component {\n\tgetScrollRequest?(): WidgetScrollRequest | undefined;\n\tonScroll?(state: WidgetScrollState): void;\n\tdispose?(): void;\n}\n\n/** Options for extension widgets. */\nexport interface ExtensionWidgetOptions {\n\t/** Where the widget is rendered. Defaults to \"aboveEditor\". */\n\tplacement?: WidgetPlacement;\n\t/** Opt in to a host-owned viewport. Height is a cap, not a guaranteed allocation. */\n\tscroll?: { maxHeight: number; maxHeightFraction?: number };\n}\n\n/** Raw terminal input listener for extensions. */\nexport type TerminalInputHandler = (data: string) => { consume?: boolean; data?: string } | undefined;\n\n/** Working indicator configuration for the interactive Working lifecycle. */\nexport interface WorkingIndicatorOptions {\n\t/** Animation frames. Use an empty array to hide the indicator entirely. Custom frames are rendered verbatim. */\n\tframes?: string[];\n\t/** Frame interval in milliseconds for animated indicators. */\n\tintervalMs?: number;\n}\n\n/** Wrap the current autocomplete provider with additional behavior. */\nexport type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;\n/**\n * Formats the host's configured keybindings for display.\n * Extensions should use these instead of importing `keyText`/`keyHint`: an import may resolve to another copy of\n * the coding-agent package, which does not see the host's keybindings.\n */\nexport interface KeybindingHints {\n\t/** Configured keys for a keybinding id, for example `\"ctrl+o\"`. Empty when the id has no keys. */\n\tkeyText(keybinding: Keybinding): string;\n\n\t/** Configured keys followed by a description, styled as a hint, for example `\"ctrl+o to expand\"`. */\n\tkeyHint(keybinding: Keybinding, description: string): string;\n}\n\nexport type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;\n/** Component returned by `ctx.ui.custom()`. Input handlers must report whether they consumed the key. */\nexport type ExtensionCustomComponent = Omit<Component, \"handleInput\"> & {\n\thandleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;\n\tdispose?(): void;\n};\n\n/**\n * Zero-width mark a custom component may embed in the line it most needs kept\n * on screen — the selected row of a list, say.\n *\n * A `reserveTranscriptRows` overlay is bounded against the terminal height, and\n * on a short terminal that bound has to drop rows. Without a mark the host can\n * only guess, and it guessed wrong: it kept a fixed number of rows from the top,\n * so on a 16-to-22-row terminal the selected option was cropped away and the\n * dialog looked frozen under the arrow keys. With the mark the host windows what\n * it keeps around that row instead.\n *\n * It is an APC sequence, so pi-tui's `visibleWidth` measures it as zero and\n * terminals ignore it — the same mechanism as pi-tui's own `CURSOR_MARKER`, but\n * private to Atomic. Embed it once per frame; the host uses the first line that\n * carries it.\n *\n * The terminator is ST (`ESC \\`), which is what ECMA-48 requires of an APC\n * string. A BEL terminator is accepted for OSC but not for APC, so terminals\n * that follow the spec — tmux among them — kept swallowing the rest of the line\n * as APC payload and drew whatever followed the mark at the wrong column. The\n * renderer strips the mark centrally in `applyLineResets` before painting, so\n * it does not reach the terminal at all; the conforming terminator is the\n * second layer, bounding the damage if a frame ever escapes that strip.\n */\nexport const OVERLAY_ACTIVE_ROW_MARKER = \"\\u001B_atomic:active\\u001B\\\\\";\n\n/** Remove every {@link OVERLAY_ACTIVE_ROW_MARKER} from `lines`, leaving widths untouched. */\nexport function stripOverlayActiveRowMarker(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OVERLAY_ACTIVE_ROW_MARKER) ? line.replaceAll(OVERLAY_ACTIVE_ROW_MARKER, \"\") : line,\n\t);\n}\n\nconst OSC133_PROMPT_MARK = \"\\u001B]133;\";\nconst OSC133_PROMPT_MARK_PATTERN = /\\u001B\\]133;[ABC][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)/g;\n\n/**\n * Remove every OSC 133 `A`/`B`/`C` shell-integration mark from `lines`, wherever it sits in the line.\n * Terminals treat `A` as a new shell prompt and drop the program's OSC 7501 status record, so a\n * fullscreen frame must never carry one. The marks are zero-width, so no column moves.\n */\nexport function stripOsc133Marks(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OSC133_PROMPT_MARK) ? line.replace(OSC133_PROMPT_MARK_PATTERN, \"\") : line,\n\t);\n}\n\nexport interface ChatRenderSettings {\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\ttoolOutputExpanded: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tmarkdownTransformers: readonly MarkdownTransformer[];\n\trenderLatex?: boolean;\n\t/** `fullscreenScrollbar`, for a transcript an overlay scrolls itself. */\n\tfullscreenScrollbar?: ScrollViewScrollbar;\n\t/** `fullscreenWheelScrollLines`, for a transcript an overlay scrolls itself. */\n\tfullscreenWheelScrollLines?: WheelScrollLines;\n\tgetToolDefinition(toolName: string): ToolRenderers | undefined;\n\tgetCustomMessageRenderer(customType: string): MessageRenderer | undefined;\n}\n\n/** Host-owned inline custom UI focus state exposed to overlays without prompt content. */\nexport interface HostCustomUiState {\n\t/** Number of active non-overlay host custom UI mounts. */\n\tblockingInlineCustomUiDepth: number;\n\t/** True when at least one non-overlay host custom UI is mounted and blocking. */\n\tblockingInlineCustomUiActive: boolean;\n\t/** True when the active inline custom UI is waiting behind an overlay that kept focus. */\n\tblockingInlineCustomUiFocusDeferred?: boolean;\n\t/** Distinguishes required prompts from navigation. Omitted when all mounts are prompts. */\n\tblockingInlineCustomUiNeedsInput?: boolean;\n}\n\nexport type HostCustomUiStateListener = (state: HostCustomUiState) => void;\n\n/** Supported field kinds for the host-native input form. */\nexport type HostInputFormFieldType = \"string\" | \"text\" | \"number\" | \"integer\" | \"boolean\" | \"select\";\n\n/** JSON-safe field descriptor for {@link ExtensionUIContext.hostInputForm}. */\nexport interface HostInputFormField {\n\tname: string;\n\ttype: HostInputFormFieldType;\n\tdescription?: string;\n\trequired?: boolean;\n\tchoices?: string[];\n\tplaceholder?: string;\n\t/** Raw, display-ready initial value. */\n\tinitialValue: string;\n}\n\n/** Request for a host-owned inline input form. */\nexport interface HostInputFormRequest {\n\ttitle: string;\n\tfields: HostInputFormField[];\n\t/** Panel heading label. Defaults to \"WORKFLOW INPUTS\". */\n\theading?: string;\n\t/** Submit button label. Defaults to \"[ Run workflow ]\". */\n\tsubmitLabel?: string;\n}\n\n/**\n * JSON-safe session-selector row for the host-native session picker.\n * Mirrors `SessionInfo` with `created`/`modified` flattened to epoch millis so\n * rows can cross the interactive-engine protocol without `Date` objects.\n */\nexport interface HostSessionPickerRow {\n\tpath: string;\n\tid: string;\n\tcwd: string;\n\t/** Creation time in epoch milliseconds. */\n\tcreatedAt: number;\n\t/** Last-modified time in epoch milliseconds. */\n\tmodifiedAt: number;\n\tmessageCount: number;\n\tfirstMessage: string;\n\t/** Generated resume summary. Absent when never generated, or stale against the latest message. */\n\tsummary?: string;\n\tallMessagesText?: string;\n\tname?: string;\n\t/** Optional semantic color for synthetic selector rows. */\n\tmessageColor?: \"success\" | \"warning\" | \"accent\" | \"error\";\n}\n\n/** Request for {@link ExtensionUIContext.hostSessionPicker}. */\nexport interface HostSessionPickerRequest {\n\t/** Rows shown in the first frame. Push later rows via the handle's `update()`. */\n\tsessions: HostSessionPickerRow[];\n\t/** Show the rename keybinding hint in the picker header. Defaults to false. */\n\tshowRenameHint?: boolean;\n\t/**\n\t * Invoked after the user confirms a Ctrl+D delete on a row. The host does\n\t * NOT remove the row; reply with `update()` (row removed) or `error()`.\n\t */\n\tonDelete?: (path: string) => void | Promise<void>;\n}\n\n/** Live control surface for an open host-native session picker. */\nexport interface HostSessionPickerHandle {\n\t/** Resolves with the selected row's `path`, or `undefined` on cancel/close. */\n\tresult: Promise<string | undefined>;\n\t/** Replace the picker rows (navigation/search state is preserved host-side). */\n\tupdate(sessions: HostSessionPickerRow[]): void;\n\t/** Surface a transient error message in the picker header. */\n\terror(message: string): void;\n\t/** Close the picker; `result` resolves `undefined`. Idempotent. */\n\tclose(): void;\n}\n\n/**\n * UI context for extensions to request interactive UI.\n * Each mode (interactive, RPC, print) provides its own implementation.\n */\nexport interface ExtensionUIContext {\n\t/** Show a selector and return the user's choice. */\n\tselect(title: string, options: string[], opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a confirmation dialog. */\n\tconfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\n\t/** Show a text input dialog. */\n\tinput(title: string, placeholder?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a notification to the user. */\n\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\n\t/** Request an interactive repaint after extension-owned state changes. */\n\trequestRender(): void;\n\n\t/** Get host-owned inline custom UI focus state, if the mode exposes it. */\n\tgetHostCustomUiState?(): HostCustomUiState;\n\n\t/** Observe host-owned inline custom UI focus state changes. Returns an unsubscribe function. */\n\tonHostCustomUiStateChange?(listener: HostCustomUiStateListener): () => void;\n\n\t/** Move focus to a mounted host-owned inline custom UI, if one is pending. */\n\tfocusHostInlineCustomUi?(): boolean;\n\n\t/** Listen to raw terminal input (interactive mode only). Returns an unsubscribe function. */\n\tonTerminalInput(handler: TerminalInputHandler): () => void;\n\n\t/** Set status text in the footer/status bar. Pass undefined to clear. */\n\tsetStatus(key: string, text: string | undefined): void;\n\n\t/**\n\t * Set the working/loading message presented during the active Working lifecycle,\n\t * from accepted prompt startup through the agent turn. This customizes\n\t * presentation only; it does not start work or emit pre-start events. Call with\n\t * no argument to restore the default.\n\t */\n\tsetWorkingMessage(message?: string): void;\n\n\t/**\n\t * Show or hide the built-in row during the active Working lifecycle.\n\t * This customizes presentation only; it does not start or stop work, and it\n\t * never hides the compaction indicator.\n\t */\n\tsetWorkingVisible(visible: boolean): void;\n\n\t/**\n\t * Configure the interactive indicator presented during the active Working\n\t * lifecycle, from accepted prompt startup through the agent turn. This\n\t * customizes presentation only; it does not start work or emit pre-start events.\n\t *\n\t * - Omit the argument to restore the default animated spinner.\n\t * - Use `frames: [\"●\"]` for a static indicator.\n\t * - Use `frames: []` to hide the indicator entirely.\n\t * - Custom frames are rendered as provided, so extensions must add their own colors.\n\t */\n\tsetWorkingIndicator(options?: WorkingIndicatorOptions): void;\n\n\t/** Set the label shown for hidden thinking blocks. Call with no argument to restore default. */\n\tsetHiddenThinkingLabel(label?: string): void;\n\n\t/** Set a widget to display above or below the editor. Accepts string array or component factory. */\n\tsetWidget(key: string, content: string[] | undefined, options?: ExtensionWidgetOptions): void;\n\tsetWidget(\n\t\tkey: string,\n\t\tcontent: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined,\n\t\toptions?: ExtensionWidgetOptions,\n\t): void;\n\n\t/** Observe host-driven widget release events for a key. Returns an unsubscribe function. */\n\tonWidgetRelease?(key: string, listener: () => void): () => void;\n\n\t/** Set a custom footer component, or undefined to restore the built-in footer.\n\t *\n\t * The factory receives a FooterDataProvider for data not otherwise accessible:\n\t * git branch and extension statuses from setStatus(). Context usage is on\n\t * ctx.getContextUsage(), token stats on ctx.sessionManager.getEntries(), and model info on ctx.model.\n\t */\n\tsetFooter(\n\t\tfactory:\n\t\t\t| ((tui: TUI, theme: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t| undefined,\n\t): void;\n\n\t/** Set a custom header component (shown at startup, above chat), or undefined to restore the built-in header. */\n\tsetHeader(factory: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;\n\n\t/** Set the terminal window/tab title. */\n\tsetTitle(title: string): void;\n\n\t/** Show a custom component with keyboard focus. */\n\tcustom<T>(\n\t\tfactory: (\n\t\t\ttui: TUI,\n\t\t\ttheme: Theme,\n\t\t\tkeybindings: KeybindingsManager,\n\t\t\tdone: (result: T) => void,\n\t\t) => ExtensionCustomComponent | Promise<ExtensionCustomComponent>,\n\t\toptions?: {\n\t\t\t/** Navigation does not emit approval-prompt events. Defaults to \"prompt\". */\n\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\toverlay?: boolean;\n\t\t\t/** Keep host inline custom UI pending in the background while this overlay is visible. */\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t/**\n\t\t\t * Declare that this component binds Ctrl+C itself (cancel, skip, close).\n\t\t\t * The host then forwards the first Ctrl+C to it instead of closing it.\n\t\t\t *\n\t\t\t * Leave it unset unless the component really handles the key: the host\n\t\t\t * closes an undeclared component on the first Ctrl+C so a component that\n\t\t\t * never resolves can never trap the keyboard.\n\t\t\t */\n\t\t\thandlesCtrlC?: boolean;\n\t\t\t/** Declare that this component claims internal UI actions such as the jump-to-bottom URL. */\n\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t/**\n\t\t\t * Overlay-only. Bound this overlay's height so a transcript strip stays\n\t\t\t * visible, and extend the transcript's scroll extent by the rows it\n\t\t\t * still covers, so every line of the scrollback can be brought above it.\n\t\t\t *\n\t\t\t * Set it for a blocking bottom-anchored dialog. Leave it unset for an\n\t\t\t * overlay that is meant to take the screen, such as a full-screen graph.\n\t\t\t */\n\t\t\treserveTranscriptRows?: boolean;\n\t\t\t/** AbortSignal to programmatically dismiss the custom UI. */\n\t\t\tsignal?: AbortSignal;\n\t\t\t/** Overlay positioning/sizing options. Can be static or a function for dynamic updates. */\n\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t/** Called with the overlay handle after the overlay is shown. Use to control visibility. */\n\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t/**\n\t\t\t * Report Atomic as blocked on user input (OSC 7501 program status) while this component waits for input.\n\t\t\t * Inline components report it while visible. Overlays report it until `done()` is called or `signal` aborts,\n\t\t\t * also while hidden with `setHidden()`.\n\t\t\t */\n\t\t\tblocked?: { kind: NonNullable<ProgramStatus[\"kind\"]>; message: string };\n\t\t},\n\t): Promise<T>;\n\n\t/**\n\t * Open a session-list picker that runs natively in the host terminal\n\t * process. Every interactive host implements it — non-isolated mode\n\t * mounts the selector directly (no IPC), isolated mode routes it over\n\t * the engine session-picker protocol channel — so callers use one\n\t * identical API. In both cases navigation and search never cross a\n\t * process boundary; only open/update/select/delete/cancel do. The\n\t * member is absent only on non-interactive surfaces (headless RPC,\n\t * print); callers should fail with an actionable error there rather\n\t * than degrade.\n\t */\n\thostSessionPicker?(request: HostSessionPickerRequest): HostSessionPickerHandle;\n\n\t/**\n\t * Open an inline form whose component, focus, and editing state live in the\n\t * terminal host. Resolves raw field values, or undefined on cancellation.\n\t */\n\thostInputForm?(request: HostInputFormRequest): Promise<Record<string, string> | undefined>;\n\n\t/**\n\t * Ask a whole `ask_user_question` questionnaire through the host, as one request, instead of rendering it in the\n\t * terminal. Resolves the user's answers, or undefined when the host can't ask right now, in which case the caller\n\t * renders the questionnaire itself.\n\t */\n\thostQuestionnaire?(\n\t\tparams: import(\"../tools/ask-user-question/tool/types.js\").QuestionParams,\n\t\tsignal?: AbortSignal,\n\t): Promise<import(\"../tools/ask-user-question/tool/types.js\").QuestionnaireResult | undefined>;\n\n\t/** Paste text into the editor, triggering paste handling (collapse for large content). */\n\tpasteToEditor(text: string): void;\n\n\t/** Set the text in the core input editor. */\n\tsetEditorText(text: string): void;\n\n\t/** Get the current text from the core input editor. */\n\tgetEditorText(): string;\n\n\t/**\n\t * Show a multi-line editor for text editing.\n\t *\n\t * `opts.signal` lets a host cancel the mount it owns — the isolated engine\n\t * bridge uses it to close dialogs belonging to a dead engine generation.\n\t */\n\teditor(title: string, prefill?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Stack additional autocomplete behavior on top of the built-in provider. */\n\taddAutocompleteProvider(factory: AutocompleteProviderFactory): void;\n\n\t/**\n\t * Set a custom editor component via factory function.\n\t * Pass undefined to restore the default editor.\n\t *\n\t * The factory receives:\n\t * - `theme`: EditorTheme for styling borders and autocomplete\n\t * - `keybindings`: KeybindingsManager for app-level keybindings\n\t *\n\t * For full app keybinding support (escape, ctrl+d, model switching, etc.),\n\t * extend `CustomEditor` from `@bastani/atomic` and return `super.handleInput(data)`\n\t * for keys you don't handle.\n\t *\n\t * @example\n\t * ```ts\n\t * import { CustomEditor } from \"@bastani/atomic\";\n\t *\n\t * class VimEditor extends CustomEditor {\n\t * private mode: \"normal\" | \"insert\" = \"insert\";\n\t *\n\t * handleInput(data: string): boolean {\n\t * if (this.mode === \"normal\") {\n\t * // Handle vim normal mode keys...\n\t * if (data === \"i\") { this.mode = \"insert\"; return true; }\n\t * }\n\t * return super.handleInput(data); // App keybindings + text editing\n\t * }\n\t * }\n\t *\n\t * ctx.ui.setEditorComponent((tui, theme, keybindings) =>\n\t * new VimEditor(tui, theme, keybindings)\n\t * );\n\t * ```\n\t */\n\tsetEditorComponent(factory: EditorFactory | undefined): void;\n\n\t/** Get the currently configured custom editor factory, or undefined when using the default editor. */\n\tgetEditorComponent(): EditorFactory | undefined;\n\n\t/** Get the built-in footer data provider so embedded extension UIs can reuse the core footer. */\n\tgetFooterDataProvider(): ReadonlyFooterDataProvider;\n\n\t/** Get the current theme for styling. */\n\treadonly theme: Theme;\n\n\t/** Get all available themes with their names and file paths. */\n\tgetAllThemes(): { name: string; path: string | undefined }[];\n\n\t/** Load a theme by name without switching to it. Returns undefined if not found. */\n\tgetTheme(name: string): Theme | undefined;\n\n\t/** Set the current theme by name or Theme object. */\n\tsetTheme(theme: string | Theme): { success: boolean; error?: string };\n\n\t/** Get current tool output expansion state. */\n\tgetToolsExpanded(): boolean;\n\n\t/** Set tool output expansion state. */\n\tsetToolsExpanded(expanded: boolean): void;\n\n\t/** Get current chat rendering preferences and extension renderers. */\n\tgetChatRenderSettings(): ChatRenderSettings;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  export type WorkflowActivityState = "working" | "idle" | "blocked";
2
2
  export type WorkflowActivityReason = "executing" | "automatic_continuation" | "retrying" | "stopping" | "waiting" | "awaiting_input" | "manual_intervention" | "paused" | "quiescent";
3
3
  export type WorkflowRunStatus = "pending" | "running" | "paused" | "completed" | "skipped" | "cancelled" | "blocked" | "failed" | "killed";
4
- export type WorkflowStageStatus = "pending" | "running" | "awaiting_input" | "paused" | "blocked" | "waiting" | "completed" | "failed" | "skipped";
4
+ export type WorkflowStageStatus = "pending" | "running" | "awaiting_input" | "paused" | "blocked" | "suspended" | "completed" | "failed" | "skipped";
5
5
  export type WorkflowToolNodeStatus = "pending" | "running" | "completed" | "failed" | "cached" | "cancelled";
6
6
  export type WorkflowControlAction = "quit" | "kill" | "pause" | "resume";
7
7
  /** Snapshot-safe descriptor of a human-input prompt waiting on a workflow graph node. */
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-events.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/workflow-events.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AACnE,MAAM,MAAM,sBAAsB,GAC/B,WAAW,GACX,wBAAwB,GACxB,UAAU,GACV,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,qBAAqB,GACrB,QAAQ,GACR,WAAW,CAAC;AAGf,MAAM,MAAM,iBAAiB,GAC1B,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,GACX,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAC5B,SAAS,GACT,SAAS,GACT,gBAAgB,GAChB,QAAQ,GACR,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,CAAC;AACb,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAC7G,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE,yFAAyF;AACzF,MAAM,WAAW,uBAAuB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,MAAM,EA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C"}
1
+ {"version":3,"file":"workflow-events.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/workflow-events.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AACnE,MAAM,MAAM,sBAAsB,GAC/B,WAAW,GACX,wBAAwB,GACxB,UAAU,GACV,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,qBAAqB,GACrB,QAAQ,GACR,WAAW,CAAC;AAGf,MAAM,MAAM,iBAAiB,GAC1B,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,GACX,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAC5B,SAAS,GACT,SAAS,GACT,gBAAgB,GAChB,QAAQ,GACR,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,GACR,SAAS,CAAC;AACb,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAC7G,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE,yFAAyF;AACzF,MAAM,WAAW,uBAAuB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CAClB;AACD,UAAU,qBAAqB;IAC9B,sGAAsG;IACtG,EAAE,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;I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,yBAAyB,CAAC;IAClC,IAAI,EAAE,oBAAoB,CAAC;CAC3B;AACD,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,MAAM,aAAa,GACtB,sBAAsB,GACtB,2BAA2B,GAC3B,4BAA4B,GAC5B,sBAAsB,CAAC;AAC1B,MAAM,WAAW,yBAAyB;IACzC,eAAe,CAAC,KAAK,EAAE,6BAA6B,GAAG,IAAI,CAAC;IAC5D,cAAc,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACjD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC;IACtE,gBAAgB,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtD;;;OAGG;IACH,uBAAuB,CAAC,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAClD,OAAO,IAAI,IAAI,CAAC;CAChB;AACD,MAAM,WAAW,6BAA6B;IAC7C,IAAI,EACD,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,wBAAwB,GACxB,kBAAkB,GAClB,iBAAiB,CAAC;IACrB,MAAM,EAAE,yBAAyB,CAAC;CAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-events.js","sourceRoot":"","sources":["../../../src/core/extensions/workflow-events.ts"],"names":[],"mappings":"","sourcesContent":["export type WorkflowActivityState = \"working\" | \"idle\" | \"blocked\";\nexport type WorkflowActivityReason =\n\t| \"executing\"\n\t| \"automatic_continuation\"\n\t| \"retrying\"\n\t| \"stopping\"\n\t| \"waiting\"\n\t| \"awaiting_input\"\n\t| \"manual_intervention\"\n\t| \"paused\"\n\t| \"quiescent\";\n\n// Kept in sync with workflows/shared/store-types without a host runtime dependency.\nexport type WorkflowRunStatus =\n\t| \"pending\"\n\t| \"running\"\n\t| \"paused\"\n\t| \"completed\"\n\t| \"skipped\"\n\t| \"cancelled\"\n\t| \"blocked\"\n\t| \"failed\"\n\t| \"killed\";\nexport type WorkflowStageStatus =\n\t| \"pending\"\n\t| \"running\"\n\t| \"awaiting_input\"\n\t| \"paused\"\n\t| \"blocked\"\n\t| \"waiting\"\n\t| \"completed\"\n\t| \"failed\"\n\t| \"skipped\";\nexport type WorkflowToolNodeStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"cached\" | \"cancelled\";\nexport type WorkflowControlAction = \"quit\" | \"kill\" | \"pause\" | \"resume\";\n\n/** Snapshot-safe descriptor of a human-input prompt waiting on a workflow graph node. */\nexport interface WorkflowGraphNodePrompt {\n\tid: string;\n\tkind: \"input\" | \"confirm\" | \"select\" | \"editor\" | \"custom\";\n\tmessage: string;\n\tchoices?: readonly string[];\n\tcreatedAt: number;\n}\ninterface WorkflowGraphNodeBase {\n\t/** Graph-unique node id: run-local in the root run, `${runId}:${nodeId}` inside nested child runs. */\n\tid: string;\n\t/** Run that owns the node. */\n\trunId: string;\n\t/** Run-local stage id or tool node id. */\n\tnodeId: string;\n\tname: string;\n\t/** Graph-unique ids of the node's parents. */\n\tparentIds: readonly string[];\n\t/** Admission order shared by stages and tool nodes within one run. */\n\texecutionOrder?: number;\n\t/** Nested workflow depth; 0 for the root run. */\n\tdepth: number;\n}\nexport interface WorkflowGraphStageNode extends WorkflowGraphNodeBase {\n\tkind: \"stage\";\n\tstatus: WorkflowStageStatus;\n\tpendingPrompt?: WorkflowGraphNodePrompt;\n}\nexport interface WorkflowGraphToolNode extends WorkflowGraphNodeBase {\n\tkind: \"tool\";\n\tstatus: WorkflowToolNodeStatus;\n\t/** Invocation ordinal of this `ctx.tool` call within its run. */\n\tordinal: number;\n}\nexport type WorkflowGraphNode = WorkflowGraphStageNode | WorkflowGraphToolNode;\n/** A human-input prompt raised by a run itself rather than by one of its stages. */\nexport interface WorkflowGraphRunPrompt extends WorkflowGraphNodePrompt {\n\t/** Run that owns the prompt. */\n\trunId: string;\n}\n/** Expanded graph of one root run, including nested child workflow runs. */\nexport interface WorkflowRootGraph {\n\tnodes: readonly WorkflowGraphNode[];\n\t/** Run-level prompts awaiting an answer; absent when there are none. */\n\trunPrompts?: readonly WorkflowGraphRunPrompt[];\n}\n\nexport interface WorkflowRootActivity {\n\trootRunId: string;\n\townerSessionId: string;\n\tstate: WorkflowActivityState;\n\treason: WorkflowActivityReason;\n\tactiveExecutionCount: number;\n\tactionableBlockCount: number;\n\tblockedPromptKind?: WorkflowGraphNodePrompt[\"kind\"];\n\tendedStatus?: Extract<WorkflowRunStatus, \"completed\" | \"cancelled\" | \"killed\" | \"failed\">;\n\tneedsAttention: boolean;\n\t/** Graph topology and node statuses; absent when the publisher reports no graph. */\n\tgraph?: WorkflowRootGraph;\n}\nexport interface WorkflowObservationCursor {\n\tepoch: string;\n\trevision: number;\n}\nexport type WorkflowActivitySnapshotInput =\n\t| { availability: \"ready\"; roots: readonly WorkflowRootActivity[] }\n\t| { availability: \"recovering\" | \"unavailable\" };\nexport type WorkflowActivitySnapshotFrame = WorkflowActivitySnapshotInput & {\n\tkind: \"snapshot\";\n\tcursor: WorkflowObservationCursor;\n};\nexport type WorkflowActivityFrame =\n\t| WorkflowActivitySnapshotFrame\n\t| { kind: \"changed\"; cursor: WorkflowObservationCursor; root: WorkflowRootActivity }\n\t| { kind: \"removed\"; cursor: WorkflowObservationCursor; rootRunId: string };\nexport type WorkflowActivityObserver = (frame: WorkflowActivityFrame) => void | Promise<void>;\nexport interface WorkflowActivitySubscription {\n\tdispose(): void;\n}\nexport type WorkflowLifecycleDelivery = \"live\" | \"replay\";\nexport type WorkflowLifecycleTarget =\n\t| {\n\t\t\tkind: \"run\";\n\t\t\trunId: string;\n\t\t\tpreviousStatus?: WorkflowRunStatus;\n\t\t\tstatus: WorkflowRunStatus;\n\t\t\taction?: WorkflowControlAction;\n\t }\n\t| {\n\t\t\tkind: \"stage\";\n\t\t\trunId: string;\n\t\t\tstageId: string;\n\t\t\tstageName: string;\n\t\t\tpreviousStatus?: WorkflowStageStatus;\n\t\t\tstatus: WorkflowStageStatus;\n\t }\n\t| {\n\t\t\tkind: \"tool\";\n\t\t\trunId: string;\n\t\t\ttoolNodeId: string;\n\t\t\ttoolName: string;\n\t\t\tpreviousStatus?: WorkflowToolNodeStatus;\n\t\t\tstatus: WorkflowToolNodeStatus;\n\t }\n\t| { kind: \"prompt\"; runId: string; stageId?: string; promptId: string; status: \"opened\" | \"answered\" | \"cancelled\" };\nexport interface WorkflowLifecycleEvent {\n\ttype: \"workflow_lifecycle\";\n\teventId: string;\n\tcursor: WorkflowObservationCursor;\n\trunId: string;\n\trootRunId: string;\n\townerSessionId: string;\n\toccurredAt: number;\n\tobservedAt: number;\n\tdelivery: WorkflowLifecycleDelivery;\n\ttarget: WorkflowLifecycleTarget;\n\tattribution?: \"user\" | \"agent\" | \"scheduler\" | \"recovery\" | \"unknown\";\n}\nexport interface WorkflowStageCompletedEvent extends Omit<WorkflowLifecycleEvent, \"type\" | \"target\"> {\n\ttype: \"workflow_stage_completed\";\n\ttarget: Extract<WorkflowLifecycleTarget, { kind: \"stage\" }> & { status: \"completed\" };\n}\nexport interface WorkflowActivityChangedEvent {\n\ttype: \"workflow_activity_changed\";\n\tcursor: WorkflowObservationCursor;\n\troot: WorkflowRootActivity;\n}\nexport interface WorkflowHeartbeatEvent {\n\ttype: \"workflow_heartbeat\";\n\trunId: string;\n\trootRunId: string;\n\townerSessionId: string;\n\tscheduledAt: number;\n\tintervalMinutes: number;\n}\nexport type WorkflowEvent =\n\t| WorkflowLifecycleEvent\n\t| WorkflowStageCompletedEvent\n\t| WorkflowActivityChangedEvent\n\t| WorkflowHeartbeatEvent;\nexport interface WorkflowActivityPublisher {\n\tpublishSnapshot(input: WorkflowActivitySnapshotInput): void;\n\tpublishChanged(root: WorkflowRootActivity): void;\n\tpublishRemoved(rootRunId: string): void;\n\tpublishLifecycle(event: Omit<WorkflowLifecycleEvent, \"cursor\">): void;\n\tpublishHeartbeat(event: WorkflowHeartbeatEvent): void;\n\t/**\n\t * Registers how to publish root changes the source has coalesced but not yet published, so\n\t * every read of the published activity sees them first.\n\t */\n\tbindPendingPublications?(flush: () => void): void;\n\tdispose(): void;\n}\nexport interface WorkflowObservationDiagnostic {\n\tkind:\n\t\t| \"ObserverDisposed\"\n\t\t| \"SourceRecovering\"\n\t\t| \"SourceUnavailable\"\n\t\t| \"ObserverDeliveryFailed\"\n\t\t| \"ObserverOverflow\"\n\t\t| \"PublisherFenced\";\n\tcursor: WorkflowObservationCursor;\n}\n"]}
1
+ {"version":3,"file":"workflow-events.js","sourceRoot":"","sources":["../../../src/core/extensions/workflow-events.ts"],"names":[],"mappings":"","sourcesContent":["export type WorkflowActivityState = \"working\" | \"idle\" | \"blocked\";\nexport type WorkflowActivityReason =\n\t| \"executing\"\n\t| \"automatic_continuation\"\n\t| \"retrying\"\n\t| \"stopping\"\n\t| \"waiting\"\n\t| \"awaiting_input\"\n\t| \"manual_intervention\"\n\t| \"paused\"\n\t| \"quiescent\";\n\n// Kept in sync with workflows/shared/store-types without a host runtime dependency.\nexport type WorkflowRunStatus =\n\t| \"pending\"\n\t| \"running\"\n\t| \"paused\"\n\t| \"completed\"\n\t| \"skipped\"\n\t| \"cancelled\"\n\t| \"blocked\"\n\t| \"failed\"\n\t| \"killed\";\nexport type WorkflowStageStatus =\n\t| \"pending\"\n\t| \"running\"\n\t| \"awaiting_input\"\n\t| \"paused\"\n\t| \"blocked\"\n\t| \"suspended\"\n\t| \"completed\"\n\t| \"failed\"\n\t| \"skipped\";\nexport type WorkflowToolNodeStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"cached\" | \"cancelled\";\nexport type WorkflowControlAction = \"quit\" | \"kill\" | \"pause\" | \"resume\";\n\n/** Snapshot-safe descriptor of a human-input prompt waiting on a workflow graph node. */\nexport interface WorkflowGraphNodePrompt {\n\tid: string;\n\tkind: \"input\" | \"confirm\" | \"select\" | \"editor\" | \"custom\";\n\tmessage: string;\n\tchoices?: readonly string[];\n\tcreatedAt: number;\n}\ninterface WorkflowGraphNodeBase {\n\t/** Graph-unique node id: run-local in the root run, `${runId}:${nodeId}` inside nested child runs. */\n\tid: string;\n\t/** Run that owns the node. */\n\trunId: string;\n\t/** Run-local stage id or tool node id. */\n\tnodeId: string;\n\tname: string;\n\t/** Graph-unique ids of the node's parents. */\n\tparentIds: readonly string[];\n\t/** Admission order shared by stages and tool nodes within one run. */\n\texecutionOrder?: number;\n\t/** Nested workflow depth; 0 for the root run. */\n\tdepth: number;\n}\nexport interface WorkflowGraphStageNode extends WorkflowGraphNodeBase {\n\tkind: \"stage\";\n\tstatus: WorkflowStageStatus;\n\tpendingPrompt?: WorkflowGraphNodePrompt;\n}\nexport interface WorkflowGraphToolNode extends WorkflowGraphNodeBase {\n\tkind: \"tool\";\n\tstatus: WorkflowToolNodeStatus;\n\t/** Invocation ordinal of this `ctx.tool` call within its run. */\n\tordinal: number;\n}\nexport type WorkflowGraphNode = WorkflowGraphStageNode | WorkflowGraphToolNode;\n/** A human-input prompt raised by a run itself rather than by one of its stages. */\nexport interface WorkflowGraphRunPrompt extends WorkflowGraphNodePrompt {\n\t/** Run that owns the prompt. */\n\trunId: string;\n}\n/** Expanded graph of one root run, including nested child workflow runs. */\nexport interface WorkflowRootGraph {\n\tnodes: readonly WorkflowGraphNode[];\n\t/** Run-level prompts awaiting an answer; absent when there are none. */\n\trunPrompts?: readonly WorkflowGraphRunPrompt[];\n}\n\nexport interface WorkflowRootActivity {\n\trootRunId: string;\n\townerSessionId: string;\n\tstate: WorkflowActivityState;\n\treason: WorkflowActivityReason;\n\tactiveExecutionCount: number;\n\tactionableBlockCount: number;\n\tblockedPromptKind?: WorkflowGraphNodePrompt[\"kind\"];\n\tendedStatus?: Extract<WorkflowRunStatus, \"completed\" | \"cancelled\" | \"killed\" | \"failed\">;\n\tneedsAttention: boolean;\n\t/** Graph topology and node statuses; absent when the publisher reports no graph. */\n\tgraph?: WorkflowRootGraph;\n}\nexport interface WorkflowObservationCursor {\n\tepoch: string;\n\trevision: number;\n}\nexport type WorkflowActivitySnapshotInput =\n\t| { availability: \"ready\"; roots: readonly WorkflowRootActivity[] }\n\t| { availability: \"recovering\" | \"unavailable\" };\nexport type WorkflowActivitySnapshotFrame = WorkflowActivitySnapshotInput & {\n\tkind: \"snapshot\";\n\tcursor: WorkflowObservationCursor;\n};\nexport type WorkflowActivityFrame =\n\t| WorkflowActivitySnapshotFrame\n\t| { kind: \"changed\"; cursor: WorkflowObservationCursor; root: WorkflowRootActivity }\n\t| { kind: \"removed\"; cursor: WorkflowObservationCursor; rootRunId: string };\nexport type WorkflowActivityObserver = (frame: WorkflowActivityFrame) => void | Promise<void>;\nexport interface WorkflowActivitySubscription {\n\tdispose(): void;\n}\nexport type WorkflowLifecycleDelivery = \"live\" | \"replay\";\nexport type WorkflowLifecycleTarget =\n\t| {\n\t\t\tkind: \"run\";\n\t\t\trunId: string;\n\t\t\tpreviousStatus?: WorkflowRunStatus;\n\t\t\tstatus: WorkflowRunStatus;\n\t\t\taction?: WorkflowControlAction;\n\t }\n\t| {\n\t\t\tkind: \"stage\";\n\t\t\trunId: string;\n\t\t\tstageId: string;\n\t\t\tstageName: string;\n\t\t\tpreviousStatus?: WorkflowStageStatus;\n\t\t\tstatus: WorkflowStageStatus;\n\t }\n\t| {\n\t\t\tkind: \"tool\";\n\t\t\trunId: string;\n\t\t\ttoolNodeId: string;\n\t\t\ttoolName: string;\n\t\t\tpreviousStatus?: WorkflowToolNodeStatus;\n\t\t\tstatus: WorkflowToolNodeStatus;\n\t }\n\t| { kind: \"prompt\"; runId: string; stageId?: string; promptId: string; status: \"opened\" | \"answered\" | \"cancelled\" };\nexport interface WorkflowLifecycleEvent {\n\ttype: \"workflow_lifecycle\";\n\teventId: string;\n\tcursor: WorkflowObservationCursor;\n\trunId: string;\n\trootRunId: string;\n\townerSessionId: string;\n\toccurredAt: number;\n\tobservedAt: number;\n\tdelivery: WorkflowLifecycleDelivery;\n\ttarget: WorkflowLifecycleTarget;\n\tattribution?: \"user\" | \"agent\" | \"scheduler\" | \"recovery\" | \"unknown\";\n}\nexport interface WorkflowStageCompletedEvent extends Omit<WorkflowLifecycleEvent, \"type\" | \"target\"> {\n\ttype: \"workflow_stage_completed\";\n\ttarget: Extract<WorkflowLifecycleTarget, { kind: \"stage\" }> & { status: \"completed\" };\n}\nexport interface WorkflowActivityChangedEvent {\n\ttype: \"workflow_activity_changed\";\n\tcursor: WorkflowObservationCursor;\n\troot: WorkflowRootActivity;\n}\nexport interface WorkflowHeartbeatEvent {\n\ttype: \"workflow_heartbeat\";\n\trunId: string;\n\trootRunId: string;\n\townerSessionId: string;\n\tscheduledAt: number;\n\tintervalMinutes: number;\n}\nexport type WorkflowEvent =\n\t| WorkflowLifecycleEvent\n\t| WorkflowStageCompletedEvent\n\t| WorkflowActivityChangedEvent\n\t| WorkflowHeartbeatEvent;\nexport interface WorkflowActivityPublisher {\n\tpublishSnapshot(input: WorkflowActivitySnapshotInput): void;\n\tpublishChanged(root: WorkflowRootActivity): void;\n\tpublishRemoved(rootRunId: string): void;\n\tpublishLifecycle(event: Omit<WorkflowLifecycleEvent, \"cursor\">): void;\n\tpublishHeartbeat(event: WorkflowHeartbeatEvent): void;\n\t/**\n\t * Registers how to publish root changes the source has coalesced but not yet published, so\n\t * every read of the published activity sees them first.\n\t */\n\tbindPendingPublications?(flush: () => void): void;\n\tdispose(): void;\n}\nexport interface WorkflowObservationDiagnostic {\n\tkind:\n\t\t| \"ObserverDisposed\"\n\t\t| \"SourceRecovering\"\n\t\t| \"SourceUnavailable\"\n\t\t| \"ObserverDeliveryFailed\"\n\t\t| \"ObserverOverflow\"\n\t\t| \"PublisherFenced\";\n\tcursor: WorkflowObservationCursor;\n}\n"]}
@@ -3,7 +3,8 @@ export type WorkflowRunJsonValue = string | number | boolean | null | readonly W
3
3
  export interface WorkflowRunJsonObject {
4
4
  readonly [key: string]: WorkflowRunJsonValue | undefined;
5
5
  }
6
- export type WorkflowRunFilterStatus = WorkflowRunStatus | WorkflowStageStatus | "awaiting_input";
6
+ /** `waiting` is a deprecated alias for `suspended`. */
7
+ export type WorkflowRunFilterStatus = WorkflowRunStatus | WorkflowStageStatus | "awaiting_input" | "waiting";
7
8
  export interface WorkflowRunListFilter {
8
9
  /** Run statuses match directly; `awaiting_input` selects runs with an unanswered prompt. */
9
10
  readonly status?: WorkflowRunFilterStatus;
@@ -11,7 +12,8 @@ export interface WorkflowRunListFilter {
11
12
  readonly includeDurable?: boolean;
12
13
  }
13
14
  export interface WorkflowStageListFilter {
14
- readonly status?: WorkflowStageStatus;
15
+ /** `waiting` is a deprecated alias for `suspended`. */
16
+ readonly status?: WorkflowStageStatus | "waiting";
15
17
  }
16
18
  export interface WorkflowRunActiveStage {
17
19
  readonly stageId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-run-control.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,oBAAoB,GAC7B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,oBAAoB,EAAE,GAC/B,qBAAqB,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;CACzD;AAED,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAEjG,MAAM,WAAW,qBAAqB;IACrC,4FAA4F;IAC5F,QAAQ,CAAC,MA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BAAuB;IACvE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,qFAAqF;AACrF,qBAAa,mCAAoC,SAAQ,uBAAuB;IAC/E,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,0DAA0D;AAC1D,qBAAa,uBAAwB,SAAQ,uBAAuB;IACnE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,2FAA2F;AAC3F,qBAAa,kCAAmC,SAAQ,uBAAuB;IAC9E,YACC,OAAO,SAA0D,EACjE,OAAO,CAAC,EAAE,8BAA8B,EAIxC;CACD"}
1
+ {"version":3,"file":"workflow-run-control.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,oBAAoB,GAC7B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,oBAAoB,EAAE,GAC/B,qBAAqB,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;CACzD;AAED,uDAAuD;AACvD,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAE7G,MAAM,WAAW,qBAAqB;IACrC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,uBAAuB;IACvC,uDAAuD;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG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AAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,0DAA0D;AAC1D,qBAAa,uBAAwB,SAAQ,uBAAuB;IACnE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,2FAA2F;AAC3F,qBAAa,kCAAmC,SAAQ,uBAAuB;IAC9E,YACC,OAAO,SAA0D,EACjE,OAAO,CAAC,EAAE,8BAA8B,EAIxC;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-run-control.js","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AAsMA,2FAA2F;AAC3F,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACxC,IAAI,CAA8B;IAClC,KAAK,CAAU;IACxB,mFAAmF;IAC1E,UAAU,CAA0C;IAE7D,YAAY,IAAiC,EAAE,OAAe,EAAE,OAAO,GAAmC,EAAE;QAC3G,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5D,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAC5E,CAAC;CACD;AAED,gEAAgE;AAChE,MAAM,OAAO,wBAAyB,SAAQ,uBAAuB;IACpE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,wBAAwB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AAED,yFAAyF;AACzF,MAAM,OAAO,yBAA0B,SAAQ,uBAAuB;IACrE,YAAY,OAAe,EAAE,OAAwC;QACpE,KA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IAC9E,YACC,OAAO,GAAG,uDAAuD,EACjE,OAAwC;QAExC,KAAK,CAAC,kCAAkC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAC;IAClD,CAAC;CACD","sourcesContent":["import type {\n\tWorkflowActivityObserver,\n\tWorkflowActivitySubscription,\n\tWorkflowRunStatus,\n\tWorkflowStageStatus,\n} from \"./workflow-events.js\";\n\nexport type WorkflowRunJsonValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| readonly WorkflowRunJsonValue[]\n\t| WorkflowRunJsonObject;\n\nexport interface WorkflowRunJsonObject {\n\treadonly [key: string]: WorkflowRunJsonValue | undefined;\n}\n\nexport type WorkflowRunFilterStatus = WorkflowRunStatus | WorkflowStageStatus | \"awaiting_input\";\n\nexport interface WorkflowRunListFilter {\n\t/** Run statuses match directly; `awaiting_input` selects runs with an unanswered prompt. */\n\treadonly status?: WorkflowRunFilterStatus;\n\t/** Include project durable/completed history in addition to this session's runs. */\n\treadonly includeDurable?: boolean;\n}\n\nexport interface WorkflowStageListFilter {\n\treadonly status?: WorkflowStageStatus;\n}\n\nexport interface WorkflowRunActiveStage {\n\treadonly stageId: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n}\n\nexport interface WorkflowRunAwaitingInput {\n\treadonly stageId?: string;\n\treadonly stageName?: string;\n\treadonly promptId?: string;\n\treadonly promptKind?: string;\n\treadonly message?: string;\n}\n\n/** Stored generated description and the run identity used by resume clients. */\nexport interface WorkflowRunSummaryMetadata {\n\treadonly label?: string;\n\treadonly identity?: string;\n\treadonly summary?: string;\n\t/** Unix milliseconds through which the summary describes the run. */\n\treadonly summarizedThrough?: number;\n}\n\n/** The concise per-run data that the `workflow` tool's `status` action lists. */\nexport interface WorkflowRunSummary extends WorkflowRunSummaryMetadata {\n\treadonly runId: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus;\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly elapsedMs: number;\n\treadonly activeStages: readonly WorkflowRunActiveStage[];\n\treadonly awaitingInputCount: number;\n\treadonly awaitingInput: readonly WorkflowRunAwaitingInput[];\n\treadonly exitReason?: string;\n\treadonly error?: string;\n}\n\nexport interface WorkflowRunStageSummary {\n\treadonly id: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n\treadonly sessionId?: string;\n\treadonly error?: string;\n\treadonly skippedReason?: string;\n\treadonly awaitingInputSince?: number;\n}\n\n/** The per-run detail that the `workflow` tool's `status` action returns for one run id. */\nexport interface WorkflowRunDetail extends WorkflowRunSummaryMetadata {\n\treadonly runId: string;\n\treadonly rootRunId?: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus | \"crashed\";\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly durationMs?: number;\n\treadonly inputs: WorkflowRunJsonObject;\n\treadonly stages: readonly WorkflowRunStageSummary[];\n\treadonly result?: WorkflowRunJsonObject;\n\treadonly error?: string;\n\treadonly exitReason?: string;\n\treadonly resumable?: boolean;\n\treadonly resumeGuidance?: string;\n\treadonly ownerActiveElsewhere?: boolean;\n}\n\nexport interface WorkflowRunAllTarget {\n\treadonly all: true;\n}\n\nexport interface WorkflowRunPauseOptions {\n\t/** Pause one stage instead of the whole run. */\n\treadonly stageId?: string;\n}\n\nexport interface WorkflowRunResumeOptions {\n\t/** Resume one paused stage instead of the whole run. */\n\treadonly stageId?: string;\n\t/** Message delivered to each resumed stage. */\n\treadonly message?: string;\n\treadonly legacyRecovery?: { readonly olderWorkersStopped: true };\n}\n\nexport type WorkflowRunControlStatus = \"ok\" | \"running\" | \"paused\" | \"partial\" | \"noop\" | \"cancelled\";\n\n/** A run that a batch pause or quit could not stop; it may still be active. */\nexport interface WorkflowRunControlFailedRun {\n\treadonly runId: string;\n\t/** Machine-readable refusal, such as `not_found`, `no_active_stages` or `pause_failed`. */\n\treadonly reason: string;\n\treadonly message?: string;\n}\n\n/**\n * The acknowledged result of a pause, quit or resume request, as the `workflow`\n * tool reports it. `runId` is `--all` for a batch request. `noop` means the request was\n * understood and found nothing to change; `partial` means only part of the\n * request took effect. For a batch pause or quit, `failedRuns` names every run that\n * could not be stopped, so a `partial` outcome is never a complete stop.\n */\nexport interface WorkflowRunControlOutcome {\n\treadonly action: \"pause\" | \"quit\" | \"resume\";\n\treadonly runId: string;\n\treadonly status: WorkflowRunControlStatus;\n\treadonly message: string;\n\treadonly stageId?: string;\n\treadonly workflowStatus?: WorkflowRunStatus;\n\treadonly abandoned?: boolean;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Typed run management for the workflow runs owned by one session, as registered by the workflows extension. */\nexport interface WorkflowRunControl {\n\tlistRuns(filter?: WorkflowRunListFilter): Promise<readonly WorkflowRunSummary[]>;\n\t/**\n\t * Every root run recorded for this session's project, including runs the user started with `/workflow` that\n\t * `listRuns({ includeDurable: true })` leaves out because no model session owns them. Optional: a host without\n\t * it is read through `listRuns({ includeDurable: true })`.\n\t */\n\tlistProjectRuns?(): Promise<readonly WorkflowRunSummary[]>;\n\tgetRun(runId: string): Promise<WorkflowRunDetail>;\n\tgetStages(runId: string, filter?: WorkflowStageListFilter): Promise<readonly WorkflowRunStageSummary[]>;\n\tpause(runId: string, options?: WorkflowRunPauseOptions): Promise<WorkflowRunControlOutcome>;\n\tpause(target: WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tquit(target: string | WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tresume(runId: string, options?: WorkflowRunResumeOptions): Promise<WorkflowRunControlOutcome>;\n\t/**\n\t * Resolves once this session has finished executing the run, which includes recording its ending in the\n\t * workflow journal and releasing its lease. A run reports `completed`, `failed` or `killed` before this\n\t * point, so wait here before treating the journal as final. Resolves at once when this session is not\n\t * executing the run. Rejects with `WorkflowRunStorageError` when the journal could not record the ending.\n\t * It never times out; race it against your own deadline.\n\t */\n\twaitForSettled(runId: string): Promise<void>;\n}\n\n/** `session.workflows`: run management plus observation of the workflow runs owned by one session. */\nexport interface SessionWorkflows extends WorkflowRunControl {\n\t/**\n\t * Follow root activity and graph changes. Delivers a snapshot frame first, then FIFO\n\t * `changed` and `removed` frames; the subscription follows extension reloads.\n\t */\n\tobserve(observer: WorkflowActivityObserver): WorkflowActivitySubscription;\n}\n\nexport interface WorkflowRunControlRegistration {\n\tdispose(): void;\n}\n\nexport type WorkflowRunControlErrorCode =\n\t| \"WORKFLOW_RUN_NOT_FOUND\"\n\t| \"WORKFLOW_RUN_OWNED_ELSEWHERE\"\n\t| \"WORKFLOW_RUN_NOT_RESUMABLE\"\n\t| \"WORKFLOW_STAGE_NOT_FOUND\"\n\t| \"WORKFLOW_STAGE_AMBIGUOUS\"\n\t| \"WORKFLOW_STAGE_RESUME_UNSUPPORTED\"\n\t| \"WORKFLOW_RUN_STORAGE\"\n\t| \"WORKFLOW_RUN_CONTROL_FAILED\"\n\t| \"WORKFLOW_RUN_CONTROL_UNAVAILABLE\";\n\nexport interface WorkflowRunControlErrorOptions extends ErrorOptions {\n\treadonly runId?: string;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Base class for every failure reported by {@link SessionWorkflows}; branch on `code`. */\nexport class WorkflowRunControlError extends Error {\n\treadonly code: WorkflowRunControlErrorCode;\n\treadonly runId?: string;\n\t/** Runs a batch pause or quit could not stop, when the whole batch was refused. */\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n\n\tconstructor(code: WorkflowRunControlErrorCode, message: string, options: WorkflowRunControlErrorOptions = {}) {\n\t\tsuper(message, options);\n\t\tthis.name = \"WorkflowRunControlError\";\n\t\tthis.code = code;\n\t\tif (options.runId !== undefined) this.runId = options.runId;\n\t\tif (options.failedRuns !== undefined) this.failedRuns = options.failedRuns;\n\t}\n}\n\n/** The run id is unknown, malformed, or an ambiguous prefix. */\nexport class WorkflowRunNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowRunNotFoundError\";\n\t}\n}\n\n/** The run belongs to another session or is executing in another live Atomic process. */\nexport class WorkflowRunOwnershipError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_OWNED_ELSEWHERE\", message, options);\n\t\tthis.name = \"WorkflowRunOwnershipError\";\n\t}\n}\n\n/** The run has no continuation to resume: it completed, was killed, or has no durable progress. */\nexport class WorkflowRunNotResumableError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_RESUMABLE\", message, options);\n\t\tthis.name = \"WorkflowRunNotResumableError\";\n\t}\n}\n\n/** The stage identifier matches no stage or tool node of the run. */\nexport class WorkflowStageNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowStageNotFoundError\";\n\t}\n}\n\n/** The stage identifier matches more than one stage or tool node; pass a more specific identifier. */\nexport class WorkflowStageAmbiguousError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_AMBIGUOUS\", message, options);\n\t\tthis.name = \"WorkflowStageAmbiguousError\";\n\t}\n}\n\n/** A durable run can only be resumed whole; resume it without a stage identifier. */\nexport class WorkflowStageResumeUnsupportedError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_RESUME_UNSUPPORTED\", message, options);\n\t\tthis.name = \"WorkflowStageResumeUnsupportedError\";\n\t}\n}\n\n/** Workflow storage is unavailable, closed, or failed. */\nexport class WorkflowRunStorageError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_STORAGE\", message, options);\n\t\tthis.name = \"WorkflowRunStorageError\";\n\t}\n}\n\n/** The workflows extension is not loaded for this session, or the session was disposed. */\nexport class WorkflowRunControlUnavailableError extends WorkflowRunControlError {\n\tconstructor(\n\t\tmessage = \"Workflow run control is unavailable for this session.\",\n\t\toptions?: WorkflowRunControlErrorOptions,\n\t) {\n\t\tsuper(\"WORKFLOW_RUN_CONTROL_UNAVAILABLE\", message, options);\n\t\tthis.name = \"WorkflowRunControlUnavailableError\";\n\t}\n}\n"]}
1
+ {"version":3,"file":"workflow-run-control.js","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AAwMA,2FAA2F;AAC3F,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACxC,IAAI,CAA8B;IAClC,KAAK,CAAU;IACxB,mFAAmF;IAC1E,UAAU,CAA0C;IAE7D,YAAY,IAAiC,EAAE,OAAe,EAAE,OAAO,GAAmC,EAAE;QAC3G,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5D,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAC5E,CAAC;CACD;AAED,gEAAgE;AAChE,MAAM,OAAO,wBAAyB,SAAQ,uBAAuB;IACpE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,wBAAwB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AAED,yFAAyF;AACzF,MAAM,OAA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AAC;CACD;AAED,2FAA2F;AAC3F,MAAM,OAAO,kCAAmC,SAAQ,uBAAuB;IAC9E,YACC,OAAO,GAAG,uDAAuD,EACjE,OAAwC;QAExC,KAAK,CAAC,kCAAkC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAC;IAClD,CAAC;CACD","sourcesContent":["import type {\n\tWorkflowActivityObserver,\n\tWorkflowActivitySubscription,\n\tWorkflowRunStatus,\n\tWorkflowStageStatus,\n} from \"./workflow-events.js\";\n\nexport type WorkflowRunJsonValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| readonly WorkflowRunJsonValue[]\n\t| WorkflowRunJsonObject;\n\nexport interface WorkflowRunJsonObject {\n\treadonly [key: string]: WorkflowRunJsonValue | undefined;\n}\n\n/** `waiting` is a deprecated alias for `suspended`. */\nexport type WorkflowRunFilterStatus = WorkflowRunStatus | WorkflowStageStatus | \"awaiting_input\" | \"waiting\";\n\nexport interface WorkflowRunListFilter {\n\t/** Run statuses match directly; `awaiting_input` selects runs with an unanswered prompt. */\n\treadonly status?: WorkflowRunFilterStatus;\n\t/** Include project durable/completed history in addition to this session's runs. */\n\treadonly includeDurable?: boolean;\n}\n\nexport interface WorkflowStageListFilter {\n\t/** `waiting` is a deprecated alias for `suspended`. */\n\treadonly status?: WorkflowStageStatus | \"waiting\";\n}\n\nexport interface WorkflowRunActiveStage {\n\treadonly stageId: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n}\n\nexport interface WorkflowRunAwaitingInput {\n\treadonly stageId?: string;\n\treadonly stageName?: string;\n\treadonly promptId?: string;\n\treadonly promptKind?: string;\n\treadonly message?: string;\n}\n\n/** Stored generated description and the run identity used by resume clients. */\nexport interface WorkflowRunSummaryMetadata {\n\treadonly label?: string;\n\treadonly identity?: string;\n\treadonly summary?: string;\n\t/** Unix milliseconds through which the summary describes the run. */\n\treadonly summarizedThrough?: number;\n}\n\n/** The concise per-run data that the `workflow` tool's `status` action lists. */\nexport interface WorkflowRunSummary extends WorkflowRunSummaryMetadata {\n\treadonly runId: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus;\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly elapsedMs: number;\n\treadonly activeStages: readonly WorkflowRunActiveStage[];\n\treadonly awaitingInputCount: number;\n\treadonly awaitingInput: readonly WorkflowRunAwaitingInput[];\n\treadonly exitReason?: string;\n\treadonly error?: string;\n}\n\nexport interface WorkflowRunStageSummary {\n\treadonly id: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n\treadonly sessionId?: string;\n\treadonly error?: string;\n\treadonly skippedReason?: string;\n\treadonly awaitingInputSince?: number;\n}\n\n/** The per-run detail that the `workflow` tool's `status` action returns for one run id. */\nexport interface WorkflowRunDetail extends WorkflowRunSummaryMetadata {\n\treadonly runId: string;\n\treadonly rootRunId?: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus | \"crashed\";\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly durationMs?: number;\n\treadonly inputs: WorkflowRunJsonObject;\n\treadonly stages: readonly WorkflowRunStageSummary[];\n\treadonly result?: WorkflowRunJsonObject;\n\treadonly error?: string;\n\treadonly exitReason?: string;\n\treadonly resumable?: boolean;\n\treadonly resumeGuidance?: string;\n\treadonly ownerActiveElsewhere?: boolean;\n}\n\nexport interface WorkflowRunAllTarget {\n\treadonly all: true;\n}\n\nexport interface WorkflowRunPauseOptions {\n\t/** Pause one stage instead of the whole run. */\n\treadonly stageId?: string;\n}\n\nexport interface WorkflowRunResumeOptions {\n\t/** Resume one paused stage instead of the whole run. */\n\treadonly stageId?: string;\n\t/** Message delivered to each resumed stage. */\n\treadonly message?: string;\n\treadonly legacyRecovery?: { readonly olderWorkersStopped: true };\n}\n\nexport type WorkflowRunControlStatus = \"ok\" | \"running\" | \"paused\" | \"partial\" | \"noop\" | \"cancelled\";\n\n/** A run that a batch pause or quit could not stop; it may still be active. */\nexport interface WorkflowRunControlFailedRun {\n\treadonly runId: string;\n\t/** Machine-readable refusal, such as `not_found`, `no_active_stages` or `pause_failed`. */\n\treadonly reason: string;\n\treadonly message?: string;\n}\n\n/**\n * The acknowledged result of a pause, quit or resume request, as the `workflow`\n * tool reports it. `runId` is `--all` for a batch request. `noop` means the request was\n * understood and found nothing to change; `partial` means only part of the\n * request took effect. For a batch pause or quit, `failedRuns` names every run that\n * could not be stopped, so a `partial` outcome is never a complete stop.\n */\nexport interface WorkflowRunControlOutcome {\n\treadonly action: \"pause\" | \"quit\" | \"resume\";\n\treadonly runId: string;\n\treadonly status: WorkflowRunControlStatus;\n\treadonly message: string;\n\treadonly stageId?: string;\n\treadonly workflowStatus?: WorkflowRunStatus;\n\treadonly abandoned?: boolean;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Typed run management for the workflow runs owned by one session, as registered by the workflows extension. */\nexport interface WorkflowRunControl {\n\tlistRuns(filter?: WorkflowRunListFilter): Promise<readonly WorkflowRunSummary[]>;\n\t/**\n\t * Every root run recorded for this session's project, including runs the user started with `/workflow` that\n\t * `listRuns({ includeDurable: true })` leaves out because no model session owns them. Optional: a host without\n\t * it is read through `listRuns({ includeDurable: true })`.\n\t */\n\tlistProjectRuns?(): Promise<readonly WorkflowRunSummary[]>;\n\tgetRun(runId: string): Promise<WorkflowRunDetail>;\n\tgetStages(runId: string, filter?: WorkflowStageListFilter): Promise<readonly WorkflowRunStageSummary[]>;\n\tpause(runId: string, options?: WorkflowRunPauseOptions): Promise<WorkflowRunControlOutcome>;\n\tpause(target: WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tquit(target: string | WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tresume(runId: string, options?: WorkflowRunResumeOptions): Promise<WorkflowRunControlOutcome>;\n\t/**\n\t * Resolves once this session has finished executing the run, which includes recording its ending in the\n\t * workflow journal and releasing its lease. A run reports `completed`, `failed` or `killed` before this\n\t * point, so wait here before treating the journal as final. Resolves at once when this session is not\n\t * executing the run. Rejects with `WorkflowRunStorageError` when the journal could not record the ending.\n\t * It never times out; race it against your own deadline.\n\t */\n\twaitForSettled(runId: string): Promise<void>;\n}\n\n/** `session.workflows`: run management plus observation of the workflow runs owned by one session. */\nexport interface SessionWorkflows extends WorkflowRunControl {\n\t/**\n\t * Follow root activity and graph changes. Delivers a snapshot frame first, then FIFO\n\t * `changed` and `removed` frames; the subscription follows extension reloads.\n\t */\n\tobserve(observer: WorkflowActivityObserver): WorkflowActivitySubscription;\n}\n\nexport interface WorkflowRunControlRegistration {\n\tdispose(): void;\n}\n\nexport type WorkflowRunControlErrorCode =\n\t| \"WORKFLOW_RUN_NOT_FOUND\"\n\t| \"WORKFLOW_RUN_OWNED_ELSEWHERE\"\n\t| \"WORKFLOW_RUN_NOT_RESUMABLE\"\n\t| \"WORKFLOW_STAGE_NOT_FOUND\"\n\t| \"WORKFLOW_STAGE_AMBIGUOUS\"\n\t| \"WORKFLOW_STAGE_RESUME_UNSUPPORTED\"\n\t| \"WORKFLOW_RUN_STORAGE\"\n\t| \"WORKFLOW_RUN_CONTROL_FAILED\"\n\t| \"WORKFLOW_RUN_CONTROL_UNAVAILABLE\";\n\nexport interface WorkflowRunControlErrorOptions extends ErrorOptions {\n\treadonly runId?: string;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Base class for every failure reported by {@link SessionWorkflows}; branch on `code`. */\nexport class WorkflowRunControlError extends Error {\n\treadonly code: WorkflowRunControlErrorCode;\n\treadonly runId?: string;\n\t/** Runs a batch pause or quit could not stop, when the whole batch was refused. */\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n\n\tconstructor(code: WorkflowRunControlErrorCode, message: string, options: WorkflowRunControlErrorOptions = {}) {\n\t\tsuper(message, options);\n\t\tthis.name = \"WorkflowRunControlError\";\n\t\tthis.code = code;\n\t\tif (options.runId !== undefined) this.runId = options.runId;\n\t\tif (options.failedRuns !== undefined) this.failedRuns = options.failedRuns;\n\t}\n}\n\n/** The run id is unknown, malformed, or an ambiguous prefix. */\nexport class WorkflowRunNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowRunNotFoundError\";\n\t}\n}\n\n/** The run belongs to another session or is executing in another live Atomic process. */\nexport class WorkflowRunOwnershipError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_OWNED_ELSEWHERE\", message, options);\n\t\tthis.name = \"WorkflowRunOwnershipError\";\n\t}\n}\n\n/** The run has no continuation to resume: it completed, was killed, or has no durable progress. */\nexport class WorkflowRunNotResumableError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_RESUMABLE\", message, options);\n\t\tthis.name = \"WorkflowRunNotResumableError\";\n\t}\n}\n\n/** The stage identifier matches no stage or tool node of the run. */\nexport class WorkflowStageNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowStageNotFoundError\";\n\t}\n}\n\n/** The stage identifier matches more than one stage or tool node; pass a more specific identifier. */\nexport class WorkflowStageAmbiguousError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_AMBIGUOUS\", message, options);\n\t\tthis.name = \"WorkflowStageAmbiguousError\";\n\t}\n}\n\n/** A durable run can only be resumed whole; resume it without a stage identifier. */\nexport class WorkflowStageResumeUnsupportedError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_RESUME_UNSUPPORTED\", message, options);\n\t\tthis.name = \"WorkflowStageResumeUnsupportedError\";\n\t}\n}\n\n/** Workflow storage is unavailable, closed, or failed. */\nexport class WorkflowRunStorageError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_STORAGE\", message, options);\n\t\tthis.name = \"WorkflowRunStorageError\";\n\t}\n}\n\n/** The workflows extension is not loaded for this session, or the session was disposed. */\nexport class WorkflowRunControlUnavailableError extends WorkflowRunControlError {\n\tconstructor(\n\t\tmessage = \"Workflow run control is unavailable for this session.\",\n\t\toptions?: WorkflowRunControlErrorOptions,\n\t) {\n\t\tsuper(\"WORKFLOW_RUN_CONTROL_UNAVAILABLE\", message, options);\n\t\tthis.name = \"WorkflowRunControlUnavailableError\";\n\t}\n}\n"]}
@@ -25,6 +25,12 @@ export interface ModelFallbackFailureOptions {
25
25
  export declare function errorMessage(error: unknown): string;
26
26
  /** Alias used by the subagent package's older public helper name. */
27
27
  export declare const modelFailureMessage: typeof errorMessage;
28
+ /**
29
+ * How long the attempt ran, in milliseconds, before its response stream ended early. It is read from the typed GitHub
30
+ * Copilot failure, never from message text: on the error, anywhere in its cause chain, or in the diagnostics of a
31
+ * failed assistant message. Undefined for any other failure, and for a stream-cut error that carries no duration.
32
+ */
33
+ export declare function streamCutDurationMs(error: unknown): number | undefined;
28
34
  export declare function normalizeModelFailureSignal(error: unknown): ModelFallbackFailureSignal;
29
35
  /** Whether a failure is a provider safety/refusal response: a content-filter refusal, or a refused tool call. */
30
36
  export declare function isSafetyRefusalFailure(error: unknown): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"model-fallback-failures.d.ts","sourceRoot":"","sources":["../../src/core/model-fallback-failures.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoFH,MAAM,MAAM,wBAAwB,GACjC,4BAA4B,GAC5B,YAAY,GACZ,iBAAiB,GACjB,sBAAsB,GACtB,iBAAiB,GACjB,iBAAiB,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CAyBtF;AAED,iHAAiH;AACjH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM9D;AAED,yGAAyG;AACzG,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE9D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAKtG;AAwBD,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAInE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAElE"}
@@ -6,7 +6,7 @@
6
6
  * module free of AgentSession and workflow imports so the published SDK can
7
7
  * expose it to the raw-TypeScript companion packages without a cycle.
8
8
  */
9
- import { findGitHubCopilotError } from "@bastani/pi-ai";
9
+ import { findGitHubCopilotError, GitHubCopilotStreamEndedEarlyError, } from "@bastani/pi-ai";
10
10
  import { isExtensionStartupFailure } from "./extension-startup-failure.js";
11
11
  const RETRYABLE_MODEL_FAILURE_PATTERNS = [
12
12
  /rate\s*limit/i,
@@ -656,6 +656,15 @@ function githubCopilotSignal(error) {
656
656
  return undefined;
657
657
  return makeSignal(GITHUB_COPILOT_FAILURE_KINDS[copilotError.code], copilotError, signalSource(error, undefined));
658
658
  }
659
+ /**
660
+ * How long the attempt ran, in milliseconds, before its response stream ended early. It is read from the typed GitHub
661
+ * Copilot failure, never from message text: on the error, anywhere in its cause chain, or in the diagnostics of a
662
+ * failed assistant message. Undefined for any other failure, and for a stream-cut error that carries no duration.
663
+ */
664
+ export function streamCutDurationMs(error) {
665
+ const copilotError = findGitHubCopilotError(error);
666
+ return copilotError instanceof GitHubCopilotStreamEndedEarlyError ? copilotError.durationMs : undefined;
667
+ }
659
668
  export function normalizeModelFailureSignal(error) {
660
669
  // Extension startup is not a model request. Its message names extension paths
661
670
  // and their own errors, which must not read as a provider failure.