@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
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: worker
3
+ description: Implementation agent for normal tasks and approved orchestrator handoffs.
4
+ systemPromptMode: replace
5
+ inheritProjectContext: true
6
+ inheritSkills: false
7
+ tools: read, edit, write, search, find, ls, bash, web_search, fetch_content, get_search_content, intercom, contact_supervisor, todo
8
+ model: zai/glm-5.2:medium
9
+ fallbackModels: zai-coding-cn/glm-5.2:medium, openai-codex/gpt-5.5:medium, github-copilot/gpt-5.5:medium, openai/gpt-5.5:medium, github-copilot/claude-opus-4.8 (1m):medium, anthropic/claude-opus-4-8:medium, github-copilot/gemini-3.5-flash (1m):medium, google/gemini-3.5-flash:medium, google-vertex/gemini-3.5-flash:medium, github-copilot/gemini-3.1-pro-preview (1m):medium, google/gemini-3.1-pro-preview:medium, google-vertex/gemini-3.1-pro-preview:medium
10
+ skills: tdd, playwright-cli, tmux
11
+ defaultContext: fork
12
+ defaultProgress: true
13
+ ---
14
+
15
+ You are `worker`: the implementation subagent.
16
+
17
+ You are the single writer thread. Your job is to execute the assigned task or approved direction with narrow, coherent edits. The main agent and user remain the decision authority.
18
+
19
+ Use the provided tools directly. First understand the inherited context, supplied files, plan, and explicit task. Then implement carefully and minimally.
20
+
21
+ If the task is framed as an approved direction, handoff, or execution plan, treat that direction as the contract. Validate it against the actual code, but do not silently make new product, architecture, or scope decisions.
22
+
23
+ If the implementation reveals a decision that was not approved and is required to continue safely, pause and escalate through the live coordination channel. If runtime bridge instructions are present, use them as the source of truth for which supervisor session to contact and how to coordinate. Use `contact_supervisor` with `reason: "need_decision"` when a new decision is needed, and stay alive to receive the reply before continuing. Use `reason: "progress_update"` only for concise non-blocking progress updates when that extra coordination is helpful or explicitly requested. Fall back to generic `intercom` only if `contact_supervisor` is unavailable. Do not finish your final response with a question that requires the supervisor to choose before you can continue.
24
+
25
+ Default responsibilities:
26
+ - validate the task or approved direction against the actual code
27
+ - implement the smallest correct change
28
+ - follow existing patterns in the codebase
29
+ - verify the result with appropriate checks when possible
30
+ - keep `progress.md` accurate when asked to maintain it
31
+ - report back clearly with changes, validation, risks, and next steps
32
+
33
+ Working rules:
34
+ - Prefer narrow, correct changes over broad rewrites.
35
+ - Do not add speculative scaffolding or future-proofing unless explicitly required.
36
+ - Do not leave placeholder code, TODOs, or silent scope changes.
37
+ - Use `bash` for inspection, validation, and relevant tests.
38
+ - If there is supplied context or a plan, read it first.
39
+ - If implementation reveals a gap in the approved direction, pause and escalate with `contact_supervisor` and `reason: "need_decision"` instead of silently patching around it with an implicit decision.
40
+ - If implementation reveals an unapproved product or architecture choice, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply instead of deciding it yourself or returning a final choose-one answer.
41
+ - If your delegated task expects code or file edits and you have not made those edits, do not return a success summary. Make the edits, contact the supervisor if blocked, or explicitly report that no edits were made.
42
+ - If you send a blocked/progress update through `contact_supervisor`, keep it short and still return the full structured task result normally.
43
+ - Do not send routine completion handoffs. Return the completed implementation summary normally when no coordination is needed.
44
+
45
+ When running in a chain, expect instructions about:
46
+ - which files to read first
47
+ - where to maintain progress tracking
48
+ - where to write output if a file target is provided
49
+
50
+ Your final response should follow this shape:
51
+
52
+ Implemented X.
53
+ Changed files: Y.
54
+ Validation: Z.
55
+ Open risks/questions: R.
56
+ Recommended next step: N.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.9.2",
3
+ "version": "0.9.3-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -153,14 +153,14 @@ Builtin agents load at the lowest priority. Project agents override user agents,
153
153
 
154
154
  | Agent | Purpose | Default model | Thinking | Tools | Notes |
155
155
  | ---------------------------- | ----------------------------------------------------------------- | --------------------- | -------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
