@elizaos/plugin-agent-orchestrator 0.1.0 → 0.3.0
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/README.md +29 -6
- package/dist/actions/coding-task-handlers.d.ts +44 -0
- package/dist/actions/coding-task-handlers.d.ts.map +1 -0
- package/dist/actions/coding-task-helpers.d.ts +27 -0
- package/dist/actions/coding-task-helpers.d.ts.map +1 -0
- package/dist/actions/finalize-workspace.d.ts +11 -0
- package/dist/actions/finalize-workspace.d.ts.map +1 -0
- package/dist/actions/list-agents.d.ts +11 -0
- package/dist/actions/list-agents.d.ts.map +1 -0
- package/dist/actions/manage-issues.d.ts +11 -0
- package/dist/actions/manage-issues.d.ts.map +1 -0
- package/dist/actions/provision-workspace.d.ts +11 -0
- package/dist/actions/provision-workspace.d.ts.map +1 -0
- package/dist/actions/send-to-agent.d.ts +11 -0
- package/dist/actions/send-to-agent.d.ts.map +1 -0
- package/dist/actions/spawn-agent.d.ts +11 -0
- package/dist/actions/spawn-agent.d.ts.map +1 -0
- package/dist/actions/start-coding-task.d.ts +17 -0
- package/dist/actions/start-coding-task.d.ts.map +1 -0
- package/dist/actions/stop-agent.d.ts +11 -0
- package/dist/actions/stop-agent.d.ts.map +1 -0
- package/dist/api/agent-routes.d.ts +18 -0
- package/dist/api/agent-routes.d.ts.map +1 -0
- package/dist/api/coordinator-routes.d.ts +22 -0
- package/dist/api/coordinator-routes.d.ts.map +1 -0
- package/dist/api/issue-routes.d.ts +17 -0
- package/dist/api/issue-routes.d.ts.map +1 -0
- package/dist/api/routes.d.ts +36 -0
- package/dist/api/routes.d.ts.map +1 -0
- package/dist/api/workspace-routes.d.ts +17 -0
- package/dist/api/workspace-routes.d.ts.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +976 -648
- package/dist/index.js.map +15 -14
- package/dist/providers/action-examples.d.ts +13 -0
- package/dist/providers/action-examples.d.ts.map +1 -0
- package/dist/providers/active-workspace-context.d.ts +13 -0
- package/dist/providers/active-workspace-context.d.ts.map +1 -0
- package/dist/services/agent-metrics.d.ts +28 -0
- package/dist/services/agent-metrics.d.ts.map +1 -0
- package/dist/services/agent-selection.d.ts +53 -0
- package/dist/services/agent-selection.d.ts.map +1 -0
- package/dist/services/ansi-utils.d.ts +48 -0
- package/dist/services/ansi-utils.d.ts.map +1 -0
- package/dist/services/pty-auto-response.d.ts +30 -0
- package/dist/services/pty-auto-response.d.ts.map +1 -0
- package/dist/services/pty-init.d.ts +45 -0
- package/dist/services/pty-init.d.ts.map +1 -0
- package/dist/services/pty-service.d.ts +92 -0
- package/dist/services/pty-service.d.ts.map +1 -0
- package/dist/services/pty-session-io.d.ts +46 -0
- package/dist/services/pty-session-io.d.ts.map +1 -0
- package/dist/services/pty-spawn.d.ts +50 -0
- package/dist/services/pty-spawn.d.ts.map +1 -0
- package/dist/services/pty-types.d.ts +80 -0
- package/dist/services/pty-types.d.ts.map +1 -0
- package/dist/services/stall-classifier.d.ts +44 -0
- package/dist/services/stall-classifier.d.ts.map +1 -0
- package/dist/services/swarm-coordinator-prompts.d.ts +75 -0
- package/dist/services/swarm-coordinator-prompts.d.ts.map +1 -0
- package/dist/services/swarm-coordinator.d.ts +196 -0
- package/dist/services/swarm-coordinator.d.ts.map +1 -0
- package/dist/services/swarm-decision-loop.d.ts +44 -0
- package/dist/services/swarm-decision-loop.d.ts.map +1 -0
- package/dist/services/swarm-event-triage.d.ts +49 -0
- package/dist/services/swarm-event-triage.d.ts.map +1 -0
- package/dist/services/swarm-idle-watchdog.d.ts +22 -0
- package/dist/services/swarm-idle-watchdog.d.ts.map +1 -0
- package/dist/services/workspace-git-ops.d.ts +28 -0
- package/dist/services/workspace-git-ops.d.ts.map +1 -0
- package/dist/services/workspace-github.d.ts +58 -0
- package/dist/services/workspace-github.d.ts.map +1 -0
- package/dist/services/workspace-lifecycle.d.ts +18 -0
- package/dist/services/workspace-lifecycle.d.ts.map +1 -0
- package/dist/services/workspace-service.d.ts +84 -0
- package/dist/services/workspace-service.d.ts.map +1 -0
- package/dist/services/workspace-types.d.ts +81 -0
- package/dist/services/workspace-types.d.ts.map +1 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Orchestrate CLI-based coding agents (Claude Code, Codex, Gemini CLI, Aider, Pi) via PTY sessions and manage git workspaces for autonomous coding tasks.
|
|
4
4
|
|
|
5
|
+
Built for [Milady](https://github.com/milady-ai/milady). The plugin registers ElizaOS-compatible actions and services, so any ElizaOS agent can spawn and manage coding agents via chat. The full experience — live xterm terminal views, real-time PTY output streaming, and the swarm monitoring dashboard — requires the Milady frontend and server.
|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- **PTY Session Management**: Spawn, control, and monitor coding agents running in pseudo-terminals
|
|
@@ -9,14 +11,33 @@ Orchestrate CLI-based coding agents (Claude Code, Codex, Gemini CLI, Aider, Pi)
|
|
|
9
11
|
- **PR Workflow**: Commit changes, push to remote, create pull requests
|
|
10
12
|
- **Multi-Agent Support**: Claude Code, Codex, Gemini CLI, Aider, Pi, or generic shell
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
This plugin spawns CLI coding agents in PTY sessions. You need **at least one** of the following installed on your machine:
|
|
17
|
+
|
|
18
|
+
| Agent | Install | Docs |
|
|
19
|
+
|-------|---------|------|
|
|
20
|
+
| **Claude Code** | `npm install -g @anthropic-ai/claude-code` | [claude.ai/claude-code](https://claude.ai/claude-code) |
|
|
21
|
+
| **Codex** | `npm install -g @openai/codex` | [github.com/openai/codex](https://github.com/openai/codex) |
|
|
22
|
+
| **Gemini CLI** | `npm install -g @google/gemini-cli` | [github.com/google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli) |
|
|
23
|
+
| **Aider** | `pip install aider-chat` | [aider.chat](https://aider.chat) |
|
|
24
|
+
|
|
25
|
+
Each agent also requires its own API key (e.g., `ANTHROPIC_API_KEY` for Claude Code, `OPENAI_API_KEY` for Codex, `GOOGLE_GENERATIVE_AI_API_KEY` for Gemini). Set these in your environment or runtime settings.
|
|
13
26
|
|
|
14
|
-
|
|
27
|
+
The plugin auto-detects which agents are available at spawn time and will report if a requested agent isn't installed.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
15
30
|
|
|
16
31
|
```bash
|
|
17
|
-
|
|
32
|
+
npm install @elizaos/plugin-agent-orchestrator
|
|
18
33
|
```
|
|
19
34
|
|
|
35
|
+
The following peer dependencies will be installed automatically:
|
|
36
|
+
|
|
37
|
+
- `pty-manager` — PTY session management
|
|
38
|
+
- `git-workspace-service` — git workspace provisioning
|
|
39
|
+
- `coding-agent-adapters` — CLI agent adapter layer
|
|
40
|
+
|
|
20
41
|
## Usage
|
|
21
42
|
|
|
22
43
|
### Register the Plugin
|
|
@@ -24,7 +45,7 @@ pnpm add pty-manager git-workspace-service
|
|
|
24
45
|
```typescript
|
|
25
46
|
import { codingAgentPlugin } from "@elizaos/plugin-agent-orchestrator";
|
|
26
47
|
|
|
27
|
-
// Add to your ElizaOS agent configuration
|
|
48
|
+
// Add to your Milady or ElizaOS agent configuration
|
|
28
49
|
const agent = {
|
|
29
50
|
plugins: [codingAgentPlugin],
|
|
30
51
|
// ... other config
|
|
@@ -161,8 +182,10 @@ runtime.setSetting("CODING_WORKSPACE_CONFIG", {
|
|
|
161
182
|
|
|
162
183
|
## Dependencies
|
|
163
184
|
|
|
164
|
-
- `pty-manager` - PTY session management with
|
|
165
|
-
- `
|
|
185
|
+
- `pty-manager` - PTY session management with stall detection and auto-response
|
|
186
|
+
- `coding-agent-adapters` - Adapter layer for Claude Code, Codex, Gemini CLI, Aider CLIs
|
|
187
|
+
- `git-workspace-service` - Git workspace provisioning, credential management, and PR creation
|
|
188
|
+
- `pty-console` - Terminal bridge for xterm.js frontend integration
|
|
166
189
|
|
|
167
190
|
## License
|
|
168
191
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler logic for the START_CODING_TASK action.
|
|
3
|
+
*
|
|
4
|
+
* - handleMultiAgent() -- Multi-agent mode (pipe-delimited `agents` param)
|
|
5
|
+
* - handleSingleAgent() -- Single-agent mode (standard handler path)
|
|
6
|
+
*
|
|
7
|
+
* @module actions/coding-task-handlers
|
|
8
|
+
*/
|
|
9
|
+
import { type ActionResult, type HandlerCallback, type IAgentRuntime, type Memory, type State } from "@elizaos/core";
|
|
10
|
+
import type { AgentCredentials } from "coding-agent-adapters";
|
|
11
|
+
import type { PTYService } from "../services/pty-service.js";
|
|
12
|
+
import { type CodingAgentType } from "../services/pty-types.js";
|
|
13
|
+
import type { CodingWorkspaceService } from "../services/workspace-service.js";
|
|
14
|
+
/** Shared context passed to both multi-agent and single-agent handlers */
|
|
15
|
+
export interface CodingTaskContext {
|
|
16
|
+
runtime: IAgentRuntime;
|
|
17
|
+
ptyService: PTYService;
|
|
18
|
+
wsService: CodingWorkspaceService | undefined;
|
|
19
|
+
credentials: AgentCredentials;
|
|
20
|
+
customCredentials: Record<string, string> | undefined;
|
|
21
|
+
callback: HandlerCallback | undefined;
|
|
22
|
+
message: Memory;
|
|
23
|
+
state: State | undefined;
|
|
24
|
+
repo: string | undefined;
|
|
25
|
+
defaultAgentType: CodingAgentType;
|
|
26
|
+
rawAgentType: string;
|
|
27
|
+
memoryContent: string | undefined;
|
|
28
|
+
approvalPreset: string | undefined;
|
|
29
|
+
explicitLabel: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Multi-agent mode handler.
|
|
33
|
+
*
|
|
34
|
+
* Parses pipe-delimited agent specs and spawns each agent in its own
|
|
35
|
+
* workspace clone (or scratch directory).
|
|
36
|
+
*/
|
|
37
|
+
export declare function handleMultiAgent(ctx: CodingTaskContext, agentsParam: string): Promise<ActionResult | undefined>;
|
|
38
|
+
/**
|
|
39
|
+
* Single-agent mode handler.
|
|
40
|
+
*
|
|
41
|
+
* Provisions a workspace (clone or scratch) and spawns a single coding agent.
|
|
42
|
+
*/
|
|
43
|
+
export declare function handleSingleAgent(ctx: CodingTaskContext, task: string | undefined): Promise<ActionResult | undefined>;
|
|
44
|
+
//# sourceMappingURL=coding-task-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-task-handlers.d.ts","sourceRoot":"","sources":["../../src/actions/coding-task-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,KAAK,MAAM,EACX,KAAK,KAAK,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EACL,KAAK,eAAe,EAKrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAU/E,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC9C,WAAW,EAAE,gBAAgB,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACtD,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,gBAAgB,EAAE,eAAe,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,iBAAiB,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CA2PnC;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAoMnC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper functions for the START_CODING_TASK action.
|
|
3
|
+
*
|
|
4
|
+
* - createScratchDir() -- Creates a scratch sandbox directory for non-repo tasks
|
|
5
|
+
* - generateLabel() -- Generate a short semantic label from repo URL and/or task description
|
|
6
|
+
* - registerSessionEvents() -- Register lifecycle event handlers for a spawned session
|
|
7
|
+
*
|
|
8
|
+
* @module actions/coding-task-helpers
|
|
9
|
+
*/
|
|
10
|
+
import { type HandlerCallback, type IAgentRuntime } from "@elizaos/core";
|
|
11
|
+
import type { PTYService } from "../services/pty-service.js";
|
|
12
|
+
/** Create a scratch sandbox directory for non-repo tasks */
|
|
13
|
+
export declare function createScratchDir(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Generate a short semantic label from repo URL and/or task description.
|
|
16
|
+
* e.g. "git-workspace-service-testbed/hello-mima" or "scratch/react-research"
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateLabel(repo: string | undefined, task: string | undefined): string;
|
|
19
|
+
/**
|
|
20
|
+
* Register lifecycle event handlers for a spawned session.
|
|
21
|
+
*
|
|
22
|
+
* When `coordinatorActive` is true the SwarmCoordinator owns chat messaging
|
|
23
|
+
* and session lifecycle for blocked / task_complete / error events.
|
|
24
|
+
* This listener still handles scratch-dir cleanup regardless.
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerSessionEvents(ptyService: PTYService, runtime: IAgentRuntime, sessionId: string, label: string, scratchDir: string | null, callback?: HandlerCallback, coordinatorActive?: boolean): void;
|
|
27
|
+
//# sourceMappingURL=coding-task-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-task-helpers.d.ts","sourceRoot":"","sources":["../../src/actions/coding-task-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,4DAA4D;AAC5D,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,MAAM,CA4BR;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,eAAe,EAC1B,iBAAiB,UAAQ,GACxB,IAAI,CAqDN"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FINALIZE_WORKSPACE action - Commit, push, and create PR for workspace changes
|
|
3
|
+
*
|
|
4
|
+
* Completes a coding task by committing changes, pushing to remote,
|
|
5
|
+
* and optionally creating a pull request.
|
|
6
|
+
*
|
|
7
|
+
* @module actions/finalize-workspace
|
|
8
|
+
*/
|
|
9
|
+
import type { Action } from "@elizaos/core";
|
|
10
|
+
export declare const finalizeWorkspaceAction: Action;
|
|
11
|
+
//# sourceMappingURL=finalize-workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finalize-workspace.d.ts","sourceRoot":"","sources":["../../src/actions/finalize-workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,uBAAuB,EAAE,MAgPrC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LIST_CODING_AGENTS action - List active coding agent sessions
|
|
3
|
+
*
|
|
4
|
+
* Returns information about all running PTY sessions,
|
|
5
|
+
* including their status, agent type, and working directory.
|
|
6
|
+
*
|
|
7
|
+
* @module actions/list-agents
|
|
8
|
+
*/
|
|
9
|
+
import type { Action } from "@elizaos/core";
|
|
10
|
+
export declare const listAgentsAction: Action;
|
|
11
|
+
//# sourceMappingURL=list-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-agents.d.ts","sourceRoot":"","sources":["../../src/actions/list-agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,gBAAgB,EAAE,MA6H9B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MANAGE_ISSUES action - Create, list, update, and close GitHub issues
|
|
3
|
+
*
|
|
4
|
+
* Provides full issue lifecycle management through the CodingWorkspaceService.
|
|
5
|
+
* Supports creating issues, listing issues, adding comments, closing, and reopening.
|
|
6
|
+
*
|
|
7
|
+
* @module actions/manage-issues
|
|
8
|
+
*/
|
|
9
|
+
import type { Action } from "@elizaos/core";
|
|
10
|
+
export declare const manageIssuesAction: Action;
|
|
11
|
+
//# sourceMappingURL=manage-issues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manage-issues.d.ts","sourceRoot":"","sources":["../../src/actions/manage-issues.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,kBAAkB,EAAE,MAkMhC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROVISION_WORKSPACE action - Create a git workspace for coding tasks
|
|
3
|
+
*
|
|
4
|
+
* Clones a repository or creates a worktree for isolated development.
|
|
5
|
+
* Useful for setting up a clean environment before spawning a coding agent.
|
|
6
|
+
*
|
|
7
|
+
* @module actions/provision-workspace
|
|
8
|
+
*/
|
|
9
|
+
import type { Action } from "@elizaos/core";
|
|
10
|
+
export declare const provisionWorkspaceAction: Action;
|
|
11
|
+
//# sourceMappingURL=provision-workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provision-workspace.d.ts","sourceRoot":"","sources":["../../src/actions/provision-workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAMvB,eAAO,MAAM,wBAAwB,EAAE,MAiNtC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEND_TO_CODING_AGENT action - Send input to a running coding agent
|
|
3
|
+
*
|
|
4
|
+
* Allows sending text or commands to an active PTY session.
|
|
5
|
+
* Useful for responding to prompts, providing feedback, or giving new instructions.
|
|
6
|
+
*
|
|
7
|
+
* @module actions/send-to-agent
|
|
8
|
+
*/
|
|
9
|
+
import type { Action } from "@elizaos/core";
|
|
10
|
+
export declare const sendToAgentAction: Action;
|
|
11
|
+
//# sourceMappingURL=send-to-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-to-agent.d.ts","sourceRoot":"","sources":["../../src/actions/send-to-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,iBAAiB,EAAE,MAiM/B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPAWN_CODING_AGENT action - Spawns a CLI coding agent
|
|
3
|
+
*
|
|
4
|
+
* Creates a new PTY session for a coding agent (Claude Code, Codex, etc.)
|
|
5
|
+
* and returns a session ID for subsequent interactions.
|
|
6
|
+
*
|
|
7
|
+
* @module actions/spawn-agent
|
|
8
|
+
*/
|
|
9
|
+
import { type Action } from "@elizaos/core";
|
|
10
|
+
export declare const spawnAgentAction: Action;
|
|
11
|
+
//# sourceMappingURL=spawn-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-agent.d.ts","sourceRoot":"","sources":["../../src/actions/spawn-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACL,KAAK,MAAM,EAQZ,MAAM,eAAe,CAAC;AAavB,eAAO,MAAM,gBAAgB,EAAE,MA8U9B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* START_CODING_TASK action - Unified action to set up and launch coding agents
|
|
3
|
+
*
|
|
4
|
+
* Combines workspace provisioning and agent spawning into a single atomic action.
|
|
5
|
+
* - If a repo URL is provided, clones it into a fresh workspace
|
|
6
|
+
* - If no repo, creates a scratch sandbox directory
|
|
7
|
+
* - Spawns the specified coding agent(s) in that workspace with the given task
|
|
8
|
+
* - Supports multi-agent mode via pipe-delimited `agents` param
|
|
9
|
+
*
|
|
10
|
+
* This eliminates the need for multi-action chaining (PROVISION_WORKSPACE -> SPAWN_CODING_AGENT)
|
|
11
|
+
* and ensures agents always run in an isolated directory.
|
|
12
|
+
*
|
|
13
|
+
* @module actions/start-coding-task
|
|
14
|
+
*/
|
|
15
|
+
import type { Action } from "@elizaos/core";
|
|
16
|
+
export declare const startCodingTaskAction: Action;
|
|
17
|
+
//# sourceMappingURL=start-coding-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start-coding-task.d.ts","sourceRoot":"","sources":["../../src/actions/start-coding-task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,eAAe,CAAC;AAYvB,eAAO,MAAM,qBAAqB,EAAE,MA+OnC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STOP_CODING_AGENT action - Stop a running coding agent session
|
|
3
|
+
*
|
|
4
|
+
* Terminates an active PTY session. Use when the agent is done,
|
|
5
|
+
* stuck, or needs to be cancelled.
|
|
6
|
+
*
|
|
7
|
+
* @module actions/stop-agent
|
|
8
|
+
*/
|
|
9
|
+
import { type Action } from "@elizaos/core";
|
|
10
|
+
export declare const stopAgentAction: Action;
|
|
11
|
+
//# sourceMappingURL=stop-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop-agent.d.ts","sourceRoot":"","sources":["../../src/actions/stop-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,MAAM,EAQZ,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,eAAe,EAAE,MA4M7B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding Agent Route Handlers
|
|
3
|
+
*
|
|
4
|
+
* Handles routes for PTY-based coding agent management:
|
|
5
|
+
* - Preflight checks, metrics, workspace files
|
|
6
|
+
* - Approval presets and config
|
|
7
|
+
* - Agent CRUD: list, spawn, get, send, stop, output
|
|
8
|
+
*
|
|
9
|
+
* @module api/agent-routes
|
|
10
|
+
*/
|
|
11
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
12
|
+
import type { RouteContext } from "./routes.js";
|
|
13
|
+
/**
|
|
14
|
+
* Handle coding agent routes (/api/coding-agents/*)
|
|
15
|
+
* Returns true if the route was handled, false otherwise
|
|
16
|
+
*/
|
|
17
|
+
export declare function handleAgentRoutes(req: IncomingMessage, res: ServerResponse, pathname: string, ctx: RouteContext): Promise<boolean>;
|
|
18
|
+
//# sourceMappingURL=agent-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-routes.d.ts","sourceRoot":"","sources":["../../src/api/agent-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AASjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWhD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,OAAO,CAAC,CAwdlB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Coordinator Route Handlers
|
|
3
|
+
*
|
|
4
|
+
* Provides SSE streaming and HTTP API for the coordination layer:
|
|
5
|
+
* - SSE event stream for real-time dashboard
|
|
6
|
+
* - Task status and context queries
|
|
7
|
+
* - Pending confirmation management
|
|
8
|
+
* - Supervision level control
|
|
9
|
+
*
|
|
10
|
+
* @module api/coordinator-routes
|
|
11
|
+
*/
|
|
12
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
13
|
+
import type { SwarmCoordinator } from "../services/swarm-coordinator.js";
|
|
14
|
+
import type { RouteContext } from "./routes.js";
|
|
15
|
+
/**
|
|
16
|
+
* Handle coordinator routes (/api/coding-agents/coordinator/*)
|
|
17
|
+
* Returns true if the route was handled, false otherwise.
|
|
18
|
+
*/
|
|
19
|
+
export declare function handleCoordinatorRoutes(req: IncomingMessage, res: ServerResponse, pathname: string, ctx: RouteContext & {
|
|
20
|
+
coordinator?: SwarmCoordinator;
|
|
21
|
+
}): Promise<boolean>;
|
|
22
|
+
//# sourceMappingURL=coordinator-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-routes.d.ts","sourceRoot":"","sources":["../../src/api/coordinator-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAahD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,GAAG;IAAE,WAAW,CAAC,EAAE,gBAAgB,CAAA;CAAE,GACrD,OAAO,CAAC,OAAO,CAAC,CA6KlB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Issue Route Handlers
|
|
3
|
+
*
|
|
4
|
+
* Handles routes for GitHub issue management:
|
|
5
|
+
* - List issues, create issue
|
|
6
|
+
* - Get issue, comment on issue, close issue
|
|
7
|
+
*
|
|
8
|
+
* @module api/issue-routes
|
|
9
|
+
*/
|
|
10
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
11
|
+
import type { RouteContext } from "./routes.js";
|
|
12
|
+
/**
|
|
13
|
+
* Handle issue routes (/api/issues/*)
|
|
14
|
+
* Returns true if the route was handled, false otherwise
|
|
15
|
+
*/
|
|
16
|
+
export declare function handleIssueRoutes(req: IncomingMessage, res: ServerResponse, pathname: string, ctx: RouteContext): Promise<boolean>;
|
|
17
|
+
//# sourceMappingURL=issue-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-routes.d.ts","sourceRoot":"","sources":["../../src/api/issue-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWhD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,OAAO,CAAC,CA+JlB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding Agent API Routes — Dispatcher
|
|
3
|
+
*
|
|
4
|
+
* Provides shared helpers (parseBody, sendJson, sendError), types, and the
|
|
5
|
+
* top-level route dispatcher that delegates to domain-specific route modules.
|
|
6
|
+
*
|
|
7
|
+
* @module api/routes
|
|
8
|
+
*/
|
|
9
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
10
|
+
import type { IAgentRuntime } from "@elizaos/core";
|
|
11
|
+
import type { PTYService } from "../services/pty-service.js";
|
|
12
|
+
import type { SwarmCoordinator } from "../services/swarm-coordinator.js";
|
|
13
|
+
import type { CodingWorkspaceService } from "../services/workspace-service.js";
|
|
14
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
15
|
+
[key: string]: JsonValue;
|
|
16
|
+
};
|
|
17
|
+
export interface RouteContext {
|
|
18
|
+
runtime: IAgentRuntime;
|
|
19
|
+
ptyService: PTYService | null;
|
|
20
|
+
workspaceService: CodingWorkspaceService | null;
|
|
21
|
+
coordinator?: SwarmCoordinator;
|
|
22
|
+
}
|
|
23
|
+
export declare const MAX_BODY_SIZE: number;
|
|
24
|
+
export declare function parseBody(req: IncomingMessage): Promise<Record<string, unknown>>;
|
|
25
|
+
export declare function sendJson(res: ServerResponse, data: JsonValue, status?: number): void;
|
|
26
|
+
export declare function sendError(res: ServerResponse, message: string, status?: number): void;
|
|
27
|
+
/**
|
|
28
|
+
* Handle coding agent routes
|
|
29
|
+
* Returns true if the route was handled, false otherwise
|
|
30
|
+
*/
|
|
31
|
+
export declare function handleCodingAgentRoutes(req: IncomingMessage, res: ServerResponse, pathname: string, ctx: RouteContext): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Create route handler with services from runtime
|
|
34
|
+
*/
|
|
35
|
+
export declare function createCodingAgentRouteHandler(runtime: IAgentRuntime, coordinator?: SwarmCoordinator): (req: IncomingMessage, res: ServerResponse, pathname: string) => Promise<boolean>;
|
|
36
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/api/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAM/E,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjC,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAGD,eAAO,MAAM,aAAa,QAAc,CAAC;AAGzC,wBAAsB,SAAS,CAC7B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAsBlC;AAGD,wBAAgB,QAAQ,CACtB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,SAAS,EACf,MAAM,SAAM,GACX,IAAI,CAGN;AAGD,wBAAgB,SAAS,CACvB,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,SAAM,GACX,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,OAAO,CAAC,CAuBlB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,aAAa,EACtB,WAAW,CAAC,EAAE,gBAAgB,IAgBtB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,UAAU,MAAM,sBAEpE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace Route Handlers
|
|
3
|
+
*
|
|
4
|
+
* Handles routes for git workspace management:
|
|
5
|
+
* - Provision (clone repos, create worktrees)
|
|
6
|
+
* - Get status, commit, push, create PR, delete
|
|
7
|
+
*
|
|
8
|
+
* @module api/workspace-routes
|
|
9
|
+
*/
|
|
10
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
11
|
+
import type { RouteContext } from "./routes.js";
|
|
12
|
+
/**
|
|
13
|
+
* Handle workspace routes (/api/workspace/*)
|
|
14
|
+
* Returns true if the route was handled, false otherwise
|
|
15
|
+
*/
|
|
16
|
+
export declare function handleWorkspaceRoutes(req: IncomingMessage, res: ServerResponse, pathname: string, ctx: RouteContext): Promise<boolean>;
|
|
17
|
+
//# sourceMappingURL=workspace-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-routes.d.ts","sourceRoot":"","sources":["../../src/api/workspace-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWhD;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,OAAO,CAAC,CAkLlB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding Agent Plugin for Milady
|
|
3
|
+
*
|
|
4
|
+
* Provides orchestration capabilities for CLI-based coding agents:
|
|
5
|
+
* - PTY session management (spawn, control, monitor coding agents)
|
|
6
|
+
* - Git workspace provisioning (clone, branch, PR creation)
|
|
7
|
+
* - GitHub issue management (create, list, update, close)
|
|
8
|
+
* - Integration with Claude Code, Codex, Gemini CLI, Aider, Pi, etc.
|
|
9
|
+
*
|
|
10
|
+
* @module @elizaos/plugin-agent-orchestrator
|
|
11
|
+
*/
|
|
12
|
+
import type { Plugin } from "@elizaos/core";
|
|
13
|
+
export declare const codingAgentPlugin: Plugin;
|
|
14
|
+
export default codingAgentPlugin;
|
|
15
|
+
export type { AdapterType, AgentCredentials, AgentFileDescriptor, ApprovalConfig, ApprovalPreset, PreflightResult, PresetDefinition, RiskLevel, ToolCategory, WriteMemoryOptions, } from "coding-agent-adapters";
|
|
16
|
+
export { finalizeWorkspaceAction } from "./actions/finalize-workspace.js";
|
|
17
|
+
export { listAgentsAction } from "./actions/list-agents.js";
|
|
18
|
+
export { manageIssuesAction } from "./actions/manage-issues.js";
|
|
19
|
+
export { provisionWorkspaceAction } from "./actions/provision-workspace.js";
|
|
20
|
+
export { sendToAgentAction } from "./actions/send-to-agent.js";
|
|
21
|
+
export { spawnAgentAction } from "./actions/spawn-agent.js";
|
|
22
|
+
export { startCodingTaskAction } from "./actions/start-coding-task.js";
|
|
23
|
+
export { stopAgentAction } from "./actions/stop-agent.js";
|
|
24
|
+
export { createCodingAgentRouteHandler, handleCodingAgentRoutes, } from "./api/routes.js";
|
|
25
|
+
export type { CodingAgentType, PTYServiceConfig, SessionEventName, SessionInfo, SpawnSessionOptions, } from "./services/pty-service.js";
|
|
26
|
+
export { getCoordinator, PTYService } from "./services/pty-service.js";
|
|
27
|
+
export type { AgentDecisionCallback, ChatMessageCallback, CoordinationDecision, PendingDecision, SupervisionLevel, SwarmEvent, TaskContext, WsBroadcastCallback, } from "./services/swarm-coordinator.js";
|
|
28
|
+
export { SwarmCoordinator } from "./services/swarm-coordinator.js";
|
|
29
|
+
export type { CoordinationLLMResponse } from "./services/swarm-coordinator-prompts.js";
|
|
30
|
+
export { buildBlockedEventMessage, buildTurnCompleteEventMessage, } from "./services/swarm-coordinator-prompts.js";
|
|
31
|
+
export type { AuthPromptCallback, CodingWorkspaceConfig, CommitOptions, ProvisionWorkspaceOptions, PushOptions, WorkspaceResult, } from "./services/workspace-service.js";
|
|
32
|
+
export { CodingWorkspaceService } from "./services/workspace-service.js";
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAoB5C,eAAO,MAAM,iBAAiB,EAAE,MAsC/B,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAGjC,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvE,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,YAAY,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EACL,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EACzB,WAAW,EACX,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC"}
|