@bastani/atomic 0.9.2 → 0.9.3-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 (452) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +2 -2
  3. package/dist/builtin/cursor/package.json +2 -2
  4. package/dist/builtin/intercom/package.json +1 -1
  5. package/dist/builtin/mcp/CHANGELOG.md +6 -0
  6. package/dist/builtin/mcp/direct-tools.ts +4 -2
  7. package/dist/builtin/mcp/package.json +1 -1
  8. package/dist/builtin/mcp/proxy-call.ts +3 -1
  9. package/dist/builtin/mcp/utils.ts +18 -7
  10. package/dist/builtin/subagents/CHANGELOG.md +11 -0
  11. package/dist/builtin/subagents/README.md +6 -6
  12. package/dist/builtin/subagents/agents/code-simplifier.md +7 -6
  13. package/dist/builtin/subagents/agents/codebase-analyzer.md +5 -4
  14. package/dist/builtin/subagents/agents/codebase-locator.md +3 -3
  15. package/dist/builtin/subagents/agents/codebase-online-researcher.md +10 -10
  16. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +4 -4
  17. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +3 -3
  18. package/dist/builtin/subagents/agents/codebase-research-locator.md +4 -4
  19. package/dist/builtin/subagents/agents/debugger.md +5 -5
  20. package/dist/builtin/subagents/agents/worker.md +56 -0
  21. package/dist/builtin/subagents/package.json +1 -1
  22. package/dist/builtin/subagents/skills/subagent/SKILL.md +11 -11
  23. package/dist/builtin/subagents/src/agents/agent-loaders.ts +3 -5
  24. package/dist/builtin/subagents/src/agents/agent-management-helpers.ts +3 -3
  25. package/dist/builtin/subagents/src/extension/schemas.ts +2 -2
  26. package/dist/builtin/subagents/src/intercom/result-intercom.ts +4 -3
  27. package/dist/builtin/subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +1 -1
  28. package/dist/builtin/subagents/src/runs/shared/nested-render.ts +2 -2
  29. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +2 -1
  30. package/dist/builtin/subagents/src/shared/types-depth.ts +5 -5
  31. package/dist/builtin/subagents/src/shared/types-runtime.ts +2 -1
  32. package/dist/builtin/subagents/src/tui/render-event-formatting.ts +2 -2
  33. package/dist/builtin/web-access/package.json +1 -1
  34. package/dist/builtin/workflows/CHANGELOG.md +13 -0
  35. package/dist/builtin/workflows/README.md +2 -2
  36. package/dist/builtin/workflows/builtin/goal-artifacts.ts +11 -6
  37. package/dist/builtin/workflows/builtin/goal-ledger.ts +33 -1
  38. package/dist/builtin/workflows/builtin/goal-prompts.ts +23 -28
  39. package/dist/builtin/workflows/builtin/goal-reducer.ts +2 -2
  40. package/dist/builtin/workflows/builtin/goal-reports.ts +2 -5
  41. package/dist/builtin/workflows/builtin/goal-review.ts +1 -1
  42. package/dist/builtin/workflows/builtin/goal-runner.ts +10 -17
  43. package/dist/builtin/workflows/builtin/open-claude-design-feedback.ts +3 -3
  44. package/dist/builtin/workflows/builtin/open-claude-design-phases.ts +1 -3
  45. package/dist/builtin/workflows/builtin/open-claude-design-setup.ts +1 -1
  46. package/dist/builtin/workflows/builtin/ralph-core.ts +7 -17
  47. package/dist/builtin/workflows/builtin/ralph-runner.ts +11 -18
  48. package/dist/builtin/workflows/builtin/shared-prompts.ts +1 -1
  49. package/dist/builtin/workflows/package.json +1 -1
  50. package/dist/builtin/workflows/src/extension/config-loader.ts +35 -15
  51. package/dist/builtin/workflows/src/extension/discovery.ts +20 -8
  52. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +1 -2
  53. package/dist/builtin/workflows/src/extension/wiring.ts +1 -1
  54. package/dist/builtin/workflows/src/tui/dispatch-confirm.ts +11 -10
  55. package/dist/cli/args.d.ts.map +1 -1
  56. package/dist/cli/args.js +9 -9
  57. package/dist/cli/args.js.map +1 -1
  58. package/dist/config-self-update.d.ts.map +1 -1
  59. package/dist/config-self-update.js +3 -4
  60. package/dist/config-self-update.js.map +1 -1
  61. package/dist/config.d.ts.map +1 -1
  62. package/dist/config.js +4 -5
  63. package/dist/config.js.map +1 -1
  64. package/dist/core/agent-session-bash.d.ts +1 -0
  65. package/dist/core/agent-session-bash.d.ts.map +1 -1
  66. package/dist/core/agent-session-bash.js +1 -0
  67. package/dist/core/agent-session-bash.js.map +1 -1
  68. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  69. package/dist/core/agent-session-tool-registry.js +23 -0
  70. package/dist/core/agent-session-tool-registry.js.map +1 -1
  71. package/dist/core/bash-executor.d.ts +2 -0
  72. package/dist/core/bash-executor.d.ts.map +1 -1
  73. package/dist/core/bash-executor.js +1 -0
  74. package/dist/core/bash-executor.js.map +1 -1
  75. package/dist/core/compaction/compaction.d.ts +29 -0
  76. package/dist/core/compaction/compaction.d.ts.map +1 -1
  77. package/dist/core/compaction/compaction.js +36 -1
  78. package/dist/core/compaction/compaction.js.map +1 -1
  79. package/dist/core/compaction/context-compaction-metrics.d.ts +14 -2
  80. package/dist/core/compaction/context-compaction-metrics.d.ts.map +1 -1
  81. package/dist/core/compaction/context-compaction-metrics.js +50 -1
  82. package/dist/core/compaction/context-compaction-metrics.js.map +1 -1
  83. package/dist/core/compaction/context-compaction-prompt.d.ts.map +1 -1
  84. package/dist/core/compaction/context-compaction-prompt.js +2 -0
  85. package/dist/core/compaction/context-compaction-prompt.js.map +1 -1
  86. package/dist/core/compaction/context-compaction-runner.d.ts.map +1 -1
  87. package/dist/core/compaction/context-compaction-runner.js +1 -1
  88. package/dist/core/compaction/context-compaction-runner.js.map +1 -1
  89. package/dist/core/compaction/context-deletion-application.d.ts.map +1 -1
  90. package/dist/core/compaction/context-deletion-application.js +5 -5
  91. package/dist/core/compaction/context-deletion-application.js.map +1 -1
  92. package/dist/core/compaction/context-deletion-targets.d.ts +2 -0
  93. package/dist/core/compaction/context-deletion-targets.d.ts.map +1 -1
  94. package/dist/core/compaction/context-deletion-targets.js +23 -3
  95. package/dist/core/compaction/context-deletion-targets.js.map +1 -1
  96. package/dist/core/compaction/context-deletion-tool-definitions.d.ts +6 -0
  97. package/dist/core/compaction/context-deletion-tool-definitions.d.ts.map +1 -1
  98. package/dist/core/compaction/context-deletion-tool-definitions.js.map +1 -1
  99. package/dist/core/compaction/context-deletion-tools.d.ts.map +1 -1
  100. package/dist/core/compaction/context-deletion-tools.js +18 -10
  101. package/dist/core/compaction/context-deletion-tools.js.map +1 -1
  102. package/dist/core/compaction/context-transcript-analysis.d.ts.map +1 -1
  103. package/dist/core/compaction/context-transcript-analysis.js +2 -4
  104. package/dist/core/compaction/context-transcript-analysis.js.map +1 -1
  105. package/dist/core/copilot-gemini-tool-arguments.d.ts.map +1 -1
  106. package/dist/core/copilot-gemini-tool-arguments.js +2 -60
  107. package/dist/core/copilot-gemini-tool-arguments.js.map +1 -1
  108. package/dist/core/extensions/context-types.d.ts +2 -0
  109. package/dist/core/extensions/context-types.d.ts.map +1 -1
  110. package/dist/core/extensions/context-types.js.map +1 -1
  111. package/dist/core/extensions/index.d.ts +2 -2
  112. package/dist/core/extensions/index.d.ts.map +1 -1
  113. package/dist/core/extensions/index.js +1 -1
  114. package/dist/core/extensions/index.js.map +1 -1
  115. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  116. package/dist/core/extensions/loader-virtual-modules.js +11 -3
  117. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  118. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  119. package/dist/core/extensions/runner-context.js +11 -0
  120. package/dist/core/extensions/runner-context.js.map +1 -1
  121. package/dist/core/extensions/tool-events.d.ts +13 -13
  122. package/dist/core/extensions/tool-events.d.ts.map +1 -1
  123. package/dist/core/extensions/tool-events.js +3 -3
  124. package/dist/core/extensions/tool-events.js.map +1 -1
  125. package/dist/core/extensions/types.d.ts +1 -1
  126. package/dist/core/extensions/types.d.ts.map +1 -1
  127. package/dist/core/extensions/types.js +1 -1
  128. package/dist/core/extensions/types.js.map +1 -1
  129. package/dist/core/flattened-tool-arguments.d.ts +18 -0
  130. package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
  131. package/dist/core/flattened-tool-arguments.js +104 -0
  132. package/dist/core/flattened-tool-arguments.js.map +1 -1
  133. package/dist/core/sdk-exports.d.ts +1 -1
  134. package/dist/core/sdk-exports.d.ts.map +1 -1
  135. package/dist/core/sdk-exports.js +1 -1
  136. package/dist/core/sdk-exports.js.map +1 -1
  137. package/dist/core/sdk-types.d.ts +2 -2
  138. package/dist/core/sdk-types.d.ts.map +1 -1
  139. package/dist/core/sdk-types.js.map +1 -1
  140. package/dist/core/settings-manager-basic-accessors.d.ts +4 -0
  141. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  142. package/dist/core/settings-manager-basic-accessors.js +18 -0
  143. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  144. package/dist/core/settings-manager-resource-accessors.d.ts +4 -0
  145. package/dist/core/settings-manager-resource-accessors.d.ts.map +1 -1
  146. package/dist/core/settings-manager-resource-accessors.js +15 -0
  147. package/dist/core/settings-manager-resource-accessors.js.map +1 -1
  148. package/dist/core/settings-types.d.ts +11 -0
  149. package/dist/core/settings-types.d.ts.map +1 -1
  150. package/dist/core/settings-types.js.map +1 -1
  151. package/dist/core/system-prompt.d.ts +1 -1
  152. package/dist/core/system-prompt.d.ts.map +1 -1
  153. package/dist/core/system-prompt.js +3 -2
  154. package/dist/core/system-prompt.js.map +1 -1
  155. package/dist/core/tools/artifact-protocol.d.ts +11 -0
  156. package/dist/core/tools/artifact-protocol.d.ts.map +1 -0
  157. package/dist/core/tools/artifact-protocol.js +76 -0
  158. package/dist/core/tools/artifact-protocol.js.map +1 -0
  159. package/dist/core/tools/artifacts.d.ts +18 -0
  160. package/dist/core/tools/artifacts.d.ts.map +1 -0
  161. package/dist/core/tools/artifacts.js +90 -0
  162. package/dist/core/tools/artifacts.js.map +1 -0
  163. package/dist/core/tools/bash-async-jobs.d.ts +20 -0
  164. package/dist/core/tools/bash-async-jobs.d.ts.map +1 -0
  165. package/dist/core/tools/bash-async-jobs.js +59 -0
  166. package/dist/core/tools/bash-async-jobs.js.map +1 -0
  167. package/dist/core/tools/bash-async-output.d.ts +10 -0
  168. package/dist/core/tools/bash-async-output.d.ts.map +1 -0
  169. package/dist/core/tools/bash-async-output.js +80 -0
  170. package/dist/core/tools/bash-async-output.js.map +1 -0
  171. package/dist/core/tools/bash-interceptor.d.ts +10 -0
  172. package/dist/core/tools/bash-interceptor.d.ts.map +1 -0
  173. package/dist/core/tools/bash-interceptor.js +39 -0
  174. package/dist/core/tools/bash-interceptor.js.map +1 -0
  175. package/dist/core/tools/bash-leading-cd.d.ts +7 -0
  176. package/dist/core/tools/bash-leading-cd.d.ts.map +1 -0
  177. package/dist/core/tools/bash-leading-cd.js +59 -0
  178. package/dist/core/tools/bash-leading-cd.js.map +1 -0
  179. package/dist/core/tools/bash-pty-native.d.ts +14 -0
  180. package/dist/core/tools/bash-pty-native.d.ts.map +1 -0
  181. package/dist/core/tools/bash-pty-native.js +71 -0
  182. package/dist/core/tools/bash-pty-native.js.map +1 -0
  183. package/dist/core/tools/bash.d.ts +28 -17
  184. package/dist/core/tools/bash.d.ts.map +1 -1
  185. package/dist/core/tools/bash.js +152 -35
  186. package/dist/core/tools/bash.js.map +1 -1
  187. package/dist/core/tools/block-resolver.d.ts +16 -0
  188. package/dist/core/tools/block-resolver.d.ts.map +1 -0
  189. package/dist/core/tools/block-resolver.js +74 -0
  190. package/dist/core/tools/block-resolver.js.map +1 -0
  191. package/dist/core/tools/conflict-registry.d.ts +16 -0
  192. package/dist/core/tools/conflict-registry.d.ts.map +1 -0
  193. package/dist/core/tools/conflict-registry.js +44 -0
  194. package/dist/core/tools/conflict-registry.js.map +1 -0
  195. package/dist/core/tools/directory-tree.d.ts +13 -0
  196. package/dist/core/tools/directory-tree.d.ts.map +1 -0
  197. package/dist/core/tools/directory-tree.js +81 -0
  198. package/dist/core/tools/directory-tree.js.map +1 -0
  199. package/dist/core/tools/edit.d.ts +4 -29
  200. package/dist/core/tools/edit.d.ts.map +1 -1
  201. package/dist/core/tools/edit.js +136 -228
  202. package/dist/core/tools/edit.js.map +1 -1
  203. package/dist/core/tools/fetch-url.d.ts +74 -0
  204. package/dist/core/tools/fetch-url.d.ts.map +1 -0
  205. package/dist/core/tools/fetch-url.js +518 -0
  206. package/dist/core/tools/fetch-url.js.map +1 -0
  207. package/dist/core/tools/find.d.ts +27 -9
  208. package/dist/core/tools/find.d.ts.map +1 -1
  209. package/dist/core/tools/find.js +400 -176
  210. package/dist/core/tools/find.js.map +1 -1
  211. package/dist/core/tools/glob-path-utils.d.ts +8 -0
  212. package/dist/core/tools/glob-path-utils.d.ts.map +1 -0
  213. package/dist/core/tools/glob-path-utils.js +26 -0
  214. package/dist/core/tools/glob-path-utils.js.map +1 -0
  215. package/dist/core/tools/grep.d.ts +12 -0
  216. package/dist/core/tools/grep.d.ts.map +1 -1
  217. package/dist/core/tools/grep.js +141 -17
  218. package/dist/core/tools/grep.js.map +1 -1
  219. package/dist/core/tools/hashline-engine/apply.d.ts +11 -0
  220. package/dist/core/tools/hashline-engine/apply.d.ts.map +1 -0
  221. package/dist/core/tools/hashline-engine/apply.js +752 -0
  222. package/dist/core/tools/hashline-engine/apply.js.map +1 -0
  223. package/dist/core/tools/hashline-engine/block.d.ts +40 -0
  224. package/dist/core/tools/hashline-engine/block.d.ts.map +1 -0
  225. package/dist/core/tools/hashline-engine/block.js +117 -0
  226. package/dist/core/tools/hashline-engine/block.js.map +1 -0
  227. package/dist/core/tools/hashline-engine/diff-preview.d.ts +15 -0
  228. package/dist/core/tools/hashline-engine/diff-preview.d.ts.map +1 -0
  229. package/dist/core/tools/hashline-engine/diff-preview.js +98 -0
  230. package/dist/core/tools/hashline-engine/diff-preview.js.map +1 -0
  231. package/dist/core/tools/hashline-engine/format.d.ts +71 -0
  232. package/dist/core/tools/hashline-engine/format.d.ts.map +1 -0
  233. package/dist/core/tools/hashline-engine/format.js +178 -0
  234. package/dist/core/tools/hashline-engine/format.js.map +1 -0
  235. package/dist/core/tools/hashline-engine/fs.d.ts +81 -0
  236. package/dist/core/tools/hashline-engine/fs.d.ts.map +1 -0
  237. package/dist/core/tools/hashline-engine/fs.js +143 -0
  238. package/dist/core/tools/hashline-engine/fs.js.map +1 -0
  239. package/dist/core/tools/hashline-engine/index.d.ts +18 -0
  240. package/dist/core/tools/hashline-engine/index.d.ts.map +1 -0
  241. package/dist/core/tools/hashline-engine/index.js +20 -0
  242. package/dist/core/tools/hashline-engine/index.js.map +1 -0
  243. package/dist/core/tools/hashline-engine/input.d.ts +101 -0
  244. package/dist/core/tools/hashline-engine/input.d.ts.map +1 -0
  245. package/dist/core/tools/hashline-engine/input.js +398 -0
  246. package/dist/core/tools/hashline-engine/input.js.map +1 -0
  247. package/dist/core/tools/hashline-engine/messages.d.ts +99 -0
  248. package/dist/core/tools/hashline-engine/messages.d.ts.map +1 -0
  249. package/dist/core/tools/hashline-engine/messages.js +144 -0
  250. package/dist/core/tools/hashline-engine/messages.js.map +1 -0
  251. package/dist/core/tools/hashline-engine/mismatch.d.ts +45 -0
  252. package/dist/core/tools/hashline-engine/mismatch.d.ts.map +1 -0
  253. package/dist/core/tools/hashline-engine/mismatch.js +90 -0
  254. package/dist/core/tools/hashline-engine/mismatch.js.map +1 -0
  255. package/dist/core/tools/hashline-engine/normalize.d.ts +21 -0
  256. package/dist/core/tools/hashline-engine/normalize.d.ts.map +1 -0
  257. package/dist/core/tools/hashline-engine/normalize.js +33 -0
  258. package/dist/core/tools/hashline-engine/normalize.js.map +1 -0
  259. package/dist/core/tools/hashline-engine/parser.d.ts +24 -0
  260. package/dist/core/tools/hashline-engine/parser.d.ts.map +1 -0
  261. package/dist/core/tools/hashline-engine/parser.js +381 -0
  262. package/dist/core/tools/hashline-engine/parser.js.map +1 -0
  263. package/dist/core/tools/hashline-engine/patcher.d.ts +118 -0
  264. package/dist/core/tools/hashline-engine/patcher.d.ts.map +1 -0
  265. package/dist/core/tools/hashline-engine/patcher.js +341 -0
  266. package/dist/core/tools/hashline-engine/patcher.js.map +1 -0
  267. package/dist/core/tools/hashline-engine/prefixes.d.ts +43 -0
  268. package/dist/core/tools/hashline-engine/prefixes.d.ts.map +1 -0
  269. package/dist/core/tools/hashline-engine/prefixes.js +135 -0
  270. package/dist/core/tools/hashline-engine/prefixes.js.map +1 -0
  271. package/dist/core/tools/hashline-engine/recovery.d.ts +41 -0
  272. package/dist/core/tools/hashline-engine/recovery.d.ts.map +1 -0
  273. package/dist/core/tools/hashline-engine/recovery.js +168 -0
  274. package/dist/core/tools/hashline-engine/recovery.js.map +1 -0
  275. package/dist/core/tools/hashline-engine/snapshots.d.ts +65 -0
  276. package/dist/core/tools/hashline-engine/snapshots.d.ts.map +1 -0
  277. package/dist/core/tools/hashline-engine/snapshots.js +108 -0
  278. package/dist/core/tools/hashline-engine/snapshots.js.map +1 -0
  279. package/dist/core/tools/hashline-engine/stream.d.ts +3 -0
  280. package/dist/core/tools/hashline-engine/stream.d.ts.map +1 -0
  281. package/dist/core/tools/hashline-engine/stream.js +111 -0
  282. package/dist/core/tools/hashline-engine/stream.js.map +1 -0
  283. package/dist/core/tools/hashline-engine/tokenizer.d.ts +69 -0
  284. package/dist/core/tools/hashline-engine/tokenizer.d.ts.map +1 -0
  285. package/dist/core/tools/hashline-engine/tokenizer.js +430 -0
  286. package/dist/core/tools/hashline-engine/tokenizer.js.map +1 -0
  287. package/dist/core/tools/hashline-engine/types.d.ts +166 -0
  288. package/dist/core/tools/hashline-engine/types.d.ts.map +1 -0
  289. package/dist/core/tools/hashline-engine/types.js +9 -0
  290. package/dist/core/tools/hashline-engine/types.js.map +1 -0
  291. package/dist/core/tools/hashline.d.ts +29 -0
  292. package/dist/core/tools/hashline.d.ts.map +1 -0
  293. package/dist/core/tools/hashline.js +110 -0
  294. package/dist/core/tools/hashline.js.map +1 -0
  295. package/dist/core/tools/index.d.ts +6 -4
  296. package/dist/core/tools/index.d.ts.map +1 -1
  297. package/dist/core/tools/index.js +52 -35
  298. package/dist/core/tools/index.js.map +1 -1
  299. package/dist/core/tools/notebook.d.ts +38 -0
  300. package/dist/core/tools/notebook.d.ts.map +1 -0
  301. package/dist/core/tools/notebook.js +125 -0
  302. package/dist/core/tools/notebook.js.map +1 -0
  303. package/dist/core/tools/read-document-extract.d.ts +9 -0
  304. package/dist/core/tools/read-document-extract.d.ts.map +1 -0
  305. package/dist/core/tools/read-document-extract.js +212 -0
  306. package/dist/core/tools/read-document-extract.js.map +1 -0
  307. package/dist/core/tools/read-selectors.d.ts +24 -0
  308. package/dist/core/tools/read-selectors.d.ts.map +1 -0
  309. package/dist/core/tools/read-selectors.js +277 -0
  310. package/dist/core/tools/read-selectors.js.map +1 -0
  311. package/dist/core/tools/read-url.d.ts +37 -0
  312. package/dist/core/tools/read-url.d.ts.map +1 -0
  313. package/dist/core/tools/read-url.js +39 -0
  314. package/dist/core/tools/read-url.js.map +1 -0
  315. package/dist/core/tools/read.d.ts +11 -11
  316. package/dist/core/tools/read.d.ts.map +1 -1
  317. package/dist/core/tools/read.js +224 -94
  318. package/dist/core/tools/read.js.map +1 -1
  319. package/dist/core/tools/resource-selectors.d.ts +44 -0
  320. package/dist/core/tools/resource-selectors.d.ts.map +1 -0
  321. package/dist/core/tools/resource-selectors.js +808 -0
  322. package/dist/core/tools/resource-selectors.js.map +1 -0
  323. package/dist/core/tools/search-details.d.ts +26 -0
  324. package/dist/core/tools/search-details.d.ts.map +1 -0
  325. package/dist/core/tools/search-details.js +24 -0
  326. package/dist/core/tools/search-details.js.map +1 -0
  327. package/dist/core/tools/search-line-ranges.d.ts +11 -0
  328. package/dist/core/tools/search-line-ranges.d.ts.map +1 -0
  329. package/dist/core/tools/search-line-ranges.js +65 -0
  330. package/dist/core/tools/search-line-ranges.js.map +1 -0
  331. package/dist/core/tools/search-native.d.ts +97 -0
  332. package/dist/core/tools/search-native.d.ts.map +1 -0
  333. package/dist/core/tools/search-native.js +27 -0
  334. package/dist/core/tools/search-native.js.map +1 -0
  335. package/dist/core/tools/search.d.ts +24 -0
  336. package/dist/core/tools/search.d.ts.map +1 -0
  337. package/dist/core/tools/search.js +573 -0
  338. package/dist/core/tools/search.js.map +1 -0
  339. package/dist/core/tools/truncate.d.ts +4 -4
  340. package/dist/core/tools/truncate.d.ts.map +1 -1
  341. package/dist/core/tools/truncate.js +3 -3
  342. package/dist/core/tools/truncate.js.map +1 -1
  343. package/dist/core/tools/url-ip-guards.d.ts +4 -0
  344. package/dist/core/tools/url-ip-guards.d.ts.map +1 -0
  345. package/dist/core/tools/url-ip-guards.js +126 -0
  346. package/dist/core/tools/url-ip-guards.js.map +1 -0
  347. package/dist/core/tools/write.d.ts +12 -2
  348. package/dist/core/tools/write.d.ts.map +1 -1
  349. package/dist/core/tools/write.js +166 -14
  350. package/dist/core/tools/write.js.map +1 -1
  351. package/dist/core/trust-manager.d.ts.map +1 -1
  352. package/dist/core/trust-manager.js +2 -3
  353. package/dist/core/trust-manager.js.map +1 -1
  354. package/dist/index-extensions.d.ts +2 -2
  355. package/dist/index-extensions.d.ts.map +1 -1
  356. package/dist/index-extensions.js +1 -1
  357. package/dist/index-extensions.js.map +1 -1
  358. package/dist/index.d.ts +3 -3
  359. package/dist/index.d.ts.map +1 -1
  360. package/dist/index.js +3 -3
  361. package/dist/index.js.map +1 -1
  362. package/dist/modes/interactive/components/custom-editor.d.ts +1 -0
  363. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  364. package/dist/modes/interactive/components/custom-editor.js +9 -2
  365. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  366. package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
  367. package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
  368. package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
  369. package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
  370. package/dist/modes/interactive/components/settings-selector-items.js +7 -0
  371. package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
  372. package/dist/modes/interactive/components/settings-selector-types.d.ts +2 -0
  373. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  374. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  375. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  376. package/dist/modes/interactive/components/tree-selector-content.js +0 -5
  377. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  378. package/dist/modes/interactive/interactive-auth-login.d.ts.map +1 -1
  379. package/dist/modes/interactive/interactive-auth-login.js +1 -0
  380. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  381. package/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
  382. package/dist/modes/interactive/interactive-autocomplete.js +80 -2
  383. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  384. package/dist/modes/interactive/interactive-hotkeys-debug.d.ts.map +1 -1
  385. package/dist/modes/interactive/interactive-hotkeys-debug.js +3 -0
  386. package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
  387. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  388. package/dist/modes/interactive/interactive-input-handling.js +51 -0
  389. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  390. package/dist/modes/interactive/interactive-mode-base.d.ts +5 -0
  391. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  392. package/dist/modes/interactive/interactive-mode-base.js +5 -0
  393. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  394. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  395. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  396. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  397. package/dist/modes/interactive/interactive-mode-surface.d.ts +12 -0
  398. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  399. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  400. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  401. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  402. package/dist/modes/interactive/interactive-mode.js +1 -0
  403. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  404. package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
  405. package/dist/modes/interactive/interactive-model-routing.js +4 -1
  406. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  407. package/dist/modes/interactive/interactive-onboarding.d.ts +11 -0
  408. package/dist/modes/interactive/interactive-onboarding.d.ts.map +1 -0
  409. package/dist/modes/interactive/interactive-onboarding.js +220 -0
  410. package/dist/modes/interactive/interactive-onboarding.js.map +1 -0
  411. package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
  412. package/dist/modes/interactive/interactive-selectors.js +4 -0
  413. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  414. package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
  415. package/dist/modes/interactive/interactive-session-routing.js +6 -0
  416. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  417. package/dist/modes/interactive/interactive-slash-commands.d.ts.map +1 -1
  418. package/dist/modes/interactive/interactive-slash-commands.js +9 -4
  419. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  420. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  421. package/dist/modes/interactive/interactive-startup.js +28 -0
  422. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  423. package/dist/utils/child-process.d.ts.map +1 -1
  424. package/dist/utils/child-process.js +21 -1
  425. package/dist/utils/child-process.js.map +1 -1
  426. package/dist/utils/markit.d.ts +8 -0
  427. package/dist/utils/markit.d.ts.map +1 -0
  428. package/dist/utils/markit.js +53 -0
  429. package/dist/utils/markit.js.map +1 -0
  430. package/dist/utils/paths.d.ts +2 -1
  431. package/dist/utils/paths.d.ts.map +1 -1
  432. package/dist/utils/paths.js +14 -1
  433. package/dist/utils/paths.js.map +1 -1
  434. package/docs/compaction.md +16 -1
  435. package/docs/containerization.md +1 -1
  436. package/docs/docs.json +1 -0
  437. package/docs/extensions.md +25 -36
  438. package/docs/quickstart.md +11 -6
  439. package/docs/sdk.md +5 -5
  440. package/docs/settings.md +7 -0
  441. package/docs/subagents.md +3 -2
  442. package/docs/tools.md +49 -0
  443. package/docs/usage.md +3 -3
  444. package/docs/workflows.md +7 -5
  445. package/examples/extensions/subagent/README.md +5 -5
  446. package/examples/extensions/subagent/agents/planner.md +1 -1
  447. package/examples/extensions/subagent/agents/reviewer.md +1 -1
  448. package/examples/extensions/subagent/agents/scout.md +2 -2
  449. package/examples/extensions/subagent/display.ts +3 -3
  450. package/examples/sdk/05-tools.ts +3 -3
  451. package/examples/sdk/README.md +1 -1
  452. package/package.json +3 -2
