@elizaos/plugin-agent-orchestrator 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/actions/coding-task-handlers.d.ts +46 -0
  2. package/dist/actions/coding-task-handlers.d.ts.map +1 -0
  3. package/dist/actions/coding-task-helpers.d.ts +27 -0
  4. package/dist/actions/coding-task-helpers.d.ts.map +1 -0
  5. package/dist/actions/finalize-workspace.d.ts +11 -0
  6. package/dist/actions/finalize-workspace.d.ts.map +1 -0
  7. package/dist/actions/list-agents.d.ts +11 -0
  8. package/dist/actions/list-agents.d.ts.map +1 -0
  9. package/dist/actions/manage-issues.d.ts +11 -0
  10. package/dist/actions/manage-issues.d.ts.map +1 -0
  11. package/dist/actions/provision-workspace.d.ts +11 -0
  12. package/dist/actions/provision-workspace.d.ts.map +1 -0
  13. package/dist/actions/send-to-agent.d.ts +11 -0
  14. package/dist/actions/send-to-agent.d.ts.map +1 -0
  15. package/dist/actions/spawn-agent.d.ts +11 -0
  16. package/dist/actions/spawn-agent.d.ts.map +1 -0
  17. package/dist/actions/start-coding-task.d.ts +17 -0
  18. package/dist/actions/start-coding-task.d.ts.map +1 -0
  19. package/dist/actions/stop-agent.d.ts +11 -0
  20. package/dist/actions/stop-agent.d.ts.map +1 -0
  21. package/dist/api/agent-routes.d.ts +18 -0
  22. package/dist/api/agent-routes.d.ts.map +1 -0
  23. package/dist/api/coordinator-routes.d.ts +22 -0
  24. package/dist/api/coordinator-routes.d.ts.map +1 -0
  25. package/dist/api/issue-routes.d.ts +17 -0
  26. package/dist/api/issue-routes.d.ts.map +1 -0
  27. package/dist/api/routes.d.ts +36 -0
  28. package/dist/api/routes.d.ts.map +1 -0
  29. package/dist/api/workspace-routes.d.ts +17 -0
  30. package/dist/api/workspace-routes.d.ts.map +1 -0
  31. package/dist/index.d.ts +33 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +39 -6
  34. package/dist/index.js.map +8 -8
  35. package/dist/providers/action-examples.d.ts +13 -0
  36. package/dist/providers/action-examples.d.ts.map +1 -0
  37. package/dist/providers/active-workspace-context.d.ts +13 -0
  38. package/dist/providers/active-workspace-context.d.ts.map +1 -0
  39. package/dist/services/agent-metrics.d.ts +28 -0
  40. package/dist/services/agent-metrics.d.ts.map +1 -0
  41. package/dist/services/agent-selection.d.ts +53 -0
  42. package/dist/services/agent-selection.d.ts.map +1 -0
  43. package/dist/services/ansi-utils.d.ts +48 -0
  44. package/dist/services/ansi-utils.d.ts.map +1 -0
  45. package/dist/services/pty-auto-response.d.ts +30 -0
  46. package/dist/services/pty-auto-response.d.ts.map +1 -0
  47. package/dist/services/pty-init.d.ts +49 -0
  48. package/dist/services/pty-init.d.ts.map +1 -0
  49. package/dist/services/pty-service.d.ts +92 -0
  50. package/dist/services/pty-service.d.ts.map +1 -0
  51. package/dist/services/pty-session-io.d.ts +49 -0
  52. package/dist/services/pty-session-io.d.ts.map +1 -0
  53. package/dist/services/pty-spawn.d.ts +52 -0
  54. package/dist/services/pty-spawn.d.ts.map +1 -0
  55. package/dist/services/pty-types.d.ts +80 -0
  56. package/dist/services/pty-types.d.ts.map +1 -0
  57. package/dist/services/stall-classifier.d.ts +67 -0
  58. package/dist/services/stall-classifier.d.ts.map +1 -0
  59. package/dist/services/swarm-coordinator-prompts.d.ts +75 -0
  60. package/dist/services/swarm-coordinator-prompts.d.ts.map +1 -0
  61. package/dist/services/swarm-coordinator.d.ts +202 -0
  62. package/dist/services/swarm-coordinator.d.ts.map +1 -0
  63. package/dist/services/swarm-decision-loop.d.ts +44 -0
  64. package/dist/services/swarm-decision-loop.d.ts.map +1 -0
  65. package/dist/services/swarm-event-triage.d.ts +49 -0
  66. package/dist/services/swarm-event-triage.d.ts.map +1 -0
  67. package/dist/services/swarm-idle-watchdog.d.ts +22 -0
  68. package/dist/services/swarm-idle-watchdog.d.ts.map +1 -0
  69. package/dist/services/workspace-git-ops.d.ts +28 -0
  70. package/dist/services/workspace-git-ops.d.ts.map +1 -0
  71. package/dist/services/workspace-github.d.ts +58 -0
  72. package/dist/services/workspace-github.d.ts.map +1 -0
  73. package/dist/services/workspace-lifecycle.d.ts +18 -0
  74. package/dist/services/workspace-lifecycle.d.ts.map +1 -0
  75. package/dist/services/workspace-service.d.ts +84 -0
  76. package/dist/services/workspace-service.d.ts.map +1 -0
  77. package/dist/services/workspace-types.d.ts +81 -0
  78. package/dist/services/workspace-types.d.ts.map +1 -0
  79. 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,EA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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"}