156
- | `codebase-locator` | Locate files, directories, tests, and configs relevant to a topic | `openai/gpt-5.4-mini` | low | read, grep, find, ls, bash | Read-only finder. Returns a categorized file map; no analysis. |
157
- | `codebase-analyzer` | Explain how specific code currently works | `openai/gpt-5.5` | low | read, grep, find, ls, bash | Read-only. Traces flow with `file:line` references; does not critique. |
158
- | `codebase-pattern-finder` | Find similar implementations or conventions | `openai/gpt-5.4-mini` | low | read, grep, find, ls, bash | Read-only. Returns code snippets with `file:line` references. |
159
- | `codebase-research-locator` | Discover prior `research/` and `specs/` docs | `openai/gpt-5.4-mini` | low | read, grep, find, ls, bash | Read-only. Sorts by date, tiers by recency, flags supersession. |
160
- | `codebase-research-analyzer` | Extract decisions and constraints from prior docs | `openai/gpt-5.5` | low | read, grep, find, ls, bash | Read-only. Filters aggressively for what still applies today. |
161
- | `codebase-online-researcher` | Web research with authoritative sources | `openai/gpt-5.5` | low | read, grep, find, ls, bash, write, web_search, fetch_content, get_search_content | Has the `browser` skill. Persists keepers to `research/web/`. |
162
- | `code-simplifier` | Clean up recently changed code without changing behavior | `openai/gpt-5.5` | low | read, edit, write, grep, find, ls, bash | **Writer.** Scopes to recently modified code by default; preserves all observable behavior. |
163
- | `debugger` | Reproduce, diagnose, and fix failing behavior | `openai/gpt-5.5` | high | read, edit, write, grep, find, ls, bash, web_search, fetch_content, get_search_content | **Writer.** Has the `tdd` and `browser` skills. Inspect-only mode requires an explicit instruction. |
156
+ | `codebase-locator` | Locate files, directories, tests, and configs relevant to a topic | `openai/gpt-5.4-mini` | low | read, search, find, ls, bash | Read-only finder. Returns a categorized file map; no analysis. |
157
+ | `codebase-analyzer` | Explain how specific code currently works | `openai/gpt-5.5` | low | read, search, find, ls, bash | Read-only. Traces flow with `file:line` references; does not critique. |
158
+ | `codebase-pattern-finder` | Find similar implementations or conventions | `openai/gpt-5.4-mini` | low | read, search, find, ls, bash | Read-only. Returns code snippets with `file:line` references. |
159
+ | `codebase-research-locator` | Discover prior `research/` and `specs/` docs | `openai/gpt-5.4-mini` | low | read, search, find, ls, bash | Read-only. Sorts by date, tiers by recency, flags supersession. |
160
+ | `codebase-research-analyzer` | Extract decisions and constraints from prior docs | `openai/gpt-5.5` | low | read, search, find, ls, bash | Read-only. Filters aggressively for what still applies today. |
161
+ | `codebase-online-researcher` | Web research with authoritative sources | `openai/gpt-5.5` | low | read, search, find, ls, bash, write, web_search, fetch_content, get_search_content | Has the `browser` skill. Persists keepers to `research/web/`. |
162
+ | `code-simplifier` | Clean up recently changed code without changing behavior | `openai/gpt-5.5` | low | read, edit, write, search, find, ls, bash | **Writer.** Scopes to recently modified code by default; preserves all observable behavior. |
163
+ | `debugger` | Reproduce, diagnose, and fix failing behavior | `openai/gpt-5.5` | high | read, edit, write, search, find, ls, bash, web_search, fetch_content, get_search_content | **Writer.** Has the `tdd` and `browser` skills. Inspect-only mode requires an explicit instruction. |
164
164
 
165
165
  Each builtin declares an explicit `model` and `fallbackModels` chain (typically `github-copilot/<same>`, then `anthropic/claude-opus-4-8`, then `github-copilot/claude-opus-4.7`). The current user-selected model is automatically appended as the last fallback and de-duplicated. Override per run with inline config:
166
166
 
@@ -479,7 +479,7 @@ subagent({
479
479
  systemPrompt: "Your system prompt here.",
480
480
  systemPromptMode: "replace",
481
481
  model: "openai/gpt-5.5",
482
- tools: "read,grep,find,ls,bash"
482
+ tools: "read,search,find,ls,bash"
483
483
  }
484
484
  })
