@bastani/atomic 0.9.14-alpha.6 → 0.9.15-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 (526) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +1 -1
  3. package/dist/builtin/intercom/package.json +2 -2
  4. package/dist/builtin/mcp/CHANGELOG.md +14 -0
  5. package/dist/builtin/mcp/package.json +4 -4
  6. package/dist/builtin/mcp/sampling-handler.ts +2 -2
  7. package/dist/builtin/mcp/types.ts +1 -1
  8. package/dist/builtin/subagents/CHANGELOG.md +42 -0
  9. package/dist/builtin/subagents/README.md +5 -22
  10. package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
  11. package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
  12. package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
  13. package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -2
  14. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
  15. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
  16. package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
  17. package/dist/builtin/subagents/agents/worker.md +2 -2
  18. package/dist/builtin/subagents/package.json +4 -4
  19. package/dist/builtin/subagents/skills/subagent/SKILL.md +6 -6
  20. package/dist/builtin/subagents/src/agents/agent-loaders.ts +0 -4
  21. package/dist/builtin/subagents/src/agents/agent-management-helpers.ts +1 -12
  22. package/dist/builtin/subagents/src/agents/agent-management.ts +0 -1
  23. package/dist/builtin/subagents/src/agents/agent-serializer.ts +7 -6
  24. package/dist/builtin/subagents/src/agents/agent-types.ts +0 -1
  25. package/dist/builtin/subagents/src/extension/schemas.ts +2 -2
  26. package/dist/builtin/subagents/src/extension/startup-maintenance.ts +2 -2
  27. package/dist/builtin/subagents/src/intercom/result-intercom.ts +0 -127
  28. package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +1 -3
  29. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +15 -106
  30. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +0 -3
  31. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +2 -13
  32. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +2 -12
  33. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +1 -20
  34. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +0 -6
  35. package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +10 -21
  36. package/dist/builtin/subagents/src/runs/inprocess/attempt-handles.ts +104 -0
  37. package/dist/builtin/subagents/src/runs/inprocess/index.ts +10 -21
  38. package/dist/builtin/subagents/src/runs/inprocess/prompt-behavior.ts +2 -3
  39. package/dist/builtin/subagents/src/runs/inprocess/runner.ts +11 -32
  40. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/temp-cleanup.ts +69 -0
  41. package/dist/builtin/subagents/src/shared/model-resolution.ts +1 -1
  42. package/dist/builtin/subagents/src/shared/types-config.ts +0 -4
  43. package/dist/builtin/subagents/src/shared/types-depth.ts +15 -103
  44. package/dist/builtin/subagents/src/shared/types-foreground-state.ts +56 -0
  45. package/dist/builtin/subagents/src/shared/types-results.ts +1 -59
  46. package/dist/builtin/subagents/src/shared/types-runtime.ts +0 -2
  47. package/dist/builtin/subagents/src/shared/types.ts +1 -1
  48. package/dist/builtin/subagents/src/shared/utils.ts +1 -1
  49. package/dist/builtin/subagents/src/slash/slash-live-state.ts +1 -1
  50. package/dist/builtin/web-access/CHANGELOG.md +16 -0
  51. package/dist/builtin/web-access/package.json +2 -2
  52. package/dist/builtin/web-access/summary-review.ts +2 -2
  53. package/dist/builtin/web-access/web-search-summary.ts +2 -2
  54. package/dist/builtin/workflows/CHANGELOG.md +84 -0
  55. package/dist/builtin/workflows/README.md +2 -2
  56. package/dist/builtin/workflows/package.json +2 -2
  57. package/dist/builtin/workflows/src/extension/index.bundle.mjs +60473 -401
  58. package/dist/builtin/workflows/src/extension/public-types.ts +1 -1
  59. package/dist/builtin/workflows/src/extension/wiring.ts +1 -1
  60. package/dist/builtin/workflows/src/extension/workflow-heartbeat-delivery.ts +48 -4
  61. package/dist/builtin/workflows/src/extension/workflow-tool.ts +1 -1
  62. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +5 -0
  63. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +35 -2
  64. package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +1 -1
  65. package/dist/builtin/workflows/src/runs/foreground/stage-runner-pause.ts +6 -0
  66. package/dist/builtin/workflows/src/tui/chat-surface-message.ts +15 -13
  67. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +25 -2
  68. package/dist/bun/cli.js +1 -1
  69. package/dist/bun/cli.js.map +1 -1
  70. package/dist/bun/register-bedrock.js +2 -2
  71. package/dist/bun/register-bedrock.js.map +1 -1
  72. package/dist/cli/auth-check.d.ts +1 -1
  73. package/dist/cli/auth-check.d.ts.map +1 -1
  74. package/dist/cli/auth-check.js +1 -1
  75. package/dist/cli/auth-check.js.map +1 -1
  76. package/dist/cli/credential-print.d.ts +1 -1
  77. package/dist/cli/credential-print.d.ts.map +1 -1
  78. package/dist/cli/credential-print.js +2 -2
  79. package/dist/cli/credential-print.js.map +1 -1
  80. package/dist/cli/file-processor.d.ts +1 -1
  81. package/dist/cli/file-processor.d.ts.map +1 -1
  82. package/dist/cli/file-processor.js.map +1 -1
  83. package/dist/cli/initial-message.d.ts +1 -1
  84. package/dist/cli/initial-message.d.ts.map +1 -1
  85. package/dist/cli/initial-message.js.map +1 -1
  86. package/dist/cli/list-models.js.map +1 -1
  87. package/dist/core/agent-session-auto-compaction.d.ts +1 -1
  88. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  89. package/dist/core/agent-session-auto-compaction.js +1 -1
  90. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  91. package/dist/core/agent-session-events.d.ts +1 -1
  92. package/dist/core/agent-session-events.d.ts.map +1 -1
  93. package/dist/core/agent-session-events.js +1 -1
  94. package/dist/core/agent-session-events.js.map +1 -1
  95. package/dist/core/agent-session-export.js.map +1 -1
  96. package/dist/core/agent-session-extension-bindings.js +1 -1
  97. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  98. package/dist/core/agent-session-message-queue.d.ts +1 -1
  99. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  100. package/dist/core/agent-session-message-queue.js.map +1 -1
  101. package/dist/core/agent-session-methods.d.ts +2 -2
  102. package/dist/core/agent-session-methods.d.ts.map +1 -1
  103. package/dist/core/agent-session-methods.js.map +1 -1
  104. package/dist/core/agent-session-models.d.ts +2 -2
  105. package/dist/core/agent-session-models.d.ts.map +1 -1
  106. package/dist/core/agent-session-models.js +2 -2
  107. package/dist/core/agent-session-models.js.map +1 -1
  108. package/dist/core/agent-session-prompt.d.ts +1 -1
  109. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  110. package/dist/core/agent-session-prompt.js.map +1 -1
  111. package/dist/core/agent-session-retry.d.ts +1 -1
  112. package/dist/core/agent-session-retry.d.ts.map +1 -1
  113. package/dist/core/agent-session-retry.js +1 -1
  114. package/dist/core/agent-session-retry.js.map +1 -1
  115. package/dist/core/agent-session-runtime-auth.js +1 -1
  116. package/dist/core/agent-session-runtime-auth.js.map +1 -1
  117. package/dist/core/agent-session-runtime.d.ts +1 -1
  118. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  119. package/dist/core/agent-session-runtime.js +1 -1
  120. package/dist/core/agent-session-runtime.js.map +1 -1
  121. package/dist/core/agent-session-services.d.ts +1 -1
  122. package/dist/core/agent-session-services.d.ts.map +1 -1
  123. package/dist/core/agent-session-services.js.map +1 -1
  124. package/dist/core/agent-session-state.d.ts +1 -1
  125. package/dist/core/agent-session-state.d.ts.map +1 -1
  126. package/dist/core/agent-session-state.js.map +1 -1
  127. package/dist/core/agent-session-tree.js.map +1 -1
  128. package/dist/core/agent-session-types.d.ts +1 -1
  129. package/dist/core/agent-session-types.d.ts.map +1 -1
  130. package/dist/core/agent-session-types.js.map +1 -1
  131. package/dist/core/agent-session.d.ts +1 -1
  132. package/dist/core/agent-session.d.ts.map +1 -1
  133. package/dist/core/agent-session.js.map +1 -1
  134. package/dist/core/anthropic-thinking-guard.d.ts +1 -1
  135. package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
  136. package/dist/core/anthropic-thinking-guard.js +1 -1
  137. package/dist/core/anthropic-thinking-guard.js.map +1 -1
  138. package/dist/core/auth-storage.d.ts +1 -1
  139. package/dist/core/auth-storage.d.ts.map +1 -1
  140. package/dist/core/auth-storage.js.map +1 -1
  141. package/dist/core/cache-stats.d.ts +1 -1
  142. package/dist/core/cache-stats.d.ts.map +1 -1
  143. package/dist/core/cache-stats.js.map +1 -1
  144. package/dist/core/cloudflare-gateway-binding.d.ts +1 -1
  145. package/dist/core/cloudflare-gateway-binding.d.ts.map +1 -1
  146. package/dist/core/cloudflare-gateway-binding.js +1 -1
  147. package/dist/core/cloudflare-gateway-binding.js.map +1 -1
  148. package/dist/core/codex-fast-mode.d.ts +2 -2
  149. package/dist/core/codex-fast-mode.d.ts.map +1 -1
  150. package/dist/core/codex-fast-mode.js +3 -2
  151. package/dist/core/codex-fast-mode.js.map +1 -1
  152. package/dist/core/compaction/branch-summarization.d.ts +2 -2
  153. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  154. package/dist/core/compaction/branch-summarization.js +2 -2
  155. package/dist/core/compaction/branch-summarization.js.map +1 -1
  156. package/dist/core/compaction/compaction-runner.d.ts +2 -2
  157. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  158. package/dist/core/compaction/compaction-runner.js.map +1 -1
  159. package/dist/core/compaction/compaction-types.d.ts +2 -2
  160. package/dist/core/compaction/compaction-types.d.ts.map +1 -1
  161. package/dist/core/compaction/compaction-types.js.map +1 -1
  162. package/dist/core/compaction/compaction.d.ts +1 -1
  163. package/dist/core/compaction/compaction.d.ts.map +1 -1
  164. package/dist/core/compaction/compaction.js.map +1 -1
  165. package/dist/core/compaction/fallback-planner.d.ts +1 -1
  166. package/dist/core/compaction/fallback-planner.d.ts.map +1 -1
  167. package/dist/core/compaction/fallback-planner.js.map +1 -1
  168. package/dist/core/compaction/planner-outcome.d.ts +1 -1
  169. package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
  170. package/dist/core/compaction/planner-outcome.js +1 -1
  171. package/dist/core/compaction/planner-outcome.js.map +1 -1
  172. package/dist/core/compaction/range-planner-diagnostics.d.ts +1 -1
  173. package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
  174. package/dist/core/compaction/range-planner-diagnostics.js +1 -1
  175. package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
  176. package/dist/core/compaction/range-planner.d.ts +2 -2
  177. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  178. package/dist/core/compaction/range-planner.js +2 -2
  179. package/dist/core/compaction/range-planner.js.map +1 -1
  180. package/dist/core/compaction/session-summarization.d.ts +2 -2
  181. package/dist/core/compaction/session-summarization.d.ts.map +1 -1
  182. package/dist/core/compaction/session-summarization.js +2 -2
  183. package/dist/core/compaction/session-summarization.js.map +1 -1
  184. package/dist/core/compaction/transcript-serialization.d.ts +1 -1
  185. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
  186. package/dist/core/compaction/transcript-serialization.js.map +1 -1
  187. package/dist/core/compaction/utils.d.ts +1 -1
  188. package/dist/core/compaction/utils.d.ts.map +1 -1
  189. package/dist/core/compaction/utils.js.map +1 -1
  190. package/dist/core/experimental.d.ts +1 -1
  191. package/dist/core/experimental.d.ts.map +1 -1
  192. package/dist/core/experimental.js.map +1 -1
  193. package/dist/core/export-html/tool-renderer.js.map +1 -1
  194. package/dist/core/extensions/agent-events.d.ts +2 -2
  195. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  196. package/dist/core/extensions/agent-events.js.map +1 -1
  197. package/dist/core/extensions/api-types.d.ts +2 -2
  198. package/dist/core/extensions/api-types.d.ts.map +1 -1
  199. package/dist/core/extensions/api-types.js.map +1 -1
  200. package/dist/core/extensions/context-types.d.ts +1 -7
  201. package/dist/core/extensions/context-types.d.ts.map +1 -1
  202. package/dist/core/extensions/context-types.js.map +1 -1
  203. package/dist/core/extensions/event-results.d.ts +1 -1
  204. package/dist/core/extensions/event-results.d.ts.map +1 -1
  205. package/dist/core/extensions/event-results.js.map +1 -1
  206. package/dist/core/extensions/index.d.ts +1 -1
  207. package/dist/core/extensions/index.d.ts.map +1 -1
  208. package/dist/core/extensions/index.js.map +1 -1
  209. package/dist/core/extensions/loader-api.js.map +1 -1
  210. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  211. package/dist/core/extensions/loader-virtual-modules.js +21 -9
  212. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  213. package/dist/core/extensions/provider-types.d.ts +2 -2
  214. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  215. package/dist/core/extensions/provider-types.js.map +1 -1
  216. package/dist/core/extensions/reactive-widget.d.ts +6 -0
  217. package/dist/core/extensions/reactive-widget.d.ts.map +1 -1
  218. package/dist/core/extensions/reactive-widget.js +62 -6
  219. package/dist/core/extensions/reactive-widget.js.map +1 -1
  220. package/dist/core/extensions/runner-context.d.ts +1 -1
  221. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  222. package/dist/core/extensions/runner-context.js.map +1 -1
  223. package/dist/core/extensions/runner-events.d.ts +1 -1
  224. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  225. package/dist/core/extensions/runner-events.js.map +1 -1
  226. package/dist/core/extensions/runner.d.ts +2 -2
  227. package/dist/core/extensions/runner.d.ts.map +1 -1
  228. package/dist/core/extensions/runner.js.map +1 -1
  229. package/dist/core/extensions/runtime-types.d.ts +2 -2
  230. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  231. package/dist/core/extensions/runtime-types.js.map +1 -1
  232. package/dist/core/extensions/tool-events.d.ts +1 -1
  233. package/dist/core/extensions/tool-events.d.ts.map +1 -1
  234. package/dist/core/extensions/tool-events.js.map +1 -1
  235. package/dist/core/extensions/tool-types.d.ts +2 -2
  236. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  237. package/dist/core/extensions/tool-types.js.map +1 -1
  238. package/dist/core/extensions/ui-types.d.ts +2 -0
  239. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  240. package/dist/core/extensions/ui-types.js.map +1 -1
  241. package/dist/core/fallback-models.d.ts +1 -1
  242. package/dist/core/fallback-models.d.ts.map +1 -1
  243. package/dist/core/fallback-models.js.map +1 -1
  244. package/dist/core/http-dispatcher.d.ts.map +1 -1
  245. package/dist/core/http-dispatcher.js +14 -0
  246. package/dist/core/http-dispatcher.js.map +1 -1
  247. package/dist/core/messages.d.ts +1 -1
  248. package/dist/core/messages.d.ts.map +1 -1
  249. package/dist/core/messages.js.map +1 -1
  250. package/dist/core/model-capabilities.d.ts +1 -1
  251. package/dist/core/model-capabilities.d.ts.map +1 -1
  252. package/dist/core/model-capabilities.js.map +1 -1
  253. package/dist/core/model-fallback-failures.d.ts.map +1 -1
  254. package/dist/core/model-fallback-failures.js +18 -1
  255. package/dist/core/model-fallback-failures.js.map +1 -1
  256. package/dist/core/model-registry.d.ts +1 -1
  257. package/dist/core/model-registry.d.ts.map +1 -1
  258. package/dist/core/model-registry.js.map +1 -1
  259. package/dist/core/model-resolver-cli.js.map +1 -1
  260. package/dist/core/model-resolver-defaults.d.ts +1 -1
  261. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  262. package/dist/core/model-resolver-defaults.js +1 -1
  263. package/dist/core/model-resolver-defaults.js.map +1 -1
  264. package/dist/core/model-resolver-initial.d.ts +1 -1
  265. package/dist/core/model-resolver-initial.d.ts.map +1 -1
  266. package/dist/core/model-resolver-initial.js.map +1 -1
  267. package/dist/core/model-resolver-patterns.d.ts +1 -1
  268. package/dist/core/model-resolver-patterns.d.ts.map +1 -1
  269. package/dist/core/model-resolver-patterns.js.map +1 -1
  270. package/dist/core/model-resolver-scope.d.ts +1 -1
  271. package/dist/core/model-resolver-scope.d.ts.map +1 -1
  272. package/dist/core/model-resolver-scope.js +1 -1
  273. package/dist/core/model-resolver-scope.js.map +1 -1
  274. package/dist/core/model-resolver-types.d.ts +1 -1
  275. package/dist/core/model-resolver-types.d.ts.map +1 -1
  276. package/dist/core/model-resolver-types.js.map +1 -1
  277. package/dist/core/model-runtime-auth.d.ts +1 -1
  278. package/dist/core/model-runtime-auth.d.ts.map +1 -1
  279. package/dist/core/model-runtime-auth.js.map +1 -1
  280. package/dist/core/model-runtime-providers.d.ts +2 -2
  281. package/dist/core/model-runtime-providers.d.ts.map +1 -1
  282. package/dist/core/model-runtime-providers.js +2 -2
  283. package/dist/core/model-runtime-providers.js.map +1 -1
  284. package/dist/core/model-runtime-restoration.d.ts +1 -1
  285. package/dist/core/model-runtime-restoration.d.ts.map +1 -1
  286. package/dist/core/model-runtime-restoration.js.map +1 -1
  287. package/dist/core/model-runtime-snapshot.d.ts +1 -1
  288. package/dist/core/model-runtime-snapshot.d.ts.map +1 -1
  289. package/dist/core/model-runtime-snapshot.js.map +1 -1
  290. package/dist/core/model-runtime-streaming.d.ts +1 -1
  291. package/dist/core/model-runtime-streaming.d.ts.map +1 -1
  292. package/dist/core/model-runtime-streaming.js +1 -1
  293. package/dist/core/model-runtime-streaming.js.map +1 -1
  294. package/dist/core/model-runtime-types.d.ts +1 -1
  295. package/dist/core/model-runtime-types.d.ts.map +1 -1
  296. package/dist/core/model-runtime-types.js.map +1 -1
  297. package/dist/core/model-runtime.d.ts +8 -1
  298. package/dist/core/model-runtime.d.ts.map +1 -1
  299. package/dist/core/model-runtime.js +15 -3
  300. package/dist/core/model-runtime.js.map +1 -1
  301. package/dist/core/models-store.d.ts +1 -1
  302. package/dist/core/models-store.d.ts.map +1 -1
  303. package/dist/core/models-store.js.map +1 -1
  304. package/dist/core/oauth-login.d.ts +1 -1
  305. package/dist/core/oauth-login.d.ts.map +1 -1
  306. package/dist/core/oauth-login.js.map +1 -1
  307. package/dist/core/oauth-provider-metadata.d.ts +1 -1
  308. package/dist/core/oauth-provider-metadata.d.ts.map +1 -1
  309. package/dist/core/oauth-provider-metadata.js.map +1 -1
  310. package/dist/core/openai-responses-payload-sanitizer.d.ts +1 -1
  311. package/dist/core/openai-responses-payload-sanitizer.d.ts.map +1 -1
  312. package/dist/core/openai-responses-payload-sanitizer.js.map +1 -1
  313. package/dist/core/provider-attribution.d.ts +1 -1
  314. package/dist/core/provider-attribution.d.ts.map +1 -1
  315. package/dist/core/provider-attribution.js.map +1 -1
  316. package/dist/core/provider-composer-internal.d.ts +1 -1
  317. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  318. package/dist/core/provider-composer-internal.js.map +1 -1
  319. package/dist/core/provider-composer.d.ts +1 -1
  320. package/dist/core/provider-composer.d.ts.map +1 -1
  321. package/dist/core/provider-composer.js +2 -2
  322. package/dist/core/provider-composer.js.map +1 -1
  323. package/dist/core/provider-context-usage.d.ts.map +1 -1
  324. package/dist/core/provider-context-usage.js.map +1 -1
  325. package/dist/core/remote-catalog-provider.d.ts +1 -1
  326. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  327. package/dist/core/remote-catalog-provider.js.map +1 -1
  328. package/dist/core/runtime-credentials.d.ts +1 -1
  329. package/dist/core/runtime-credentials.d.ts.map +1 -1
  330. package/dist/core/runtime-credentials.js.map +1 -1
  331. package/dist/core/sdk-types.d.ts +1 -1
  332. package/dist/core/sdk-types.d.ts.map +1 -1
  333. package/dist/core/sdk-types.js.map +1 -1
  334. package/dist/core/sdk.d.ts +1 -1
  335. package/dist/core/sdk.d.ts.map +1 -1
  336. package/dist/core/sdk.js +30 -6
  337. package/dist/core/sdk.js.map +1 -1
  338. package/dist/core/session-manager-core.d.ts +2 -2
  339. package/dist/core/session-manager-core.d.ts.map +1 -1
  340. package/dist/core/session-manager-core.js.map +1 -1
  341. package/dist/core/session-manager-entries.d.ts +1 -1
  342. package/dist/core/session-manager-entries.d.ts.map +1 -1
  343. package/dist/core/session-manager-entries.js.map +1 -1
  344. package/dist/core/session-manager-list.js.map +1 -1
  345. package/dist/core/session-manager-types.d.ts +1 -1
  346. package/dist/core/session-manager-types.d.ts.map +1 -1
  347. package/dist/core/session-manager-types.js.map +1 -1
  348. package/dist/core/session-manager-validation.js +1 -1
  349. package/dist/core/session-manager-validation.js.map +1 -1
  350. package/dist/core/settings-manager-basic-accessors.d.ts +1 -0
  351. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  352. package/dist/core/settings-manager-basic-accessors.js +11 -0
  353. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  354. package/dist/core/settings-types.d.ts +2 -1
  355. package/dist/core/settings-types.d.ts.map +1 -1
  356. package/dist/core/settings-types.js.map +1 -1
  357. package/dist/core/summarization-retry.d.ts +1 -1
  358. package/dist/core/summarization-retry.d.ts.map +1 -1
  359. package/dist/core/summarization-retry.js.map +1 -1
  360. package/dist/core/tools/bash-session-environment.d.ts +1 -1
  361. package/dist/core/tools/bash-session-environment.d.ts.map +1 -1
  362. package/dist/core/tools/bash-session-environment.js.map +1 -1
  363. package/dist/core/tools/oversized-tool-result.d.ts +1 -1
  364. package/dist/core/tools/oversized-tool-result.d.ts.map +1 -1
  365. package/dist/core/tools/oversized-tool-result.js.map +1 -1
  366. package/dist/core/tools/read-url.d.ts +1 -1
  367. package/dist/core/tools/read-url.d.ts.map +1 -1
  368. package/dist/core/tools/read-url.js.map +1 -1
  369. package/dist/core/tools/read.d.ts.map +1 -1
  370. package/dist/core/tools/read.js.map +1 -1
  371. package/dist/core/tools/render-utils.d.ts +1 -1
  372. package/dist/core/tools/render-utils.d.ts.map +1 -1
  373. package/dist/core/tools/render-utils.js.map +1 -1
  374. package/dist/core/tools/resource-selectors.d.ts +1 -1
  375. package/dist/core/tools/resource-selectors.d.ts.map +1 -1
  376. package/dist/core/tools/resource-selectors.js +2 -7
  377. package/dist/core/tools/resource-selectors.js.map +1 -1
  378. package/dist/core/typebox-compat.js +1 -1
  379. package/dist/core/typebox-compat.js.map +1 -1
  380. package/dist/core/usage-totals.d.ts +1 -1
  381. package/dist/core/usage-totals.d.ts.map +1 -1
  382. package/dist/core/usage-totals.js.map +1 -1
  383. package/dist/extensions/llama/provider.d.ts +1 -1
  384. package/dist/extensions/llama/provider.d.ts.map +1 -1
  385. package/dist/extensions/llama/provider.js +1 -1
  386. package/dist/extensions/llama/provider.js.map +1 -1
  387. package/dist/main-app-mode.d.ts +1 -1
  388. package/dist/main-app-mode.d.ts.map +1 -1
  389. package/dist/main-app-mode.js.map +1 -1
  390. package/dist/main-session-options.js +1 -1
  391. package/dist/main-session-options.js.map +1 -1
  392. package/dist/modes/interactive/components/assistant-message.d.ts +1 -1
  393. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  394. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  395. package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -1
  396. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  397. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  398. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  399. package/dist/modes/interactive/components/login-dialog.d.ts +1 -1
  400. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  401. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  402. package/dist/modes/interactive/components/model-selector.d.ts +1 -1
  403. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  404. package/dist/modes/interactive/components/model-selector.js +1 -1
  405. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  406. package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -1
  407. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  408. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  409. package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
  410. package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -1
  411. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  412. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  413. package/dist/modes/interactive/interactive-auth-routing.js +1 -1
  414. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  415. package/dist/modes/interactive/interactive-deferred-startup.js +1 -1
  416. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  417. package/dist/modes/interactive/interactive-extension-context.js +26 -0
  418. package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
  419. package/dist/modes/interactive/interactive-extension-runtime.js +7 -2
  420. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  421. package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
  422. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  423. package/dist/modes/interactive/interactive-mode-base.js +1 -0
  424. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  425. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  426. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  427. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  428. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  429. package/dist/modes/interactive/interactive-mode-helpers.js +1 -1
  430. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  431. package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -0
  432. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  433. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  434. package/dist/modes/interactive/model-catalog-refresh.d.ts +1 -1
  435. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  436. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  437. package/dist/modes/interactive/streaming-assistant-message.d.ts +1 -1
  438. package/dist/modes/interactive/streaming-assistant-message.d.ts.map +1 -1
  439. package/dist/modes/interactive/streaming-assistant-message.js.map +1 -1
  440. package/dist/modes/interactive-engine/engine-custom-ui.d.ts +3 -0
  441. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  442. package/dist/modes/interactive-engine/engine-custom-ui.js +26 -3
  443. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  444. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  445. package/dist/modes/interactive-engine/remote-component.d.ts +2 -1
  446. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  447. package/dist/modes/interactive-engine/remote-component.js +14 -0
  448. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  449. package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
  450. package/dist/modes/json-event.d.ts +1 -1
  451. package/dist/modes/json-event.d.ts.map +1 -1
  452. package/dist/modes/json-event.js.map +1 -1
  453. package/dist/modes/print-mode.d.ts +1 -1
  454. package/dist/modes/print-mode.d.ts.map +1 -1
  455. package/dist/modes/print-mode.js.map +1 -1
  456. package/dist/modes/rpc/rpc-client-api.d.ts +2 -2
  457. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  458. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  459. package/dist/modes/rpc/rpc-client.d.ts +1 -1
  460. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  461. package/dist/modes/rpc/rpc-client.js.map +1 -1
  462. package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
  463. package/dist/modes/rpc/rpc-extension-ui.js +4 -1
  464. package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
  465. package/dist/modes/rpc/rpc-provider-auth.d.ts +1 -1
  466. package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
  467. package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
  468. package/dist/modes/rpc/rpc-types.d.ts +2 -2
  469. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  470. package/dist/modes/rpc/rpc-types.js.map +1 -1
  471. package/dist/utils/tool-result-images.d.ts +1 -1
  472. package/dist/utils/tool-result-images.d.ts.map +1 -1
  473. package/dist/utils/tool-result-images.js.map +1 -1
  474. package/docs/custom-provider.md +11 -8
  475. package/docs/development.md +0 -2
  476. package/docs/extensions.md +2 -2
  477. package/docs/json.md +1 -1
  478. package/docs/models/artificial-analysis-index.md +2 -2
  479. package/docs/models/model-selection.md +8 -8
  480. package/docs/models/pareto-efficiency.md +10 -10
  481. package/docs/models.md +9 -3
  482. package/docs/packages.md +1 -1
  483. package/docs/providers.md +5 -3
  484. package/docs/quickstart.md +1 -1
  485. package/docs/rpc.md +1 -1
  486. package/docs/sdk.md +2 -2
  487. package/docs/session-format.md +2 -2
  488. package/docs/settings.md +2 -1
  489. package/docs/subagents.md +5 -6
  490. package/docs/tui.md +3 -0
  491. package/docs/workflows.md +3 -1
  492. package/examples/extensions/README.md +1 -1
  493. package/examples/extensions/custom-footer.ts +1 -1
  494. package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
  495. package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
  496. package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
  497. package/examples/extensions/handoff.ts +2 -2
  498. package/examples/extensions/hello.ts +1 -1
  499. package/examples/extensions/plan-mode/index.ts +1 -1
  500. package/examples/extensions/preset.ts +1 -1
  501. package/examples/extensions/qna.ts +1 -1
  502. package/examples/extensions/subagent/display.ts +1 -1
  503. package/examples/extensions/subagent/runner.ts +1 -1
  504. package/examples/extensions/subagent/types.ts +1 -1
  505. package/examples/extensions/summarize.ts +2 -2
  506. package/examples/extensions/tool-override.ts +1 -1
  507. package/examples/sdk/02-custom-model.ts +1 -1
  508. package/examples/sdk/12-full-control.ts +1 -1
  509. package/examples/sdk/README.md +1 -1
  510. package/npm-shrinkwrap.json +54 -31
  511. package/package.json +3 -3
  512. package/dist/builtin/subagents/src/extension/fanout-child.ts +0 -259
  513. package/dist/builtin/subagents/src/runs/inprocess/nested-routing.ts +0 -218
  514. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-api.ts +0 -55
  515. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-control.ts +0 -178
  516. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-core.ts +0 -187
  517. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-paths.ts +0 -57
  518. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-projection.ts +0 -42
  519. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-registry.ts +0 -352
  520. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-rendering.ts +0 -136
  521. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-sanitize.ts +0 -252
  522. package/dist/builtin/subagents/src/shared/types-nested.ts +0 -127
  523. package/dist/core/copilot-env-routing.d.ts +0 -36
  524. package/dist/core/copilot-env-routing.d.ts.map +0 -1
  525. package/dist/core/copilot-env-routing.js +0 -94
  526. package/dist/core/copilot-env-routing.js.map +0 -1
