@elizaos/plugin-agent-orchestrator 2.0.0-alpha.8 → 2.0.0-beta.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.
- package/CHANGELOG.md +62 -0
- package/LICENSE +21 -0
- package/PROJECT.md +119 -0
- package/README.md +160 -0
- package/dist/browser/index.browser.js +21051 -0
- package/dist/browser/index.browser.js.map +29 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.node.cjs +20491 -0
- package/dist/cjs/index.node.js.map +72 -0
- package/dist/index.d.ts +2 -21
- package/dist/node/index.browser.d.ts +3 -0
- package/dist/node/index.browser.d.ts.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.node.d.ts +4 -0
- package/dist/node/index.node.d.ts.map +1 -0
- package/dist/node/index.node.js +20471 -0
- package/dist/node/index.node.js.map +72 -0
- package/dist/node/src/actions/cancel-task.d.ts +3 -0
- package/dist/node/src/actions/cancel-task.d.ts.map +1 -0
- package/dist/node/src/actions/coding-task-handlers.d.ts +69 -0
- package/dist/node/src/actions/coding-task-handlers.d.ts.map +1 -0
- package/dist/node/src/actions/coding-task-helpers.d.ts +35 -0
- package/dist/node/src/actions/coding-task-helpers.d.ts.map +1 -0
- package/dist/node/src/actions/common.d.ts +56 -0
- package/dist/node/src/actions/common.d.ts.map +1 -0
- package/dist/node/src/actions/create-task.d.ts +8 -0
- package/dist/node/src/actions/create-task.d.ts.map +1 -0
- package/dist/node/src/actions/eval-metadata.d.ts +11 -0
- package/dist/node/src/actions/eval-metadata.d.ts.map +1 -0
- package/dist/node/src/actions/finalize-workspace.d.ts +11 -0
- package/dist/node/src/actions/finalize-workspace.d.ts.map +1 -0
- package/dist/node/src/actions/list-agents.d.ts +4 -0
- package/dist/node/src/actions/list-agents.d.ts.map +1 -0
- package/dist/node/src/actions/manage-issues.d.ts +11 -0
- package/dist/node/src/actions/manage-issues.d.ts.map +1 -0
- package/dist/node/src/actions/provision-workspace.d.ts +11 -0
- package/dist/node/src/actions/provision-workspace.d.ts.map +1 -0
- package/dist/node/src/actions/sandbox-stub.d.ts +21 -0
- package/dist/node/src/actions/sandbox-stub.d.ts.map +1 -0
- package/dist/node/src/actions/send-to-agent.d.ts +4 -0
- package/dist/node/src/actions/send-to-agent.d.ts.map +1 -0
- package/dist/node/src/actions/spawn-agent.d.ts +8 -0
- package/dist/node/src/actions/spawn-agent.d.ts.map +1 -0
- package/dist/node/src/actions/stop-agent.d.ts +4 -0
- package/dist/node/src/actions/stop-agent.d.ts.map +1 -0
- package/dist/node/src/actions/task-control.d.ts +3 -0
- package/dist/node/src/actions/task-control.d.ts.map +1 -0
- package/dist/node/src/actions/task-history.d.ts +3 -0
- package/dist/node/src/actions/task-history.d.ts.map +1 -0
- package/dist/node/src/actions/task-share.d.ts +3 -0
- package/dist/node/src/actions/task-share.d.ts.map +1 -0
- package/dist/node/src/actions/task-thread-target.d.ts +11 -0
- package/dist/node/src/actions/task-thread-target.d.ts.map +1 -0
- package/dist/node/src/actions/tasks.d.ts +88 -0
- package/dist/node/src/actions/tasks.d.ts.map +1 -0
- package/dist/node/src/api/agent-routes.d.ts +18 -0
- package/dist/node/src/api/agent-routes.d.ts.map +1 -0
- package/dist/node/src/api/bridge-routes.d.ts +32 -0
- package/dist/node/src/api/bridge-routes.d.ts.map +1 -0
- package/dist/node/src/api/coordinator-routes.d.ts +22 -0
- package/dist/node/src/api/coordinator-routes.d.ts.map +1 -0
- package/dist/node/src/api/hook-routes.d.ts +18 -0
- package/dist/node/src/api/hook-routes.d.ts.map +1 -0
- package/dist/node/src/api/issue-routes.d.ts +17 -0
- package/dist/node/src/api/issue-routes.d.ts.map +1 -0
- package/dist/node/src/api/parent-context-routes.d.ts +17 -0
- package/dist/node/src/api/parent-context-routes.d.ts.map +1 -0
- package/dist/node/src/api/route-utils.d.ts +18 -0
- package/dist/node/src/api/route-utils.d.ts.map +1 -0
- package/dist/node/src/api/routes.d.ts +23 -0
- package/dist/node/src/api/routes.d.ts.map +1 -0
- package/dist/node/src/api/workspace-routes.d.ts +17 -0
- package/dist/node/src/api/workspace-routes.d.ts.map +1 -0
- package/dist/node/src/index.d.ts +32 -0
- package/dist/node/src/index.d.ts.map +1 -0
- package/dist/node/src/providers/action-examples.d.ts +14 -0
- package/dist/node/src/providers/action-examples.d.ts.map +1 -0
- package/dist/node/src/providers/active-sub-agents.d.ts +15 -0
- package/dist/node/src/providers/active-sub-agents.d.ts.map +1 -0
- package/dist/node/src/providers/active-workspace-context.d.ts +13 -0
- package/dist/node/src/providers/active-workspace-context.d.ts.map +1 -0
- package/dist/node/src/providers/available-agents.d.ts +4 -0
- package/dist/node/src/providers/available-agents.d.ts.map +1 -0
- package/dist/node/src/register-routes.d.ts +11 -0
- package/dist/node/src/register-routes.d.ts.map +1 -0
- package/dist/node/src/routes/coding-agents-fallback-routes.d.ts +19 -0
- package/dist/node/src/routes/coding-agents-fallback-routes.d.ts.map +1 -0
- package/dist/node/src/services/acp-service.d.ts +61 -0
- package/dist/node/src/services/acp-service.d.ts.map +1 -0
- package/dist/node/src/services/acpx-subprocess.d.ts +3 -0
- package/dist/node/src/services/acpx-subprocess.d.ts.map +1 -0
- package/dist/node/src/services/agent-credentials.d.ts +23 -0
- package/dist/node/src/services/agent-credentials.d.ts.map +1 -0
- package/dist/node/src/services/agent-metrics.d.ts +30 -0
- package/dist/node/src/services/agent-metrics.d.ts.map +1 -0
- package/dist/node/src/services/agent-selection.d.ts +53 -0
- package/dist/node/src/services/agent-selection.d.ts.map +1 -0
- package/dist/node/src/services/ansi-utils.d.ts +64 -0
- package/dist/node/src/services/ansi-utils.d.ts.map +1 -0
- package/dist/node/src/services/claude-code-skill-installer.d.ts +33 -0
- package/dist/node/src/services/claude-code-skill-installer.d.ts.map +1 -0
- package/dist/node/src/services/config-env.d.ts +23 -0
- package/dist/node/src/services/config-env.d.ts.map +1 -0
- package/dist/node/src/services/coordinator-event-normalizer.d.ts +50 -0
- package/dist/node/src/services/coordinator-event-normalizer.d.ts.map +1 -0
- package/dist/node/src/services/custom-validator-runner.d.ts +66 -0
- package/dist/node/src/services/custom-validator-runner.d.ts.map +1 -0
- package/dist/node/src/services/debug-capture.d.ts +38 -0
- package/dist/node/src/services/debug-capture.d.ts.map +1 -0
- package/dist/node/src/services/json-model-output.d.ts +2 -0
- package/dist/node/src/services/json-model-output.d.ts.map +1 -0
- package/dist/node/src/services/parent-agent-broker.d.ts +21 -0
- package/dist/node/src/services/parent-agent-broker.d.ts.map +1 -0
- package/dist/node/src/services/pty-auto-response.d.ts +30 -0
- package/dist/node/src/services/pty-auto-response.d.ts.map +1 -0
- package/dist/node/src/services/pty-init.d.ts +55 -0
- package/dist/node/src/services/pty-init.d.ts.map +1 -0
- package/dist/node/src/services/pty-service.d.ts +218 -0
- package/dist/node/src/services/pty-service.d.ts.map +1 -0
- package/dist/node/src/services/pty-session-io.d.ts +49 -0
- package/dist/node/src/services/pty-session-io.d.ts.map +1 -0
- package/dist/node/src/services/pty-spawn.d.ts +104 -0
- package/dist/node/src/services/pty-spawn.d.ts.map +1 -0
- package/dist/node/src/services/pty-types.d.ts +94 -0
- package/dist/node/src/services/pty-types.d.ts.map +1 -0
- package/dist/node/src/services/repo-input.d.ts +16 -0
- package/dist/node/src/services/repo-input.d.ts.map +1 -0
- package/dist/node/src/services/session-event-queue.d.ts +25 -0
- package/dist/node/src/services/session-event-queue.d.ts.map +1 -0
- package/dist/node/src/services/session-store.d.ts +107 -0
- package/dist/node/src/services/session-store.d.ts.map +1 -0
- package/dist/node/src/services/skill-callback-bridge.d.ts +78 -0
- package/dist/node/src/services/skill-callback-bridge.d.ts.map +1 -0
- package/dist/node/src/services/skill-essentials.d.ts +16 -0
- package/dist/node/src/services/skill-essentials.d.ts.map +1 -0
- package/dist/node/src/services/skill-lifeops-context-broker.d.ts +20 -0
- package/dist/node/src/services/skill-lifeops-context-broker.d.ts.map +1 -0
- package/dist/node/src/services/skill-manifest.d.ts +48 -0
- package/dist/node/src/services/skill-manifest.d.ts.map +1 -0
- package/dist/node/src/services/skill-recommender.d.ts +51 -0
- package/dist/node/src/services/skill-recommender.d.ts.map +1 -0
- package/dist/node/src/services/spawn-trajectory.d.ts +23 -0
- package/dist/node/src/services/spawn-trajectory.d.ts.map +1 -0
- package/dist/node/src/services/stall-classifier.d.ts +69 -0
- package/dist/node/src/services/stall-classifier.d.ts.map +1 -0
- package/dist/node/src/services/structured-proof-bridge.d.ts +99 -0
- package/dist/node/src/services/structured-proof-bridge.d.ts.map +1 -0
- package/dist/node/src/services/sub-agent-router.d.ts +38 -0
- package/dist/node/src/services/sub-agent-router.d.ts.map +1 -0
- package/dist/node/src/services/swarm-coordinator-prompts.d.ts +93 -0
- package/dist/node/src/services/swarm-coordinator-prompts.d.ts.map +1 -0
- package/dist/node/src/services/swarm-coordinator.d.ts +473 -0
- package/dist/node/src/services/swarm-coordinator.d.ts.map +1 -0
- package/dist/node/src/services/swarm-decision-loop.d.ts +69 -0
- package/dist/node/src/services/swarm-decision-loop.d.ts.map +1 -0
- package/dist/node/src/services/swarm-event-triage.d.ts +49 -0
- package/dist/node/src/services/swarm-event-triage.d.ts.map +1 -0
- package/dist/node/src/services/swarm-history.d.ts +27 -0
- package/dist/node/src/services/swarm-history.d.ts.map +1 -0
- package/dist/node/src/services/swarm-idle-watchdog.d.ts +22 -0
- package/dist/node/src/services/swarm-idle-watchdog.d.ts.map +1 -0
- package/dist/node/src/services/task-acceptance.d.ts +8 -0
- package/dist/node/src/services/task-acceptance.d.ts.map +1 -0
- package/dist/node/src/services/task-agent-auth.d.ts +69 -0
- package/dist/node/src/services/task-agent-auth.d.ts.map +1 -0
- package/dist/node/src/services/task-agent-frameworks.d.ts +90 -0
- package/dist/node/src/services/task-agent-frameworks.d.ts.map +1 -0
- package/dist/node/src/services/task-kind.d.ts +3 -0
- package/dist/node/src/services/task-kind.d.ts.map +1 -0
- package/dist/node/src/services/task-policy.d.ts +17 -0
- package/dist/node/src/services/task-policy.d.ts.map +1 -0
- package/dist/node/src/services/task-registry.d.ts +550 -0
- package/dist/node/src/services/task-registry.d.ts.map +1 -0
- package/dist/node/src/services/task-share.d.ts +18 -0
- package/dist/node/src/services/task-share.d.ts.map +1 -0
- package/dist/node/src/services/task-validation.d.ts +69 -0
- package/dist/node/src/services/task-validation.d.ts.map +1 -0
- package/dist/node/src/services/task-verifier-runner.d.ts +5 -0
- package/dist/node/src/services/task-verifier-runner.d.ts.map +1 -0
- package/dist/node/src/services/trajectory-context.d.ts +73 -0
- package/dist/node/src/services/trajectory-context.d.ts.map +1 -0
- package/dist/node/src/services/trajectory-feedback.d.ts +53 -0
- package/dist/node/src/services/trajectory-feedback.d.ts.map +1 -0
- package/dist/node/src/services/types.d.ts +152 -0
- package/dist/node/src/services/types.d.ts.map +1 -0
- package/dist/node/src/services/workspace-git-ops.d.ts +28 -0
- package/dist/node/src/services/workspace-git-ops.d.ts.map +1 -0
- package/dist/node/src/services/workspace-github.d.ts +60 -0
- package/dist/node/src/services/workspace-github.d.ts.map +1 -0
- package/dist/node/src/services/workspace-lifecycle.d.ts +18 -0
- package/dist/node/src/services/workspace-lifecycle.d.ts.map +1 -0
- package/dist/node/src/services/workspace-service.d.ts +122 -0
- package/dist/node/src/services/workspace-service.d.ts.map +1 -0
- package/dist/node/src/services/workspace-types.d.ts +81 -0
- package/dist/node/src/services/workspace-types.d.ts.map +1 -0
- package/dist/node/src/setup-routes.d.ts +9 -0
- package/dist/node/src/setup-routes.d.ts.map +1 -0
- package/dist/node/vitest.config.d.ts +3 -0
- package/dist/node/vitest.config.d.ts.map +1 -0
- package/docs/default-eliza-skills-and-agent-bridge-plan.md +231 -0
- package/docs/sub-agent-routing.md +197 -0
- package/package.json +113 -37
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -21110
- package/dist/index.js.map +0 -109
- package/dist/src/actions/messaging.d.ts +0 -24
- package/dist/src/actions/messaging.d.ts.map +0 -1
- package/dist/src/actions/peek-subagent.d.ts +0 -3
- package/dist/src/actions/peek-subagent.d.ts.map +0 -1
- package/dist/src/actions/subagent-management.d.ts +0 -7
- package/dist/src/actions/subagent-management.d.ts.map +0 -1
- package/dist/src/actions/task-management.d.ts +0 -9
- package/dist/src/actions/task-management.d.ts.map +0 -1
- package/dist/src/config.d.ts +0 -4
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/providers/orchestrator-config.d.ts +0 -80
- package/dist/src/providers/orchestrator-config.d.ts.map +0 -1
- package/dist/src/providers/task-context.d.ts +0 -3
- package/dist/src/providers/task-context.d.ts.map +0 -1
- package/dist/src/services/agent-orchestrator-service.d.ts +0 -59
- package/dist/src/services/agent-orchestrator-service.d.ts.map +0 -1
- package/dist/src/services/messaging-service.d.ts +0 -111
- package/dist/src/services/messaging-service.d.ts.map +0 -1
- package/dist/src/services/sandbox-service.d.ts +0 -103
- package/dist/src/services/sandbox-service.d.ts.map +0 -1
- package/dist/src/services/subagent-service.d.ts +0 -140
- package/dist/src/services/subagent-service.d.ts.map +0 -1
- package/dist/src/sub-agents/adapter.d.ts +0 -13
- package/dist/src/sub-agents/adapter.d.ts.map +0 -1
- package/dist/src/sub-agents/claude-agent-sdk-sub-agent.d.ts +0 -18
- package/dist/src/sub-agents/claude-agent-sdk-sub-agent.d.ts.map +0 -1
- package/dist/src/sub-agents/codex-sdk-sub-agent.d.ts +0 -18
- package/dist/src/sub-agents/codex-sdk-sub-agent.d.ts.map +0 -1
- package/dist/src/sub-agents/eliza-sub-agent.d.ts +0 -27
- package/dist/src/sub-agents/eliza-sub-agent.d.ts.map +0 -1
- package/dist/src/sub-agents/elizaos-native-sub-agent.d.ts +0 -61
- package/dist/src/sub-agents/elizaos-native-sub-agent.d.ts.map +0 -1
- package/dist/src/sub-agents/index.d.ts +0 -10
- package/dist/src/sub-agents/index.d.ts.map +0 -1
- package/dist/src/sub-agents/opencode-sub-agent.d.ts +0 -44
- package/dist/src/sub-agents/opencode-sub-agent.d.ts.map +0 -1
- package/dist/src/sub-agents/registry.d.ts +0 -3
- package/dist/src/sub-agents/registry.d.ts.map +0 -1
- package/dist/src/sub-agents/sweagent-sub-agent.d.ts +0 -19
- package/dist/src/sub-agents/sweagent-sub-agent.d.ts.map +0 -1
- package/dist/src/sub-agents/tools.d.ts +0 -15
- package/dist/src/sub-agents/tools.d.ts.map +0 -1
- package/dist/src/sub-agents/types.d.ts +0 -170
- package/dist/src/sub-agents/types.d.ts.map +0 -1
- package/dist/src/types/index.d.ts +0 -12
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/messaging.d.ts +0 -202
- package/dist/src/types/messaging.d.ts.map +0 -1
- package/dist/src/types/sandbox.d.ts +0 -228
- package/dist/src/types/sandbox.d.ts.map +0 -1
- package/dist/src/types/subagent.d.ts +0 -232
- package/dist/src/types/subagent.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -138
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/utils/index.d.ts +0 -7
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/session.d.ts +0 -184
- package/dist/src/utils/session.d.ts.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0 (unreleased)
|
|
4
|
+
|
|
5
|
+
Consolidated ACP-based spawn, PTY sessions, and workspace services into
|
|
6
|
+
a single package at `plugins/plugin-agent-orchestrator`. Internal
|
|
7
|
+
`@elizaos/plugin-acpx` callers were rewritten to the consolidated package.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `SubAgentRouter` service: subscribes to `AcpService.onSessionEvent`,
|
|
12
|
+
posts terminal events (`task_complete`, `error`, `blocked`) as
|
|
13
|
+
synthetic inbound memories addressed to the original
|
|
14
|
+
`roomId`/`userId`/`messageId` captured at spawn time. Lets the main
|
|
15
|
+
agent's normal action layer decide `REPLY` / `SEND_TO_AGENT` / both.
|
|
16
|
+
- `activeSubAgentsProvider`: cache-stable view of routed sub-agent
|
|
17
|
+
sessions. Sorted by sessionId, structural-only fields, status bucketing
|
|
18
|
+
(`ready`/`running`/`busy`/`tool_running`/`authenticating` → `"active"`)
|
|
19
|
+
so transient flips don't invalidate the prefix cache.
|
|
20
|
+
- Round-trip cap: per-session inject counter; force-stops after
|
|
21
|
+
`ACPX_SUB_AGENT_ROUND_TRIP_CAP` (default 32) and surfaces a single
|
|
22
|
+
`round_trip_cap_exceeded` notice with `subAgentRoundTrip` /
|
|
23
|
+
`subAgentRoundTripCap` / `subAgentCapExceeded: true`.
|
|
24
|
+
- Live e2e test (`__tests__/live/sub-agent-router.live.test.ts`) gated on
|
|
25
|
+
`RUN_LIVE_ACPX=1` plus `acpx --version`.
|
|
26
|
+
- `spawnAgentAction` now threads `source: content.source` into spawn
|
|
27
|
+
metadata for parity with `createTaskAction`.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- Package renamed from `@elizaos/plugin-acpx` → `@elizaos/plugin-agent-orchestrator`.
|
|
32
|
+
- `SubAgentRouter` derives the per-session sub-agent UUID locally via SHA1
|
|
33
|
+
instead of importing `createUniqueUuid` from `@elizaos/core`. This keeps
|
|
34
|
+
the router's import surface type-only.
|
|
35
|
+
- Browser build dropped: this package owns Node-only services
|
|
36
|
+
(`PTYService`, `CodingWorkspaceService`, child_process spawn).
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- `task-agent-frameworks.ts` `normalizeTaskAgentAdapterForModelPrefs`:
|
|
41
|
+
removed three duplicate switch cases (`opencode` / `open-code` /
|
|
42
|
+
`open code`) that were dead code after the matching cases earlier in
|
|
43
|
+
the same switch.
|
|
44
|
+
- Greptile-flagged bugs from PR #7463 (already on develop pre-rename):
|
|
45
|
+
`"errored"` → `"error"` status normalization,
|
|
46
|
+
`listSessions`/`getSession` for FileSessionStore + RuntimeDbSessionStore,
|
|
47
|
+
`enforceSessionLimit` excluding both `"error"` and `"errored"`.
|
|
48
|
+
|
|
49
|
+
### Deprecated
|
|
50
|
+
|
|
51
|
+
- `swarm-coordinator.ts` and the entire `swarm-*` / `pty-*` family are
|
|
52
|
+
retained for callers that still depend on `PTYService`, but are
|
|
53
|
+
dormant for ACP-spawned sessions. Retiring them is a follow-up
|
|
54
|
+
cleanup; new work should use `AcpService` + `SubAgentRouter`.
|
|
55
|
+
|
|
56
|
+
## 0.1.0
|
|
57
|
+
|
|
58
|
+
Pre-consolidation. Bootstrap package scaffold for `@elizaos/plugin-acpx`
|
|
59
|
+
under its original name. Initial ACP subprocess service, session store
|
|
60
|
+
adapters, six canonical actions (`CREATE_TASK`, `SPAWN_AGENT`,
|
|
61
|
+
`SEND_TO_AGENT`, `STOP_AGENT`, `LIST_AGENTS`, `CANCEL_TASK`), and the
|
|
62
|
+
`availableAgentsProvider`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 @stwd / 0xSolace
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PROJECT.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# @elizaos/plugin-agent-orchestrator
|
|
2
|
+
|
|
3
|
+
ElizaOS plugin: acpx-backed task and subagent backend (wraps the `acpx` CLI to spawn coding agents). Sibling, not replacement, for `@elizaos/plugin-agent-orchestrator`. Distinct from `@elizaos/plugin-acp` (Shaw's ACP gateway client).
|
|
4
|
+
|
|
5
|
+
Drop-in compatible with `@elizaos/plugin-agent-orchestrator` (PTY-based). Uses
|
|
6
|
+
ACPX (Agent Client Protocol CLI) under the hood for structured streaming,
|
|
7
|
+
named sessions, cooperative cancel, and crash-resilient sessions.
|
|
8
|
+
|
|
9
|
+
## Why this exists
|
|
10
|
+
|
|
11
|
+
`plugin-agent-orchestrator` (sibling, PTY-based) maintains an entire
|
|
12
|
+
stall-classifier, ANSI-stripping, prompt-regex-dismissal, pty-state-capture
|
|
13
|
+
stack to extract structure out of terminal byte streams. The Agent Client Protocol (ACP) is the structured
|
|
14
|
+
protocol underneath, `tool_call`, `thinking`, `diff`, `done` events, typed
|
|
15
|
+
auth handshake, cooperative `session/cancel`. ACPX provides one CLI surface
|
|
16
|
+
across 15 Agent Client Protocol (ACP)-compatible coding agents (codex, claude-code, gemini, copilot,
|
|
17
|
+
cursor, droid, local Eliza-1 agents, etc).
|
|
18
|
+
|
|
19
|
+
This plugin is a sibling-not-replacement: deploys alongside
|
|
20
|
+
`plugin-agent-orchestrator`, exposes the same action names so users can switch
|
|
21
|
+
transports by swapping the plugin import.
|
|
22
|
+
|
|
23
|
+
## Goals
|
|
24
|
+
|
|
25
|
+
- Drop-in action surface compatible with `plugin-agent-orchestrator`
|
|
26
|
+
- ACPX subprocess transport (NDJSON streaming, no pty)
|
|
27
|
+
- Configurable cli binary (`ELIZA_ACP_CLI=acpx`, override possible)
|
|
28
|
+
- Persistent named sessions (eliza-runtime-table-backed)
|
|
29
|
+
- Cooperative cancel + crash reconnect
|
|
30
|
+
- 80%+ unit test coverage
|
|
31
|
+
- Parity smoke vs plugin-agent-orchestrator on at least codex
|
|
32
|
+
- Publishable to npm under `@elizaos`
|
|
33
|
+
|
|
34
|
+
## Non-goals
|
|
35
|
+
|
|
36
|
+
- Replace plugin-agent-orchestrator (sibling, not replacement)
|
|
37
|
+
- Git workspace provisioning (PROVISION_WORKSPACE / FINALIZE_WORKSPACE)
|
|
38
|
+
- Frontend xterm view
|
|
39
|
+
- Non-codex agent support in v0.1.0 (codex first; claude/gemini in 0.2.0+)
|
|
40
|
+
|
|
41
|
+
## Action surface
|
|
42
|
+
|
|
43
|
+
Match `plugin-agent-orchestrator` exactly:
|
|
44
|
+
|
|
45
|
+
| Action | Purpose |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `SPAWN_AGENT` | Spawn an acpx coding-agent session |
|
|
48
|
+
| `SEND_TO_AGENT` | Send prompt or input to running session |
|
|
49
|
+
| `LIST_AGENTS` | List active sessions |
|
|
50
|
+
| `STOP_AGENT` | Terminate session via session/cancel |
|
|
51
|
+
| `CREATE_TASK` | Async task (spawn + first prompt + return when done) |
|
|
52
|
+
| `CANCEL_TASK` | Cooperative cancel |
|
|
53
|
+
|
|
54
|
+
## Provider
|
|
55
|
+
|
|
56
|
+
`availableAgents` provider exposes which Agent Client Protocol (ACP)-compatible agents are installed.
|
|
57
|
+
|
|
58
|
+
## Architecture
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
┌─────────────────────────┐
|
|
62
|
+
│ Eliza runtime │
|
|
63
|
+
│ ├─ actions (SPAWN, ..) │
|
|
64
|
+
│ └─ provider (available)│
|
|
65
|
+
└──────────┬──────────────┘
|
|
66
|
+
│
|
|
67
|
+
┌──────────v──────────────┐
|
|
68
|
+
│ AcpService │
|
|
69
|
+
│ - spawn `acpx` proc │
|
|
70
|
+
│ - parse NDJSON stream │
|
|
71
|
+
│ - emit typed events │
|
|
72
|
+
│ - cancel via session/ │
|
|
73
|
+
└──────────┬──────────────┘
|
|
74
|
+
│
|
|
75
|
+
┌──────────v──────────────┐
|
|
76
|
+
│ acpx (cli subprocess) │
|
|
77
|
+
│ --format json │
|
|
78
|
+
│ codex / claude / etc │
|
|
79
|
+
└─────────────────────────┘
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Reference materials
|
|
83
|
+
|
|
84
|
+
- `acpx-docs/README.md`, acpx README
|
|
85
|
+
- `acpx-docs/docs_CLI.md`, full acpx CLI reference
|
|
86
|
+
- `acpx-docs/skills_acpx_SKILL.md`, skill reference
|
|
87
|
+
|
|
88
|
+
## Layout
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
src/
|
|
92
|
+
index.ts # plugin export
|
|
93
|
+
actions/
|
|
94
|
+
spawn-agent.ts
|
|
95
|
+
send-to-agent.ts
|
|
96
|
+
list-agents.ts
|
|
97
|
+
stop-agent.ts
|
|
98
|
+
create-task.ts
|
|
99
|
+
cancel-task.ts
|
|
100
|
+
providers/
|
|
101
|
+
available-agents.ts
|
|
102
|
+
services/
|
|
103
|
+
acp-service.ts # core ACPX wrapper
|
|
104
|
+
session-store.ts # persistent session state
|
|
105
|
+
types.ts # acpx event types
|
|
106
|
+
__tests__/
|
|
107
|
+
*.test.ts
|
|
108
|
+
docs/
|
|
109
|
+
sub-agent-routing.md
|
|
110
|
+
PROJECT.md # this file
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Status
|
|
114
|
+
|
|
115
|
+
🚧 Bootstrapping, wave A in progress.
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# @elizaos/plugin-agent-orchestrator
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@elizaos/plugin-agent-orchestrator)
|
|
4
|
+
[](https://github.com/elizaos/eliza/actions/workflows/ci.yml)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
The canonical orchestration plugin for ElizaOS task agents. Spawns local coding agents (codex, claude, gemini, ...) via the [`acpx`](https://github.com/0xouroboros/acp) CLI using the structured Agent Client Protocol, routes their output back through the runtime so the main agent decides what to do, and bundles workspace lifecycle, GitHub PR integration, task share, and supporting services in a single package.
|
|
8
|
+
|
|
9
|
+
> Naming: this plugin is *not* the same thing as `@elizaos/plugin-acp`. That package is Shaw's ACP gateway client (IDE bridge over a remote ACP gateway). `@elizaos/plugin-agent-orchestrator` is the *task backend* that uses `acpx` to run coding agents as subprocesses on the same host as the runtime.
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
The plugin combines three concerns:
|
|
14
|
+
|
|
15
|
+
1. **Spawn** coding agents via ACP. The ACP path uses typed JSON-RPC events — `tool_call` / `tool_call_update`, `agent_message_chunk`, cooperative `session/cancel`, parallel sessions in the same workspace, recoverable via `session/load`.
|
|
16
|
+
2. **Route** sub-agent terminal events (`task_complete`, `error`, `blocked`) back into the runtime as synthetic inbound messages addressed to the original `roomId`/`userId`/`messageId`. The main agent's normal action layer then decides whether to `REPLY` to the user, `SEND_TO_AGENT` to push the sub-agent further, or both. See [`docs/sub-agent-routing.md`](./docs/sub-agent-routing.md).
|
|
17
|
+
3. **Coordinate** workspace lifecycle (clone, branch, commit, push, PR open) and GitHub issue management for repo-hosted tasks.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @elizaos/plugin-agent-orchestrator
|
|
23
|
+
npm install -g acpx@latest
|
|
24
|
+
acpx --version
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
You also need at least one ACP-compatible agent CLI (`codex`, `claude`, or `gemini`) installed and authenticated.
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import agentOrchestratorPlugin from "@elizaos/plugin-agent-orchestrator";
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
plugins: [agentOrchestratorPlugin],
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Action surface
|
|
40
|
+
|
|
41
|
+
| Action | Purpose |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `ACPX_CREATE_TASK` (`CREATE_TASK`) | One-shot: spawn + prompt + return. Captures origin metadata for routing. |
|
|
44
|
+
| `SPAWN_AGENT` | Start a long-lived ACP coding-agent session. Returns `data.agents[]`. |
|
|
45
|
+
| `SEND_TO_AGENT` | Send a follow-up prompt to a running session. The main agent uses this to push a sub-agent further when its proof is unsatisfying. |
|
|
46
|
+
| `STOP_AGENT` | Cooperatively cancel + close a session. |
|
|
47
|
+
| `LIST_AGENTS` | List active and persisted sessions. |
|
|
48
|
+
| `CANCEL_TASK` | Cancel an in-flight task while preserving history. |
|
|
49
|
+
| `TASK_HISTORY` / `TASK_CONTROL` / `TASK_SHARE` | Task lifecycle ops over the coordinator surface. |
|
|
50
|
+
| `PROVISION_WORKSPACE` / `FINALIZE_WORKSPACE` | Git workspace setup, commit, push, PR open. |
|
|
51
|
+
| `MANAGE_ISSUES` | GitHub issue create/list/update/close. |
|
|
52
|
+
|
|
53
|
+
## Providers
|
|
54
|
+
|
|
55
|
+
- `AVAILABLE_AGENTS` — adapter inventory + raw session list.
|
|
56
|
+
- `ACTIVE_SUB_AGENTS` — cache-stable view of currently-routed sub-agent sessions; sorted by sessionId, structural fields only (no timestamps, no message excerpts), so the planner-visible block stays cached across status flips.
|
|
57
|
+
- `ACTIVE_WORKSPACE_CONTEXT` — live workspace/session state.
|
|
58
|
+
- `CODING_AGENT_EXAMPLES` — structured action call examples.
|
|
59
|
+
|
|
60
|
+
## Services
|
|
61
|
+
|
|
62
|
+
- `AcpService` — ACP subprocess lifecycle, NDJSON parsing, session state, event emission. Registers under `ACP_SUBPROCESS_SERVICE`.
|
|
63
|
+
- `SubAgentRouter` (canonical) — subscribes to `AcpService.onSessionEvent`, posts terminal-event synthetic memories to `runtime.messageService.handleMessage`. Per-session round-trip cap (`ACPX_SUB_AGENT_ROUND_TRIP_CAP`, default 32) force-stops runaway loops. Disable with `ACPX_SUB_AGENT_ROUTER_DISABLED=1`.
|
|
64
|
+
- `PTYService` — PTY-based spawn surface. Bound to `pty-manager`.
|
|
65
|
+
- `CodingWorkspaceService` — git workspace lifecycle helpers.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import { AcpService, SubAgentRouter } from "@elizaos/plugin-agent-orchestrator";
|
|
69
|
+
|
|
70
|
+
const acp = runtime.getService("ACP_SUBPROCESS_SERVICE") as AcpService;
|
|
71
|
+
|
|
72
|
+
const { sessionId } = await acp.spawnSession({
|
|
73
|
+
agentType: "codex",
|
|
74
|
+
workdir: "/tmp/my-task",
|
|
75
|
+
approvalPreset: "permissive",
|
|
76
|
+
metadata: {
|
|
77
|
+
roomId: message.roomId,
|
|
78
|
+
userId: message.entityId,
|
|
79
|
+
messageId: message.id,
|
|
80
|
+
label: "fix bug 42",
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const result = await acp.sendPrompt(sessionId, "what is 7 + 8?");
|
|
85
|
+
console.log(result.finalText); // "15"
|
|
86
|
+
console.log(result.stopReason); // "end_turn"
|
|
87
|
+
console.log(result.durationMs); // 4864
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Subscribing to events
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
acp.onSessionEvent((sessionId, eventName, data) => {
|
|
94
|
+
// eventName: "ready" | "message" | "tool_running" | "task_complete" | "stopped" | "error" | "blocked" | "login_required" | "reconnected"
|
|
95
|
+
// data shape depends on eventName, see SessionEventName in src/services/types.ts
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The `task_complete` event:
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
{ response: string, durationMs: number, stopReason: "end_turn" | "error" | string }
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
You usually don't subscribe directly — `SubAgentRouter` already does, and routes terminal events into the runtime. Subscribe only if you need raw access (e.g. dashboards).
|
|
106
|
+
|
|
107
|
+
## Configuration
|
|
108
|
+
|
|
109
|
+
All configuration is via environment variables. Sensible defaults; most users only need `ELIZA_ACP_CLI` if `acpx` is not on `PATH`.
|
|
110
|
+
|
|
111
|
+
| Variable | Default | Purpose |
|
|
112
|
+
| --- | --- | --- |
|
|
113
|
+
| `ELIZA_ACP_CLI` | `acpx` | ACPX executable name or absolute path. |
|
|
114
|
+
| `ELIZA_ACP_DEFAULT_AGENT` | `codex` | Default agent type. |
|
|
115
|
+
| `ELIZA_ACP_DEFAULT_APPROVAL` | `autonomous` | Approval preset (`read-only`, `auto`, `permissive`, `autonomous`, `full-access`). |
|
|
116
|
+
| `ELIZA_ACP_PROMPT_TIMEOUT_MS` / `ACPX_DEFAULT_TIMEOUT_MS` | `1800000` (30m) | Per-prompt timeout. |
|
|
117
|
+
| `ELIZA_ACP_AUTH_TIMEOUT_MS` | `120000` | Auth handshake timeout. |
|
|
118
|
+
| `ELIZA_ACP_STATE_DIR` | `~/.eliza/plugin-acpx` | Where to persist session state when no runtime DB. |
|
|
119
|
+
| `ACPX_DEFAULT_CWD` | runtime cwd | Base directory for spawned agent workdirs. |
|
|
120
|
+
| `ELIZA_ACP_LOG_LEVEL` | `info` | `debug` \| `info` \| `warn` \| `error`. |
|
|
121
|
+
| `ELIZA_ACP_MAX_SESSIONS` | `8` | Concurrent session cap. |
|
|
122
|
+
| `ACPX_SUB_AGENT_ROUTER_DISABLED` | unset | Set to `1` to keep the router service registered but unbound (test/staging). |
|
|
123
|
+
| `ACPX_SUB_AGENT_ROUND_TRIP_CAP` | `32` | Per-session inject cap before force-stop to prevent ping-pong loops. |
|
|
124
|
+
|
|
125
|
+
## Persistence
|
|
126
|
+
|
|
127
|
+
Session state is persisted with a tiered backend:
|
|
128
|
+
|
|
129
|
+
1. If `runtime.databaseAdapter` exposes SQL methods, sessions live in the `acp_sessions` table.
|
|
130
|
+
2. Otherwise, JSON file at `$ELIZA_ACP_STATE_DIR/sessions.json` (atomic writes via temp+rename).
|
|
131
|
+
3. Last resort: in-memory `Map` (warns that sessions won't survive restart).
|
|
132
|
+
|
|
133
|
+
## End-to-end smoke tests
|
|
134
|
+
|
|
135
|
+
Two smokes ship with the repo:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Raw AcpService against installed acpx + codex:
|
|
139
|
+
npm install -g acpx@latest
|
|
140
|
+
# authenticate codex first
|
|
141
|
+
npm run build
|
|
142
|
+
node tests/e2e/acp-codex-smoke.mjs
|
|
143
|
+
|
|
144
|
+
# Full router loop (vitest, gated):
|
|
145
|
+
RUN_LIVE_ACPX=1 bun run test
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
`acp-codex-smoke.mjs` spawns a real codex session, sends "what is 7 + 8?", and verifies `task_complete` fires with response `"15"`. The vitest live test (`__tests__/live/sub-agent-router.live.test.ts`) verifies the synthetic Memory routes back from a real subprocess into a fake `messageService.handleMessage` with all routing keys intact. Both no-op (skip) when `acpx` isn't installed.
|
|
149
|
+
|
|
150
|
+
## Status
|
|
151
|
+
|
|
152
|
+
`0.2.0` — consolidated package. ACP subprocess sessions are the primary spawn path; PTY services remain available for terminal-backed route handlers and coordinator tooling.
|
|
153
|
+
|
|
154
|
+
## Contributing
|
|
155
|
+
|
|
156
|
+
PRs welcome. Run `npm run typecheck && npm test` before opening.
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
MIT. See [LICENSE](./LICENSE).
|