@@ -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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AAqB,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
- const pendingData = ctx.pendingTurnComplete.get(sessionId);
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) {
@@ -2233,6 +2234,7 @@ async function initializePTYManager(ctx) {
2233
2234
  ctx.log(`session_ready event received for ${session.id} (type: ${session.type}, status: ${session.status})`);
2234
2235
  ctx.emitEvent(session.id, "ready", { session });
2235
2236
  forwardReadyAsTaskComplete(ctx, session);
2237
+ ctx.markTaskDelivered?.(session.id);
2236
2238
  });
2237
2239
  bunManager.on("session_exit", (id, code) => {
2238
2240
  ctx.emitEvent(id, "stopped", { reason: `exit code ${code}` });
@@ -2312,6 +2314,7 @@ async function initializePTYManager(ctx) {
2312
2314
  nodeManager.on("session_ready", (session) => {
2313
2315
  ctx.emitEvent(session.id, "ready", { session });
2314
2316
  forwardReadyAsTaskComplete(ctx, session);
2317
+ ctx.markTaskDelivered?.(session.id);
2315
2318
  });
2316
2319
  nodeManager.on("blocking_prompt", (session, promptInfo, autoResponded) => {
2317
2320
  ctx.emitEvent(session.id, "blocked", { promptInfo, autoResponded });
@@ -2518,6 +2521,7 @@ function setupDeferredTaskDelivery(ctx, session, task, agentType) {
2518
2521
  taskSent = true;
2519
2522
  if (readyTimeout)
2520
2523
  clearTimeout(readyTimeout);
2524
+ ctx.markTaskDelivered?.(sid);
2521
2525
  setTimeout(() => sendTaskWithRetry(0), settleMs);
2522
2526
  if (ctx.usingBunWorker) {
2523
2527
  ctx.manager.removeListener("session_ready", onReady);
@@ -2865,6 +2869,16 @@ async function classifyAndDecideForCoordinator(ctx) {
2865
2869
  return null;
2866
2870
  }
2867
2871
  const mappedState = parsed.state === "tool_running" ? "still_working" : parsed.state;
2872
+ if (mappedState === "waiting_for_input" && parsed.suggestedResponse) {
2873
+ const promptText = typeof parsed.prompt === "string" ? parsed.prompt : "";
2874
+ const responseText = parsed.suggestedResponse.trim().toLowerCase();
2875
+ const approving = ["y", "yes", "keys:enter", "keys:down,enter"].includes(responseText);
2876
+ const hasAbsPath = /(?:^|[\s"'`])\/[^\s"'`]+/.test(promptText);
2877
+ if (approving && hasAbsPath && !promptText.includes(taskContext.workdir)) {
2878
+ log(`Combined classify+decide: overriding out-of-scope approval for ${sessionId}`);
2879
+ parsed.suggestedResponse = `n — That path is outside your workspace. Use ${taskContext.workdir} instead.`;
2880
+ }
2881
+ }
2868
2882
  const classification = {
2869
2883
  state: mappedState,
2870
2884
  prompt: parsed.prompt,
@@ -3203,7 +3217,8 @@ class SwarmCoordinator {
3203
3217
  autoResolvedCount: 0,
3204
3218
  registeredAt: Date.now(),
3205
3219
  lastActivityAt: Date.now(),
3206
- idleCheckCount: 0
3220
+ idleCheckCount: 0,
3221
+ taskDelivered: false
3207
3222
  });
3208
3223
  this.broadcast({
3209
3224
  type: "task_registered",
@@ -3592,7 +3607,17 @@ class PTYService {
3592
3607
  if (!coordinator)
3593
3608
  return false;
3594
3609
  const taskCtx = coordinator.getTaskContext(sessionId);
3595
- return (taskCtx?.decisions.length ?? 0) > 0;
3610
+ if (!taskCtx)
3611
+ return false;
3612
+ return taskCtx.taskDelivered || taskCtx.decisions.length > 0;
3613
+ },
3614
+ markTaskDelivered: (sessionId) => {
3615
+ const coordinator = this.coordinator;
3616
+ if (!coordinator)
3617
+ return;
3618
+ const taskCtx = coordinator.getTaskContext(sessionId);
3619
+ if (taskCtx)
3620
+ taskCtx.taskDelivered = true;
3596
3621
  }
3597
3622
  });
3598
3623
  this.manager = result.manager;
@@ -3721,7 +3746,15 @@ class PTYService {
3721
3746
  sendKeysToSession: (id, keys) => this.sendKeysToSession(id, keys),
3722
3747
  pushDefaultRules: (id, type) => this.pushDefaultRules(id, type),
3723
3748
  toSessionInfo: (s, w) => this.toSessionInfo(s, w),
3724
- log: (msg) => this.log(msg)
3749
+ log: (msg) => this.log(msg),
3750
+ markTaskDelivered: (sessionId2) => {
3751
+ const coordinator = this.coordinator;
3752
+ if (!coordinator)
3753
+ return;
3754
+ const taskCtx = coordinator.getTaskContext(sessionId2);
3755
+ if (taskCtx)
3756
+ taskCtx.taskDelivered = true;
3757
+ }
3725
3758
  };
3726
3759
  if (this.usingBunWorker) {
3727
3760
  setupOutputBuffer(ctx, session.id);
@@ -6545,5 +6578,5 @@ export {
6545
6578
  CodingWorkspaceService
6546
6579
  };
6547
6580
 
6548
- //# debugId=D911125D768F397664756E2164756E21
6581
+ //# debugId=87DC30F17636D1DA64756E2164756E21
6549
6582
  //# sourceMappingURL=index.js.map