agent-relay 1.0.11 → 1.0.13
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 +15 -7
- package/dist/bridge/config.d.ts.map +1 -1
- package/dist/bridge/multi-project-client.d.ts.map +1 -1
- package/dist/bridge/multi-project-client.js +1 -1
- package/dist/bridge/multi-project-client.js.map +1 -1
- package/dist/bridge/spawner.d.ts +51 -8
- package/dist/bridge/spawner.d.ts.map +1 -1
- package/dist/bridge/spawner.js +186 -73
- package/dist/bridge/spawner.js.map +1 -1
- package/dist/bridge/types.d.ts +4 -2
- package/dist/bridge/types.d.ts.map +1 -1
- package/dist/cli/index.js +162 -297
- package/dist/cli/index.js.map +1 -1
- package/dist/daemon/router.d.ts.map +1 -1
- package/dist/daemon/router.js.map +1 -1
- package/dist/dashboard/out/404.html +1 -0
- package/dist/dashboard/out/_next/static/VaJQUKoHpKVXkxkyQVNa4/_buildManifest.js +1 -0
- package/dist/dashboard/out/_next/static/VaJQUKoHpKVXkxkyQVNa4/_ssgManifest.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/117-3bef7b19f3e60751.js +2 -0
- package/dist/dashboard/out/_next/static/chunks/648-6cf686106c891ad3.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/_not-found/page-8ff6572bc7c9bc61.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/layout-c9d8c5d95e48c6bf.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-8aa9936bc6c771ab.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-967d136fefe19b95.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/fd9d1056-26bd8d656b496dba.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/framework-f66176bb897dc684.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/main-app-bae2e535de00de50.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/main-e0a1f53fe0617a63.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/webpack-c81f7fd28659d64f.js +1 -0
- package/dist/dashboard/out/_next/static/css/34bb8e70353694d8.css +1 -0
- package/dist/dashboard/out/index.html +1 -0
- package/dist/dashboard/out/index.txt +7 -0
- package/dist/dashboard/out/metrics.html +515 -0
- package/dist/dashboard/out/metrics.txt +7 -0
- package/dist/dashboard-server/metrics.d.ts.map +1 -0
- package/dist/dashboard-server/metrics.js.map +1 -0
- package/dist/dashboard-server/needs-attention.d.ts.map +1 -0
- package/dist/dashboard-server/needs-attention.js.map +1 -0
- package/dist/dashboard-server/server.d.ts.map +1 -0
- package/dist/{dashboard → dashboard-server}/server.js +24 -40
- package/dist/dashboard-server/server.js.map +1 -0
- package/dist/dashboard-server/start.d.ts.map +1 -0
- package/dist/dashboard-server/start.js.map +1 -0
- package/dist/utils/update-checker.d.ts +26 -0
- package/dist/utils/update-checker.d.ts.map +1 -0
- package/dist/utils/update-checker.js +174 -0
- package/dist/utils/update-checker.js.map +1 -0
- package/dist/wrapper/pty-wrapper.d.ts +140 -0
- package/dist/wrapper/pty-wrapper.d.ts.map +1 -0
- package/dist/wrapper/pty-wrapper.js +508 -0
- package/dist/wrapper/pty-wrapper.js.map +1 -0
- package/dist/wrapper/tmux-wrapper.d.ts +1 -1
- package/dist/wrapper/tmux-wrapper.d.ts.map +1 -1
- package/dist/wrapper/tmux-wrapper.js +1 -1
- package/dist/wrapper/tmux-wrapper.js.map +1 -1
- package/docs/AGENTS.md +43 -30
- package/docs/INTEGRATION-GUIDE.md +1 -1
- package/docs/PROTOCOL.md +16 -10
- package/docs/agent-relay-snippet.md +21 -17
- package/package.json +7 -5
- package/scripts/postinstall.js +30 -1
- package/dist/dashboard/metrics.d.ts.map +0 -1
- package/dist/dashboard/metrics.js.map +0 -1
- package/dist/dashboard/needs-attention.d.ts.map +0 -1
- package/dist/dashboard/needs-attention.js.map +0 -1
- package/dist/dashboard/public/bridge.html +0 -1272
- package/dist/dashboard/public/index.html +0 -2262
- package/dist/dashboard/public/js/app.js +0 -184
- package/dist/dashboard/public/js/app.js.map +0 -7
- package/dist/dashboard/public/metrics.html +0 -999
- package/dist/dashboard/server.d.ts.map +0 -1
- package/dist/dashboard/server.js.map +0 -1
- package/dist/dashboard/start.d.ts.map +0 -1
- package/dist/dashboard/start.js.map +0 -1
- package/dist/dashboard-v2/index.d.ts +0 -10
- package/dist/dashboard-v2/index.d.ts.map +0 -1
- package/dist/dashboard-v2/index.js +0 -54
- package/dist/dashboard-v2/index.js.map +0 -1
- package/dist/dashboard-v2/lib/api.d.ts +0 -95
- package/dist/dashboard-v2/lib/api.d.ts.map +0 -1
- package/dist/dashboard-v2/lib/api.js +0 -270
- package/dist/dashboard-v2/lib/api.js.map +0 -1
- package/dist/dashboard-v2/lib/colors.d.ts +0 -61
- package/dist/dashboard-v2/lib/colors.d.ts.map +0 -1
- package/dist/dashboard-v2/lib/colors.js +0 -198
- package/dist/dashboard-v2/lib/colors.js.map +0 -1
- package/dist/dashboard-v2/lib/hierarchy.d.ts +0 -74
- package/dist/dashboard-v2/lib/hierarchy.d.ts.map +0 -1
- package/dist/dashboard-v2/lib/hierarchy.js +0 -196
- package/dist/dashboard-v2/lib/hierarchy.js.map +0 -1
- package/dist/dashboard-v2/types/index.d.ts +0 -154
- package/dist/dashboard-v2/types/index.d.ts.map +0 -1
- package/dist/dashboard-v2/types/index.js +0 -6
- package/dist/dashboard-v2/types/index.js.map +0 -1
- /package/dist/{dashboard → dashboard-server}/metrics.d.ts +0 -0
- /package/dist/{dashboard → dashboard-server}/metrics.js +0 -0
- /package/dist/{dashboard → dashboard-server}/needs-attention.d.ts +0 -0
- /package/dist/{dashboard → dashboard-server}/needs-attention.js +0 -0
- /package/dist/{dashboard → dashboard-server}/server.d.ts +0 -0
- /package/dist/{dashboard → dashboard-server}/start.d.ts +0 -0
- /package/dist/{dashboard → dashboard-server}/start.js +0 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PtyWrapper - Node-PTY based wrapper for spawned workers
|
|
3
|
+
*
|
|
4
|
+
* Unlike TmuxWrapper which provides interactive terminal access,
|
|
5
|
+
* PtyWrapper runs agents headlessly with output capture for logs.
|
|
6
|
+
* Used for spawned workers that don't need direct user interaction.
|
|
7
|
+
*/
|
|
8
|
+
import * as pty from 'node-pty';
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
import { EventEmitter } from 'node:events';
|
|
12
|
+
import { RelayClient } from './client.js';
|
|
13
|
+
/** Maximum lines to keep in output buffer */
|
|
14
|
+
const MAX_BUFFER_LINES = 10000;
|
|
15
|
+
export class PtyWrapper extends EventEmitter {
|
|
16
|
+
config;
|
|
17
|
+
ptyProcess;
|
|
18
|
+
client;
|
|
19
|
+
running = false;
|
|
20
|
+
outputBuffer = [];
|
|
21
|
+
rawBuffer = '';
|
|
22
|
+
relayPrefix;
|
|
23
|
+
sentMessageHashes = new Set();
|
|
24
|
+
processedSpawnCommands = new Set();
|
|
25
|
+
processedReleaseCommands = new Set();
|
|
26
|
+
messageQueue = [];
|
|
27
|
+
isInjecting = false;
|
|
28
|
+
logFilePath;
|
|
29
|
+
logStream;
|
|
30
|
+
constructor(config) {
|
|
31
|
+
super();
|
|
32
|
+
this.config = config;
|
|
33
|
+
this.relayPrefix = config.relayPrefix ?? '->relay:';
|
|
34
|
+
this.client = new RelayClient({
|
|
35
|
+
agentName: config.name,
|
|
36
|
+
socketPath: config.socketPath,
|
|
37
|
+
cli: 'spawned',
|
|
38
|
+
workingDirectory: config.cwd ?? process.cwd(),
|
|
39
|
+
quiet: true,
|
|
40
|
+
});
|
|
41
|
+
// Handle incoming messages
|
|
42
|
+
this.client.onMessage = (from, payload, messageId) => {
|
|
43
|
+
this.handleIncomingMessage(from, payload, messageId);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Start the agent process
|
|
48
|
+
*/
|
|
49
|
+
async start() {
|
|
50
|
+
if (this.running)
|
|
51
|
+
return;
|
|
52
|
+
// Set up log file if logsDir is provided
|
|
53
|
+
if (this.config.logsDir) {
|
|
54
|
+
try {
|
|
55
|
+
fs.mkdirSync(this.config.logsDir, { recursive: true });
|
|
56
|
+
this.logFilePath = path.join(this.config.logsDir, `${this.config.name}.log`);
|
|
57
|
+
this.logStream = fs.createWriteStream(this.logFilePath, { flags: 'a' });
|
|
58
|
+
this.logStream.write(`\n--- Worker ${this.config.name} started at ${new Date().toISOString()} ---\n`);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
console.error(`[pty:${this.config.name}] Failed to create log file: ${err.message}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Connect to relay daemon
|
|
65
|
+
try {
|
|
66
|
+
await this.client.connect();
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
console.error(`[pty:${this.config.name}] Relay connect failed: ${err.message}`);
|
|
70
|
+
}
|
|
71
|
+
// Build command args
|
|
72
|
+
const args = this.config.args ?? [];
|
|
73
|
+
// Spawn the process
|
|
74
|
+
this.ptyProcess = pty.spawn(this.config.command, args, {
|
|
75
|
+
name: 'xterm-256color',
|
|
76
|
+
cols: 120,
|
|
77
|
+
rows: 40,
|
|
78
|
+
cwd: this.config.cwd ?? process.cwd(),
|
|
79
|
+
env: {
|
|
80
|
+
...process.env,
|
|
81
|
+
...this.config.env,
|
|
82
|
+
AGENT_RELAY_NAME: this.config.name,
|
|
83
|
+
TERM: 'xterm-256color',
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
this.running = true;
|
|
87
|
+
// Capture output
|
|
88
|
+
this.ptyProcess.onData((data) => {
|
|
89
|
+
this.handleOutput(data);
|
|
90
|
+
});
|
|
91
|
+
// Handle exit
|
|
92
|
+
this.ptyProcess.onExit(({ exitCode }) => {
|
|
93
|
+
this.running = false;
|
|
94
|
+
this.emit('exit', exitCode);
|
|
95
|
+
this.config.onExit?.(exitCode);
|
|
96
|
+
this.client.destroy();
|
|
97
|
+
});
|
|
98
|
+
// Inject initial instructions after a delay
|
|
99
|
+
setTimeout(() => this.injectInstructions(), 2000);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Handle output from the process
|
|
103
|
+
*/
|
|
104
|
+
handleOutput(data) {
|
|
105
|
+
// Append to raw buffer
|
|
106
|
+
this.rawBuffer += data;
|
|
107
|
+
// Write to log file if available
|
|
108
|
+
if (this.logStream) {
|
|
109
|
+
this.logStream.write(data);
|
|
110
|
+
}
|
|
111
|
+
// Emit for external listeners
|
|
112
|
+
this.emit('output', data);
|
|
113
|
+
// Store in line buffer for logs
|
|
114
|
+
const lines = data.split('\n');
|
|
115
|
+
for (const line of lines) {
|
|
116
|
+
if (line.trim()) {
|
|
117
|
+
this.outputBuffer.push(line);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Trim buffer if too large
|
|
121
|
+
while (this.outputBuffer.length > MAX_BUFFER_LINES) {
|
|
122
|
+
this.outputBuffer.shift();
|
|
123
|
+
}
|
|
124
|
+
// Parse for relay commands
|
|
125
|
+
this.parseRelayCommands();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Parse relay commands from output.
|
|
129
|
+
* Handles both single-line and multi-line (fenced) formats.
|
|
130
|
+
* Deduplication via sentMessageHashes.
|
|
131
|
+
*/
|
|
132
|
+
parseRelayCommands() {
|
|
133
|
+
const cleanContent = this.stripAnsi(this.rawBuffer);
|
|
134
|
+
// First, try to find fenced multi-line messages: ->relay:Target <<<\n...\n>>>
|
|
135
|
+
this.parseFencedMessages(cleanContent);
|
|
136
|
+
// Then parse single-line messages
|
|
137
|
+
this.parseSingleLineMessages(cleanContent);
|
|
138
|
+
// Parse spawn/release commands
|
|
139
|
+
this.parseSpawnReleaseCommands(cleanContent);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Parse fenced multi-line messages: ->relay:Target <<<\n...\n>>>
|
|
143
|
+
*/
|
|
144
|
+
parseFencedMessages(content) {
|
|
145
|
+
// Pattern: ->relay:Target <<< (with content on same or following lines until >>>)
|
|
146
|
+
const fenceStartPattern = new RegExp(`${this.relayPrefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(\\S+)\\s*<<<`, 'g');
|
|
147
|
+
let match;
|
|
148
|
+
while ((match = fenceStartPattern.exec(content)) !== null) {
|
|
149
|
+
const target = match[1];
|
|
150
|
+
const startIdx = match.index + match[0].length;
|
|
151
|
+
// Find the closing >>>
|
|
152
|
+
const endIdx = content.indexOf('>>>', startIdx);
|
|
153
|
+
if (endIdx === -1)
|
|
154
|
+
continue;
|
|
155
|
+
// Extract the body between <<< and >>>
|
|
156
|
+
const body = content.substring(startIdx, endIdx).trim();
|
|
157
|
+
if (!body)
|
|
158
|
+
continue;
|
|
159
|
+
// Parse target for cross-project syntax
|
|
160
|
+
const colonIdx = target.indexOf(':');
|
|
161
|
+
let to = target;
|
|
162
|
+
let project;
|
|
163
|
+
if (colonIdx > 0 && colonIdx < target.length - 1) {
|
|
164
|
+
project = target.substring(0, colonIdx);
|
|
165
|
+
to = target.substring(colonIdx + 1);
|
|
166
|
+
}
|
|
167
|
+
this.sendRelayCommand({
|
|
168
|
+
to,
|
|
169
|
+
kind: 'message',
|
|
170
|
+
body,
|
|
171
|
+
project,
|
|
172
|
+
raw: match[0],
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Parse single-line messages (no fenced format)
|
|
178
|
+
*/
|
|
179
|
+
parseSingleLineMessages(content) {
|
|
180
|
+
const lines = content.split('\n');
|
|
181
|
+
for (const line of lines) {
|
|
182
|
+
// Skip lines that are part of fenced messages
|
|
183
|
+
if (line.includes('<<<') || line.includes('>>>'))
|
|
184
|
+
continue;
|
|
185
|
+
// Find the relay prefix in the line
|
|
186
|
+
const prefixIdx = line.indexOf(this.relayPrefix);
|
|
187
|
+
if (prefixIdx === -1)
|
|
188
|
+
continue;
|
|
189
|
+
// Extract everything after the prefix
|
|
190
|
+
const afterPrefix = line.substring(prefixIdx + this.relayPrefix.length);
|
|
191
|
+
// Find the target (first non-whitespace segment)
|
|
192
|
+
const targetMatch = afterPrefix.match(/^(\S+)/);
|
|
193
|
+
if (!targetMatch)
|
|
194
|
+
continue;
|
|
195
|
+
const target = targetMatch[1];
|
|
196
|
+
const bodyStart = targetMatch[0].length;
|
|
197
|
+
const body = afterPrefix.substring(bodyStart).trim();
|
|
198
|
+
// Skip if no body
|
|
199
|
+
if (!body)
|
|
200
|
+
continue;
|
|
201
|
+
// Parse target for cross-project syntax
|
|
202
|
+
const colonIdx = target.indexOf(':');
|
|
203
|
+
let to = target;
|
|
204
|
+
let project;
|
|
205
|
+
if (colonIdx > 0 && colonIdx < target.length - 1) {
|
|
206
|
+
project = target.substring(0, colonIdx);
|
|
207
|
+
to = target.substring(colonIdx + 1);
|
|
208
|
+
}
|
|
209
|
+
this.sendRelayCommand({
|
|
210
|
+
to,
|
|
211
|
+
kind: 'message',
|
|
212
|
+
body,
|
|
213
|
+
project,
|
|
214
|
+
raw: line,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Strip ANSI escape codes from string.
|
|
220
|
+
* Converts cursor movements to spaces to preserve visual layout.
|
|
221
|
+
*/
|
|
222
|
+
stripAnsi(str) {
|
|
223
|
+
// Convert cursor forward movements to spaces (CSI n C)
|
|
224
|
+
// \x1B[nC means move cursor right n columns
|
|
225
|
+
// eslint-disable-next-line no-control-regex
|
|
226
|
+
str = str.replace(/\x1B\[(\d+)C/g, (_m, n) => ' '.repeat(parseInt(n, 10) || 1));
|
|
227
|
+
// Convert single cursor right (CSI C) to space
|
|
228
|
+
// eslint-disable-next-line no-control-regex
|
|
229
|
+
str = str.replace(/\x1B\[C/g, ' ');
|
|
230
|
+
// Remove carriage returns (causes text overwriting issues)
|
|
231
|
+
str = str.replace(/\r(?!\n)/g, '');
|
|
232
|
+
// Strip remaining ANSI escape sequences
|
|
233
|
+
// eslint-disable-next-line no-control-regex
|
|
234
|
+
return str.replace(/\x1B(?:\[[0-9;]*[A-Za-z]|\].*?(?:\x07|\x1B\\)|[@-Z\\-_])/g, '');
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Send relay command to daemon
|
|
238
|
+
*/
|
|
239
|
+
sendRelayCommand(cmd) {
|
|
240
|
+
const msgHash = `${cmd.to}:${cmd.body}`;
|
|
241
|
+
if (this.sentMessageHashes.has(msgHash)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (this.client.state !== 'READY') {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const success = this.client.sendMessage(cmd.to, cmd.body, cmd.kind, cmd.data, cmd.thread);
|
|
248
|
+
if (success) {
|
|
249
|
+
this.sentMessageHashes.add(msgHash);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Parse spawn/release commands from output
|
|
254
|
+
* Uses string-based parsing for robustness with PTY output.
|
|
255
|
+
* Delegates to dashboard API if dashboardPort is set (for nested spawns).
|
|
256
|
+
*/
|
|
257
|
+
parseSpawnReleaseCommands(content) {
|
|
258
|
+
// Need either API port or callbacks to handle spawn/release
|
|
259
|
+
const canSpawn = this.config.dashboardPort || this.config.onSpawn;
|
|
260
|
+
const canRelease = this.config.dashboardPort || this.config.onRelease;
|
|
261
|
+
if (!canSpawn && !canRelease)
|
|
262
|
+
return;
|
|
263
|
+
const lines = content.split('\n');
|
|
264
|
+
const spawnPrefix = '->relay:spawn';
|
|
265
|
+
const releasePrefix = '->relay:release';
|
|
266
|
+
for (const line of lines) {
|
|
267
|
+
// Check for spawn command
|
|
268
|
+
const spawnIdx = line.indexOf(spawnPrefix);
|
|
269
|
+
if (spawnIdx !== -1 && canSpawn) {
|
|
270
|
+
const afterSpawn = line.substring(spawnIdx + spawnPrefix.length).trim();
|
|
271
|
+
// Parse: WorkerName cli "task" or WorkerName cli 'task'
|
|
272
|
+
const parts = afterSpawn.split(/\s+/);
|
|
273
|
+
if (parts.length >= 3) {
|
|
274
|
+
const name = parts[0];
|
|
275
|
+
const cli = parts[1];
|
|
276
|
+
// Task is everything after cli, potentially in quotes
|
|
277
|
+
const taskPart = parts.slice(2).join(' ');
|
|
278
|
+
// Remove surrounding quotes if present
|
|
279
|
+
const quoteMatch = taskPart.match(/^["'](.*)["']$/);
|
|
280
|
+
const task = quoteMatch ? quoteMatch[1] : taskPart;
|
|
281
|
+
if (name && cli && task) {
|
|
282
|
+
const spawnKey = `${name}:${cli}:${task}`;
|
|
283
|
+
if (!this.processedSpawnCommands.has(spawnKey)) {
|
|
284
|
+
this.processedSpawnCommands.add(spawnKey);
|
|
285
|
+
this.executeSpawn(name, cli, task);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
// Check for release command
|
|
292
|
+
const releaseIdx = line.indexOf(releasePrefix);
|
|
293
|
+
if (releaseIdx !== -1 && canRelease) {
|
|
294
|
+
const afterRelease = line.substring(releaseIdx + releasePrefix.length).trim();
|
|
295
|
+
const name = afterRelease.split(/\s+/)[0];
|
|
296
|
+
if (name && !this.processedReleaseCommands.has(name)) {
|
|
297
|
+
this.processedReleaseCommands.add(name);
|
|
298
|
+
this.executeRelease(name);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Execute spawn via API or callback
|
|
305
|
+
*/
|
|
306
|
+
async executeSpawn(name, cli, task) {
|
|
307
|
+
if (this.config.dashboardPort) {
|
|
308
|
+
// Use dashboard API for spawning (works from spawned agents)
|
|
309
|
+
try {
|
|
310
|
+
const response = await fetch(`http://localhost:${this.config.dashboardPort}/api/spawn`, {
|
|
311
|
+
method: 'POST',
|
|
312
|
+
headers: { 'Content-Type': 'application/json' },
|
|
313
|
+
body: JSON.stringify({ name, cli, task }),
|
|
314
|
+
});
|
|
315
|
+
const result = await response.json();
|
|
316
|
+
if (result.success) {
|
|
317
|
+
console.log(`[pty:${this.config.name}] Spawned ${name} via API`);
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
console.error(`[pty:${this.config.name}] Spawn failed: ${result.error}`);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
catch (err) {
|
|
324
|
+
console.error(`[pty:${this.config.name}] Spawn API call failed: ${err.message}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else if (this.config.onSpawn) {
|
|
328
|
+
// Fall back to callback
|
|
329
|
+
try {
|
|
330
|
+
await this.config.onSpawn(name, cli, task);
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
console.error(`[pty:${this.config.name}] Spawn failed: ${err.message}`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Execute release via API or callback
|
|
339
|
+
*/
|
|
340
|
+
async executeRelease(name) {
|
|
341
|
+
if (this.config.dashboardPort) {
|
|
342
|
+
// Use dashboard API for releasing
|
|
343
|
+
try {
|
|
344
|
+
const response = await fetch(`http://localhost:${this.config.dashboardPort}/api/spawned/${name}`, {
|
|
345
|
+
method: 'DELETE',
|
|
346
|
+
});
|
|
347
|
+
const result = await response.json();
|
|
348
|
+
if (result.success) {
|
|
349
|
+
console.log(`[pty:${this.config.name}] Released ${name} via API`);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
console.error(`[pty:${this.config.name}] Release failed: ${result.error}`);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
catch (err) {
|
|
356
|
+
console.error(`[pty:${this.config.name}] Release API call failed: ${err.message}`);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
else if (this.config.onRelease) {
|
|
360
|
+
// Fall back to callback
|
|
361
|
+
try {
|
|
362
|
+
await this.config.onRelease(name);
|
|
363
|
+
}
|
|
364
|
+
catch (err) {
|
|
365
|
+
console.error(`[pty:${this.config.name}] Release failed: ${err.message}`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Handle incoming message from relay
|
|
371
|
+
*/
|
|
372
|
+
handleIncomingMessage(from, payload, messageId) {
|
|
373
|
+
this.messageQueue.push({ from, body: payload.body, messageId });
|
|
374
|
+
this.processMessageQueue();
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Process queued messages
|
|
378
|
+
*/
|
|
379
|
+
async processMessageQueue() {
|
|
380
|
+
if (this.isInjecting || this.messageQueue.length === 0)
|
|
381
|
+
return;
|
|
382
|
+
if (!this.ptyProcess || !this.running)
|
|
383
|
+
return;
|
|
384
|
+
this.isInjecting = true;
|
|
385
|
+
const msg = this.messageQueue.shift();
|
|
386
|
+
if (!msg) {
|
|
387
|
+
this.isInjecting = false;
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
try {
|
|
391
|
+
const shortId = msg.messageId.substring(0, 8);
|
|
392
|
+
const sanitizedBody = msg.body.replace(/[\r\n]+/g, ' ').trim();
|
|
393
|
+
const injection = `Relay message from ${msg.from} [${shortId}]: ${sanitizedBody}`;
|
|
394
|
+
// Write message to PTY, then send Enter separately after a small delay
|
|
395
|
+
// This matches how TmuxWrapper does it for better CLI compatibility
|
|
396
|
+
this.ptyProcess.write(injection);
|
|
397
|
+
await this.sleep(50);
|
|
398
|
+
this.ptyProcess.write('\r');
|
|
399
|
+
}
|
|
400
|
+
catch (err) {
|
|
401
|
+
console.error(`[pty:${this.config.name}] Injection failed: ${err.message}`);
|
|
402
|
+
}
|
|
403
|
+
finally {
|
|
404
|
+
this.isInjecting = false;
|
|
405
|
+
// Process next message if any
|
|
406
|
+
if (this.messageQueue.length > 0) {
|
|
407
|
+
setTimeout(() => this.processMessageQueue(), 500);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Inject usage instructions
|
|
413
|
+
*/
|
|
414
|
+
injectInstructions() {
|
|
415
|
+
if (!this.running || !this.ptyProcess)
|
|
416
|
+
return;
|
|
417
|
+
const escapedPrefix = '\\' + this.relayPrefix;
|
|
418
|
+
const instructions = `[Agent Relay] You are "${this.config.name}" - connected for real-time messaging. SEND: ${escapedPrefix}AgentName message`;
|
|
419
|
+
try {
|
|
420
|
+
this.ptyProcess.write(instructions + '\r');
|
|
421
|
+
}
|
|
422
|
+
catch {
|
|
423
|
+
// Silent fail
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Write directly to the PTY
|
|
428
|
+
*/
|
|
429
|
+
write(data) {
|
|
430
|
+
if (this.ptyProcess && this.running) {
|
|
431
|
+
this.ptyProcess.write(data);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Get captured output lines
|
|
436
|
+
*/
|
|
437
|
+
getOutput(limit) {
|
|
438
|
+
if (limit && limit > 0) {
|
|
439
|
+
return this.outputBuffer.slice(-limit);
|
|
440
|
+
}
|
|
441
|
+
return [...this.outputBuffer];
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Get raw output buffer
|
|
445
|
+
*/
|
|
446
|
+
getRawOutput() {
|
|
447
|
+
return this.rawBuffer;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Stop the agent process
|
|
451
|
+
*/
|
|
452
|
+
stop() {
|
|
453
|
+
if (!this.running)
|
|
454
|
+
return;
|
|
455
|
+
this.running = false;
|
|
456
|
+
if (this.ptyProcess) {
|
|
457
|
+
// Try graceful termination first
|
|
458
|
+
this.ptyProcess.write('\x03'); // Ctrl+C
|
|
459
|
+
setTimeout(() => {
|
|
460
|
+
if (this.ptyProcess) {
|
|
461
|
+
this.ptyProcess.kill();
|
|
462
|
+
}
|
|
463
|
+
}, 1000);
|
|
464
|
+
}
|
|
465
|
+
this.closeLogStream();
|
|
466
|
+
this.client.destroy();
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Kill the process immediately
|
|
470
|
+
*/
|
|
471
|
+
kill() {
|
|
472
|
+
this.running = false;
|
|
473
|
+
if (this.ptyProcess) {
|
|
474
|
+
this.ptyProcess.kill();
|
|
475
|
+
}
|
|
476
|
+
this.closeLogStream();
|
|
477
|
+
this.client.destroy();
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Sleep helper
|
|
481
|
+
*/
|
|
482
|
+
sleep(ms) {
|
|
483
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Close the log file stream
|
|
487
|
+
*/
|
|
488
|
+
closeLogStream() {
|
|
489
|
+
if (this.logStream) {
|
|
490
|
+
this.logStream.write(`\n--- Worker ${this.config.name} stopped at ${new Date().toISOString()} ---\n`);
|
|
491
|
+
this.logStream.end();
|
|
492
|
+
this.logStream = undefined;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
get isRunning() {
|
|
496
|
+
return this.running;
|
|
497
|
+
}
|
|
498
|
+
get name() {
|
|
499
|
+
return this.config.name;
|
|
500
|
+
}
|
|
501
|
+
get pid() {
|
|
502
|
+
return this.ptyProcess?.pid;
|
|
503
|
+
}
|
|
504
|
+
get logPath() {
|
|
505
|
+
return this.logFilePath;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
//# sourceMappingURL=pty-wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pty-wrapper.js","sourceRoot":"","sources":["../../src/wrapper/pty-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO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;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC;IAC9B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -65,7 +65,7 @@ export interface TmuxWrapperConfig {
|
|
|
65
65
|
* Get the default relay prefix for a given CLI type.
|
|
66
66
|
* All agents now use '->relay:' as the unified prefix.
|
|
67
67
|
*/
|
|
68
|
-
export declare function getDefaultPrefix(
|
|
68
|
+
export declare function getDefaultPrefix(_cliType: 'claude' | 'codex' | 'gemini' | 'droid' | 'other'): string;
|
|
69
69
|
export declare class TmuxWrapper {
|
|
70
70
|
private config;
|
|
71
71
|
private sessionName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tmux-wrapper.d.ts","sourceRoot":"","sources":["../../src/wrapper/tmux-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA0BH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM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qB;IAqB7B;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAgBpC;;OAEG;YACW,iBAAiB;IAiG/B,OAAO,CAAC,eAAe;IAkBvB;;OAEG;YACW,QAAQ;IAItB;;OAEG;YACW,eAAe;IAa7B;;;OAGG;YACW,YAAY;IAqB1B,OAAO,CAAC,KAAK;IAIb;;;OAGG;IACH,iBAAiB,IAAI,IAAI;IAMzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;OAEG;YACW,WAAW;IAYzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAOvB;;;OAGG;YACW,YAAY;IAkB1B;;;OAGG;YACW,UAAU;IAWxB;;;;;;;OAOG;YACW,iBAAiB;IAqC/B;;;OAGG;YACW,oBAAoB;IAYlC;;OAEG;YACW,iBAAiB;IA2B/B;;OAEG;IACH,IAAI,IAAI,IAAI;IAyBZ,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -35,7 +35,7 @@ const RELAY_LOG_TRUNCATE_LENGTH = 50;
|
|
|
35
35
|
* Get the default relay prefix for a given CLI type.
|
|
36
36
|
* All agents now use '->relay:' as the unified prefix.
|
|
37
37
|
*/
|
|
38
|
-
export function getDefaultPrefix(
|
|
38
|
+
export function getDefaultPrefix(_cliType) {
|
|
39
39
|
// Unified prefix for all agent types
|
|
40
40
|
return '->relay:';
|
|
41
41
|
}
|