485
485
  ```
@@ -517,7 +517,7 @@ package: code-analysis
517
517
  description: What this agent does
518
518
  model: openai/gpt-5.5
519
519
  thinking: high
520
- tools: read, grep, find, ls, bash
520
+ tools: read, search, find, ls, bash
521
521
  ---
522
522
 
523
523
  Your system prompt here.
@@ -548,7 +548,7 @@ If a prompt-template extension is installed, additional user prompt templates ca
548
548
 
549
549
  - **Forking requires a persisted parent session.** If the current session does not have a persisted session file, forked runs fail.
550
550
  - **Forked runs inherit parent history.** They are branched threads, not fresh filtered contexts. Use fresh context for adversarial review unless the user explicitly asks for forked context.
551
- - **Default subagent nesting depth is 2.** Deeper recursive delegation is blocked unless configured otherwise.
551
+ - **Default subagent nesting depth is 5.** Deeper recursive delegation is blocked, and configured values above 5 are clamped to the hard ceiling.
552
552
  - **Attention signals are not lifecycle state.** `needs_attention` means no activity has been observed past the configured threshold. `paused` means the child turn was intentionally interrupted or is awaiting direction; it is not the same as `failed`.
553
553
  - **Builtin specialists do not have `intercom`.** They cannot escalate decisions mid-run. Decide what the child should do up front, or use a custom agent with bridge tools when mid-run coordination is required.
554
554
  - **Intercom asks are blocking.** A session can only maintain one pending outbound ask wait state at a time.
@@ -14,6 +14,7 @@ import {
14
14
  type ChainConfig,
15
15
  type ChainDiscoveryDiagnostic,
16
16
  } from "./agent-types.ts";
17
+ import { normalizeMaxSubagentDepth } from "../shared/types.ts";
17
18
 
18
19
  function listFilesRecursive(dir: string, predicate: (fileName: string) => boolean): string[] {
19
20
  const files: string[] = [];
@@ -111,7 +112,7 @@ export function loadAgentsFromDir(dir: string, source: AgentSource): AgentConfig
111
112
  if (shouldPreserveAgentExtraField(key)) extraFields[key] = value;
112
113
  }
113
114
 
114
- const parsedMaxSubagentDepth = Number(frontmatter.maxSubagentDepth);
115
+ const parsedMaxSubagentDepth = normalizeMaxSubagentDepth(frontmatter.maxSubagentDepth);
115
116
 
116
117
  agents.push({
117
118
  name: runtimeName,
@@ -137,10 +138,7 @@ export function loadAgentsFromDir(dir: string, source: AgentSource): AgentConfig
137
138
  defaultReads,
138
139
  defaultProgress: frontmatter.defaultProgress === "true",
139
140
  interactive: frontmatter.interactive === "true",
140
- maxSubagentDepth:
141
- Number.isInteger(parsedMaxSubagentDepth) && parsedMaxSubagentDepth >= 0
142
- ? parsedMaxSubagentDepth
143
- : undefined,
141
+ maxSubagentDepth: parsedMaxSubagentDepth,
144
142
  extraFields: Object.keys(extraFields).length > 0 ? extraFields : undefined,
145
143
  });
146
144
  }
@@ -1,7 +1,7 @@
1
1
  import type { AgentConfig, AgentScope, ChainConfig, ChainStepConfig } from "./agents.ts";
2
2
  import { discoverAgentsAll, parsePackageName } from "./agents.ts";
3
3
  import { discoverAvailableSkills } from "./skills.ts";
4
- import type { SubagentToolResult } from "../shared/types.ts";
4
+ import { MAX_SUBAGENT_NESTING_DEPTH, type SubagentToolResult } from "../shared/types.ts";
5
5
  import type { ManagementContext, ManagementScope } from "./agent-management.ts";
6
6
 
7
7
  export function result(text: string, isError = false): SubagentToolResult {
@@ -302,8 +302,8 @@ export function applyAgentConfig(target: AgentConfig, cfg: Record<string, unknow
302
302
  if (hasKey(cfg, "maxSubagentDepth")) {
303
303
  if (cfg.maxSubagentDepth === false || cfg.maxSubagentDepth === "") target.maxSubagentDepth = undefined;
304
304
  else if (typeof cfg.maxSubagentDepth === "number" && Number.isInteger(cfg.maxSubagentDepth) && cfg.maxSubagentDepth >= 0) {
305
- target.maxSubagentDepth = cfg.maxSubagentDepth;
306
- } else return "config.maxSubagentDepth must be an integer >= 0 or false when provided.";
305
+ target.maxSubagentDepth = Math.min(cfg.maxSubagentDepth, MAX_SUBAGENT_NESTING_DEPTH);
306
+ } else return `config.maxSubagentDepth must be an integer >= 0 or false when provided; values above ${MAX_SUBAGENT_NESTING_DEPTH} are clamped.`;
307
307
  }
308
308
  return undefined;
309
309
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { Type } from "typebox";
6
- import { SUBAGENT_ACTIONS } from "../shared/types.ts";
6
+ import { MAX_SUBAGENT_NESTING_DEPTH, SUBAGENT_ACTIONS } from "../shared/types.ts";
7
7
 
8
8
  const SkillOverride = Type.Unsafe({
9
9
  anyOf: [
@@ -188,7 +188,7 @@ export const SubagentParams = Type.Object({
188
188
  { type: "object", additionalProperties: true },
189
189
  { type: "string" },
190
190
  ],
191
- description: "Agent or chain config for create/update. Agent: name, package (optional namespace; runtime name becomes package.name), description, scope ('user'|'project', default 'user'), systemPrompt, systemPromptMode, inheritProjectContext, inheritSkills, defaultContext ('fresh'|'fork'), model, tools (comma-separated), extensions (comma-separated), skills (comma-separated), thinking, output, reads, progress, maxSubagentDepth. Chain: name, package, description, scope, steps (array of {agent, task?, output?, outputMode?, reads?, model?, skill?, progress?}). Presence of 'steps' creates a chain instead of an agent. String values must be valid JSON."
191
+ description: `Agent or chain config for create/update. Agent: name, package (optional namespace; runtime name becomes package.name), description, scope ('user'|'project', default 'user'), systemPrompt, systemPromptMode, inheritProjectContext, inheritSkills, defaultContext ('fresh'|'fork'), model, tools (comma-separated), extensions (comma-separated), skills (comma-separated), thinking, output, reads, progress, maxSubagentDepth (integer >= 0, clamped to ${MAX_SUBAGENT_NESTING_DEPTH}). Chain: name, package, description, scope, steps (array of {agent, task?, output?, outputMode?, reads?, model?, skill?, progress?}). Presence of 'steps' creates a chain instead of an agent. String values must be valid JSON.`
192
192
  })),
193
193
  tasks: Type.Optional(Type.Array(TaskItem, { description: "PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]" })),
194
194
  concurrency: Type.Optional(Type.Integer({ minimum: 1, description: "Top-level PARALLEL mode only: max concurrent tasks. Defaults to config.parallel.concurrency or 4." })),
@@ -10,6 +10,7 @@ import {
10
10
  type SubagentResultIntercomPayload,
11
11
  type SubagentResultStatus,
12
12
  type SubagentRunMode,
13
+ MAX_SUBAGENT_NESTING_DEPTH,
13
14
  SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT,
14
15
  SUBAGENT_RESULT_INTERCOM_EVENT,
15
16
  } from "../shared/types.ts";
@@ -69,7 +70,7 @@ function compactNestedRun(run: NestedRunSummary | PublicNestedRunSummary, depth
69
70
  ...(run.parentStepIndex !== undefined ? { parentStepIndex: run.parentStepIndex } : {}),
70
71
  ...(run.parentAgent ? { parentAgent: run.parentAgent } : {}),
71
72
  depth: run.depth,
72
- path: run.path.slice(0, 4).map((part) => ({
73
+ path: run.path.slice(0, MAX_SUBAGENT_NESTING_DEPTH + 1).map((part) => ({
73
74
  runId: part.runId,
74
75
  ...(part.stepIndex !== undefined ? { stepIndex: part.stepIndex } : {}),
75
76
  ...(part.agent ? { agent: part.agent } : {}),
@@ -114,9 +115,9 @@ function compactNestedRun(run: NestedRunSummary | PublicNestedRunSummary, depth
114
115
  ...(step.startedAt !== undefined ? { startedAt: step.startedAt } : {}),
115
116
  ...(step.endedAt !== undefined ? { endedAt: step.endedAt } : {}),
116
117
  ...(step.error ? { error: step.error } : {}),
117
- ...(depth < 2 && step.children?.length ? { children: step.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) } : {}),
118
+ ...(depth < MAX_SUBAGENT_NESTING_DEPTH && step.children?.length ? { children: step.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) } : {}),
118
119
  })) } : {}),
119
- ...(depth < 2 && run.children?.length ? { children: run.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) } : {}),
120
+ ...(depth < MAX_SUBAGENT_NESTING_DEPTH && run.children?.length ? { children: run.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) } : {}),
120
121
  };
121
122
  }
122
123
 
@@ -7,7 +7,7 @@ import { getAgentDir } from "../../shared/utils.ts";
7
7
 
8
8
  const CACHE_VERSION = 1;
9
9
  const CACHE_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000;
10
- const BUILTIN_TOOL_NAMES = new Set(["read", "bash", "edit", "write", "grep", "find", "ls", "mcp"]);
10
+ const BUILTIN_TOOL_NAMES = new Set(["read", "bash", "edit", "write", "grep", "find", "search", "ls", "mcp"]);
11
11
  const GENERIC_GLOBAL_CONFIG_PATH = path.join(os.homedir(), ".config", "mcp", "mcp.json");
12
12
  const IMPORT_PATHS = {
13
13
  cursor: [path.join(os.homedir(), ".cursor", "mcp.json")],
@@ -1,6 +1,6 @@
1
1
  import { formatDuration, formatTokens, shortenPath } from "../../shared/formatters.ts";
2
2
  import { formatActivityLabel } from "../../shared/status-format.ts";
3
- import type { ActivityState, NestedRunSummary } from "../../shared/types.ts";
3
+ import { MAX_SUBAGENT_NESTING_DEPTH, type ActivityState, type NestedRunSummary } from "../../shared/types.ts";
4
4
 
5
5
  export interface NestedRunCounts {
6
6
  total: number;
@@ -108,7 +108,7 @@ function formatNestedRunLines(children: NestedRunSummary[] | undefined, options:
108
108
  export function formatNestedRunStatusLines(children: NestedRunSummary[] | undefined, options: { indent?: string; maxDepth?: number; maxLines?: number; commandHints?: boolean } = {}): string[] {
109
109
  return formatNestedRunLines(children, {
110
110
  indent: options.indent ?? " ",
111
- maxDepth: options.maxDepth ?? 2,
111
+ maxDepth: options.maxDepth ?? MAX_SUBAGENT_NESTING_DEPTH,
112
112
  maxLines: options.maxLines ?? 40,
113
113
  commandHints: options.commandHints ?? false,
114
114
  });
@@ -13,10 +13,11 @@ import { encodeNestedPathEnv, parseNestedPathEnv, type NestedPathEntry } from ".
13
13
  import { resolveMcpDirectToolNames } from "./mcp-direct-tool-allowlist.ts";
14
14
  import { STRUCTURED_OUTPUT_CAPTURE_ENV, STRUCTURED_OUTPUT_SCHEMA_ENV } from "./structured-output.ts";
15
15
  import type { JsonSchemaObject } from "../../shared/types.ts";
16
+ import { MAX_SUBAGENT_NESTING_DEPTH } from "../../shared/types-runtime.ts";
16
17
 
17
18
  const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"];
18
19
  const TASK_ARG_LIMIT = 8000;
19
- export const SUBAGENT_PARENT_MAX_DEPTH = 3;
20
+ export const SUBAGENT_PARENT_MAX_DEPTH = MAX_SUBAGENT_NESTING_DEPTH;
20
21
  export const PROMPT_RUNTIME_EXTENSION_PATH = path.join(path.dirname(fileURLToPath(import.meta.url)), "subagent-prompt-runtime.ts");
21
22
  const ENV_PREFIX = APP_NAME.toUpperCase();
22
23
  export const FANOUT_CHILD_EXTENSION_PATH = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "..", "extension", "fanout-child.ts");
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type { ExtensionContext } from "@bastani/atomic";
6
6
  import { APP_NAME, getEnvValue, WORKFLOW_STAGE_SUBAGENT_GUARD_ENV } from "@bastani/atomic";
7
- import { DEFAULT_SUBAGENT_MAX_DEPTH } from "./types-runtime.ts";
7
+ import { DEFAULT_SUBAGENT_MAX_DEPTH, MAX_SUBAGENT_NESTING_DEPTH } from "./types-runtime.ts";
8
8
 
9
9
  const ENV_PREFIX = APP_NAME.toUpperCase();
10
10
  const SUBAGENT_MAX_DEPTH_ENV = `${ENV_PREFIX}_SUBAGENT_MAX_DEPTH`;
@@ -16,7 +16,7 @@ export { WORKFLOW_STAGE_SUBAGENT_GUARD_ENV };
16
16
  export function normalizeMaxSubagentDepth(value: unknown): number | undefined {
17
17
  const parsed = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
18
18
  if (!Number.isInteger(parsed) || parsed < 0) return undefined;
19
- return parsed;
19
+ return Math.min(parsed, MAX_SUBAGENT_NESTING_DEPTH);
20
20
  }
21
21
 
22
22
  export function resolveCurrentMaxSubagentDepth(configMaxDepth?: number): number {
@@ -45,9 +45,9 @@ export function resolveWorkflowStageMaxSubagentDepth(
45
45
  ): number {
46
46
  const maxDepth = resolveCurrentMaxSubagentDepth(configMaxDepth);
47
47
  return isWorkflowStageOrchestrationContext(ctx)
48
- // Workflow stages use the same two-hop default as main chat. A 0-depth
49
- // constraint still preserves one child-subagent hop so configured workflow
50
- // stages can delegate at least once.
48
+ // Workflow stages receive an explicit host constraint, clamped by the
49
+ // inherited/global nesting ceiling. A 0-depth workflow constraint still
50
+ // preserves one child-subagent hop so configured stages can delegate once.
51
51
  ? Math.min(maxDepth, Math.max(1, ctx.orchestrationContext?.constraints.maxSubagentDepth ?? 1))
52
52
  : maxDepth;
53
53
  }
@@ -93,7 +93,8 @@ export const SLASH_SUBAGENT_UPDATE_EVENT = "subagent:slash:update";
93
93
  export const SLASH_SUBAGENT_CANCEL_EVENT = "subagent:slash:cancel";
94
94
  export const POLL_INTERVAL_MS = 250;
95
95
  export const MAX_WIDGET_JOBS = 4;
96
- export const DEFAULT_SUBAGENT_MAX_DEPTH = 2;
96
+ export const MAX_SUBAGENT_NESTING_DEPTH = 5;
97
+ export const DEFAULT_SUBAGENT_MAX_DEPTH = MAX_SUBAGENT_NESTING_DEPTH;
97
98
  export const SUBAGENT_ACTIONS = ["list", "get", "create", "update", "delete", "status", "interrupt", "resume", "doctor"] as const;
98
99
 
99
100
  export const DEFAULT_FORK_PREAMBLE =
@@ -1,5 +1,5 @@
1
1
  import * as path from "node:path";
2
- import type { AsyncJobState, AsyncJobStep, NestedRunSummary, NestedStepSummary } from "../shared/types.ts";
2
+ import { MAX_SUBAGENT_NESTING_DEPTH, type AsyncJobState, type AsyncJobStep, type NestedRunSummary, type NestedStepSummary } from "../shared/types.ts";
3
3
  import { flatToLogicalStepIndex } from "../runs/background/parallel-groups.ts";
4
4
  import { formatDuration, formatModelThinking, shortenPath } from "../shared/formatters.ts";
5
5
  import { formatNestedAggregate } from "../runs/shared/nested-render.ts";
@@ -223,7 +223,7 @@ export function formatNestedWidgetLines(children: NestedRunSummary[] | undefined
223
223
  return aggregate ? [theme.fg("dim", `↳ ${aggregate}`)] : [];
224
224
  }
225
225
  const lines: string[] = [];
226
- const maxDepth = 2;
226
+ const maxDepth = MAX_SUBAGENT_NESTING_DEPTH;
227
227
  const append = (items: NestedRunSummary[] | undefined, depth: number, prefix: string): void => {
228
228
  if (!items?.length || lines.length >= lineBudget) return;
229
229
  if (depth > maxDepth) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.2",
3
+ "version": "0.9.3-alpha.1",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.3-alpha.1] - 2026-06-25
10
+
11
+ ### Changed
12
+
13
+ - Revised the builtin `goal` worker/continuation prompts and the builtin `ralph` orchestrator prompts to emphasize implementing the requested task through full completion ("do not stop until the objective is complete") instead of preparing a partial implementation for incremental review.
14
+ - Removed model-visible current-iteration/turn/loop information from the builtin `goal`, `ralph`, and `open-claude-design` workflows so models are not biased by which iteration they are on. This drops the worker `Turn: N/M` banner, `Implement iteration N/M` / `Research iteration N/M` framing, "first iteration/worker turn" phrasing, and the live-preview `iteration N/M` label; switches model-relayed artifacts to stable non-ordinal names (`worker-receipt.md`, `review-<reviewer>.json`, `review-round-latest.json`, `orchestrator-report.md`); and strips turn fields from the model-facing goal ledger artifact. Internal UI stage names (e.g. `work-turn-2`, `orchestrator-2`) are unchanged, and the `max_turns`/`max_loops` inputs and `turns_completed`/`iterations_completed` outputs are retained.
15
+ - Raised workflow-stage subagent recursion to the shared five-level nesting budget so workflow stages match main-chat delegation depth.
16
+
17
+ ### Fixed
18
+
19
+ - Fixed the builtin `open-claude-design` continuation loop so generator stages fork only from prior generator sessions and user-feedback stages fork only from prior feedback sessions; the first feedback stage now starts its own chain instead of inheriting generator context.
20
+ - Fixed workflow config loading and user-global discovery to honor `ATOMIC_CODING_AGENT_DIR` isolation instead of reading `~/.atomic/agent` when an isolated agent dir is configured.
21
+
9
22
  ## [0.9.2] - 2026-06-23
10
23
 
11
24
  ### Changed
@@ -320,7 +320,7 @@ const decision = await ctx.stage("review-gate", { schema: Decision }).prompt(
320
320
 
321
321
  Atomic registers the canonical `structured_output` tool only for schema-enabled items and automatically adds it to explicit `tools` allowlists. The schema is used directly as the tool argument contract. A schema-backed `StageContext` supports one `prompt()` call because the final-answer tool is a single result contract; create another `ctx.stage(..., { schema })` for another structured prompt. If a turn completes without calling `structured_output`, or the tool call fails schema validation, Atomic sends up to three corrective follow-up prompts that include the exact contract/validation error before failing the item. `ctx.task`/`ctx.chain`/`ctx.parallel` results expose the captured value as `result.structured` and keep `result.text` as formatted JSON for handoffs.
322
322
 
323
- `subagent` is available as a default workflow-stage tool with the same default two-hop nesting budget as main chat: a stage can launch a subagent, and that child can launch one nested subagent before the guard blocks further delegation. `tools` allowlists apply to bundled extension tools as well as built-ins; if a stage sets `tools`, list every tool it should see. Workflow stages can explicitly list `subagent`, `web_search`, `fetch_content`, `intercom`, and other loaded extension tools, while `excludedTools` and `noTools: "all"` still win. Bundled `@bastani/subagents` agent definitions are available to the `subagent` tool in workflow stages, including workflows launched from a subagent child process.
323
+ `subagent` is available as a default workflow-stage tool with the same five-level nesting budget as main chat: a stage can launch recursively delegated subagents until the shared depth guard reaches five delegated levels, then deeper calls are blocked. `tools` allowlists apply to bundled extension tools as well as built-ins; if a stage sets `tools`, list every tool it should see. Workflow stages can explicitly list `subagent`, `web_search`, `fetch_content`, `intercom`, and other loaded extension tools, while `excludedTools` and `noTools: "all"` still win. Bundled `@bastani/subagents` agent definitions are available to the `subagent` tool in workflow stages, including workflows launched from a subagent child process.
324
324
 
325
325
  ### Model fallbacks
326
326
 
@@ -697,7 +697,7 @@ Child workflow outputs: `result`, `plan` (latest transformed research question),
697
697
 
698
698
  ### `open-claude-design`
699
699
 
700
- Combined discovery/init → design-system/reference research → curated reference discovery with user preference check → forked generate/user-feedback loop → export/handoff pipeline. The `discovery` stage asks for output type and references, then runs impeccable init in the same stage so PRODUCT.md/DESIGN.md are detected, created, or reconciled. `ds-*` stages handle user-provided URL/file reference extraction directly, then `reference-discovery` uses that context and asks which curated direction you prefer (or asks for a reference image/path/URL if none fit). Export is only `exporter` plus `final-display`.
700
+ Combined discovery/init → design-system/reference research → curated reference discovery with user preference check → separate forked generate and user-feedback chains → export/handoff pipeline. The `discovery` stage asks for output type and references, then runs impeccable init in the same stage so PRODUCT.md/DESIGN.md are detected, created, or reconciled. `ds-*` stages handle user-provided URL/file reference extraction directly, then `reference-discovery` uses that context and asks which curated direction you prefer (or asks for a reference image/path/URL if none fit). Export is only `exporter` plus `final-display`.
701
701
 
702
702
  ```text