@@ -125,7 +125,6 @@ function formatAgentDetail(agent: AgentConfig): string {
125
125
  if (agent.output) lines.push(`Output: ${agent.output}`);
126
126
  if (agent.defaultReads?.length) lines.push(`Reads: ${agent.defaultReads.join(", ")}`);
127
127
  if (agent.defaultProgress) lines.push("Progress: true");
128
- if (agent.maxSubagentDepth !== undefined) lines.push(`Max subagent depth: ${agent.maxSubagentDepth}`);
129
128
  if (agent.systemPrompt.trim()) lines.push("", "System Prompt:", agent.systemPrompt);
130
129
  return lines.join("\n");
131
130
  }
@@ -23,10 +23,15 @@ export const KNOWN_FIELDS = new Set([
23
23
  "defaultReads",
24
24
  "defaultProgress",
25
25
  "interactive",
26
- "maxSubagentDepth",
27
26
  ]);
28
27
 
29
- const REMOVED_AGENT_FRONTMATTER_FIELDS = new Set<string>([`completion${"Guard"}`]);
28
+ /**
29
+ * Frontmatter keys whose feature is gone. They are neither preserved on load nor
30
+ * re-emitted on serialize, so an agent-management rewrite strips a stale key from
31
+ * the file. Each is spelled with a splice so the removed identifier never appears
32
+ * as contiguous source text.
33
+ */
34
+ const REMOVED_AGENT_FRONTMATTER_FIELDS = new Set<string>([`completion${"Guard"}`, `maxSubagent${"Depth"}`]);
30
35
 
