@elizaos/plugin-agent-orchestrator 2.0.0-beta.1 → 2.0.3-beta.3

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 (268) hide show
  1. package/CHANGELOG.md +6 -8
  2. package/README.md +102 -30
  3. package/dist/cjs/index.node.cjs +17539 -17068
  4. package/dist/cjs/index.node.js.map +71 -61
  5. package/dist/node/index.node.js +17545 -17070
  6. package/dist/node/index.node.js.map +71 -61
  7. package/dist/node/src/actions/common.d.ts +62 -4
  8. package/dist/node/src/actions/common.d.ts.map +1 -1
  9. package/dist/node/src/actions/elizaos-capability.d.ts +3 -0
  10. package/dist/node/src/actions/elizaos-capability.d.ts.map +1 -0
  11. package/dist/node/src/actions/sandbox-stub.d.ts +9 -5
  12. package/dist/node/src/actions/sandbox-stub.d.ts.map +1 -1
  13. package/dist/node/src/actions/tasks.d.ts +22 -2
  14. package/dist/node/src/actions/tasks.d.ts.map +1 -1
  15. package/dist/node/src/api/agent-routes.d.ts +1 -1
  16. package/dist/node/src/api/agent-routes.d.ts.map +1 -1
  17. package/dist/node/src/api/bridge-routes.d.ts +57 -19
  18. package/dist/node/src/api/bridge-routes.d.ts.map +1 -1
  19. package/dist/node/src/api/credential-prompt.d.ts +38 -0
  20. package/dist/node/src/api/credential-prompt.d.ts.map +1 -0
  21. package/dist/node/src/api/orchestrator-routes.d.ts +25 -0
  22. package/dist/node/src/api/orchestrator-routes.d.ts.map +1 -0
  23. package/dist/node/src/api/parent-context-routes.d.ts.map +1 -1
  24. package/dist/node/src/api/route-utils.d.ts +23 -7
  25. package/dist/node/src/api/route-utils.d.ts.map +1 -1
  26. package/dist/node/src/api/routes.d.ts +1 -2
  27. package/dist/node/src/api/routes.d.ts.map +1 -1
  28. package/dist/node/src/evaluators/sub-agent-completion.d.ts +3 -0
  29. package/dist/node/src/evaluators/sub-agent-completion.d.ts.map +1 -0
  30. package/dist/node/src/index.d.ts +33 -8
  31. package/dist/node/src/index.d.ts.map +1 -1
  32. package/dist/node/src/providers/action-examples.d.ts.map +1 -1
  33. package/dist/node/src/providers/active-sub-agents.d.ts.map +1 -1
  34. package/dist/node/src/providers/active-workspace-context.d.ts +2 -2
  35. package/dist/node/src/providers/active-workspace-context.d.ts.map +1 -1
  36. package/dist/node/src/providers/available-agents.d.ts.map +1 -1
  37. package/dist/node/src/providers/coding-session-changes.d.ts +17 -0
  38. package/dist/node/src/providers/coding-session-changes.d.ts.map +1 -0
  39. package/dist/node/src/register-routes.d.ts +21 -1
  40. package/dist/node/src/register-routes.d.ts.map +1 -1
  41. package/dist/node/src/services/acceptance-criteria.d.ts +84 -0
  42. package/dist/node/src/services/acceptance-criteria.d.ts.map +1 -0
  43. package/dist/node/src/services/acp-native-transport.d.ts +111 -0
  44. package/dist/node/src/services/acp-native-transport.d.ts.map +1 -0
  45. package/dist/node/src/services/acp-service.d.ts +169 -4
  46. package/dist/node/src/services/acp-service.d.ts.map +1 -1
  47. package/dist/node/src/services/active-session-forward.d.ts +31 -0
  48. package/dist/node/src/services/active-session-forward.d.ts.map +1 -0
  49. package/dist/node/src/services/agent-name-assignment.d.ts +50 -0
  50. package/dist/node/src/services/agent-name-assignment.d.ts.map +1 -0
  51. package/dist/node/src/services/ansi-utils.d.ts +1 -1
  52. package/dist/node/src/services/app-deploy-guidance.d.ts +52 -0
  53. package/dist/node/src/services/app-deploy-guidance.d.ts.map +1 -0
  54. package/dist/node/src/services/audit.d.ts +18 -0
  55. package/dist/node/src/services/audit.d.ts.map +1 -0
  56. package/dist/node/src/services/coding-account-selection.d.ts +79 -0
  57. package/dist/node/src/services/coding-account-selection.d.ts.map +1 -0
  58. package/dist/node/src/services/completion-envelope.d.ts +63 -0
  59. package/dist/node/src/services/completion-envelope.d.ts.map +1 -0
  60. package/dist/node/src/services/completion-evidence.d.ts +144 -0
  61. package/dist/node/src/services/completion-evidence.d.ts.map +1 -0
  62. package/dist/node/src/services/config-env.d.ts +11 -7
  63. package/dist/node/src/services/config-env.d.ts.map +1 -1
  64. package/dist/node/src/services/goal-contract.d.ts +25 -0
  65. package/dist/node/src/services/goal-contract.d.ts.map +1 -0
  66. package/dist/node/src/services/goal-llm-verifier.d.ts +157 -0
  67. package/dist/node/src/services/goal-llm-verifier.d.ts.map +1 -0
  68. package/dist/node/src/services/goal-prompt.d.ts +82 -0
  69. package/dist/node/src/services/goal-prompt.d.ts.map +1 -0
  70. package/dist/node/src/services/independent-verifier.d.ts +58 -0
  71. package/dist/node/src/services/independent-verifier.d.ts.map +1 -0
  72. package/dist/node/src/services/interruption-decider.d.ts +43 -0
  73. package/dist/node/src/services/interruption-decider.d.ts.map +1 -0
  74. package/dist/node/src/services/opencode-config.d.ts +21 -0
  75. package/dist/node/src/services/opencode-config.d.ts.map +1 -0
  76. package/dist/node/src/services/orchestrator-device-support-matrix.d.ts +46 -0
  77. package/dist/node/src/services/orchestrator-device-support-matrix.d.ts.map +1 -0
  78. package/dist/node/src/services/orchestrator-task-mapper.d.ts +192 -0
  79. package/dist/node/src/services/orchestrator-task-mapper.d.ts.map +1 -0
  80. package/dist/node/src/services/orchestrator-task-service.d.ts +370 -0
  81. package/dist/node/src/services/orchestrator-task-service.d.ts.map +1 -0
  82. package/dist/node/src/services/orchestrator-task-store.d.ts +156 -0
  83. package/dist/node/src/services/orchestrator-task-store.d.ts.map +1 -0
  84. package/dist/node/src/services/orchestrator-task-types.d.ts +334 -0
  85. package/dist/node/src/services/orchestrator-task-types.d.ts.map +1 -0
  86. package/dist/node/src/services/parent-agent-broker.d.ts +5 -3
  87. package/dist/node/src/services/parent-agent-broker.d.ts.map +1 -1
  88. package/dist/node/src/services/parent-agent-dispatch.d.ts +62 -0
  89. package/dist/node/src/services/parent-agent-dispatch.d.ts.map +1 -0
  90. package/dist/node/src/services/screenshot-delivery.d.ts +38 -0
  91. package/dist/node/src/services/screenshot-delivery.d.ts.map +1 -0
  92. package/dist/node/src/services/session-event-queue.d.ts +1 -8
  93. package/dist/node/src/services/session-event-queue.d.ts.map +1 -1
  94. package/dist/node/src/services/session-store.d.ts +2 -1
  95. package/dist/node/src/services/session-store.d.ts.map +1 -1
  96. package/dist/node/src/services/skill-lifeops-context-broker.d.ts +1 -1
  97. package/dist/node/src/services/skill-lifeops-context-broker.d.ts.map +1 -1
  98. package/dist/node/src/services/skill-manifest.d.ts +1 -1
  99. package/dist/node/src/services/skill-recommender.d.ts +2 -0
  100. package/dist/node/src/services/skill-recommender.d.ts.map +1 -1
  101. package/dist/node/src/services/smithers-task-executor.d.ts +73 -0
  102. package/dist/node/src/services/smithers-task-executor.d.ts.map +1 -0
  103. package/dist/node/src/services/smithers-task-integration.d.ts +52 -0
  104. package/dist/node/src/services/smithers-task-integration.d.ts.map +1 -0
  105. package/dist/node/src/services/smithers-task-runner.d.ts +27 -0
  106. package/dist/node/src/services/smithers-task-runner.d.ts.map +1 -0
  107. package/dist/node/src/services/smithers-task-types.d.ts +96 -0
  108. package/dist/node/src/services/smithers-task-types.d.ts.map +1 -0
  109. package/dist/node/src/services/spawn-trajectory.d.ts +2 -2
  110. package/dist/node/src/services/spawn-trajectory.d.ts.map +1 -1
  111. package/dist/node/src/services/spend-allowance.d.ts +143 -0
  112. package/dist/node/src/services/spend-allowance.d.ts.map +1 -0
  113. package/dist/node/src/services/ssrf-guard.d.ts +66 -0
  114. package/dist/node/src/services/ssrf-guard.d.ts.map +1 -0
  115. package/dist/node/src/services/sub-agent-identity.d.ts +27 -0
  116. package/dist/node/src/services/sub-agent-identity.d.ts.map +1 -0
  117. package/dist/node/src/services/sub-agent-inbox.d.ts +26 -0
  118. package/dist/node/src/services/sub-agent-inbox.d.ts.map +1 -0
  119. package/dist/node/src/services/sub-agent-router.d.ts +142 -2
  120. package/dist/node/src/services/sub-agent-router.d.ts.map +1 -1
  121. package/dist/node/src/services/task-agent-frameworks.d.ts +21 -8
  122. package/dist/node/src/services/task-agent-frameworks.d.ts.map +1 -1
  123. package/dist/node/src/services/task-agent-routing.d.ts +33 -0
  124. package/dist/node/src/services/task-agent-routing.d.ts.map +1 -0
  125. package/dist/node/src/services/task-supervisor-service.d.ts +65 -0
  126. package/dist/node/src/services/task-supervisor-service.d.ts.map +1 -0
  127. package/dist/node/src/services/task-watchdog-service.d.ts +50 -0
  128. package/dist/node/src/services/task-watchdog-service.d.ts.map +1 -0
  129. package/dist/node/src/services/terminal-capabilities.d.ts +48 -0
  130. package/dist/node/src/services/terminal-capabilities.d.ts.map +1 -0
  131. package/dist/node/src/services/trajectory-context.d.ts +4 -8
  132. package/dist/node/src/services/trajectory-context.d.ts.map +1 -1
  133. package/dist/node/src/services/trajectory-feedback.d.ts +1 -1
  134. package/dist/node/src/services/types.d.ts +38 -2
  135. package/dist/node/src/services/types.d.ts.map +1 -1
  136. package/dist/node/src/services/view-deploy-guidance.d.ts +14 -0
  137. package/dist/node/src/services/view-deploy-guidance.d.ts.map +1 -0
  138. package/dist/node/src/services/workdir-validation.d.ts +10 -0
  139. package/dist/node/src/services/workdir-validation.d.ts.map +1 -0
  140. package/dist/node/src/services/workspace-diff.d.ts +50 -0
  141. package/dist/node/src/services/workspace-diff.d.ts.map +1 -0
  142. package/dist/node/src/services/workspace-git-ops.d.ts +2 -2
  143. package/dist/node/src/services/workspace-git-ops.d.ts.map +1 -1
  144. package/dist/node/src/services/workspace-github.d.ts +7 -7
  145. package/dist/node/src/services/workspace-github.d.ts.map +1 -1
  146. package/dist/node/src/services/workspace-lifecycle.d.ts +2 -15
  147. package/dist/node/src/services/workspace-lifecycle.d.ts.map +1 -1
  148. package/dist/node/src/services/workspace-service.d.ts +6 -2
  149. package/dist/node/src/services/workspace-service.d.ts.map +1 -1
  150. package/dist/node/src/setup-routes.d.ts.map +1 -1
  151. package/docs/SUBAGENT_FLOW_AND_PARITY.md +138 -0
  152. package/docs/default-eliza-skills-and-agent-bridge-plan.md +9 -15
  153. package/docs/economics-goal-runbook.md +140 -0
  154. package/docs/multi-account-orchestration.md +76 -0
  155. package/docs/orchestrator-buildout-followups.md +124 -0
  156. package/docs/orchestrator-dashboard-task-widget-secrets-assessment.md +174 -0
  157. package/docs/orchestrator-dashboard-task-widget-secrets-design.md +301 -0
  158. package/docs/research/orchestrator-view-research-report.md +273 -0
  159. package/docs/sub-agent-routing.md +53 -23
  160. package/package.json +111 -25
  161. package/PROJECT.md +0 -119
  162. package/dist/browser/index.browser.js +0 -21051
  163. package/dist/browser/index.browser.js.map +0 -29
  164. package/dist/browser/index.d.ts +0 -2
  165. package/dist/node/index.browser.d.ts +0 -3
  166. package/dist/node/index.browser.d.ts.map +0 -1
  167. package/dist/node/src/actions/cancel-task.d.ts +0 -3
  168. package/dist/node/src/actions/cancel-task.d.ts.map +0 -1
  169. package/dist/node/src/actions/coding-task-handlers.d.ts +0 -69
  170. package/dist/node/src/actions/coding-task-handlers.d.ts.map +0 -1
  171. package/dist/node/src/actions/coding-task-helpers.d.ts +0 -35
  172. package/dist/node/src/actions/coding-task-helpers.d.ts.map +0 -1
  173. package/dist/node/src/actions/create-task.d.ts +0 -8
  174. package/dist/node/src/actions/create-task.d.ts.map +0 -1
  175. package/dist/node/src/actions/eval-metadata.d.ts +0 -11
  176. package/dist/node/src/actions/eval-metadata.d.ts.map +0 -1
  177. package/dist/node/src/actions/finalize-workspace.d.ts +0 -11
  178. package/dist/node/src/actions/finalize-workspace.d.ts.map +0 -1
  179. package/dist/node/src/actions/list-agents.d.ts +0 -4
  180. package/dist/node/src/actions/list-agents.d.ts.map +0 -1
  181. package/dist/node/src/actions/manage-issues.d.ts +0 -11
  182. package/dist/node/src/actions/manage-issues.d.ts.map +0 -1
  183. package/dist/node/src/actions/provision-workspace.d.ts +0 -11
  184. package/dist/node/src/actions/provision-workspace.d.ts.map +0 -1
  185. package/dist/node/src/actions/send-to-agent.d.ts +0 -4
  186. package/dist/node/src/actions/send-to-agent.d.ts.map +0 -1
  187. package/dist/node/src/actions/spawn-agent.d.ts +0 -8
  188. package/dist/node/src/actions/spawn-agent.d.ts.map +0 -1
  189. package/dist/node/src/actions/stop-agent.d.ts +0 -4
  190. package/dist/node/src/actions/stop-agent.d.ts.map +0 -1
  191. package/dist/node/src/actions/task-control.d.ts +0 -3
  192. package/dist/node/src/actions/task-control.d.ts.map +0 -1
  193. package/dist/node/src/actions/task-history.d.ts +0 -3
  194. package/dist/node/src/actions/task-history.d.ts.map +0 -1
  195. package/dist/node/src/actions/task-share.d.ts +0 -3
  196. package/dist/node/src/actions/task-share.d.ts.map +0 -1
  197. package/dist/node/src/actions/task-thread-target.d.ts +0 -11
  198. package/dist/node/src/actions/task-thread-target.d.ts.map +0 -1
  199. package/dist/node/src/api/coordinator-routes.d.ts +0 -22
  200. package/dist/node/src/api/coordinator-routes.d.ts.map +0 -1
  201. package/dist/node/src/api/hook-routes.d.ts +0 -18
  202. package/dist/node/src/api/hook-routes.d.ts.map +0 -1
  203. package/dist/node/src/routes/coding-agents-fallback-routes.d.ts +0 -19
  204. package/dist/node/src/routes/coding-agents-fallback-routes.d.ts.map +0 -1
  205. package/dist/node/src/services/acpx-subprocess.d.ts +0 -3
  206. package/dist/node/src/services/acpx-subprocess.d.ts.map +0 -1
  207. package/dist/node/src/services/agent-credentials.d.ts +0 -23
  208. package/dist/node/src/services/agent-credentials.d.ts.map +0 -1
  209. package/dist/node/src/services/agent-metrics.d.ts +0 -30
  210. package/dist/node/src/services/agent-metrics.d.ts.map +0 -1
  211. package/dist/node/src/services/agent-selection.d.ts +0 -53
  212. package/dist/node/src/services/agent-selection.d.ts.map +0 -1
  213. package/dist/node/src/services/claude-code-skill-installer.d.ts +0 -33
  214. package/dist/node/src/services/claude-code-skill-installer.d.ts.map +0 -1
  215. package/dist/node/src/services/coordinator-event-normalizer.d.ts +0 -50
  216. package/dist/node/src/services/coordinator-event-normalizer.d.ts.map +0 -1
  217. package/dist/node/src/services/custom-validator-runner.d.ts +0 -66
  218. package/dist/node/src/services/custom-validator-runner.d.ts.map +0 -1
  219. package/dist/node/src/services/debug-capture.d.ts +0 -38
  220. package/dist/node/src/services/debug-capture.d.ts.map +0 -1
  221. package/dist/node/src/services/pty-auto-response.d.ts +0 -30
  222. package/dist/node/src/services/pty-auto-response.d.ts.map +0 -1
  223. package/dist/node/src/services/pty-init.d.ts +0 -55
  224. package/dist/node/src/services/pty-init.d.ts.map +0 -1
  225. package/dist/node/src/services/pty-service.d.ts +0 -218
  226. package/dist/node/src/services/pty-service.d.ts.map +0 -1
  227. package/dist/node/src/services/pty-session-io.d.ts +0 -49
  228. package/dist/node/src/services/pty-session-io.d.ts.map +0 -1
  229. package/dist/node/src/services/pty-spawn.d.ts +0 -104
  230. package/dist/node/src/services/pty-spawn.d.ts.map +0 -1
  231. package/dist/node/src/services/pty-types.d.ts +0 -94
  232. package/dist/node/src/services/pty-types.d.ts.map +0 -1
  233. package/dist/node/src/services/skill-callback-bridge.d.ts +0 -78
  234. package/dist/node/src/services/skill-callback-bridge.d.ts.map +0 -1
  235. package/dist/node/src/services/skill-essentials.d.ts +0 -16
  236. package/dist/node/src/services/skill-essentials.d.ts.map +0 -1
  237. package/dist/node/src/services/stall-classifier.d.ts +0 -69
  238. package/dist/node/src/services/stall-classifier.d.ts.map +0 -1
  239. package/dist/node/src/services/structured-proof-bridge.d.ts +0 -99
  240. package/dist/node/src/services/structured-proof-bridge.d.ts.map +0 -1
  241. package/dist/node/src/services/swarm-coordinator-prompts.d.ts +0 -93
  242. package/dist/node/src/services/swarm-coordinator-prompts.d.ts.map +0 -1
  243. package/dist/node/src/services/swarm-coordinator.d.ts +0 -473
  244. package/dist/node/src/services/swarm-coordinator.d.ts.map +0 -1
  245. package/dist/node/src/services/swarm-decision-loop.d.ts +0 -69
  246. package/dist/node/src/services/swarm-decision-loop.d.ts.map +0 -1
  247. package/dist/node/src/services/swarm-event-triage.d.ts +0 -49
  248. package/dist/node/src/services/swarm-event-triage.d.ts.map +0 -1
  249. package/dist/node/src/services/swarm-history.d.ts +0 -27
  250. package/dist/node/src/services/swarm-history.d.ts.map +0 -1
  251. package/dist/node/src/services/swarm-idle-watchdog.d.ts +0 -22
  252. package/dist/node/src/services/swarm-idle-watchdog.d.ts.map +0 -1
  253. package/dist/node/src/services/task-acceptance.d.ts +0 -8
  254. package/dist/node/src/services/task-acceptance.d.ts.map +0 -1
  255. package/dist/node/src/services/task-agent-auth.d.ts +0 -69
  256. package/dist/node/src/services/task-agent-auth.d.ts.map +0 -1
  257. package/dist/node/src/services/task-kind.d.ts +0 -3
  258. package/dist/node/src/services/task-kind.d.ts.map +0 -1
  259. package/dist/node/src/services/task-registry.d.ts +0 -550
  260. package/dist/node/src/services/task-registry.d.ts.map +0 -1
  261. package/dist/node/src/services/task-share.d.ts +0 -18
  262. package/dist/node/src/services/task-share.d.ts.map +0 -1
  263. package/dist/node/src/services/task-validation.d.ts +0 -69
  264. package/dist/node/src/services/task-validation.d.ts.map +0 -1
  265. package/dist/node/src/services/task-verifier-runner.d.ts +0 -5
  266. package/dist/node/src/services/task-verifier-runner.d.ts.map +0 -1
  267. package/dist/node/vitest.config.d.ts +0 -3
  268. package/dist/node/vitest.config.d.ts.map +0 -1
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Cloud deployment guidance for elizaOS view/plugin builds.
3
+ *
4
+ * View plugins have a different deploy contract from generic web apps:
5
+ * the view bundle must be published, registered as a Cloud app, and wired
6
+ * back into `Plugin.views`/the published manifest with a concrete viewKind.
7
+ */
8
+ export interface ViewPluginDeployPromptOptions {
9
+ /** Source directory the sub-agent should treat as the plugin root. */
10
+ sourceDir?: string;
11
+ }
12
+ export declare function buildViewPluginDeployPrompt(options?: ViewPluginDeployPromptOptions): string;
13
+ export declare function buildLocalViewPluginPrompt(): string;
14
+ //# sourceMappingURL=view-deploy-guidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-deploy-guidance.d.ts","sourceRoot":"","sources":["../../../../src/services/view-deploy-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,6BAA6B;IAC5C,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,6BAAkC,GAC1C,MAAM,CAkBR;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAQnD"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Default per-task workdir for an auto-spawned coding agent:
3
+ * `~/.eliza/workspaces/<taskId>`, created if missing. Always inside the allowed
4
+ * workspace base (see {@link resolveAllowedWorkdir}), so messaging a task can
5
+ * spawn an agent without a caller-supplied workdir — the parity-with-claude/codex
6
+ * "just message it and it works" path relies on this.
7
+ */
8
+ export declare function ensureTaskWorkdir(taskId: string): Promise<string>;
9
+ export declare function resolveAllowedWorkdir(rawWorkdir: string): Promise<string>;
10
+ //# sourceMappingURL=workdir-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workdir-validation.d.ts","sourceRoot":"","sources":["../../../../src/services/workdir-validation.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMvE;AAED,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAuBjB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * What a sub-agent actually changed in its workspace, captured as ground
3
+ * truth from git (plus the agent's own edit/write tool calls) rather than from
4
+ * the model's frequently-confabulated description of its work. Persisted on
5
+ * session metadata at `task_complete` so the parent can answer "what did you
6
+ * change / show me the diff" from the real change set.
7
+ */
8
+ export interface WorkspaceChangeSet {
9
+ changedFiles: string[];
10
+ diffStat: string;
11
+ diff: string;
12
+ truncated: boolean;
13
+ capturedAt: number;
14
+ }
15
+ /**
16
+ * The repo HEAD at spawn time, so the change set at completion is scoped to
17
+ * exactly what this sub-agent did (committed or not). Undefined when the
18
+ * workspace is not a git work tree or has no commits yet.
19
+ */
20
+ export declare function captureBaselineSha(workdir: string): Promise<string | undefined>;
21
+ /**
22
+ * Tracked files already modified in the workspace at spawn time. The completion
23
+ * diff (`git diff <baseline>`) compares the working tree to the baseline
24
+ * COMMIT, so files that were dirty BEFORE the session (a leftover edit, a dirty
25
+ * submodule pointer) show up even though this sub-agent never touched them.
26
+ * Recording them at spawn lets the change set exclude that pre-existing churn.
27
+ */
28
+ export declare function captureBaselineDirty(workdir: string): Promise<string[]>;
29
+ /**
30
+ * What this sub-agent changed in `workdir` since spawn, from the union of two
31
+ * SESSION-SCOPED signals — no filesystem walk, no path denylist, no mtime
32
+ * heuristics, so it works for any workdir/language/deployment:
33
+ * - `git diff --name-status <base>`: tracked edits, deletions, renames since
34
+ * the spawn baseline (covers shell-driven writes to tracked files);
35
+ * - `toolPaths`: files the agent explicitly wrote via edit/write tool calls
36
+ * this session — including gitignored DEPLOY targets (`data/apps/<name>/`)
37
+ * that git won't surface.
38
+ *
39
+ * Deliberately NOT using `git ls-files --others`: it lists EVERY untracked file
40
+ * in the work tree regardless of when it appeared, so in a shared/long-lived
41
+ * workspace it scoops up accumulated clutter from prior sessions (stray .venv,
42
+ * old build output, scratch PDFs) that this task never touched. Both signals
43
+ * above are scoped to this session, so the change set stays accurate.
44
+ *
45
+ * Returns undefined when nothing changed or the workspace isn't a git repo.
46
+ */
47
+ export declare function captureChangeSet(workdir: string, baselineSha?: string, toolPaths?: string[], baselineDirty?: string[]): Promise<WorkspaceChangeSet | undefined>;
48
+ /** One-line, human-facing summary of a change set for a completion banner. */
49
+ export declare function summarizeChangeSet(changeSet: WorkspaceChangeSet): string;
50
+ //# sourceMappingURL=workspace-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-diff.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-diff.ts"],"names":[],"mappings":"AAwBA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAsDD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI7B;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAM7E;AAkDD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,GAAE,MAAM,EAAO,EACxB,aAAa,GAAE,MAAM,EAAO,GAC3B,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAuDzC;AAqDD,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAMxE"}
@@ -7,7 +7,7 @@
7
7
  * @module services/workspace-git-ops
8
8
  */
9
9
  import type { PullRequestInfo, WorkspaceService } from "git-workspace-service";
10
- import type { CommitOptions, PROptions, PushOptions, WorkspaceResult, WorkspaceStatusResult } from "./workspace-service.js";
10
+ import type { CommitOptions, PROptions, PushOptions, WorkspaceResult, WorkspaceStatusResult } from "./workspace-types.js";
11
11
  /**
12
12
  * Get workspace git status (branch, staged/modified/untracked files).
13
13
  */
@@ -20,7 +20,7 @@ export declare function commit(workspacePath: string, options: CommitOptions, lo
20
20
  /**
21
21
  * Push changes to remote for a workspace.
22
22
  */
23
- export declare function push(workspacePath: string, branch: string, options: PushOptions | undefined, log: (msg: string) => void): Promise<void>;
23
+ export declare function push(workspacePath: string, branch: string, options: PushOptions | undefined, log: (msg: string) => void, env?: NodeJS.ProcessEnv): Promise<void>;
24
24
  /**
25
25
  * Create a pull request for a workspace via the underlying WorkspaceService.
26
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-git-ops.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-git-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,eAAe,EACf,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,wBAAsB,SAAS,CAC7B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,qBAAqB,CAAC,CAuChC;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,EAClB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,eAAe,CAAC,CAsB1B"}
1
+ {"version":3,"file":"workspace-git-ops.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-git-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,eAAe,EACf,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,wBAAsB,SAAS,CAC7B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,qBAAqB,CAAC,CAuChC;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC1B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,EAClB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,eAAe,CAAC,CAsB1B"}
@@ -7,7 +7,7 @@
7
7
  * @module services/workspace-github
8
8
  */
9
9
  import type { IAgentRuntime } from "@elizaos/core";
10
- import { type CreateIssueOptions, GitHubPatClient, type IssueComment, type IssueInfo, type IssueState } from "git-workspace-service";
10
+ import type { CreateIssueOptions, GitHubPatClient as GitHubPatClientInstance, IssueComment, IssueInfo, IssueState } from "git-workspace-service";
11
11
  /**
12
12
  * Callback for surfacing auth prompts to the user.
13
13
  * Returns true only when the prompt was delivered through an immediate
@@ -25,10 +25,10 @@ export type AuthPromptCallback = (prompt: {
25
25
  */
26
26
  export interface GitHubContext {
27
27
  runtime: IAgentRuntime;
28
- githubClient: GitHubPatClient | null;
29
- setGithubClient: (client: GitHubPatClient) => void;
30
- githubAuthInProgress: Promise<GitHubPatClient> | null;
31
- setGithubAuthInProgress: (p: Promise<GitHubPatClient> | null) => void;
28
+ githubClient: GitHubPatClientInstance | null;
29
+ setGithubClient: (client: GitHubPatClientInstance) => void;
30
+ githubAuthInProgress: Promise<GitHubPatClientInstance> | null;
31
+ setGithubAuthInProgress: (p: Promise<GitHubPatClientInstance> | null) => void;
32
32
  authPromptCallback: AuthPromptCallback | null;
33
33
  log: (msg: string) => void;
34
34
  }
@@ -36,8 +36,8 @@ export declare function parseOwnerRepo(repo: string): {
36
36
  owner: string;
37
37
  repo: string;
38
38
  };
39
- export declare function ensureGitHubClient(ctx: GitHubContext): Promise<GitHubPatClient>;
40
- export declare function performOAuthFlow(ctx: GitHubContext, clientId: string): Promise<GitHubPatClient>;
39
+ export declare function ensureGitHubClient(ctx: GitHubContext): Promise<GitHubPatClientInstance>;
40
+ export declare function performOAuthFlow(ctx: GitHubContext, clientId: string): Promise<GitHubPatClientInstance>;
41
41
  export declare function createIssue(ctx: GitHubContext, repo: string, options: CreateIssueOptions): Promise<IssueInfo>;
42
42
  export declare function getIssue(ctx: GitHubContext, repo: string, issueNumber: number): Promise<IssueInfo>;
43
43
  export declare function listIssues(ctx: GitHubContext, repo: string, options?: {
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-github.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-github.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EACvB,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,UAAU,EAEhB,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEjC;;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CACnB,GACA,OAAO,CAAC,SAAS,EAAE,CAAC,CAItB;AAED,wBAAsB,WAAW,CAC/B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,GACA,OAAO,CAAC,SAAS,CAAC,CAIpB;AAED,wBAAsB,UAAU,CAC9B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAIvB;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,EAAE,CAAC,CAIzB;AAED,wBAAsB,UAAU,CAC9B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,CAAC,CAMpB;AAED,wBAAsB,WAAW,CAC/B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,CAAC,CAIpB;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,IAAI,CAAC,CAIf"}
1
+ {"version":3,"file":"workspace-github.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-github.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,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,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,CAAC,CAIpB;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -1,18 +1,5 @@
1
- /**
2
- * Workspace lifecycle utilities — garbage collection and scratch directory cleanup.
3
- *
4
- * Extracted from workspace-service.ts to reduce module size.
5
- *
6
- * @module services/workspace-lifecycle
7
- */
8
- /**
9
- * Remove a scratch directory (non-git workspace used for ad-hoc tasks).
10
- * Safe to call for any path under the workspaces base dir.
11
- */
1
+ /** Remove a scratch directory safely — only if under baseDir or one of allowedDirs. */
12
2
  export declare function removeScratchDir(dirPath: string, baseDir: string, log: (msg: string) => void, allowedDirs?: string[]): Promise<void>;
13
- /**
14
- * Garbage-collect orphaned workspace directories.
15
- * Removes directories older than the given TTL that aren't tracked by the current session.
16
- */
3
+ /** Garbage-collect orphaned workspace directories older than workspaceTtlMs. */
17
4
  export declare function gcOrphanedWorkspaces(baseDir: string, workspaceTtlMs: number, trackedWorkspaceIds: Set<string>, log: (msg: string) => void): Promise<void>;
18
5
  //# sourceMappingURL=workspace-lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC1B,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,EAChC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,IAAI,CAAC,CAkDf"}
1
+ {"version":3,"file":"workspace-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-lifecycle.ts"],"names":[],"mappings":"AAIA,uFAAuF;AACvF,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC1B,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED,gFAAgF;AAChF,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,EAChC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,IAAI,CAAC,CAiDf"}
@@ -10,7 +10,7 @@
10
10
  * @module services/workspace-service
11
11
  */
12
12
  import type { IAgentRuntime } from "@elizaos/core";
13
- import { type CreateIssueOptions, type IssueComment, type IssueInfo, type IssueState, type PullRequestInfo, type WorkspaceEvent } from "git-workspace-service";
13
+ import type { CreateIssueOptions, IssueComment, IssueInfo, IssueState, PullRequestInfo, WorkspaceEvent } from "git-workspace-service";
14
14
  import type { AuthPromptCallback } from "./workspace-github.js";
15
15
  export type { AuthPromptCallback } from "./workspace-github.js";
16
16
  export type { CodingWorkspaceConfig, CommitOptions, PROptions, ProvisionWorkspaceOptions, PushOptions, WorkspaceResult, WorkspaceStatusResult, } from "./workspace-types.js";
@@ -27,7 +27,7 @@ export interface ScratchWorkspaceRecord {
27
27
  terminalEvent: ScratchTerminalEvent;
28
28
  expiresAt?: number;
29
29
  }
30
- export declare function resolveDefaultBranch(repoUrl: string): Promise<string>;
30
+ export declare function resolveDefaultBranch(repoUrl: string, token?: string): Promise<string>;
31
31
  /** Test hook: drop the per-repo cache so each test starts clean. */
32
32
  export declare function _clearDefaultBranchCache(): void;
33
33
  export declare function getCodingWorkspaceService(runtime: IAgentRuntime): CodingWorkspaceService | null;
@@ -41,6 +41,7 @@ export declare class CodingWorkspaceService {
41
41
  private githubAuthInProgress;
42
42
  private serviceConfig;
43
43
  private workspaces;
44
+ private ambientCredentialWorkspaceIds;
44
45
  private labels;
45
46
  private scratchBySession;
46
47
  private scratchCleanupTimers;
@@ -52,6 +53,7 @@ export declare class CodingWorkspaceService {
52
53
  static start(runtime: IAgentRuntime): Promise<CodingWorkspaceService>;
53
54
  static stopRuntime(runtime: IAgentRuntime): Promise<void>;
54
55
  private initialize;
56
+ private installCredentialSafeClone;
55
57
  stop(): Promise<void>;
56
58
  /** Provision a new workspace */
57
59
  provisionWorkspace(options: ProvisionWorkspaceOptions): Promise<WorkspaceResult>;
@@ -109,6 +111,8 @@ export declare class CodingWorkspaceService {
109
111
  /** GC orphaned workspace directories older than workspaceTtlMs. */
110
112
  private gcOrphanedWorkspaces;
111
113
  private log;
114
+ private resolveUserCredentials;
115
+ private removeAmbientCredentialHelper;
112
116
  /** Read a key from the config file's env section (live, no restart needed). */
113
117
  private readConfigEnvKey;
114
118
  private getScratchRetentionPolicy;
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-service.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EAGvB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,UAAU,EAEf,KAAK,eAAe,EAEpB,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAchE,YAAY,EAA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uB,CAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,sBAAsB,CAAC;IA8BlC,mEAAmE;YACrD,oBAAoB;IASlC,OAAO,CAAC,GAAG;IAMX,OAAO,CAAC,sBAAsB;YA0BhB,6BAA6B;IAa3C,+EAA+E;IAC/E,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,yBAAyB;IAsBjC,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,qBAAqB;YASf,oBAAoB;CAsBnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"setup-routes.d.ts","sourceRoot":"","sources":["../../../src/setup-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAiB,MAAM,EAAS,MAAM,eAAe,CAAC;AAuIlE,eAAO,MAAM,sBAAsB,EAAE,MAMpC,CAAC"}
1
+ {"version":3,"file":"setup-routes.d.ts","sourceRoot":"","sources":["../../../src/setup-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAGV,MAAM,EAIP,MAAM,eAAe,CAAC;AAgJvB,eAAO,MAAM,sBAAsB,EAAE,MAMpC,CAAC"}
@@ -0,0 +1,138 @@
1
+ # Sub-agent flow & Codex / Claude-Code parity review
2
+
3
+ A thorough walk of how the main agent creates a task, spawns sub-agents,
4
+ provisions them, and communicates — across the elizaOS, Codex, and Claude
5
+ frameworks — plus an honest parity assessment against standalone Codex CLI and
6
+ Claude Code, and the concrete open items.
7
+
8
+ ## 1. End-to-end flow
9
+
10
+ ```
11
+ user msg → planner → TASKS_CREATE ─────────────► durable task (status: open)
12
+ │ roomId, taskRoomId, ownerUserId,
13
+ │ originalRequest, acceptanceCriteria
14
+
15
+ TASKS_SPAWN_AGENT ────────────► AcpService.spawnSession(SpawnOptions)
16
+ │ goal-prompt.ts wraps agentType, workdir, goalPrompt,
17
+ │ the goal + rooms + approvalPreset, metadata{roomId,
18
+ │ acceptance criteria source, label, worldId, userId}
19
+
20
+ ACP subprocess (native JSON-RPC over stdio)
21
+ elizaos | codex | claude | opencode | pi-agent
22
+ │ session/new → session/prompt(goal)
23
+
24
+ events: ready · tool_running · message · reasoning · plan ·
25
+ blocked · task_complete · error · usage_update
26
+
27
+ ┌────────────────┴───────────────────────────────┐
28
+ ▼ ▼
29
+ OrchestratorTaskService.onSessionEvent SubAgentRouter.handleEvent
30
+ (durable: addEvent / updateSession / (synthetic Memory → planner;
31
+ recordMessage; task_complete → "validating") round-trip cap = 32)
32
+
33
+
34
+ planner ↔ subAgentCompletionResponseEvaluator
35
+ → reply to user OR TASKS_SEND_TO_AGENT
36
+ ```
37
+
38
+ **Key files:** task create `actions/tasks.ts:685` → `services/orchestrator-task-service.ts:746`;
39
+ spawn `actions/tasks.ts:743` → `services/acp-service.ts:511`; goal wrap
40
+ `services/goal-prompt.ts:129`; event bridge `orchestrator-task-service.ts:519`;
41
+ routing `services/sub-agent-router.ts`; completion gate
42
+ `orchestrator-task-service.ts:608` (`task_complete` → `validating`, never straight
43
+ to `done`); evaluator `evaluators/sub-agent-completion.ts`.
44
+
45
+ **Provisioning** happens at spawn: `acp-service.ts` resolves the workdir, captures
46
+ a git baseline SHA + dirty set (for the completion changeset), and writes a
47
+ sub-agent `AGENTS.md`/`CLAUDE.md` identity manifest on bare workdirs
48
+ (`sub-agent-identity.ts`). Explicit repo clone / worktree / branch / commit / push
49
+ / PR is `CodingWorkspaceService` (`workspace-*.ts`), driven by
50
+ `TASKS_PROVISION_WORKSPACE` / `TASKS_SUBMIT_WORKSPACE`.
51
+
52
+ ## 2. Sub-agent rooms per task
53
+
54
+ - `roomId` = the originating user channel (where the final reply goes).
55
+ `taskRoomId` = a dedicated task-scoped room; all sessions' messages
56
+ (`senderKind: user|orchestrator|sub_agent|system`) append there. Exposed via
57
+ `GET /api/orchestrator/tasks/:id/messages`, `/timeline`, and `/stream` (SSE).
58
+ - The in-app **task view** (`plugin-task-coordinator/src/OrchestratorWorkbench.tsx`)
59
+ renders this as a per-task message room: the merged timeline + per-sub-agent
60
+ sessions list + plan + diff + usage + recovery, with near-live polling.
61
+ - On chat connectors, the **progress thread** (`index.ts emitProgress`) routes all
62
+ sub-agent narration into a per-task Discord thread / Telegram forum topic
63
+ (capability-gated on `create_thread` + `post_to_thread` + threaded progress
64
+ mode), keeping the main channel clean. This is the "task info as threads in TG
65
+ and Discord" surface.
66
+
67
+ ## 3. Inter-agent communication
68
+
69
+ **Topology: hub-and-spoke.** Sub-agents do not address each other directly. Each
70
+ talks only to the parent:
71
+ - parent → sub: initial goal prompt; mid-flight `TASKS_SEND_TO_AGENT`; live user
72
+ messages in the task room are auto-forwarded to the active session
73
+ (`index.ts` MESSAGE_RECEIVED listener).
74
+ - sub → parent: terminal ACP events → synthetic memories; plus a sub-agent can
75
+ emit `USE_SKILL parent-agent {…}` which the router dispatches to the
76
+ parent-agent broker (`parent-agent-dispatch.ts` / `parent-agent-broker.ts`) and
77
+ replies back over the session.
78
+ - sub → parent context: loopback-only bridge `GET /api/coding-agents/:id/context/*`
79
+ (parent character, current room, memory search, active workspaces).
80
+
81
+ Multiple sub-agents per task are supported (`sessions[]`), unsynchronized; the
82
+ router de-dupes concurrent `task_complete` so only the first posts to the user.
83
+
84
+ ## 4. Framework matrix (elizaOS / Codex / Claude)
85
+
86
+ All run as ACP subprocesses over the native JSON-RPC transport
87
+ (`acp-native-transport.ts`); spawn command per framework is env-overridable
88
+ (`ELIZA_{ELIZAOS,CODEX,CLAUDE,OPENCODE,PI_AGENT}_ACP_COMMAND`; Codex/Claude default
89
+ to pinned `npx` ACP shims). The orchestrator implements the ACP client side of:
90
+ `session/new`, `session/prompt`, `session/cancel`, `session/update` (streaming
91
+ `agent_message_chunk` / `agent_thought_chunk` / `tool_call` / `plan`),
92
+ `session/request_permission`, `fs/read_text_file`, `fs/write_text_file`, and the
93
+ `terminal/*` family. Approval presets (`readonly|standard|permissive|autonomous`)
94
+ gate file/terminal ops. Credentials reach sub-agents via the loopback credential
95
+ tunnel (`bridge-routes.ts`); host connector tokens are denylisted from the child
96
+ env, and Claude OAuth-subscription tokens are stripped so the child uses its own
97
+ subscription.
98
+
99
+ ## 5. Parity vs standalone Codex CLI / Claude Code
100
+
101
+ **At parity:** multi-framework spawn + routing; file read/write; terminal exec;
102
+ plan/reasoning/tool streaming; approval gates; real git-diff capture & surfacing
103
+ (`coding-session-changes.ts`); token usage; orphaned-session recovery on restart;
104
+ durable task store + task view; per-task threads on connectors.
105
+
106
+ **Partial:** plan/todo events are emitted by OpenCode but not uniformly by
107
+ Codex/Claude; diff surfacing truncates (20 files / 50 lines) with no inline
108
+ per-line review UI; sub-agents run `--no-terminal` (event-driven, no interactive
109
+ TUI — correct for orchestration, but differs from a human at the CLI).
110
+
111
+ **Gaps:**
112
+ 1. **MCP forwarding** — ✅ implemented (opt-in). `acp-native-transport.ts`
113
+ forwards `ELIZA_ACP_MCP_SERVERS` (a JSON array of stdio/http MCP server
114
+ configs) into `session/new.mcpServers` via `parseAcpMcpServersEnv`, so
115
+ sub-agents get the parent's MCP tools (Codex / Claude-Code parity). Defaults
116
+ to `[]` (prior behavior) so spawning never regresses. Remaining: auto-inherit
117
+ the parent runtime's MCP set without explicit env config (needs a runtime
118
+ MCP-config surface, which doesn't exist yet).
119
+ 2. **Sub-agent nesting** (open) — no spawn-child API; a sub-agent cannot delegate
120
+ to its own sub-agents (single level of orchestration). Feature-level work.
121
+ 3. **Inline code-review surface** — diffs are captured but there's no structured
122
+ per-file/line review/approve UI in the task view.
123
+
124
+ ## 6. Open items checklist
125
+
126
+ - [x] Interaction protocol (forms / choice + custom / secret / task) across app + TG + Discord
127
+ - [x] Pick-an-option round-trip on both connectors; secret/OAuth DM link-out on both
128
+ - [x] Per-task threads on TG + Discord (orchestrator-driven; both connectors now capable)
129
+ - [x] Task view with sub-agent message room (OrchestratorWorkbench)
130
+ - [x] Real interaction-widget + connector round-trip tests
131
+ - [x] MCP server forwarding to sub-agents (opt-in via `ELIZA_ACP_MCP_SERVERS`)
132
+ - [ ] Sub-agent nesting / delegation (gap #2 — feature-level)
133
+ - [ ] Inline diff review UI in the task view (gap #3)
134
+ - [ ] Live connector E2E (needs TG/Discord credentials) + orchestrator HTTP task-flow E2E
135
+ - [ ] Optional: `outgoing_before_deliver` central interaction normalization hook
136
+
137
+ See `@elizaos/core` `src/messaging/interactions/README.md` for the interaction
138
+ protocol; this doc covers the orchestration + sub-agent layer.
@@ -7,7 +7,7 @@ Date: 2026-05-10
7
7
  Make Eliza's default task workers self-sufficient:
8
8
 
9
9
  - They should receive editable, repo-owned default skills for Eliza, elizaOS plugin/app development, Eliza Cloud APIs, and monetization.
10
- - Claude, Codex, OpenCode, Gemini, Aider, and other orchestrated workers should receive those defaults through the agent orchestrator.
10
+ - Claude, Codex, and OpenCode workers should receive those defaults through the ACP agent orchestrator.
11
11
  - Applications should be able to override defaults without forking the shipped skill package.
12
12
  - Workers should be able to ask the running parent Eliza agent for context or actions that only the parent can perform.
13
13
  - Paid, private, or destructive operations should remain mediated by the parent agent and its confirmation flow.
@@ -39,10 +39,9 @@ The task agent infrastructure is in `plugins/plugin-agent-orchestrator`.
39
39
 
40
40
  Important surfaces:
41
41
 
42
- - `src/services/pty-service.ts` spawns agents, writes adapter memory files, injects parent runtime loopback context, and manages session lifecycle.
43
- - `src/actions/coding-task-handlers.ts` prepares `SKILLS.md`, recommends skills, spawns task sessions, and registers per-session skill allow-lists.
42
+ - `src/services/acp-service.ts` spawns ACP agents, records session metadata, and manages session lifecycle.
43
+ - `src/actions/tasks.ts` prepares ACP spawn/send/list/control requests through the single task-agent action surface.
44
44
  - `src/services/skill-manifest.ts` renders the task-local manifest and virtual broker skills.
45
- - `src/services/skill-callback-bridge.ts` listens for child output lines matching `USE_SKILL <slug> <json_args>` and routes them back to the parent runtime.
46
45
  - `src/services/skill-lifeops-context-broker.ts` already exposes task-scoped LifeOps context.
47
46
 
48
47
  ### Cloud and monetization
@@ -95,7 +94,7 @@ Sensitive broker access is session allow-listed. The orchestrator includes `pare
95
94
 
96
95
  ### Worker manifest
97
96
 
98
- `SKILLS.md` now tells workers to emit a standalone `USE_SKILL <slug> <json_args>` line. The orchestrator writes this manifest into the workspace and sets `ELIZA_SKILLS_MANIFEST`, so Codex/Claude/Gemini/Aider-style workers can discover skill protocol without hardcoding.
97
+ `SKILLS.md` now tells workers to emit a standalone `USE_SKILL <slug> <json_args>` line. The orchestrator writes this manifest into the workspace and sets `ELIZA_SKILLS_MANIFEST`, so Codex/Claude/OpenCode workers can discover skill protocol without hardcoding.
99
98
 
100
99
  The injected parent runtime memory also now explains:
101
100
 
@@ -113,9 +112,6 @@ The orchestrator-managed gitignore block now includes common generated agent fil
113
112
  - `.claude/`
114
113
  - `AGENTS.md`
115
114
  - `.codex/`
116
- - `GEMINI.md`
117
- - `.gemini/`
118
- - `.aider*`
119
115
  - `.opencode/`
120
116
  - `SKILLS.md`
121
117
 
@@ -178,11 +174,11 @@ Review focus:
178
174
 
179
175
  - Type correctness around synthetic `Memory` construction and `messageService.handleMessage`.
180
176
  - Session allow-list behavior for virtual brokers.
181
- - Whether all spawned adapter types can see `SKILLS.md` and parent memory text.
177
+ - Whether all ACP agent types can see `SKILLS.md` and parent memory text.
182
178
  - Whether tracked `AGENTS.md` repos need a safer memory-file strategy than writing in the workspace root.
183
- - Whether OpenCode should become a first-class adapter type instead of shell-compatible spawn.
179
+ - Whether OpenCode's vendored ACP path has enough smoke coverage against Cerebras.
184
180
 
185
- Status: partially implemented. The first three are covered by code/tests; the last two remain follow-up design items.
181
+ Status: partially implemented. The first three are covered by code/tests; live OpenCode/Cerebras validation remains credential-gated.
186
182
 
187
183
  ### Pass 5: Testing, Verification, Validation
188
184
 
@@ -197,8 +193,8 @@ Minimum local tests:
197
193
  Live validation:
198
194
 
199
195
  - Start a parent Eliza runtime with agent skills and orchestrator loaded.
200
- - Spawn Codex and Claude workers and verify they read `SKILLS.md`.
201
- - Spawn OpenCode using Eliza Cloud with Cerebras OpenAI `gpt-oss-120b` and verify it can emit `USE_SKILL parent-agent ...`.
196
+ - Spawn Codex, Claude, and OpenCode workers and verify they read `SKILLS.md`.
197
+ - Spawn OpenCode through ACP using the vendored OpenCode shim with Cerebras `gpt-oss-120b` and verify it can emit `USE_SKILL parent-agent ...`.
202
198
  - Simulate:
203
199
  - action listing
204
200
  - parent memory search
@@ -212,8 +208,6 @@ Status: local unit/type/skills tests are implemented and passing. Live OpenCode/
212
208
 
213
209
  ## Remaining Gaps
214
210
 
215
- - OpenCode is currently treated through shell-compatible spawn paths in parts of the orchestrator. It should become a first-class memory/config adapter if the project wants equivalent behavior to Claude/Codex/Gemini.
216
- - `PARALLAX_DEFAULT_AGENT_TYPE` fixed-default parsing still only accepts `claude`, `gemini`, `codex`, and `aider`. Routing can rank OpenCode, but fixed default should be extended after type/API review.
217
211
  - Writing adapter memory files named `AGENTS.md` can collide with repos that already track `AGENTS.md`. A safer strategy is needed for Codex memory injection in tracked-repo workspaces.
218
212
  - Live agent benchmarking against OpenCode + Eliza Cloud + Cerebras requires credentials and running infrastructure.
219
213
  - The parent-agent broker currently asks through the normal parent message pipeline. Direct action invocation APIs could be added later, but the message path is more flexible and preserves confirmation behavior.
@@ -0,0 +1,140 @@
1
+ # Economics `/goal` runbook — autonomous monetized-app loop
2
+
3
+ How to drive (and what currently blocks) a `/goal` sub-agent that autonomously
4
+ runs the monetized-app loop: create app → deploy container → enable monetization
5
+ → buy a domain → stay alive on earnings, with paid Cloud commands auto-authorized
6
+ within a spend cap.
7
+
8
+ ## What already works (verified)
9
+
10
+ - **Capped self-spend allowance.** `decideSpendAuthorization`
11
+ (`src/services/spend-allowance.ts`) gates each Cloud command by risk/cap, and
12
+ `runCloudCommand` (`src/services/parent-agent-broker.ts:1067`) emits the
13
+ structured `event: "spend_auto_authorized"` log when a self-spend command
14
+ auto-authorizes within `ELIZA_AGENT_SPEND_CAP_USD`. Confirmed by
15
+ `src/__tests__/parent-agent-broker.test.ts` › _capped self-spend allowance_
16
+ (4 cases pass: within-cap auto-authorizes, over-cap confirms, non-self-spend
17
+ mutating auto-authorizes).
18
+ - **Economics capability profile.** `/economics` (or `/monetize`,
19
+ `/monetized-app`) in the composer sets `metadata.capabilityProfile = "economics"`
20
+ (`plugin-task-coordinator` composer directives → `createOrchestratorTask`), and
21
+ `spawnAgentForTask` reads `coerceGoalCapabilityProfile(task.metadata.capabilityProfile)`
22
+ and widens the goal fence via `ECONOMICS_GOAL_CAPABILITIES` (`goal-prompt.ts`).
23
+ - **The Cloud loop itself.** `apps.create → monetization.update → domains.buy
24
+ (real credit debit) → earnings → survival economics` is exercised end-to-end
25
+ against the mock stack by
26
+ `packages/test/cloud-e2e/tests/monetized-app-loop.spec.ts`.
27
+
28
+ ## Runbook
29
+
30
+ 1. Boot a stubbed-but-real Cloud so paid commands succeed without real money:
31
+
32
+ ```bash
33
+ CLOUD_E2E=1 NODE_ENV=test bun run cloud:mock --reset
34
+ # note the printed "Ready on http://127.0.0.1:<apiPort>"
35
+ ```
36
+
37
+ `cloud:mock` opens its PGlite store as a single-writer file, so you cannot
38
+ seed an org/API key from a second process while it runs. To seed live (and to
39
+ give the broker a key the granular per-route permission gate accepts), boot
40
+ through the cloud-e2e stack fixture instead — it stands up a PGlite **TCP
41
+ bridge** + the same wrangler launcher, then `seedTestUser()` mints an org with
42
+ credits + an API key. Mint the key with `permissions: ["*"]` if you want the
43
+ actual `containers.create` / `domains.buy` cloud calls to succeed (the default
44
+ `read/write/admin` seed key still proves `spend_auto_authorized`, because that
45
+ log fires from the cap decision *before* the HTTP call — but the call itself
46
+ 401s on routes that require granular scopes like `containers:write`).
47
+
48
+ 2. Point the broker at the mock and arm the spend cap (these resolve through
49
+ `config-env.ts`, so the eliza config `env` section or process env both work):
50
+
51
+ ```bash
52
+ ELIZA_CLOUD_BASE_URL=http://127.0.0.1:<apiPort>
53
+ ELIZAOS_CLOUD_API_KEY=<a seeded org API key> # see cloud-e2e seedTestUser
54
+ ELIZA_AGENT_SPEND_CAP_USD=20
55
+ ELIZA_ACP_DEFAULT_AGENT=opencode # Cerebras auto-detected; or codex/claude with their keys
56
+ OPENCODE_DISABLE_AUTOUPDATE=1 # opencode's network update check can blow the spawn timeout
57
+ ACPX_DEFAULT_TIMEOUT_MS=600000 # first opencode init (compile + provider fetch) ~3-5min
58
+ ```
59
+
60
+ 3. Create an economics task — `/economics build and monetize a tiny app` in the
61
+ composer, or `POST /api/orchestrator` with
62
+ `metadata: { capabilityProfile: "economics" }`.
63
+
64
+ 4. The sub-agent loads the `build-monetized-app` skill and SKILLS.md and drives
65
+ the loop through the parent-agent broker. Watch the logs for
66
+ `event: "spend_auto_authorized"` on `containers.create` / `domains.buy` —
67
+ that line is the proof the agent spent within its cap without a human prompt.
68
+
69
+ - **Domains gotcha:** `domains.buy` (and `media.*`/`promote.*`) resolve to
70
+ unknown cost and stall on confirmation unless the agent first calls
71
+ `domains.check` and threads the quote into `params.spendEstimateUsd`.
72
+ `containers.create` has a built-in `$0.67/day` estimate, so it
73
+ auto-authorizes without a hint.
74
+ - **`containers.create` needs a `name`** in addition to `appId`/`image`, or
75
+ the cloud call 422s (the spend log still fires; the deploy record is not
76
+ created). A capable agent self-corrects via `list-cloud-commands`.
77
+
78
+ ## Sub-agent → broker dispatcher (now wired)
79
+
80
+ `runCloudCommand` (the only emitter of `spend_auto_authorized`) is now reachable
81
+ by a live agent. The three gaps the earlier draft of this runbook called out are
82
+ closed:
83
+
84
+ 1. **Dispatch.** `SubAgentRouter.handleEvent` accumulates the child's streamed
85
+ `message` text and, when a complete `USE_SKILL parent-agent <json>` directive
86
+ appears, bridges it to `runParentAgentBroker({ runtime, sessionId, session,
87
+ args })` and streams `result.text` back via `acp.sendToSession`
88
+ (`src/services/parent-agent-dispatch.ts`). Detection is marker-guarded (it
89
+ only acts on text containing `USE_SKILL parent-agent`, which ordinary coding
90
+ tasks never emit) and capped by `ACPX_SUB_AGENT_ROUND_TRIP_CAP`.
91
+ 2. **Advertise.** `spawnAgentForTask` writes a `SKILLS.md` into the workdir for
92
+ `capabilityProfile === "economics"` tasks via `buildSkillsManifest(runtime, {
93
+ recommendedSlugs: ["build-monetized-app", "eliza-cloud"], virtualSkills:
94
+ [PARENT_AGENT_BROKER_MANIFEST_ENTRY] })`, so the child learns the `parent-agent`
95
+ slug and its arg contract.
96
+ 3. **Estimate.** The broker's unknown-cost stall now returns an *actionable*
97
+ instruction ("fetch a quote with `domains.check` and retry with
98
+ `params.spendEstimateUsd`") instead of a human-only yes/no, and the manifest
99
+ guidance advertises the same pattern — so an autonomous agent self-authorizes
100
+ `domains.buy` within the cap without a human turn.
101
+
102
+ The directive parser and the broker→`sendToSession` bridge are unit-tested in
103
+ `src/__tests__/parent-agent-dispatch.test.ts`; `spend_auto_authorized` itself
104
+ stays covered by `parent-agent-broker.test.ts`.
105
+
106
+ ## Live verification (2026-06-06)
107
+
108
+ The full loop was run end-to-end against `cloud:mock` with a real
109
+ `opencode` ACP child on a Cerebras key (`gpt-oss-120b`) — no human in the loop:
110
+
111
+ - The child read `SKILLS.md`, then drove `cloud.health → apps.create →
112
+ containers.create` entirely through `USE_SKILL parent-agent {…}` directives.
113
+ `apps.create` created a real app; `containers.create` self-authorized within
114
+ the cap and emitted, verbatim:
115
+ `event:"spend_auto_authorized" command:"containers.create" risk:"paid"
116
+ estimatedCostUsd:0.67 runningTotalUsd:0.67 capUsd:20 reason:"within-cap"`.
117
+ When the first `containers.create` 422'd (missing `name`), the child called
118
+ `list-cloud-commands`, corrected the params, and re-authorized — no human turn.
119
+ - The `domains.buy` self-resolve path was verified at the broker level against
120
+ the same live mock: `domains.check` returned a `$14.95` quote, that price was
121
+ threaded into `params.spendEstimateUsd`, `domains.buy` emitted
122
+ `spend_auto_authorized` ($14.95 of the $20 cap), and the org credit balance
123
+ dropped **1000.00 → 985.05** — a real debit.
124
+
125
+ Two defects the live run surfaced (both fixed):
126
+
127
+ 1. **Windows env forwarding (`acp-service.ts`).** `shouldForwardEnv` matched
128
+ `PATH` case-sensitively, but the repo runtime is Bun and Bun-on-Windows
129
+ reports the key as `Path` — so ACP sub-agents spawned with NO `PATH` and the
130
+ opencode shim died with `'bun' is not recognized`. Now matched
131
+ case-insensitively (+ Windows system vars), with the path key canonicalized
132
+ to `PATH` in `buildEnv`.
133
+ 2. **Mid-turn reply delivery (`parent-agent-dispatch.ts`).** A child emits its
134
+ directive *mid-turn* and ends the turn awaiting the reply; delivering the
135
+ reply is a new prompt, which the transport rejects ("session is already
136
+ busy") until the turn finishes. The old code dropped the reply, stalling the
137
+ loop on the first directive. Delivery now retries until the session goes idle.
138
+
139
+ See `default-eliza-skills-and-agent-bridge-plan.md` for the broader bridge design;
140
+ this runbook is the economics-specific slice.