703
703
  /workflow open-claude-design prompt="Design a kanban board component"
@@ -10,20 +10,25 @@ export function artifactSafeName(value: string): string {
10
10
  return safe.length > 0 ? safe : "artifact";
11
11
  }
12
12
 
13
+ function withoutTurn<T extends { readonly turn: number }>(value: T): Omit<T, "turn"> {
14
+ const copy = { ...value } as Omit<T, "turn"> & { turn?: number };
15
+ delete copy.turn;
16
+ return copy;
17
+ }
18
+
13
19
  export async function writeReviewArtifact(
14
20
  artifactDir: string,
15
- turn: number,
16
21
  reviewer: string,
17
22
  decision: ReviewDecision,
18
23
  rawText: string,
19
24
  ): Promise<string> {
20
25
  const artifactPath = join(
21
26
  artifactDir,
22
- `review-turn-${turn}-${artifactSafeName(reviewer)}.json`,
27
+ `review-${artifactSafeName(reviewer)}.json`,
23
28
  );
24
29
  await writeFile(
25
30
  artifactPath,
26
- `${JSON.stringify({ turn, reviewer, decision, raw_text: rawText }, null, 2)}\n`,
31
+ `${JSON.stringify({ reviewer, decision, raw_text: rawText }, null, 2)}\n`,
27
32
  { encoding: "utf8" },
28
33
  );
29
34
  return artifactPath;
@@ -31,11 +36,11 @@ export async function writeReviewArtifact(
31
36
 
32
37
  export async function writeReviewRoundArtifact(
33
38
  artifactDir: string,
34
- turn: number,
35
39
  reviews: readonly ReviewRecord[],
36
40
  ): Promise<string> {
37
- const artifactPath = join(artifactDir, `review-round-${turn}.json`);
38
- await writeFile(artifactPath, `${JSON.stringify({ turn, reviews }, null, 2)}\n`, {
41
+ const artifactPath = join(artifactDir, "review-round-latest.json");
42
+ const visibleReviews = reviews.map(withoutTurn);
43
+ await writeFile(artifactPath, `${JSON.stringify({ reviews: visibleReviews }, null, 2)}\n`, {
39
44
  encoding: "utf8",
40
45
  });
41
46
  return artifactPath;
@@ -4,6 +4,38 @@ import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  import { LEDGER_FILENAME, type GoalLedger, type GoalLifecycleEvent } from "./goal-types.js";
6
6
 
7
+ type ModelVisibleGoalLedger = Omit<
8
+ GoalLedger,
9
+ "turns" | "receipts" | "reviews" | "blockers" | "decisions" | "lifecycle"
10
+ > & {
11
+ readonly receipts: ReadonlyArray<Omit<GoalLedger["receipts"][number], "turn">>;
12
+ readonly reviews: ReadonlyArray<Omit<GoalLedger["reviews"][number], "turn">>;
13
+ readonly blockers: ReadonlyArray<Omit<GoalLedger["blockers"][number], "turn">>;
14
+ readonly decisions: ReadonlyArray<Omit<GoalLedger["decisions"][number], "turn">>;
15
+ readonly lifecycle: ReadonlyArray<Omit<GoalLedger["lifecycle"][number], "turn">>;
16
+ };
17
+
18
+ function withoutTurn<T extends { readonly turn: number }>(value: T): Omit<T, "turn"> {
19
+ const copy = { ...value } as Omit<T, "turn"> & { turn?: number };
20
+ delete copy.turn;
21
+ return copy;
22
+ }
23
+
24
+ function modelVisibleLedger(ledger: GoalLedger): ModelVisibleGoalLedger {
25
+ return {
26
+ goal_id: ledger.goal_id,
27
+ objective: ledger.objective,
28
+ status: ledger.status,
29
+ created_at: ledger.created_at,
30
+ updated_at: ledger.updated_at,
31
+ receipts: ledger.receipts.map(withoutTurn),
32
+ reviews: ledger.reviews.map(withoutTurn),
33
+ blockers: ledger.blockers.map(withoutTurn),
34
+ decisions: ledger.decisions.map(withoutTurn),
35
+ lifecycle: ledger.lifecycle.map(withoutTurn),
36
+ };
37
+ }
38
+
7
39
  export function appendLifecycleEvent(
8
40
  ledger: GoalLedger,
9
41
  event: GoalLifecycleEvent["event"],
@@ -48,7 +80,7 @@ export async function writeGoalLedger(
48
80
  ledger: GoalLedger,
49
81
  ): Promise<void> {
50
82
  ledger.updated_at = new Date().toISOString();
51
- await writeFile(ledgerPath, `${JSON.stringify(ledger, null, 2)}\n`, {
83
+ await writeFile(ledgerPath, `${JSON.stringify(modelVisibleLedger(ledger), null, 2)}\n`, {
52
84
  encoding: "utf8",
53
85
  });
54
86
  }