@@ -9,8 +9,9 @@ export { WORKER_PREFLIGHT_CONTRACT };
9
9
 
10
10
  export const GOAL_CONTINUATION_REFERENCE = [
11
11
  "Continuation behavior:",
12
- "- This goal persists across turns. Ending this turn does not require shrinking the objective to what fits now.",
13
- "- Keep the full objective intact. If it cannot be finished now, make concrete progress toward the real requested end state, leave the goal active, and do not redefine success around a smaller or easier task.",
12
+ "- This goal persists across workflow continuations. A worker session ending does not require shrinking the objective to what fits immediately.",
13
+ "- Keep the full objective intact and do not stop until the objective is complete. Do not intentionally leave known required implementation, validation, documentation, or cleanup for a later worker session.",
14
+ "- If the full objective genuinely cannot be finished with available context/tools, make the most concrete progress toward the real requested end state, leave the goal active, and do not redefine success around a smaller or easier task.",
14
15
  "- Temporary rough edges are acceptable while the work is moving in the right direction. Completion still requires the requested end state to be true and verified.",
15
16
  "",
16
17
  "Work from evidence:",
@@ -20,7 +21,7 @@ export const GOAL_CONTINUATION_REFERENCE = [
20
21
  "If todo management is available and the next work is meaningfully multi-step, use it to show a concise plan tied to the real objective. Keep the plan current as steps complete or the next best action changes. Skip planning overhead for trivial one-step progress, and do not treat a todo update as a substitute for doing the work.",
21
22
  "",
22
23
  "Fidelity:",
23
- "- Optimize each turn for movement toward the requested end state, not for the smallest stable-looking subset or easiest passing change.",
24
+ "- Optimize worker effort for full completion of the requested end state, not for the smallest stable-looking subset or easiest passing change.",
24
25
  "- Do not substitute a narrower, safer, smaller, merely compatible, or easier-to-test solution because it is more likely to pass current tests.",
25
26
  "- Treat alignment as movement toward the requested end state. An edit is aligned only if it makes the requested final state more true; useful-looking behavior that preserves a different end state is misaligned.",
26
27
  "",
@@ -39,20 +40,21 @@ export const GOAL_CONTINUATION_REFERENCE = [
39
40
  "",
40
41
  "Blocked audit:",
41
42
  "- Do not report blocked the first time a blocker appears.",
42
- "- Only use blocked when the same blocking condition has repeated for the configured blocker threshold of consecutive goal turns, counting the original worker turn and any workflow continuations.",
43
+ "- Only use blocked when the same blocking condition has repeated often enough for the controller's blocker policy to identify a true impasse.",
43
44
  "- Use blocked only when you are truly at an impasse and cannot make meaningful progress without user input or an external-state change.",
44
45
  "- Once the blocked threshold is satisfied, do not keep reporting that you are still blocked while leaving the goal active; report blocked.",
45
46
  "- Never use blocked merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.",
46
47
  "",
47
- "Do not report the goal as done unless the goal is complete. Do not mark a goal complete merely because the workflow turn is ending.",
48
+ "Do not report the goal as done unless the goal is complete. Do not mark a goal complete merely because the worker session is ending.",
48
49
  ].join("\n");
49
50
 
50
51
  export const WORKER_RECEIPT_CONTRACT = [
51
- "Produce concrete progress toward the full objective in this turn.",
52
+ "Implement the requested objective completely before reporting. Do not stop until the objective is complete.",
52
53
  "Inspect current files, commands, artifacts, and repository guidance before relying on prior summaries.",
53
54
  "Improve, replace, or remove existing work as needed to satisfy the actual objective.",
54
55
  "If todo management is available and the next work is meaningfully multi-step, use it to show a concise plan tied to the real objective. Keep the plan current as steps complete or the next best action changes. Skip planning overhead for trivial one-step progress, and do not treat todo updates as a substitute for doing the work.",
55
- "If meaningful work remains, do the next safest useful slice; do not redefine success around a smaller task.",
56
+ "If meaningful work remains, keep working through implementation, validation, documentation, and cleanup instead of stopping at a reviewable partial state.",
57
+ "Only leave remaining work when it is blocked or impossible to complete with available context and tools; do not redefine success around a smaller task.",
56
58
  "Before saying the goal is ready for review, derive concrete requirements from the objective and referenced files, plans, specifications, issues, or user instructions.",
57
59
  "For every explicit requirement, numbered item, named artifact, command, test, gate, invariant, and deliverable, identify authoritative evidence from files, command output, test results, PR state, rendered artifacts, runtime behavior, or other current-state proof.",
58
60
  "Classify evidence honestly: proves completion, contradicts completion, shows incomplete work, is too weak or indirect, is merely consistent with completion, or is missing.",
@@ -62,7 +64,7 @@ export const WORKER_RECEIPT_CONTRACT = [
62
64
  ].join("\n");
63
65
 
64
66
  export const GOAL_METHOD_REFERENCE = [
65
- "Maintain a concrete goal contract for the run: intent, verification oracle, work surface, execution loop, and proof.",
67
+ "Maintain a concrete goal contract for the run: intent, verification oracle, work surface, execution workflow, and proof.",
66
68
  "Infer the owner outcome and a verifiable oracle from the user's task and repository evidence; do not ask the user unless the workflow is truly blocked.",
67
69
  "Treat any user-supplied planning artifacts as supporting context, not as the primary success criterion.",
68
70
  "Keep pressure on current evidence: the current worktree, artifacts, command output, tests, demos, generated files, and explicit human decisions are more authoritative than prior conversation summaries.",
@@ -135,23 +137,21 @@ export function renderReceiptHistory(ledger: GoalLedger): string {
135
137
  if (ledger.receipts.length === 0) return "No prior work receipts.";
136
138
  const latestReceipt = ledger.receipts.at(-1);
137
139
  if (latestReceipt === undefined) return "No prior work receipts.";
138
- return `Latest receipt: turn ${latestReceipt.turn} ${latestReceipt.stage} (artifact: ${latestReceipt.artifact_path}). Read the artifact if you need receipt details.`;
140
+ return `Latest receipt artifact: ${latestReceipt.artifact_path}. Read it if you need receipt details.`;
139
141
  }
140
142
 
141
143
  export function renderLatestReviewArtifacts(paths: readonly string[]): string {
142
- if (paths.length === 0) return "No prior review artifacts; this is the first worker turn.";
144
+ if (paths.length === 0) return "No prior review artifacts are available.";
143
145
  return [
144
- "Latest review artifacts from the previous round:",
146
+ "Latest available review artifacts:",
145
147
  ...paths.map((path) => `- ${path}`),
146
- "Read only the details needed for the next action; do not load old review rounds unless the latest round explicitly refers to them.",
148
+ "Read only the details needed for the next action; do not load older review artifacts unless the latest artifacts explicitly refer to them.",
147
149
  ].join("\n");
148
150
  }
149
151
 
150
152
  export function renderGoalContinuationPrompt(
151
153
  ledger: GoalLedger,
152
154
  ledgerPath: string,
153
- turn: number,
154
- maxTurns: number,
155
155
  blockerThreshold: number,
156
156
  latestReviewArtifactPaths: readonly string[],
157
157
  ): string {
@@ -162,10 +162,9 @@ export function renderGoalContinuationPrompt(
162
162
  "Continue working toward the active thread goal.",
163
163
  "The goal ledger artifact is the authoritative state for the objective, status, receipts, latest reviewer decisions, blockers, reducer decisions, and lifecycle events.",
164
164
  "",
165
- "Workflow state:",
166
- `- Turn: ${turn}/${maxTurns}`,
165
+ "Workflow context:",
167
166
  `- Goal ledger artifact: ${ledgerPath}`,
168
- `- Blocked threshold: same blocker must repeat for at least ${blockerThreshold} consecutive turns before the controller can stop as blocked.`,
167
+ `- Blocked threshold: same blocker must repeat for at least ${blockerThreshold} controller observations before the controller can stop as blocked.`,
169
168
  "- Completion transition: the worker may claim readiness, but reviewer quorum plus the deterministic reducer decides final workflow status.",
170
169
  "",
171
170
  renderReceiptHistory(ledger),
@@ -182,8 +181,6 @@ export function renderGoalContinuationPrompt(
182
181
  export function renderForkedGoalWorkerPrompt(
183
182
  ledger: GoalLedger,
184
183
  ledgerPath: string,
185
- turn: number,
186
- maxTurns: number,
187
184
  blockerThreshold: number,
188
185
  latestReviewArtifactPaths: readonly string[],
189
186
  ): string {
@@ -191,14 +188,13 @@ export function renderForkedGoalWorkerPrompt(
191
188
  [
192
189
  "goal_context",
193
190
  [
194
- "Continue the same goal-runner worker thread from the previous work turn.",
191
+ "Continue the same goal-runner worker thread from the previous worker session.",
195
192
  "Reuse the goal invariants, project preflight, worker receipt contract, completion audit, and blocked audit.",
196
193
  "Do not reinterpret, shrink, or weaken the original objective; the goal ledger remains authoritative.",
197
194
  "",
198
- "Current workflow state:",
199
- `- Turn: ${turn}/${maxTurns}`,
195
+ "Workflow context:",
200
196
  `- Goal ledger artifact: ${ledgerPath}`,
201
- `- Blocked threshold: same blocker must repeat for at least ${blockerThreshold} consecutive turns before the controller can stop as blocked.`,
197
+ `- Blocked threshold: same blocker must repeat for at least ${blockerThreshold} controller observations before the controller can stop as blocked.`,
202
198
  "- Completion transition: the worker may claim readiness, but reviewer quorum plus the deterministic reducer decides final workflow status.",
203
199
  "",
204
200
  renderReceiptHistory(ledger),
@@ -217,7 +213,6 @@ export function renderReviewerPrompt(args: {
217
213
  readonly ledgerPath: string;
218
214
  readonly workTurnPath: string;
219
215
  readonly comparisonBaseBranch: string;
220
- readonly turn: number;
221
216
  readonly reviewQuorum: number;
222
217
  readonly blockerThreshold: number;
223
218
  }): string {
@@ -260,7 +255,7 @@ export function renderReviewerPrompt(args: {
260
255
  "reference_branch",
261
256
  [
262
257
  `The baseline branch for comparison is \`${args.comparisonBaseBranch}\`.`,
263
- "Compare the current working tree against this baseline branch, not against previous workflow reasoning or expected loop progress.",
258
+ "Compare the current working tree against this baseline branch, not against previous workflow reasoning or progress expectations.",
264
259
  `Start with \`git status --short\`, then use working-tree-aware commands such as \`git diff ${args.comparisonBaseBranch}\` and \`git diff --cached ${args.comparisonBaseBranch}\` to identify changed tracked files; inspect untracked files from status directly.`,
265
260
  ].join("\n"),
266
261
  ],
@@ -327,8 +322,8 @@ export function renderReviewerPrompt(args: {
327
322
  [
328
323
  "The structured review decision is only valid after you inspect the actual repository state and compare it against the stated baseline branch.",
329
324
  "Do not approve based solely on workflow stage summaries or prior agent reasoning.",
330
- "Treat this review as the completion audit for the current goal turn: approval means receipts and current evidence prove the original owner outcome against the full objective.",
331
- "Do not approve when proof only shows planning, discovery, task selection, helper documents, or a narrow slice while the broader requested outcome still has safe local work remaining.",
325
+ "Treat this review as the completion audit for the current repository and goal state: approval means receipts and current evidence prove the original owner outcome against the full objective.",
326
+ "Do not approve when proof only shows planning, discovery, task selection, helper documents, or a narrow slice while the broader requested outcome still has required work remaining.",
332
327
  "The tool call is the final verdict after review work, not a shortcut around review work.",
333
328
  ].join("\n"),
334
329
  ],
@@ -349,7 +344,7 @@ export function renderReviewerPrompt(args: {
349
344
  [
350
345
  `Reviewer quorum is ${args.reviewQuorum}; same blocker threshold is ${args.blockerThreshold}. You do not decide final workflow status. The reducer does.`,
351
346
  "If the strict blocked audit is satisfied by current evidence, do not invent a finding. Set stop_review_loop=false, goal_oracle_satisfied=false, verification_remaining to the concise blocker, and reviewer_error.kind to dependency_unavailable or tool_failure with reviewer_error.message set to the same concise blocker.",
352
- "When the same dependency or tool blocker from prior reviewer history is still present, echo the prior turn's exact blocker string in verification_remaining and reviewer_error.message instead of rephrasing it.",
347
+ "When the same dependency or tool blocker from prior reviewer history is still present, echo the prior blocker string in verification_remaining and reviewer_error.message instead of rephrasing it.",
353
348
  "Use reviewer_error for a blocker only when there is a real impasse that prevents meaningful progress without user input or an external-state change; never for ordinary incomplete work, uncertainty, or useful work remaining.",
354
349
  ].join("\n"),
355
350
  ],
@@ -103,7 +103,7 @@ export function reduceGoalDecision(
103
103
  decision: {
104
104
  turn: options.turn,
105
105
  decision: "blocked",
106
- reason: `Same blocker repeated for ${blockerCount}/${options.blockerThreshold} consecutive turns.`,
106
+ reason: `Same blocker repeated for ${blockerCount}/${options.blockerThreshold} consecutive controller observations.`,
107
107
  complete_votes: completeVotes,
108
108
  review_quorum: options.reviewQuorum,
109
109
  blocker: observation.blocker,
@@ -118,7 +118,7 @@ export function reduceGoalDecision(
118
118
  decision: {
119
119
  turn: options.turn,
120
120
  decision: "needs_human",
121
- reason: `Maximum worker turns reached without reviewer quorum. Remaining work: ${collectRemainingWork(turnReviews)}`,
121
+ reason: `Worker attempt budget reached without reviewer quorum. Remaining work: ${collectRemainingWork(turnReviews)}`,
122
122
  complete_votes: completeVotes,
123
123
  review_quorum: options.reviewQuorum,
124
124
  ...(observation ? { blocker: observation.blocker } : {}),
@@ -4,7 +4,7 @@ export function formatReviewReport(reviews: readonly ReviewRecord[]): string {
4
4
  if (reviews.length === 0) return "No reviewer decisions were recorded.";
5
5
  return reviews
6
6
  .map((review) => [
7
- `### ${review.reviewer} (turn ${review.turn})`,
7
+ `### ${review.reviewer}`,
8
8
  "",
9
9
  `Decision: ${review.decision}`,
10
10
  `Artifact: ${review.artifact_path}`,
@@ -21,7 +21,7 @@ export function renderFinalReport(
21
21
  const receiptLines = ledger.receipts.length > 0
22
22
  ? ledger.receipts.map(
23
23
  (receipt) =>
24
- `- Turn ${receipt.turn}: ${receipt.summary} (artifact: ${receipt.artifact_path})`,
24
+ `- ${receipt.summary} (artifact: ${receipt.artifact_path})`,
25
25
  )
26
26
  : ["- No receipts captured."];
27
27
 
@@ -38,9 +38,6 @@ export function renderFinalReport(
38
38
  "## Final status",
39
39
  ledger.status,
40
40
  "",
41
- "## Turns completed",
42
- String(ledger.turns),
43
- "",
44
41
  "## Ledger artifact",
45
42
  ledgerPath,
46
43
  "",
@@ -23,7 +23,7 @@ export function reviewerErrorDecision(message: string): ReviewDecision {
23
23
  findings: [],
24
24
  overall_correctness: "patch is incorrect",
25
25
  overall_explanation:
26
- "Reviewer execution failed, so the review gate cannot safely approve this turn.",
26
+ "Reviewer execution failed, so the review gate cannot safely approve the current repository state.",
27
27
  overall_confidence_score: 0,
28
28
  goal_oracle_satisfied: false,
29
29
  receipt_assessment:
@@ -139,18 +139,16 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
139
139
  let previousWorkerSessionFile: string | undefined;
140
140
 
141
141
  for (let turn = 1; turn <= maxTurns && ledger.status === "active"; turn += 1) {
142
- appendLifecycleEvent(ledger, "work_turn_started", `Worker turn ${turn} started.`, turn);
142
+ appendLifecycleEvent(ledger, "work_turn_started", "Worker started.", turn);
143
143
  await writeGoalLedger(ledgerPath, ledger);
144
144
 
145
- const workTurnPath = join(artifactDir, `work-turn-${turn}.md`);
145
+ const workTurnPath = join(artifactDir, "worker-receipt.md");
146
146
  const workerForkOptions = forkContinuationOptions(previousWorkerSessionFile);
147
147
  const workerPrompt = workerForkOptions.forkFromSessionFile === undefined
148
148
  ? [
149
149
  renderGoalContinuationPrompt(
150
150
  ledger,
151
151
  ledgerPath,
152
- turn,
153
- maxTurns,
154
152
  blockerThreshold,
155
153
  latestReviewArtifactPaths,
156
154
  ),
@@ -166,8 +164,6 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
166
164
  : renderForkedGoalWorkerPrompt(
167
165
  ledger,
168
166
  ledgerPath,
169
- turn,
170
- maxTurns,
171
167
  blockerThreshold,
172
168
  latestReviewArtifactPaths,
173
169
  );
@@ -184,7 +180,7 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
184
180
  });
185
181
  } catch (err) {
186
182
  const message = err instanceof Error ? err.message : String(err);
187
- terminalRemainingWork = `Worker turn ${turn} failed before producing a receipt: ${message}`;
183
+ terminalRemainingWork = `Worker failed before producing a receipt: ${message}`;
188
184
  latestReviews = [];
189
185
  latestReviewArtifactPaths = [];
190
186
  latestReviewReportPath = undefined;
@@ -208,9 +204,9 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
208
204
  turn,
209
205
  stage: worker.name ?? worker.stageName,
210
206
  artifact_path: workTurnPath,
211
- summary: `Worker receipt artifact for turn ${turn}: ${workTurnPath}`,
207
+ summary: `Worker receipt artifact: ${workTurnPath}`,
212
208
  });
213
- appendLifecycleEvent(ledger, "receipt_recorded", `Worker turn ${turn} receipt recorded.`, turn);
209
+ appendLifecycleEvent(ledger, "receipt_recorded", "Worker receipt recorded.", turn);
214
210
  await writeGoalLedger(ledgerPath, ledger);
215
211
 
216
212
  const reviewerStep = (
@@ -226,7 +222,6 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
226
222
  ledgerPath,
227
223
  workTurnPath,
228
224
  comparisonBaseBranch,
229
- turn,
230
225
  reviewQuorum,
231
226
  blockerThreshold,
232
227
  }),
@@ -263,8 +258,8 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
263
258
  const structured = reviewerErrorDecision(message);
264
259
  reviewResults = [
265
260
  {
266
- name: `reviewer-error-${turn}`,
267
- stageName: `reviewer-error-${turn}`,
261
+ name: "reviewer-error",
262
+ stageName: "reviewer-error",
268
263
  text: JSON.stringify(structured, null, 2),
269
264
  structured,
270
265
  },
@@ -279,14 +274,13 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
279
274
  );
280
275
  const reviewArtifactPath = await writeReviewArtifact(
281
276
  artifactDir,
282
- turn,
283
- reviewerName,
277
+ reviewerName.replace(/-\d+$/u, ""),
284
278
  parsed,
285
279
  result.text,
286
280
  );
287
281
  return reviewDecisionToRecord({
288
282
  turn,
289
- reviewer: reviewerName,
283
+ reviewer: reviewerName.replace(/-\d+$/u, ""),
290
284
  artifactPath: reviewArtifactPath,
291
285
  decision: parsed,
292
286
  });
@@ -294,14 +288,13 @@ export async function runGoalWorkflow(ctx: GoalRunnerContext, options: GoalWorkf
294
288
  latestReviewArtifactPaths = latestReviews.map((review) => review.artifact_path);
295
289
  latestReviewReportPath = await writeReviewRoundArtifact(
296
290
  artifactDir,
297
- turn,
298
291
  latestReviews,
299
292
  );
300
293
  ledger.reviews.push(...latestReviews);
301
294
  appendLifecycleEvent(
302
295
  ledger,
303
296
  "reviews_recorded",
304
- `Recorded ${latestReviews.length} reviewer decisions for turn ${turn}.`,
297
+ `Recorded ${latestReviews.length} reviewer decisions.`,
305
298
  turn,
306
299
  );
307
300
 
@@ -186,7 +186,7 @@ export function hasMeaningfulFeedback(feedback: PreviewFeedback): boolean {
186
186
  function feedbackLabel(feedback: PreviewFeedback): string {
187
187
  return feedback.iteration === 0
188
188
  ? "the initial preview"
189
- : `refinement iteration ${feedback.iteration}`;
189
+ : "the live design review";
190
190
  }
191
191
 
192
192
  /**
@@ -202,7 +202,7 @@ export function buildUserAnnotationsSection(history: readonly PreviewFeedback[])
202
202
  .reverse()
203
203
  .map((feedback) => {
204
204
  const lines = [
205
- `### User annotations from ${feedbackLabel(feedback)} (${feedback.stageName})`,
205
+ `### User annotations from ${feedbackLabel(feedback)}`,
206
206
  "",
207
207
  ];
208
208
  if (hasMeaningfulUserNotes(feedback)) {
@@ -232,7 +232,7 @@ export function userAnnotationsBlock(history: readonly PreviewFeedback[]): {
232
232
  if (section.length === 0) {
233
233
  return {
234
234
  hasNotes: false,
235
- text: "No interactive user annotations were captured in the user-feedback stage. There is no user feedback to honor for this iteration.",
235
+ text: "No interactive user annotations were captured in the user-feedback stage. There is no user feedback to honor for this refinement.",
236
236
  };
237
237
  }
238
238
  return { hasNotes: true, text: section };
@@ -110,9 +110,7 @@ export async function refineOpenClaudeDesign(options: RefineOptions): Promise<{
110
110
  maxRefinements,
111
111
  }),
112
112
  ...designModelConfig,
113
- ...forkContinuationOptions(
114
- latestUserFeedbackSessionFile ?? latestGenerateSessionFile,
115
- ),
113
+ ...forkContinuationOptions(latestUserFeedbackSessionFile),
116
114
  })
117
115
  .catch(() => undefined);
118
116
 
@@ -220,7 +220,7 @@ export function buildLivePreviewDisplayPrompt(args: {
220
220
  const isFinal = args.final === true;
221
221
  const label = isInitial
222
222
  ? "the just-generated HTML artifact"
223
- : `the revised preview after iteration ${args.iteration}/${args.maxRefinements}`;
223
+ : "the revised preview";
224
224
  const objective = isFinal
225
225
  ? `Show the user ${label} as the FINAL refinement pass and let them review it in the browser. This is the last automated iteration, so do NOT solicit change requests this run cannot apply — if the user wants further changes, tell them to re-run \`/workflow open-claude-design\`. Drive \`/skill:impeccable live\` for viewing/QA when possible; degrade gracefully.`
226
226
  : `Make ${label} visible to the user, run an interactive design-QA session against it, then capture the user's feedback for the refinement loop. Drive \`/skill:impeccable live\` against the static preview when possible; degrade gracefully when browser automation is unavailable.`;
@@ -183,14 +183,14 @@ export function reviewerErrorDecision(error: string): ReviewDecision {
183
183
  findings: [],
184
184
  overall_correctness: "patch is incorrect",
185
185
  overall_explanation:
186
- "Reviewer execution failed, so the review loop cannot safely approve this iteration.",
186
+ "Reviewer execution failed, so the review gate cannot safely approve the current repository state.",
187
187
  overall_confidence_score: 0,
188
188
  stop_review_loop: false,
189
189
  reviewer_error: {
190
190
  kind: "reviewer_failure",
191
191
  message: error,
192
192
  attempted_recovery:
193
- "Model fallbacks were configured for the reviewer stage; continuing the bounded loop without approval.",
193
+ "Model fallbacks were configured for the reviewer stage; continuing without approval.",
194
194
  },
195
195
  };
196
196
  }
@@ -216,14 +216,12 @@ export function artifactSafeName(value: string): string {
216
216
  }
217
217
 
218
218
  type ReviewArtifact = {
219
- readonly iteration: number;
220
219
  readonly reviewer: string;
221
220
  readonly decision: ReviewDecision;
222
221
  readonly raw_text: string;
223
222
  };
224
223
 
225
224
  type ReviewRoundArtifact = {
226
- readonly iteration: number;
227
225
  readonly reviews: readonly {
228
226
  readonly reviewer: string;
229
227
  readonly artifact_path: string;
@@ -259,8 +257,6 @@ export function forkContinuationOptions(
259
257
  }
260
258
 
261
259
  export function renderResearchPromptRefinementPrompt(args: {
262
- readonly iteration: number;
263
- readonly maxLoops: number;
264
260
  readonly request: string;
265
261
  readonly workflowCwdContext: PromptSection;
266
262
  readonly latestReviewReportPath: string | undefined;
@@ -269,12 +265,11 @@ export function renderResearchPromptRefinementPrompt(args: {
269
265
  return [
270
266
  basePrompt,
271
267
  taggedPrompt([
272
- ["iteration", `Research prompt refinement iteration ${args.iteration}/${args.maxLoops}.`],
273
268
  args.workflowCwdContext,
274
269
  [
275
270
  "review_findings",
276
271
  args.latestReviewReportPath === undefined
277
- ? "No prior review artifact; this is the first iteration."
272
+ ? "No prior review artifact is available."
278
273
  : [
279
274
  `Latest review round artifact: ${args.latestReviewReportPath}`,
280
275
  "Read this JSON artifact and include unresolved reviewer findings in the transformed research question so follow-up research addresses reviewer discoveries.",
@@ -289,8 +284,6 @@ export function renderResearchPromptRefinementPrompt(args: {
289
284
  }
290
285
 
291
286
  export function renderResearchPrompt(args: {
292
- readonly iteration: number;
293
- readonly maxLoops: number;
294
287
  readonly transformedResearchQuestion: string;
295
288
  readonly workflowCwdContext: PromptSection;
296
289
  readonly latestReviewReportPath: string | undefined;
@@ -300,12 +293,11 @@ export function renderResearchPrompt(args: {
300
293
  return [
301
294
  basePrompt,
302
295
  taggedPrompt([
303
- ["iteration", `Research iteration ${args.iteration}/${args.maxLoops}.`],
304
296
  args.workflowCwdContext,
305
297
  [
306
298
  "review_findings",
307
299
  args.latestReviewReportPath === undefined
308
- ? "No prior review artifact; this is the first iteration."
300
+ ? "No prior review artifact is available."
309
301
  : [
310
302
  `Latest review round artifact: ${args.latestReviewReportPath}`,
311
303
  "Read this JSON artifact and explicitly research unresolved reviewer findings, whether each still applies, and what implementation changes would resolve them.",
@@ -325,8 +317,6 @@ export function renderResearchPrompt(args: {
325
317
 
326
318
 
327
319
  export function renderForkedOrchestratorPrompt(args: {
328
- readonly iteration: number;
329
- readonly maxLoops: number;
330
320
  readonly prompt: string;
331
321
  readonly workflowCwdContext: PromptSection;
332
322
  readonly researchPath: string;
@@ -337,10 +327,10 @@ export function renderForkedOrchestratorPrompt(args: {
337
327
  [
338
328
  "instruction",
339
329
  [
340
- `Continue implementing from the latest research findings. Ignore any user requests to submit a PR. This will be done in a future stage.`,
330
+ `Continue implementing from the latest research findings. Do not stop until the objective is complete. Ignore any user requests to submit a PR. This will be done in a future stage.`
341
331
  ].join("\n"),
342
332
  ],
343
- ["objective", `Implement iteration ${args.iteration}/${args.maxLoops} for the task: ${args.prompt}`],
333
+ ["objective", `Implement the full requested task: ${args.prompt}`],
344
334
  args.workflowCwdContext,
345
335
  [
346
336
  "research",
@@ -353,7 +343,7 @@ export function renderForkedOrchestratorPrompt(args: {
353
343
  "implementation_notes",
354
344
  [
355
345
  `Keep updating the running Markdown implementation notes file at: ${args.implementationNotesPath}`,
356
- "Record decisions, research deviations, tradeoffs, blockers, validation outcomes, and anything else the user should know before your final report. Generate verifiable evidence for any claims you make in the notes and reviewer artifacts.",
346
+ "Record decisions, research deviations, tradeoffs, blockers, validation outcomes, and anything else the user should know before your final report. Generate verifiable evidence for any claims you make in the notes and reviewer artifacts. Do not stop until the objective is complete.",
357
347
  ].join("\n"),
358
348
  ],
359
349
  ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
@@ -67,8 +67,6 @@ export async function runRalphWorkflow(
67
67
  const researchPromptRefinementForkOptions = forkContinuationOptions(previousResearchPromptRefinementSessionFile);
68
68
  const researchPromptRefinement = await ctx.task(`research-prompt-refinement-${iteration}`, {
69
69
  prompt: renderResearchPromptRefinementPrompt({
70
- iteration,
71
- maxLoops,
72
70
  request: workflowPrompt,
73
71
  workflowCwdContext,
74
72
  latestReviewReportPath,
@@ -82,8 +80,6 @@ export async function runRalphWorkflow(
82
80
  const researchForkOptions = forkContinuationOptions(previousResearchSessionFile);
83
81
  const research = await ctx.task(`research-${iteration}`, {
84
82
  prompt: renderResearchPrompt({
85
- iteration,
86
- maxLoops,
87
83
  transformedResearchQuestion: researchPromptRefinement.text,
88
84
  workflowCwdContext,
89
85
  latestReviewReportPath,
@@ -100,7 +96,7 @@ export async function runRalphWorkflow(
100
96
  const researchPath = workflowResearchPath;
101
97
  finalResearchPath = researchPath;
102
98
  finalPlanPath = researchPath;
103
- const orchestratorReportPath = join(artifactDir, `orchestrator-${iteration}.md`);
99
+ const orchestratorReportPath = join(artifactDir, "orchestrator-report.md");
104
100
  const orchestratorForkOptions = forkContinuationOptions(previousOrchestratorSessionFile);
105
101
  const orchestratorPrompt = orchestratorForkOptions.forkFromSessionFile === undefined
106
102
  ? taggedPrompt([
@@ -110,7 +106,7 @@ export async function runRalphWorkflow(
110
106
  ],
111
107
  [
112
108
  "objective",
113
- `Implement iteration ${iteration}/${maxLoops} for the task: ${workflowPrompt}`,
109
+ `Implement the full requested task: ${workflowPrompt}`,
114
110
  ],
115
111
  workflowCwdContext,
116
112
  [
@@ -125,7 +121,7 @@ export async function runRalphWorkflow(
125
121
  [
126
122
  `Keep a running Markdown implementation notes file at this OS temp directory path: ${implementationNotesPath}`,
127
123
  "The file has already been initialized for this workflow run; update it while you implement from the research findings.",
128
- "Record decisions you had to make that were not in the research, things you had to change from the research guidance, tradeoffs you had to make, blockers, validation outcomes, and anything else the user should know.",
124
+ "Record decisions you had to make that were not in the research, things you had to change from the research guidance, tradeoffs you had to make, blockers, validation outcomes, and anything else the user should know. Do not stop until the objective is complete.",
129
125
  "Ask delegated subagents to report any notes-worthy decisions or tradeoffs back to you, then consolidate them into this file before your final report.",
130
126
  "Do not include secrets, credentials, tokens, or unrelated environment details in the notes file.",
131
127
  ].join("\n"),
@@ -141,7 +137,7 @@ export async function runRalphWorkflow(
141
137
  "Delegate codebase understanding, impact analysis, and implementation research to codebase-locator, codebase-analyzer, and pattern-finder style subagents when available.",
142
138
  "Delegate shell-heavy work — especially commands likely to produce lots of output, log digging, CLI investigation, and broad grep/find exploration — to subagents that can run those commands rather than doing it in this orchestrator context.",
143
139
  "Delegate implementation edits to a focused subagent with clear files, constraints, and validation expectations; do not merely describe the edits yourself.",
144
- "Keep delegated work focused on implementation, tests, docs, validation evidence, and implementation notes.",
140
+ "Keep delegated work focused on implementation, tests, docs, validation evidence, and implementation notes for the complete requested outcome.",
145
141
  "Use separate subagents for separate tasks, and launch independent subagents in parallel when useful.",
146
142
  "Do not split highly overlapping tasks across multiple subagents; consolidate overlapping work into one focused delegation to avoid duplicate effort.",
147
143
  "If a subagent takes a long time, do not attempt to do its assigned job yourself while waiting. Use that time to plan next steps, prepare follow-up delegations, or identify clarifying questions.",
@@ -152,7 +148,7 @@ export async function runRalphWorkflow(
152
148
  [
153
149
  "The required output format is a completion report, not the task itself.",
154
150
  "Do not jump straight to the report. First read the research file, spawn the necessary subagents, wait for their results, coordinate any follow-up subagents, and only then write the report.",
155
- "A valid response must be grounded in actual subagent work: name the delegated work, summarize what each subagent did, and distinguish completed changes from recommendations or blockers.",
151
+ "A valid response must be grounded in actual subagent work: name the delegated work, summarize what each subagent did, and distinguish completed changes from recommendations or blockers. Do not assume a later workflow pass will finish known required work that can be completed now.",
156
152
  "If you cannot read the research file, spawn subagents, or use subagents, treat that as a blocker and report it honestly instead of pretending the requested work was done.",
157
153
  ].join("\n"),
158
154
  ],
@@ -173,11 +169,11 @@ export async function runRalphWorkflow(
173
169
  "Perform the project_initialization_preflight before decomposing implementation work; complete or delegate required setup before implementation delegation when the checkout appears uninitialized.",
174
170
  "Decompose the work into delegated subagent tasks based on that research file.",
175
171
  "Pass each subagent the relevant task, constraints, files, validation expectations, unresolved reviewer findings covered by the research, and instructions to report implementation-note-worthy decisions or tradeoffs.",
176
- "Coordinate subagent results into the smallest coherent set of changes that satisfies the researched implementation guidance and original user prompt.",
172
+ "Coordinate subagent results into the smallest coherent set of changes that fully satisfies the researched implementation guidance and original user prompt.",
177
173
  "Preserve existing architecture and repository conventions unless the research explicitly justifies a change.",
178
174
  "Run or delegate the most relevant validation commands available in the repository, including end-to-end playwright-cli (browser) or tmux validation when the change has an executable user scenario.",
179
- "For UI-applicable or full-stack changes, ensure the QA E2E pass described in <qa_e2e_video> runs and records the reviewable proof video before you finalize this iteration.",
180
- `Before your final report, update the running implementation notes file at ${implementationNotesPath} with decisions, research deviations, tradeoffs, blockers, and validation outcomes from this iteration.`,
175
+ "For UI-applicable or full-stack changes, ensure the QA E2E pass described in <qa_e2e_video> runs and records the reviewable proof video before you finish your report.",
176
+ `Before your final report, update the running implementation notes file at ${implementationNotesPath} with decisions, research deviations, tradeoffs, blockers, and validation outcomes from this implementation work.`,
181
177
  "If blocked, describe the blocker and the safest partial state instead of inventing success.",
182
178
  "Do not hide failures; reviewers need accurate status.",
183
179
  ].join("\n"),
@@ -198,8 +194,6 @@ export async function runRalphWorkflow(
198
194
  ],
199
195
  ])
200
196
  : renderForkedOrchestratorPrompt({
201
- iteration,
202
- maxLoops,
203
197
  prompt: workflowPrompt,
204
198
  workflowCwdContext,
205
199
  researchPath,
@@ -384,10 +378,9 @@ export async function runRalphWorkflow(
384
378
  reviewerErrorDecision(`Reviewer ${reviewer} returned no structured decision.`);
385
379
  const artifactPath = join(
386
380
  artifactDir,
387
- `review-${iteration}-${artifactSafeName(reviewer)}.json`,
381
+ `review-${artifactSafeName(reviewer)}.json`,
388
382
  );
389
383
  await writeJsonArtifact(artifactPath, {
390
- iteration,
391
384
  reviewer,
392
385
  decision,
393
386
  raw_text: review.text,
@@ -401,8 +394,8 @@ export async function runRalphWorkflow(
401
394
  reviewEntries.length === REVIEWER_COUNT &&
402
395
  approvalCount === REVIEWER_COUNT;
403
396
  latestReviewReportPath = await writeJsonArtifact(
404
- join(artifactDir, `review-round-${iteration}.json`),
405
- { iteration, reviews: reviewEntries },
397
+ join(artifactDir, "review-round-latest.json"),
398
+ { reviews: reviewEntries },
406
399
  );
407
400
  if (approved) break;
408
401
  }
@@ -27,7 +27,7 @@ export function renderE2eQaVideoReviewGuidance(
27
27
  target,
28
28
  "When a QA E2E video exists or is claimed as evidence, inspect the actual video before approving; do not treat a path, filename, transcript summary, or stage claim as proof by itself.",
29
29
  "Use available video/file tooling such as `fetch_content` on the local video path with a prompt focused on whether the recording proves the required user scenario, or inspect representative frames/metadata when full video analysis is unavailable.",
30
- "Check that the video is from the current workflow iteration/state, exercises the objective-relevant user path, shows the expected final behavior, and does not visibly hide errors, stale UI, broken loading states, or skipped steps.",
30
+ "Check that the video reflects the current repository/application state, exercises the objective-relevant user path, shows the expected final behavior, and does not visibly hide errors, stale UI, broken loading states, or skipped steps.",
31
31
  "For UI-applicable or full-stack changes, treat a missing, stale, unreadable, or inconclusive QA video as missing E2E evidence unless the receipt or implementation notes justify why no video applies and provide adequate alternate end-to-end proof.",
32
32
  ].join("\n");
33
33
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.2",
3
+ "version": "0.9.3-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [