@elizaos/plugin-agent-orchestrator 0.3.6 → 0.3.7
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/dist/actions/coding-task-handlers.d.ts +46 -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 +14 -3
- package/dist/index.js.map +4 -4
- 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 +47 -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 +49 -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 +67 -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 +200 -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 +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
import type { AgentSelectionStrategy } from "../services/agent-selection.js";
|
|
15
|
+
/** Shared context passed to both multi-agent and single-agent handlers */
|
|
16
|
+
export interface CodingTaskContext {
|
|
17
|
+
runtime: IAgentRuntime;
|
|
18
|
+
ptyService: PTYService;
|
|
19
|
+
wsService: CodingWorkspaceService | undefined;
|
|
20
|
+
credentials: AgentCredentials;
|
|
21
|
+
customCredentials: Record<string, string> | undefined;
|
|
22
|
+
callback: HandlerCallback | undefined;
|
|
23
|
+
message: Memory;
|
|
24
|
+
state: State | undefined;
|
|
25
|
+
repo: string | undefined;
|
|
26
|
+
defaultAgentType: CodingAgentType;
|
|
27
|
+
rawAgentType: string;
|
|
28
|
+
agentSelectionStrategy: AgentSelectionStrategy;
|
|
29
|
+
memoryContent: string | undefined;
|
|
30
|
+
approvalPreset: string | undefined;
|
|
31
|
+
explicitLabel: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Multi-agent mode handler.
|
|
35
|
+
*
|
|
36
|
+
* Parses pipe-delimited agent specs and spawns each agent in its own
|
|
37
|
+
* workspace clone (or scratch directory).
|
|
38
|
+
*/
|
|
39
|
+
export declare function handleMultiAgent(ctx: CodingTaskContext, agentsParam: string): Promise<ActionResult | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* Single-agent mode handler.
|
|
42
|
+
*
|
|
43
|
+
* Provisions a workspace (clone or scratch) and spawns a single coding agent.
|
|
44
|
+
*/
|
|
45
|
+
export declare function handleSingleAgent(ctx: CodingTaskContext, task: string | undefined): Promise<ActionResult | undefined>;
|
|
46
|
+
//# 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;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAU7E,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,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,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,CA4QnC;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,MAgPnC,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"}
|
package/dist/index.js
CHANGED
|
@@ -491,9 +491,9 @@ function toDecisionHistory(taskCtx) {
|
|
|
491
491
|
}));
|
|
492
492
|
}
|
|
493
493
|
async function drainPendingTurnComplete(ctx, sessionId) {
|
|
494
|
-
|
|
495
|
-
if (!pendingData)
|
|
494
|
+
if (!ctx.pendingTurnComplete.has(sessionId))
|
|
496
495
|
return;
|
|
496
|
+
const pendingData = ctx.pendingTurnComplete.get(sessionId);
|
|
497
497
|
ctx.pendingTurnComplete.delete(sessionId);
|
|
498
498
|
const taskCtx = ctx.tasks.get(sessionId);
|
|
499
499
|
if (!taskCtx || taskCtx.status !== "active")
|
|
@@ -825,6 +825,7 @@ async function handleTurnComplete(ctx, sessionId, taskCtx, data) {
|
|
|
825
825
|
await executeDecision(ctx, sessionId, decision);
|
|
826
826
|
} finally {
|
|
827
827
|
ctx.inFlightDecisions.delete(sessionId);
|
|
828
|
+
await drainPendingTurnComplete(ctx, sessionId);
|
|
828
829
|
}
|
|
829
830
|
}
|
|
830
831
|
async function handleAutonomousDecision(ctx, sessionId, taskCtx, promptText, recentOutput, promptType) {
|
|
@@ -2865,6 +2866,16 @@ async function classifyAndDecideForCoordinator(ctx) {
|
|
|
2865
2866
|
return null;
|
|
2866
2867
|
}
|
|
2867
2868
|
const mappedState = parsed.state === "tool_running" ? "still_working" : parsed.state;
|
|
2869
|
+
if (mappedState === "waiting_for_input" && parsed.suggestedResponse) {
|
|
2870
|
+
const promptText = typeof parsed.prompt === "string" ? parsed.prompt : "";
|
|
2871
|
+
const responseText = parsed.suggestedResponse.trim().toLowerCase();
|
|
2872
|
+
const approving = ["y", "yes", "keys:enter", "keys:down,enter"].includes(responseText);
|
|
2873
|
+
const hasAbsPath = /(?:^|[\s"'`])\/[^\s"'`]+/.test(promptText);
|
|
2874
|
+
if (approving && hasAbsPath && !promptText.includes(taskContext.workdir)) {
|
|
2875
|
+
log(`Combined classify+decide: overriding out-of-scope approval for ${sessionId}`);
|
|
2876
|
+
parsed.suggestedResponse = `n — That path is outside your workspace. Use ${taskContext.workdir} instead.`;
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2868
2879
|
const classification = {
|
|
2869
2880
|
state: mappedState,
|
|
2870
2881
|
prompt: parsed.prompt,
|
|
@@ -6545,5 +6556,5 @@ export {
|
|
|
6545
6556
|
CodingWorkspaceService
|
|
6546
6557
|
};
|
|
6547
6558
|
|
|
6548
|
-
//# debugId=
|
|
6559
|
+
//# debugId=D5A4E2FBAF42C88664756E2164756E21
|
|
6549
6560
|
//# sourceMappingURL=index.js.map
|