31
36
  export function shouldPreserveAgentExtraField(key: string): boolean {
32
37
  return !KNOWN_FIELDS.has(key) && !REMOVED_AGENT_FRONTMATTER_FIELDS.has(key);
@@ -93,10 +98,6 @@ export function serializeAgent(config: AgentConfig): string {
93
98
 
94
99
  if (config.defaultProgress) lines.push("defaultProgress: true");
95
100
  if (config.interactive) lines.push("interactive: true");
96
- const maxSubagentDepth = config.maxSubagentDepth;
97
- if (typeof maxSubagentDepth === "number" && Number.isInteger(maxSubagentDepth) && maxSubagentDepth >= 0) {
98
- lines.push(`maxSubagentDepth: ${maxSubagentDepth}`);
99
- }
100
101
 
101
102
  if (config.extraFields) {
102
103
  for (const [key, value] of Object.entries(config.extraFields)) {
@@ -79,7 +79,6 @@ export interface AgentConfig {
79
79
  defaultReads?: string[];
80
80
  defaultProgress?: boolean;
81
81
  interactive?: boolean;
82
- maxSubagentDepth?: number;
83
82
  disabled?: boolean;
84
83
  extraFields?: Record<string, FrontmatterValue>;
85
84
  override?: BuiltinAgentOverrideInfo;
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { Type } from "typebox";
6
- import { MAX_PARALLEL_TASKS, MAX_SUBAGENT_NESTING_DEPTH, SUBAGENT_ACTIONS } from "../shared/types.js";
6
+ import { MAX_PARALLEL_TASKS, SUBAGENT_ACTIONS } from "../shared/types.js";
7
7
 
8
8
  const SkillOverride = Type.Unsafe({
9
9
  anyOf: [{ type: "array", items: { type: "string" } }, { type: "boolean" }, { type: "string" }],
@@ -146,7 +146,7 @@ export const SubagentParams = Type.Object(
146
146
  config: Type.Optional(
147
147
  Type.Unsafe({
148
148
  anyOf: [{ type: "object", additionalProperties: true }, { type: "string" }],
149
- description: `Agent 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}). String values must be valid JSON.`,
149
+ description: `Agent 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. String values must be valid JSON.`,
150
150
  }),
151
151
  ),
152
152
  tasks: Type.Optional(
@@ -1,6 +1,6 @@
1
1
  import * as path from "node:path";
2
2
  import type { ExtensionContext } from "@bastani/atomic";
3
- import { cleanupOldNestedRuntimeDirs } from "../runs/inprocess/runtime-support/nested-api.js";
3
+ import { cleanupOldSubagentRuntimeDirs } from "../runs/inprocess/runtime-support/temp-cleanup.js";
4
4
  import { cleanupAllArtifactDirs, cleanupOldArtifacts, getArtifactsDir } from "../shared/artifacts.js";
5
5
  import type { SubagentState } from "../shared/types.js";
6
6
 
@@ -105,7 +105,7 @@ export function createSubagentStartupMaintenance(
105
105
  return {
106
106
  scheduleStartupCleanup() {
107
107
  schedule(() => {
108
- swallowCleanup(() => cleanupOldNestedRuntimeDirs(options.artifactCleanupDays));
108
+ swallowCleanup(() => cleanupOldSubagentRuntimeDirs(options.artifactCleanupDays));
109
109
  scheduleDelayed(
110
110
  () => swallowCleanup(() => cleanupAllArtifactDirs(options.artifactCleanupDays, contextSessionsRoots)),
111
111
  STARTUP_ARTIFACT_SCAN_DELAY_MS,
@@ -3,9 +3,6 @@ import { isStaleExtensionContextError } from "@bastani/atomic";
3
3
  import {
4
4
  type Details,
5
5
  type IntercomEventBus,
6
- MAX_SUBAGENT_NESTING_DEPTH,
7
- type NestedRunSummary,
8
- type PublicNestedRunSummary,
9
6
  type SingleResult,
10
7
  SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT,
11
8
  SUBAGENT_RESULT_INTERCOM_EVENT,
@@ -63,128 +60,6 @@ function resolveGroupedStatus(children: SubagentResultIntercomChild[]): Subagent
63
60
  return "failed";
64
61
  }
65
62
 
66
- function compactNestedRun(run: NestedRunSummary | PublicNestedRunSummary, depth = 0): PublicNestedRunSummary {
67
- return {
68
- id: run.id,
69
- parentRunId: run.parentRunId,
70
- ...(run.parentStepIndex !== undefined ? { parentStepIndex: run.parentStepIndex } : {}),
71
- ...(run.parentAgent ? { parentAgent: run.parentAgent } : {}),
72
- depth: run.depth,
73
- path: run.path.slice(0, MAX_SUBAGENT_NESTING_DEPTH + 1).map((part) => ({
74
- runId: part.runId,
75
- ...(part.stepIndex !== undefined ? { stepIndex: part.stepIndex } : {}),
76
- ...(part.agent ? { agent: part.agent } : {}),
77
- })),
78
- ...(run.sessionId ? { sessionId: run.sessionId } : {}),
79
- ...(run.sessionFile ? { sessionFile: run.sessionFile } : {}),
80
- ...(run.intercomTarget ? { intercomTarget: run.intercomTarget } : {}),
81
- ...(run.ownerIntercomTarget ? { ownerIntercomTarget: run.ownerIntercomTarget } : {}),
82
- ...(run.leafIntercomTarget ? { leafIntercomTarget: run.leafIntercomTarget } : {}),
83
- ...(run.ownerState ? { ownerState: run.ownerState } : {}),
84
- ...(run.mode ? { mode: run.mode } : {}),
85
- state: run.state,
86
- ...(run.agent ? { agent: run.agent } : {}),
87
- ...(run.agents?.length ? { agents: run.agents.slice(0, 12) } : {}),
88
- ...(run.activityState ? { activityState: run.activityState } : {}),
89
- ...(run.lastActivityAt !== undefined ? { lastActivityAt: run.lastActivityAt } : {}),
90
- ...(run.currentTool ? { currentTool: run.currentTool } : {}),
91
- ...(run.currentToolStartedAt !== undefined ? { currentToolStartedAt: run.currentToolStartedAt } : {}),
92
- ...(run.currentPath ? { currentPath: run.currentPath } : {}),
93
- ...(run.turnCount !== undefined ? { turnCount: run.turnCount } : {}),
94
- ...(run.toolCount !== undefined ? { toolCount: run.toolCount } : {}),
95
- ...(run.totalTokens ? { totalTokens: run.totalTokens } : {}),
96
- ...(run.startedAt !== undefined ? { startedAt: run.startedAt } : {}),
97
- ...(run.endedAt !== undefined ? { endedAt: run.endedAt } : {}),
98
- ...(run.lastUpdate !== undefined ? { lastUpdate: run.lastUpdate } : {}),
99
- ...(run.error ? { error: run.error } : {}),
100
- ...(run.steps?.length
101
- ? {
102
- steps: run.steps.slice(0, 12).map((step) => ({
103
- agent: step.agent,
104
- status: step.status,
105
- ...(step.sessionFile ? { sessionFile: step.sessionFile } : {}),
106
- ...(step.activityState ? { activityState: step.activityState } : {}),
107
- ...(step.lastActivityAt !== undefined ? { lastActivityAt: step.lastActivityAt } : {}),
108
- ...(step.currentTool ? { currentTool: step.currentTool } : {}),
109
- ...(step.currentToolStartedAt !== undefined
110
- ? { currentToolStartedAt: step.currentToolStartedAt }
111
- : {}),
112
- ...(step.currentPath ? { currentPath: step.currentPath } : {}),
113
- ...(step.turnCount !== undefined ? { turnCount: step.turnCount } : {}),
114
- ...(step.toolCount !== undefined ? { toolCount: step.toolCount } : {}),
115
- ...(step.startedAt !== undefined ? { startedAt: step.startedAt } : {}),
116
- ...(step.endedAt !== undefined ? { endedAt: step.endedAt } : {}),
117
- ...(step.error ? { error: step.error } : {}),
118
- ...(depth < MAX_SUBAGENT_NESTING_DEPTH && step.children?.length
119
- ? { children: step.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) }
120
- : {}),
121
- })),
122
- }
123
- : {}),
124
- ...(depth < MAX_SUBAGENT_NESTING_DEPTH && run.children?.length
125
- ? { children: run.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) }
126
- : {}),
127
- };
128
- }
129
-
130
- export function compactNestedResultChildren(
131
- children: Array<NestedRunSummary | PublicNestedRunSummary> | undefined,
132
- ): PublicNestedRunSummary[] | undefined {
133
- if (!children?.length) return undefined;
134
- return children.slice(0, 16).map((child) => compactNestedRun(child));
135
- }
136
-
137
- export function attachNestedChildrenToResultChildren(
138
- runId: string,
139
- children: SubagentResultIntercomChild[],
140
- nestedChildren: NestedRunSummary[] | undefined,
141
- ): SubagentResultIntercomChild[] {
142
- const compact = compactNestedResultChildren(nestedChildren);
143
- if (!compact?.length)
144
- return children.map((child) => ({ ...child, children: compactNestedResultChildren(child.children) }));
145
- return children.map((child, index) => {
146
- const childIndex = child.index ?? index;
147
- const alreadyAttachedIds = new Set(child.children?.map((nested) => nested.id) ?? []);
148
- const attached = compact.filter(
149
- (nested) =>
150
- nested.parentRunId === runId && nested.parentStepIndex === childIndex && !alreadyAttachedIds.has(nested.id),
151
- );
152
- const fallbackAttached =
153
- children.length === 1
154
- ? compact.filter(
155
- (nested) =>
156
- nested.parentRunId === runId &&
157
- nested.parentStepIndex === undefined &&
158
- !alreadyAttachedIds.has(nested.id),
159
- )
160
- : [];
161
- const merged = compactNestedResultChildren([...(child.children ?? []), ...attached, ...fallbackAttached]);
162
- return merged?.length ? { ...child, children: merged } : { ...child, children: undefined };
163
- });
164
- }
165
-
166
- function formatNestedResultLines(children: PublicNestedRunSummary[] | undefined): string[] {
167
- if (!children?.length) return [];
168
- const lines = ["Nested subagents:"];
169
- let remaining = 10;
170
- const append = (runs: PublicNestedRunSummary[] | undefined, indent: string): void => {
171
- for (const run of runs ?? []) {
172
- if (remaining <= 0) {
173
- lines.push(`${indent}↳ +more nested runs; inspect status for full tree`);
174
- return;
175
- }
176
- remaining--;
177
- const label = run.agent ?? run.agents?.join("+") ?? run.id;
178
- lines.push(`${indent}↳ ${label} — ${run.state} [${run.id}]`);
179
- if (run.sessionFile) lines.push(`${indent} Session: ${run.sessionFile}`);
180
- append(run.children, `${indent} `);
181
- for (const step of run.steps ?? []) append(step.children, `${indent} `);
182
- }
183
- };
184
- append(children, "");
185
- return lines;
186
- }
187
-
188
63
  export interface GroupedResultIntercomMessageInput {
189
64
  to: string;
190
65
  runId: string;
@@ -220,7 +95,6 @@ function formatSubagentResultIntercomMessage(input: {
220
95
  if (child.intercomTarget) lines.push(`Run intercom target: ${child.intercomTarget}`);
221
96
  if (child.artifactPath) lines.push(`Output artifact: ${child.artifactPath}`);
222
97
  if (child.sessionPath) lines.push(`Session: ${child.sessionPath}`);
223
- lines.push(...formatNestedResultLines(child.children));
224
98
  lines.push("Summary:", child.summary);
225
99
  }
226
100
 
@@ -233,7 +107,6 @@ export function buildSubagentResultIntercomPayload(
233
107
  const children = input.children.map((child) => ({
234
108
  ...child,
235
109
  summary: child.summary.trim() || "(no output)",
236
- children: compactNestedResultChildren(child.children),
237
110
  }));
238
111
  const status = resolveGroupedStatus(children);
239
112
  const summary = formatStatusCounts(countStatuses(children));
@@ -56,7 +56,6 @@ function workflowOrchestrationContext(options: RunSyncOptions): ParentContext["o
56
56
  workflowStageName: workflow.stageName,
57
57
  constraints: {
58
58
  disableWorkflowTool: true,
59
- maxSubagentDepth: options.maxSubagentDepth ?? 5,
60
59
  },
61
60
  ...(options.intercomGroup ? { intercomGroup: options.intercomGroup } : {}),
62
61
  };
@@ -263,7 +262,6 @@ export async function runSingleInProcess(
263
262
  cwd,
264
263
  testSession: testSession,
265
264
  sessionFile: options.sessionFile,
266
- ...(options.maxSubagentDepth === undefined ? {} : { maxSubagentDepth: options.maxSubagentDepth }),
267
265
  tools: agent.tools,
268
266
  mcpDirectTools: agent.mcpDirectTools,
269
267
  skills: options.skills ?? agent.skills,
@@ -351,7 +349,7 @@ export async function runSingleInProcess(
351
349
  lastActivityAt: Date.now(),
352
350
  });
353
351
  }
354
- control.registerNestedAttempt(options.runId, running, {
352
+ control.registerAttempt(options.runId, running, {
355
353
  model: resolvedCandidate?.model,
356
354
  modelId: candidate,
357
355
  thinkingLevel: spec.thinkingLevel,
@@ -7,7 +7,6 @@ import {
7
7
  applyIntercomBridgeToAgent,
8
8
  resolveIntercomBridge,
9
9
  resolveIntercomSessionTarget,
10
- resolveSubagentIntercomTarget,
11
10
  } from "../../intercom/intercom-bridge.js";
12
11
  import { getArtifactsDir } from "../../shared/artifacts.js";
13
12
  import { createForkContextResolver } from "../../shared/fork-context.js";
@@ -15,19 +14,13 @@ import { resolveCurrentSessionId } from "../../shared/session-identity.js";
15
14
  import { buildReadInstruction } from "../../shared/settings.js";
16
15
  import {
17
16
  type ArtifactConfig,
18
- checkSubagentDepth,
19
17
  DEFAULT_ARTIFACT_CONFIG,
20
- resolveSubagentDepthPolicy,
18
+ getCurrentSubagentDepth,
19
+ isSubagentChildSession,
20
+ SUBAGENT_CHILD_DELEGATION_BLOCKED_MESSAGE,
21
+ type SubagentRunMode,
21
22
  type SubagentToolResult,
22
- subagentDepthBlockedMessage,
23
23
  } from "../../shared/types.js";
24
-
25
- import {
26
- createNestedRoute,
27
- resolveInheritedNestedRouteFromEnv,
28
- resolveNestedParentAddressFromEnv,
29
- writeNestedEvent,
30
- } from "../inprocess/runtime-support/nested-api.js";
31
24
  import { resolveControlConfig } from "../shared/subagent-control.js";
32
25
  import {
33
26
  applyAgentDefaultContext,
@@ -43,23 +36,19 @@ import type {
43
36
  SubagentParamsLike,
44
37
  } from "./subagent-executor-types.js";
45
38
 
46
- export function checkDepthForExecution(
47
- ctx: ExtensionContext,
48
- deps: ResolvedExecutorDeps,
39
+ /**
40
+ * Delegation is one level deep and not configurable: a session that was itself
41
+ * admitted as a subagent child may never call the subagent tool.
42
+ */
43
+ export function refuseSubagentChildDelegation(
44
+ ctx: Pick<ExtensionContext, "subagentPolicy">,
45
+ mode: SubagentRunMode | "management",
49
46
  ): SubagentToolResult | undefined {
50
- const depthPolicy = resolveSubagentDepthPolicy(ctx, deps.config.maxSubagentDepth);
51
- const { blocked, depth, maxDepth } = checkSubagentDepth(ctx, depthPolicy.maxSubagentDepth);
52
- const workflowStageSubagentGuard = depthPolicy.workflowStageSubagentGuard;
53
- if (!blocked) return undefined;
47
+ if (!isSubagentChildSession(ctx)) return undefined;
54
48
  return {
55
- content: [
56
- {
57
- type: "text",
58
- text: subagentDepthBlockedMessage(depth, maxDepth, { workflowStageGuard: workflowStageSubagentGuard }),
59
- },
60
- ],
49
+ content: [{ type: "text", text: SUBAGENT_CHILD_DELEGATION_BLOCKED_MESSAGE }],
61
50
  isError: true,
62
- details: { mode: "single" as const, results: [] },
51
+ details: { mode, results: [] },
63
52
  };
64
53
  }
65
54
 
@@ -71,8 +60,7 @@ export function prepareExecutionContext(input: {
71
60
  deps: ResolvedExecutorDeps;
72
61
  }): ExecutionContextBuildResult {
73
62
  const { params, ctx, signal, onUpdate, deps } = input;
74
- const depthPolicy = resolveSubagentDepthPolicy(ctx, deps.config.maxSubagentDepth);
75
- const { depth } = checkSubagentDepth(ctx, depthPolicy.maxSubagentDepth);
63
+ const depth = getCurrentSubagentDepth(ctx);
76
64
  const normalized = normalizeRepeatedParallelCounts(params);
77
65
  if (normalized.error) return { error: normalized.error };
78
66
  const normalizedParams = normalized.params!;
@@ -96,9 +84,6 @@ export function prepareExecutionContext(input: {
96
84
  ? discoveredAgents.map((agent) => applyIntercomBridgeToAgent(agent, intercomBridge))
97
85
  : discoveredAgents;
98
86
  const runId = randomUUID().slice(0, 8);
99
- const inheritedNestedRoute = resolveInheritedNestedRouteFromEnv();
100
- const nestedParentAddress = inheritedNestedRoute ? resolveNestedParentAddressFromEnv() : undefined;
101
- const nestedRoute = inheritedNestedRoute ?? createNestedRoute(runId);
102
87
  const shareEnabled = effectiveParams.share === true;
103
88
  const hasTasks = (effectiveParams.tasks?.length ?? 0) > 0;
104
89
  const hasSingle = !hasTasks && Boolean(effectiveParams.agent);
@@ -169,7 +154,6 @@ export function prepareExecutionContext(input: {
169
154
  parentDepth: depth,
170
155
  controlConfig,
171
156
  intercomBridge,
172
- nestedRoute,
173
157
  };
174
158
 
175
159
  const foregroundMode: "single" | "parallel" = hasTasks ? "parallel" : "single";
@@ -178,85 +162,11 @@ export function prepareExecutionContext(input: {
178
162
  mode: foregroundMode,
179
163
  startedAt: Date.now(),
180
164
  updatedAt: Date.now(),
181
- nestedRoute,
182
165
  interrupt: undefined,
183
166
  };
184
167
  deps.state.foregroundControls.set(runId, foregroundControl);
185
168
  deps.state.lastForegroundControlId = runId;
186
169
 
187
- const writeNestedForegroundEvent = (
188
- type: "subagent.nested.started" | "subagent.nested.completed",
189
- result?: SubagentToolResult,
190
- ): void => {
191
- if (!inheritedNestedRoute || !nestedParentAddress) return;
192
- const now = Date.now();
193
- const details = result?.details;
194
- const state =
195
- type === "subagent.nested.started"
196
- ? "running"
197
- : result?.isError || details?.results.some((child) => child.status === "error")
198
- ? "failed"
199
- : details?.results.some((child) => child.interrupted || child.status === "interrupted")
200
- ? "paused"
201
- : "complete";
202
- const errorText = result?.isError ? result.content.find((item) => item.type === "text")?.text : undefined;
203
- const agentsForSummary =
204
- hasTasks && effectiveParams.tasks
205
- ? effectiveParams.tasks.map((task) => task.agent)
206
- : effectiveParams.agent
207
- ? [effectiveParams.agent]
208
- : [];
209
- const leafIntercomTarget =
210
- intercomBridge.active && agentsForSummary[0]
211
- ? resolveSubagentIntercomTarget(runId, agentsForSummary[0], 0)
212
- : undefined;
213
- try {
214
- writeNestedEvent(inheritedNestedRoute, {
215
- type,
216
- ts: now,
217
- parentRunId: nestedParentAddress.parentRunId,
218
- parentStepIndex: nestedParentAddress.parentStepIndex,
219
- child: {
220
- id: runId,
221
- parentRunId: nestedParentAddress.parentRunId,
222
- parentStepIndex: nestedParentAddress.parentStepIndex,
223
- depth: nestedParentAddress.depth,
224
- path: nestedParentAddress.path,
225
- ownerIntercomTarget:
226
- ctx.subagentPolicy?.intercom?.sessionName ?? ctx.subagentPolicy?.intercom?.orchestratorTarget,
227
- leafIntercomTarget,
228
- intercomTarget: leafIntercomTarget,
229
- ownerState: state === "running" ? "live" : "gone",
230
- mode: foregroundMode,
231
- state,
232
- agent: agentsForSummary[0],
233
- agents: agentsForSummary,
234
- startedAt: foregroundControl?.startedAt ?? now,
235
- ...(state !== "running" ? { endedAt: now } : {}),
236
- lastUpdate: now,
237
- ...(errorText ? { error: errorText } : {}),
238
- ...(details?.results.length
239
- ? {
240
- steps: details.results.map((child) => ({
241
- agent: child.agent,
242
- status:
243
- child.interrupted || child.status === "interrupted"
244
- ? "paused"
245
- : child.status === "ok"
246
- ? "complete"
247
- : "failed",
248
- ...(child.sessionFile ? { sessionFile: child.sessionFile } : {}),
249
- ...(child.error ? { error: child.error } : {}),
250
- })),
251
- }
252
- : {}),
253
- },
254
- });
255
- } catch (error) {
256
- console.error("Failed to emit nested foreground status event:", error);
257
- }
258
- };
259
-
260
170
  return {
261
171
  prepared: {
262
172
  effectiveParams,
@@ -267,7 +177,6 @@ export function prepareExecutionContext(input: {
267
177
  foregroundMode,
268
178
  execData,
269
179
  foregroundControl,
270
- writeNestedForegroundEvent,
271
180
  },
272
181
  };
273
182
  }
@@ -38,7 +38,6 @@ interface ForegroundParallelRunInput {
38
38
  artifactsDir: string;
39
39
  maxOutput?: MaxOutputConfig;
40
40
  paramsCwd: string;
41
- maxSubagentDepths: number[];
42
41
  parentDepth?: number;
43
42
  workflowStageSubagentGuard?: boolean;
44
43
  availableModels: ModelInfo[];
@@ -126,7 +125,6 @@ export async function runForegroundParallelTasks(input: ForegroundParallelRunInp
126
125
  maxOutput: input.maxOutput,
127
126
  outputPath,
128
127
  outputMode: behavior?.outputMode,
129
- maxSubagentDepth: input.maxSubagentDepths[index],
130
128
  parentDepth: input.parentDepth,
131
129
  workflowStageSubagentGuard: input.workflowStageSubagentGuard,
132
130
  workflowSessionMetadata: workflowSessionMetadataFromContext(input.ctx),
@@ -142,7 +140,6 @@ export async function runForegroundParallelTasks(input: ForegroundParallelRunInp
142
140
  onDetachedExit: (result) => input.onDetachedExit?.(index, result),
143
141
  intercomDetachSignal: intercomDetachController.signal,
144
142
  onIntercomDetachCommit: () => intercomDetachController.abort(),
145
- nestedRoute: input.foregroundControl?.nestedRoute,
146
143
  modelOverride: input.modelOverrides[index],
147
144
  availableModels: input.availableModels,
148
145
  knownModelProviders: input.knownModelProviders,
@@ -12,8 +12,7 @@ import {
12
12
  import {
13
13
  type AgentProgress,
14
14
  type ArtifactPaths,
15
- resolveChildMaxSubagentDepth,
16
- resolveSubagentDepthPolicy,
15
+ isWorkflowStageOrchestrationContext,
17
16
  resolveTopLevelParallelConcurrency,
18
17
  resolveTopLevelParallelMaxTasks,
19
18
  type SingleResult,
@@ -21,7 +20,6 @@ import {
21
20
  wrapForkTask,
22
21
  } from "../../shared/types.js";
23
22
  import { compactForegroundDetails, getSingleResultOutput } from "../../shared/utils.js";
24
- import { updateForegroundNestedProjection } from "../inprocess/runtime-support/nested-api.js";
25
23
  import { sharedAutoGroupForSet } from "../shared/intercom-group.js";
26
24
  import { resolveModelCandidate } from "../shared/model-fallback.js";
27
25
  import { aggregateParallelOutputs } from "../shared/parallel-utils.js";
@@ -97,12 +95,7 @@ export async function runParallelPath(
97
95
  agentConfigs.push(config);
98
96
  }
99
97
 
100
- const depthPolicy = resolveSubagentDepthPolicy(ctx, deps.config.maxSubagentDepth);
101
- const currentMaxSubagentDepth = depthPolicy.maxSubagentDepth;
102
- const workflowStageSubagentGuard = depthPolicy.workflowStageSubagentGuard;
103
- const maxSubagentDepths = agentConfigs.map((config) =>
104
- resolveChildMaxSubagentDepth(currentMaxSubagentDepth, config.maxSubagentDepth),
105
- );
98
+ const workflowStageSubagentGuard = isWorkflowStageOrchestrationContext(ctx);
106
99
 
107
100
  if (params.worktree) {
108
101
  const worktreeTaskCwdError = buildParallelWorktreeTaskCwdError(tasks, effectiveCwd);
@@ -227,7 +220,6 @@ export async function runParallelPath(
227
220
  sharedAutoIntercomGroup: sharedAutoGroupForSet(params.group, tasks),
228
221
  foregroundControl,
229
222
  concurrencyLimit: parallelConcurrency,
230
- maxSubagentDepths,
231
223
  parentDepth: data.parentDepth,
232
224
  liveResults,
233
225
  liveProgress,
@@ -258,7 +250,6 @@ export async function runParallelPath(
258
250
  mode: "parallel",
259
251
  cwd: effectiveCwd,
260
252
  results: details.results,
261
- maxSubagentDepths,
262
253
  });
263
254
  if (interrupted) {
264
255
  return {
@@ -288,14 +279,12 @@ export async function runParallelPath(
288
279
  };
289
280
  }
290
281
 
291
- if (foregroundControl) updateForegroundNestedProjection(foregroundControl);
292
282
  const intercomReceipt = await maybeBuildForegroundIntercomReceipt({
293
283
  pi: deps.pi,
294
284
  intercomBridge: data.intercomBridge,
295
285
  runId,
296
286
  mode: "parallel",
297
287
  details,
298
- ...(foregroundControl?.nestedChildren?.length ? { nestedChildren: foregroundControl.nestedChildren } : {}),
299
288
  });
300
289
  if (intercomReceipt) {
301
290
  return {
@@ -12,15 +12,13 @@ import {
12
12
  import {
13
13
  type AgentProgress,
14
14
  type ArtifactPaths,
15
- resolveChildMaxSubagentDepth,
16
- resolveSubagentDepthPolicy,
15
+ isWorkflowStageOrchestrationContext,
17
16
  type SingleResult,
18
17
  type SubagentToolResult,
19
18
  workflowSessionMetadataFromContext,
20
19
  wrapForkTask,
21
20
  } from "../../shared/types.js";
22
21
  import { compactForegroundDetails, getSingleResultOutput } from "../../shared/utils.js";
23
- import { updateForegroundNestedProjection } from "../inprocess/runtime-support/nested-api.js";
24
22
  import { inheritedIntercomGroup, resolveChildIntercomGroup } from "../shared/intercom-group.js";
25
23
  import { currentModelFullId, resolveModelCandidate } from "../shared/model-fallback.js";
26
24
  import { recordRun } from "../shared/run-history.js";
@@ -135,10 +133,7 @@ export async function runSinglePath(
135
133
  const rawOutput = params.output !== undefined ? params.output : agentConfig.output;
136
134
  const effectiveOutput = normalizeSingleOutputOverride(rawOutput, agentConfig.output);
137
135
  const effectiveOutputMode = params.outputMode ?? "inline";
138
- const depthPolicy = resolveSubagentDepthPolicy(ctx, deps.config.maxSubagentDepth);
139
- const currentMaxSubagentDepth = depthPolicy.maxSubagentDepth;
140
- const workflowStageSubagentGuard = depthPolicy.workflowStageSubagentGuard;
141
- const maxSubagentDepth = resolveChildMaxSubagentDepth(currentMaxSubagentDepth, agentConfig.maxSubagentDepth);
136
+ const workflowStageSubagentGuard = isWorkflowStageOrchestrationContext(ctx);
142
137
  const progress = resolveSingleProgress(agentConfig, params.progress, task);
143
138
 
144
139
  if (params.context === "fork") {
@@ -204,7 +199,6 @@ export async function runSinglePath(
204
199
  maxOutput: params.maxOutput,
205
200
  outputPath,
206
201
  outputMode: effectiveOutputMode,
207
- maxSubagentDepth,
208
202
  parentDepth: data.parentDepth,
209
203
  workflowStageSubagentGuard,
210
204
  workflowSessionMetadata: workflowSessionMetadataFromContext(ctx),
@@ -214,7 +208,6 @@ export async function runSinglePath(
214
208
  intercomSessionName: childIntercomTarget,
215
209
  orchestratorIntercomTarget: data.intercomBridge.active ? data.intercomBridge.orchestratorTarget : undefined,
216
210
  intercomGroup: resolveChildIntercomGroup(params.group, inheritedIntercomGroup(ctx), undefined),
217
- nestedRoute: foregroundControl?.nestedRoute,
218
211
  onDetachedExit: (result) => {
219
212
  cleanupTransientProgress(progressDir, artifactConfig.enabled);
220
213
  if (result) {
@@ -279,18 +272,15 @@ export async function runSinglePath(
279
272
  mode: "single",
280
273
  cwd: effectiveCwd,
281
274
  results: details.results,
282
- maxSubagentDepths: [maxSubagentDepth],
283
275
  });
284
276
 
285
277
  if (!r.detached && !r.interrupted) {
286
- if (foregroundControl) updateForegroundNestedProjection(foregroundControl);
287
278
  const intercomReceipt = await maybeBuildForegroundIntercomReceipt({
288
279
  pi: deps.pi,
289
280
  intercomBridge: data.intercomBridge,
290
281
  runId,
291
282
  mode: "single",
292
283
  details,
293
- ...(foregroundControl?.nestedChildren?.length ? { nestedChildren: foregroundControl.nestedChildren } : {}),
294
284
  });
295
285
  if (intercomReceipt) {
296
286
  return {