@elizaos/plugin-coding-agent 0.1.0-next.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 +169 -0
- package/dist/index.js +5788 -0
- package/dist/index.js.map +45 -0
- package/dist/src/actions/coding-task-handlers.d.ts +44 -0
- package/dist/src/actions/coding-task-handlers.d.ts.map +1 -0
- package/dist/src/actions/coding-task-helpers.d.ts +27 -0
- package/dist/src/actions/coding-task-helpers.d.ts.map +1 -0
- package/dist/src/actions/finalize-workspace.d.ts +11 -0
- package/dist/src/actions/finalize-workspace.d.ts.map +1 -0
- package/dist/src/actions/list-agents.d.ts +11 -0
- package/dist/src/actions/list-agents.d.ts.map +1 -0
- package/dist/src/actions/manage-issues.d.ts +11 -0
- package/dist/src/actions/manage-issues.d.ts.map +1 -0
- package/dist/src/actions/provision-workspace.d.ts +11 -0
- package/dist/src/actions/provision-workspace.d.ts.map +1 -0
- package/dist/src/actions/send-to-agent.d.ts +11 -0
- package/dist/src/actions/send-to-agent.d.ts.map +1 -0
- package/dist/src/actions/spawn-agent.d.ts +11 -0
- package/dist/src/actions/spawn-agent.d.ts.map +1 -0
- package/dist/src/actions/start-coding-task.d.ts +17 -0
- package/dist/src/actions/start-coding-task.d.ts.map +1 -0
- package/dist/src/actions/stop-agent.d.ts +11 -0
- package/dist/src/actions/stop-agent.d.ts.map +1 -0
- package/dist/src/api/agent-routes.d.ts +18 -0
- package/dist/src/api/agent-routes.d.ts.map +1 -0
- package/dist/src/api/coordinator-routes.d.ts +22 -0
- package/dist/src/api/coordinator-routes.d.ts.map +1 -0
- package/dist/src/api/issue-routes.d.ts +17 -0
- package/dist/src/api/issue-routes.d.ts.map +1 -0
- package/dist/src/api/routes.d.ts +36 -0
- package/dist/src/api/routes.d.ts.map +1 -0
- package/dist/src/api/workspace-routes.d.ts +17 -0
- package/dist/src/api/workspace-routes.d.ts.map +1 -0
- package/dist/src/index.d.ts +32 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/providers/action-examples.d.ts +13 -0
- package/dist/src/providers/action-examples.d.ts.map +1 -0
- package/dist/src/providers/active-workspace-context.d.ts +13 -0
- package/dist/src/providers/active-workspace-context.d.ts.map +1 -0
- package/dist/src/services/agent-metrics.d.ts +28 -0
- package/dist/src/services/agent-metrics.d.ts.map +1 -0
- package/dist/src/services/agent-selection.d.ts +53 -0
- package/dist/src/services/agent-selection.d.ts.map +1 -0
- package/dist/src/services/ansi-utils.d.ts +48 -0
- package/dist/src/services/ansi-utils.d.ts.map +1 -0
- package/dist/src/services/pty-auto-response.d.ts +30 -0
- package/dist/src/services/pty-auto-response.d.ts.map +1 -0
- package/dist/src/services/pty-init.d.ts +43 -0
- package/dist/src/services/pty-init.d.ts.map +1 -0
- package/dist/src/services/pty-service.d.ts +92 -0
- package/dist/src/services/pty-service.d.ts.map +1 -0
- package/dist/src/services/pty-session-io.d.ts +46 -0
- package/dist/src/services/pty-session-io.d.ts.map +1 -0
- package/dist/src/services/pty-spawn.d.ts +44 -0
- package/dist/src/services/pty-spawn.d.ts.map +1 -0
- package/dist/src/services/pty-types.d.ts +80 -0
- package/dist/src/services/pty-types.d.ts.map +1 -0
- package/dist/src/services/stall-classifier.d.ts +44 -0
- package/dist/src/services/stall-classifier.d.ts.map +1 -0
- package/dist/src/services/swarm-coordinator-prompts.d.ts +61 -0
- package/dist/src/services/swarm-coordinator-prompts.d.ts.map +1 -0
- package/dist/src/services/swarm-coordinator.d.ts +155 -0
- package/dist/src/services/swarm-coordinator.d.ts.map +1 -0
- package/dist/src/services/swarm-decision-loop.d.ts +37 -0
- package/dist/src/services/swarm-decision-loop.d.ts.map +1 -0
- package/dist/src/services/swarm-idle-watchdog.d.ts +22 -0
- package/dist/src/services/swarm-idle-watchdog.d.ts.map +1 -0
- package/dist/src/services/workspace-git-ops.d.ts +28 -0
- package/dist/src/services/workspace-git-ops.d.ts.map +1 -0
- package/dist/src/services/workspace-github.d.ts +58 -0
- package/dist/src/services/workspace-github.d.ts.map +1 -0
- package/dist/src/services/workspace-lifecycle.d.ts +18 -0
- package/dist/src/services/workspace-lifecycle.d.ts.map +1 -0
- package/dist/src/services/workspace-service.d.ts +84 -0
- package/dist/src/services/workspace-service.d.ts.map +1 -0
- package/dist/src/services/workspace-types.d.ts +81 -0
- package/dist/src/services/workspace-types.d.ts.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +66 -0
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# @milaidy/plugin-coding-agent
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **PTY Session Management**: Spawn, control, and monitor coding agents running in pseudo-terminals
|
|
8
|
+
- **Git Workspace Provisioning**: Clone repos, create worktrees, manage branches
|
|
9
|
+
- **PR Workflow**: Commit changes, push to remote, create pull requests
|
|
10
|
+
- **Multi-Agent Support**: Claude Code, Codex, Gemini CLI, Aider, Pi, or generic shell
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
This plugin is part of the Milaidy monorepo. It requires the following peer dependencies:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add pty-manager git-workspace-service
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Register the Plugin
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { codingAgentPlugin } from "@milaidy/plugin-coding-agent";
|
|
26
|
+
|
|
27
|
+
// Add to your ElizaOS agent configuration
|
|
28
|
+
const agent = {
|
|
29
|
+
plugins: [codingAgentPlugin],
|
|
30
|
+
// ... other config
|
|
31
|
+
};
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Actions
|
|
35
|
+
|
|
36
|
+
#### PTY Session Management
|
|
37
|
+
|
|
38
|
+
| Action | Description |
|
|
39
|
+
|--------|-------------|
|
|
40
|
+
| `SPAWN_CODING_AGENT` | Spawn a new coding agent session |
|
|
41
|
+
| `SEND_TO_CODING_AGENT` | Send input or keys to a running agent |
|
|
42
|
+
| `STOP_CODING_AGENT` | Terminate an agent session |
|
|
43
|
+
| `LIST_CODING_AGENTS` | List all active sessions |
|
|
44
|
+
|
|
45
|
+
#### Workspace Management
|
|
46
|
+
|
|
47
|
+
| Action | Description |
|
|
48
|
+
|--------|-------------|
|
|
49
|
+
| `PROVISION_WORKSPACE` | Clone a repo or create a worktree |
|
|
50
|
+
| `FINALIZE_WORKSPACE` | Commit, push, and optionally create PR |
|
|
51
|
+
|
|
52
|
+
### Example Conversation
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
User: Spawn Claude Code to fix the auth bug in src/auth.ts
|
|
56
|
+
Agent: Starting claude-code agent in /workspace...
|
|
57
|
+
Session ID: abc123, Status: running
|
|
58
|
+
|
|
59
|
+
User: What coding agents are running?
|
|
60
|
+
Agent: Active sessions:
|
|
61
|
+
1. claude-code (abc123...) - running
|
|
62
|
+
Working in: /workspace
|
|
63
|
+
|
|
64
|
+
User: Tell it to accept the changes
|
|
65
|
+
Agent: Sent "y" to coding agent.
|
|
66
|
+
|
|
67
|
+
User: Create a PR for the fix
|
|
68
|
+
Agent: Workspace finalized!
|
|
69
|
+
Commit: a1b2c3d4
|
|
70
|
+
PR #42: https://github.com/user/repo/pull/42
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Services
|
|
74
|
+
|
|
75
|
+
### PTYService
|
|
76
|
+
|
|
77
|
+
Manages PTY sessions for coding agents.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { PTYService } from "@milaidy/plugin-coding-agent";
|
|
81
|
+
|
|
82
|
+
// Access via runtime
|
|
83
|
+
const ptyService = runtime.getService("PTY_SERVICE") as PTYService;
|
|
84
|
+
|
|
85
|
+
// Spawn a session
|
|
86
|
+
const session = await ptyService.spawnSession({
|
|
87
|
+
agentType: "claude-code",
|
|
88
|
+
workdir: "/path/to/project",
|
|
89
|
+
initialTask: "Fix the auth bug",
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Send input
|
|
93
|
+
await ptyService.sendToSession(session.id, "y");
|
|
94
|
+
|
|
95
|
+
// Check status
|
|
96
|
+
const info = ptyService.getSession(session.id);
|
|
97
|
+
console.log(info.status); // "running" | "blocked" | "completed"
|
|
98
|
+
|
|
99
|
+
// Stop session
|
|
100
|
+
await ptyService.stopSession(session.id);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### CodingWorkspaceService
|
|
104
|
+
|
|
105
|
+
Manages git workspaces for coding tasks.
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { CodingWorkspaceService } from "@milaidy/plugin-coding-agent";
|
|
109
|
+
|
|
110
|
+
// Access via runtime
|
|
111
|
+
const workspaceService = runtime.getService("CODING_WORKSPACE_SERVICE");
|
|
112
|
+
|
|
113
|
+
// Clone a repo
|
|
114
|
+
const workspace = await workspaceService.provisionWorkspace({
|
|
115
|
+
repoUrl: "https://github.com/user/repo.git",
|
|
116
|
+
branch: "feature/my-feature",
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Create worktree for parallel work
|
|
120
|
+
const worktree = await workspaceService.provisionWorkspace({
|
|
121
|
+
useWorktree: true,
|
|
122
|
+
parentWorkspaceId: workspace.id,
|
|
123
|
+
branch: "bugfix/issue-123",
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// Commit and push
|
|
127
|
+
await workspaceService.commit(workspace.id, {
|
|
128
|
+
message: "fix: resolve auth issue",
|
|
129
|
+
all: true,
|
|
130
|
+
});
|
|
131
|
+
await workspaceService.push(workspace.id, { setUpstream: true });
|
|
132
|
+
|
|
133
|
+
// Create PR
|
|
134
|
+
const pr = await workspaceService.createPR(workspace.id, {
|
|
135
|
+
title: "Fix auth issue",
|
|
136
|
+
body: "Resolves #123",
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Configuration
|
|
141
|
+
|
|
142
|
+
Configure via runtime settings:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
// PTY Service config
|
|
146
|
+
runtime.setSetting("PTY_SERVICE_CONFIG", {
|
|
147
|
+
maxSessions: 5,
|
|
148
|
+
idleTimeoutMs: 30 * 60 * 1000,
|
|
149
|
+
debug: true,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// Workspace Service config
|
|
153
|
+
runtime.setSetting("CODING_WORKSPACE_CONFIG", {
|
|
154
|
+
baseDir: "~/.milaidy/workspaces",
|
|
155
|
+
credentials: {
|
|
156
|
+
github: { token: process.env.GITHUB_TOKEN },
|
|
157
|
+
},
|
|
158
|
+
debug: true,
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Dependencies
|
|
163
|
+
|
|
164
|
+
- `pty-manager` - PTY session management with adapter pattern
|
|
165
|
+
- `git-workspace-service` - Git workspace provisioning and PR creation
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
MIT
|