network-ai 5.0.0 → 5.1.1
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/INTEGRATION_GUIDE.md +4 -4
- package/QUICKSTART.md +4 -4
- package/README.md +15 -12
- package/dist/adapters/custom-adapter.d.ts +1 -1
- package/dist/adapters/custom-adapter.js +1 -1
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +4 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/langchain-adapter.js +1 -1
- package/dist/adapters/langchain-adapter.js.map +1 -1
- package/dist/adapters/mcp-adapter.d.ts +1 -1
- package/dist/adapters/mcp-adapter.js +3 -3
- package/dist/adapters/mcp-adapter.js.map +1 -1
- package/dist/adapters/openclaw-adapter.d.ts +1 -1
- package/dist/adapters/openclaw-adapter.js +3 -3
- package/dist/adapters/openclaw-adapter.js.map +1 -1
- package/dist/adapters/orchestrator-adapter.d.ts +118 -0
- package/dist/adapters/orchestrator-adapter.d.ts.map +1 -0
- package/dist/adapters/orchestrator-adapter.js +218 -0
- package/dist/adapters/orchestrator-adapter.js.map +1 -0
- package/dist/demo-control-plane.d.ts +12 -0
- package/dist/demo-control-plane.d.ts.map +1 -0
- package/dist/demo-control-plane.js +147 -0
- package/dist/demo-control-plane.js.map +1 -0
- package/dist/demo-worktree-dashboard.d.ts +2 -0
- package/dist/demo-worktree-dashboard.d.ts.map +1 -0
- package/dist/demo-worktree-dashboard.js +131 -0
- package/dist/demo-worktree-dashboard.js.map +1 -0
- package/dist/examples/01-hello-swarm.d.ts +13 -0
- package/dist/examples/01-hello-swarm.d.ts.map +1 -0
- package/dist/examples/01-hello-swarm.js +165 -0
- package/dist/examples/01-hello-swarm.js.map +1 -0
- package/dist/examples/02-fsm-pipeline.d.ts +20 -0
- package/dist/examples/02-fsm-pipeline.d.ts.map +1 -0
- package/dist/examples/02-fsm-pipeline.js +189 -0
- package/dist/examples/02-fsm-pipeline.js.map +1 -0
- package/dist/examples/03-parallel-agents.d.ts +21 -0
- package/dist/examples/03-parallel-agents.d.ts.map +1 -0
- package/dist/examples/03-parallel-agents.js +192 -0
- package/dist/examples/03-parallel-agents.js.map +1 -0
- package/dist/examples/05-code-review-swarm.d.ts +21 -0
- package/dist/examples/05-code-review-swarm.d.ts.map +1 -0
- package/dist/examples/05-code-review-swarm.js +1177 -0
- package/dist/examples/05-code-review-swarm.js.map +1 -0
- package/dist/examples/06-ai-pipeline-demo.d.ts +24 -0
- package/dist/examples/06-ai-pipeline-demo.d.ts.map +1 -0
- package/dist/examples/06-ai-pipeline-demo.js +263 -0
- package/dist/examples/06-ai-pipeline-demo.js.map +1 -0
- package/dist/examples/07-full-showcase.d.ts +27 -0
- package/dist/examples/07-full-showcase.d.ts.map +1 -0
- package/dist/examples/07-full-showcase.js +946 -0
- package/dist/examples/07-full-showcase.js.map +1 -0
- package/dist/examples/08-control-plane-stress-demo.d.ts +19 -0
- package/dist/examples/08-control-plane-stress-demo.d.ts.map +1 -0
- package/dist/examples/08-control-plane-stress-demo.js +186 -0
- package/dist/examples/08-control-plane-stress-demo.js.map +1 -0
- package/dist/examples/09-real-langchain.d.ts +19 -0
- package/dist/examples/09-real-langchain.d.ts.map +1 -0
- package/dist/examples/09-real-langchain.js +231 -0
- package/dist/examples/09-real-langchain.js.map +1 -0
- package/dist/examples/10-nemoclaw-sandbox-swarm.d.ts +16 -0
- package/dist/examples/10-nemoclaw-sandbox-swarm.d.ts.map +1 -0
- package/dist/examples/10-nemoclaw-sandbox-swarm.js +270 -0
- package/dist/examples/10-nemoclaw-sandbox-swarm.js.map +1 -0
- package/dist/examples/demo-runner.d.ts +2 -0
- package/dist/examples/demo-runner.d.ts.map +1 -0
- package/dist/examples/demo-runner.js +119 -0
- package/dist/examples/demo-runner.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-guardian.js.map +1 -1
- package/dist/lib/control-plane.d.ts +128 -0
- package/dist/lib/control-plane.d.ts.map +1 -0
- package/dist/lib/control-plane.js +527 -0
- package/dist/lib/control-plane.js.map +1 -0
- package/dist/lib/coverage-reporter.js.map +1 -1
- package/dist/lib/goal-dsl.d.ts.map +1 -1
- package/dist/lib/goal-dsl.js +0 -1
- package/dist/lib/goal-dsl.js.map +1 -1
- package/dist/lib/work-tree-dashboard.d.ts +130 -0
- package/dist/lib/work-tree-dashboard.d.ts.map +1 -0
- package/dist/lib/work-tree-dashboard.js +583 -0
- package/dist/lib/work-tree-dashboard.js.map +1 -0
- package/dist/lib/work-tree-ui.d.ts +107 -0
- package/dist/lib/work-tree-ui.d.ts.map +1 -0
- package/dist/lib/work-tree-ui.js +333 -0
- package/dist/lib/work-tree-ui.js.map +1 -0
- package/dist/lib/work-tree.d.ts +184 -0
- package/dist/lib/work-tree.d.ts.map +1 -0
- package/dist/lib/work-tree.js +480 -0
- package/dist/lib/work-tree.js.map +1 -0
- package/dist/security.d.ts.map +1 -1
- package/dist/security.js +3 -2
- package/dist/security.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* WorkTreeDashboard — Browser-based live WorkTree visualization
|
|
4
|
+
*
|
|
5
|
+
* Serves a single-page HTML dashboard over HTTP and streams WorkTree
|
|
6
|
+
* state changes over WebSocket. Zero external dependencies — uses only
|
|
7
|
+
* Node.js built-in modules.
|
|
8
|
+
*
|
|
9
|
+
* Follows the same architecture as {@link DashboardServer} for the
|
|
10
|
+
* TopologyTracker but renders a hierarchical task tree instead of a
|
|
11
|
+
* force-directed graph.
|
|
12
|
+
*
|
|
13
|
+
* @module WorkTreeDashboard
|
|
14
|
+
* @version 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.WorkTreeDashboard = void 0;
|
|
18
|
+
const http_1 = require("http");
|
|
19
|
+
const crypto_1 = require("crypto");
|
|
20
|
+
const events_1 = require("events");
|
|
21
|
+
const fs_1 = require("fs");
|
|
22
|
+
const path_1 = require("path");
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// WEBSOCKET HELPERS (RFC 6455 minimal — same as dashboard-server)
|
|
25
|
+
// ============================================================================
|
|
26
|
+
const WS_GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
|
|
27
|
+
function computeAcceptKey(key) {
|
|
28
|
+
return (0, crypto_1.createHash)('sha1').update(key + WS_GUID).digest('base64');
|
|
29
|
+
}
|
|
30
|
+
function encodeWSFrame(data) {
|
|
31
|
+
const payload = Buffer.from(data, 'utf8');
|
|
32
|
+
const len = payload.length;
|
|
33
|
+
let header;
|
|
34
|
+
if (len < 126) {
|
|
35
|
+
header = Buffer.alloc(2);
|
|
36
|
+
header[0] = 0x81;
|
|
37
|
+
header[1] = len;
|
|
38
|
+
}
|
|
39
|
+
else if (len < 65536) {
|
|
40
|
+
header = Buffer.alloc(4);
|
|
41
|
+
header[0] = 0x81;
|
|
42
|
+
header[1] = 126;
|
|
43
|
+
header.writeUInt16BE(len, 2);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
header = Buffer.alloc(10);
|
|
47
|
+
header[0] = 0x81;
|
|
48
|
+
header[1] = 127;
|
|
49
|
+
header.writeUInt32BE(0, 2);
|
|
50
|
+
header.writeUInt32BE(len, 6);
|
|
51
|
+
}
|
|
52
|
+
return Buffer.concat([header, payload]);
|
|
53
|
+
}
|
|
54
|
+
function decodeWSFrame(buf) {
|
|
55
|
+
if (buf.length < 2)
|
|
56
|
+
return null;
|
|
57
|
+
const opcode = buf[0] & 0x0f;
|
|
58
|
+
const masked = (buf[1] & 0x80) !== 0;
|
|
59
|
+
let payloadLen = buf[1] & 0x7f;
|
|
60
|
+
let offset = 2;
|
|
61
|
+
if (payloadLen === 126) {
|
|
62
|
+
if (buf.length < 4)
|
|
63
|
+
return null;
|
|
64
|
+
payloadLen = buf.readUInt16BE(2);
|
|
65
|
+
offset = 4;
|
|
66
|
+
}
|
|
67
|
+
else if (payloadLen === 127) {
|
|
68
|
+
if (buf.length < 10)
|
|
69
|
+
return null;
|
|
70
|
+
payloadLen = buf.readUInt32BE(6);
|
|
71
|
+
offset = 10;
|
|
72
|
+
}
|
|
73
|
+
if (masked) {
|
|
74
|
+
if (buf.length < offset + 4 + payloadLen)
|
|
75
|
+
return null;
|
|
76
|
+
const mask = buf.subarray(offset, offset + 4);
|
|
77
|
+
offset += 4;
|
|
78
|
+
const payload = Buffer.alloc(payloadLen);
|
|
79
|
+
for (let i = 0; i < payloadLen; i++) {
|
|
80
|
+
payload[i] = buf[offset + i] ^ mask[i % 4];
|
|
81
|
+
}
|
|
82
|
+
return { opcode, payload };
|
|
83
|
+
}
|
|
84
|
+
if (buf.length < offset + payloadLen)
|
|
85
|
+
return null;
|
|
86
|
+
return { opcode, payload: buf.subarray(offset, offset + payloadLen) };
|
|
87
|
+
}
|
|
88
|
+
// ============================================================================
|
|
89
|
+
// HTML LOADER
|
|
90
|
+
// ============================================================================
|
|
91
|
+
function getDashboardHTML(wsPort) {
|
|
92
|
+
const htmlPath = (0, path_1.join)(__dirname, 'work-tree-dashboard.html');
|
|
93
|
+
const html = (0, fs_1.readFileSync)(htmlPath, 'utf-8');
|
|
94
|
+
return html.replace('__WS_PORT__', String(wsPort));
|
|
95
|
+
}
|
|
96
|
+
// ============================================================================
|
|
97
|
+
// WORK TREE DASHBOARD
|
|
98
|
+
// ============================================================================
|
|
99
|
+
/**
|
|
100
|
+
* HTTP + WebSocket server for live WorkTree visualization.
|
|
101
|
+
*
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const tree = new WorkTree('root', 'My Project');
|
|
104
|
+
* const dashboard = new WorkTreeDashboard(tree, { port: 4821 });
|
|
105
|
+
* await dashboard.start();
|
|
106
|
+
* // Open http://127.0.0.1:4821 in your browser
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
class WorkTreeDashboard extends events_1.EventEmitter {
|
|
110
|
+
tree;
|
|
111
|
+
port;
|
|
112
|
+
host;
|
|
113
|
+
server = null;
|
|
114
|
+
clients = new Map();
|
|
115
|
+
pingInterval = null;
|
|
116
|
+
eventHandlers = [];
|
|
117
|
+
clientCounter = 0;
|
|
118
|
+
deltaPending = false;
|
|
119
|
+
agentLogs = new Map();
|
|
120
|
+
orchestratorLogs = [];
|
|
121
|
+
orchestratorAgent = null;
|
|
122
|
+
constructor(tree, options) {
|
|
123
|
+
super();
|
|
124
|
+
this.tree = tree;
|
|
125
|
+
this.port = options?.port ?? 4821;
|
|
126
|
+
this.host = options?.host ?? '127.0.0.1';
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Start the dashboard server.
|
|
130
|
+
*/
|
|
131
|
+
async start() {
|
|
132
|
+
return new Promise((resolve, reject) => {
|
|
133
|
+
const server = (0, http_1.createServer)((req, res) => this.handleHTTP(req, res));
|
|
134
|
+
server.on('upgrade', (req, socket) => {
|
|
135
|
+
this.handleUpgrade(req, socket);
|
|
136
|
+
});
|
|
137
|
+
server.on('error', (err) => {
|
|
138
|
+
this.emit('error', err);
|
|
139
|
+
reject(err);
|
|
140
|
+
});
|
|
141
|
+
server.listen(this.port, this.host, () => {
|
|
142
|
+
this.server = server;
|
|
143
|
+
this.subscribeToTree();
|
|
144
|
+
// Ping clients every 30s
|
|
145
|
+
this.pingInterval = setInterval(() => this.pingClients(), 30000);
|
|
146
|
+
this.emit('listening', { port: this.port, host: this.host });
|
|
147
|
+
resolve();
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Stop the dashboard server.
|
|
153
|
+
*/
|
|
154
|
+
async stop() {
|
|
155
|
+
if (this.pingInterval) {
|
|
156
|
+
clearInterval(this.pingInterval);
|
|
157
|
+
this.pingInterval = null;
|
|
158
|
+
}
|
|
159
|
+
this.unsubscribeFromTree();
|
|
160
|
+
for (const client of this.clients.values()) {
|
|
161
|
+
client.close();
|
|
162
|
+
}
|
|
163
|
+
this.clients.clear();
|
|
164
|
+
return new Promise((resolve) => {
|
|
165
|
+
if (!this.server) {
|
|
166
|
+
resolve();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
this.server.close(() => {
|
|
170
|
+
this.server = null;
|
|
171
|
+
resolve();
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/** Number of connected WebSocket clients. */
|
|
176
|
+
clientCount() {
|
|
177
|
+
return this.clients.size;
|
|
178
|
+
}
|
|
179
|
+
/** The URL the dashboard is serving on. */
|
|
180
|
+
get url() {
|
|
181
|
+
return `http://${this.host}:${this.port}`;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Designate an agent as the orchestrator (shown at the top of the Agents tab).
|
|
185
|
+
*/
|
|
186
|
+
setOrchestrator(agentName) {
|
|
187
|
+
this.orchestratorAgent = agentName;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Push a log entry for an agent. Triggers a broadcast to connected clients.
|
|
191
|
+
*
|
|
192
|
+
* @param agent - The agent name (must match `node.agent` in the tree)
|
|
193
|
+
* @param message - Log message text
|
|
194
|
+
* @param level - Severity: 'info' | 'warn' | 'error' (default: 'info')
|
|
195
|
+
*/
|
|
196
|
+
pushLog(agent, message, level = 'info') {
|
|
197
|
+
const entry = {
|
|
198
|
+
time: new Date().toLocaleTimeString(),
|
|
199
|
+
message,
|
|
200
|
+
level,
|
|
201
|
+
};
|
|
202
|
+
if (!this.agentLogs.has(agent)) {
|
|
203
|
+
this.agentLogs.set(agent, []);
|
|
204
|
+
}
|
|
205
|
+
const logs = this.agentLogs.get(agent);
|
|
206
|
+
logs.push(entry);
|
|
207
|
+
// Keep max 100 entries per agent
|
|
208
|
+
if (logs.length > 100)
|
|
209
|
+
logs.splice(0, logs.length - 100);
|
|
210
|
+
// Also add to orchestrator narrative if it's the orchestrator
|
|
211
|
+
if (agent === this.orchestratorAgent) {
|
|
212
|
+
this.orchestratorLogs.push(entry);
|
|
213
|
+
if (this.orchestratorLogs.length > 50) {
|
|
214
|
+
this.orchestratorLogs.splice(0, this.orchestratorLogs.length - 50);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
this.broadcastUpdate();
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Push a narrative message to the orchestrator log (not tied to a specific agent).
|
|
221
|
+
*/
|
|
222
|
+
pushNarrative(message) {
|
|
223
|
+
const entry = {
|
|
224
|
+
time: new Date().toLocaleTimeString(),
|
|
225
|
+
message,
|
|
226
|
+
level: 'info',
|
|
227
|
+
};
|
|
228
|
+
this.orchestratorLogs.push(entry);
|
|
229
|
+
if (this.orchestratorLogs.length > 50) {
|
|
230
|
+
this.orchestratorLogs.splice(0, this.orchestratorLogs.length - 50);
|
|
231
|
+
}
|
|
232
|
+
this.broadcastUpdate();
|
|
233
|
+
}
|
|
234
|
+
// --------------------------------------------------------------------------
|
|
235
|
+
// TREE EVENT SUBSCRIPTION
|
|
236
|
+
// --------------------------------------------------------------------------
|
|
237
|
+
subscribeToTree() {
|
|
238
|
+
const events = [
|
|
239
|
+
'node:added', 'node:removed', 'node:status',
|
|
240
|
+
'node:tokens', 'node:progress', 'tree:complete',
|
|
241
|
+
];
|
|
242
|
+
for (const eventName of events) {
|
|
243
|
+
const handler = (..._args) => {
|
|
244
|
+
this.broadcastUpdate();
|
|
245
|
+
};
|
|
246
|
+
this.tree.on(eventName, handler);
|
|
247
|
+
this.eventHandlers.push({ event: eventName, handler });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
unsubscribeFromTree() {
|
|
251
|
+
for (const { event, handler } of this.eventHandlers) {
|
|
252
|
+
this.tree.removeListener(event, handler);
|
|
253
|
+
}
|
|
254
|
+
this.eventHandlers = [];
|
|
255
|
+
}
|
|
256
|
+
// --------------------------------------------------------------------------
|
|
257
|
+
// HTTP
|
|
258
|
+
// --------------------------------------------------------------------------
|
|
259
|
+
handleHTTP(req, res) {
|
|
260
|
+
const url = req.url ?? '/';
|
|
261
|
+
if (url === '/' || url === '/index.html') {
|
|
262
|
+
res.writeHead(200, {
|
|
263
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
264
|
+
'Cache-Control': 'no-cache',
|
|
265
|
+
'X-Content-Type-Options': 'nosniff',
|
|
266
|
+
});
|
|
267
|
+
res.end(getDashboardHTML(this.port));
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (url === '/api/snapshot') {
|
|
271
|
+
const snapshot = this.tree.snapshot();
|
|
272
|
+
res.writeHead(200, {
|
|
273
|
+
'Content-Type': 'application/json',
|
|
274
|
+
'Cache-Control': 'no-cache',
|
|
275
|
+
'X-Content-Type-Options': 'nosniff',
|
|
276
|
+
});
|
|
277
|
+
res.end(JSON.stringify(snapshot));
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (url === '/api/health') {
|
|
281
|
+
res.writeHead(200, {
|
|
282
|
+
'Content-Type': 'application/json',
|
|
283
|
+
'X-Content-Type-Options': 'nosniff',
|
|
284
|
+
});
|
|
285
|
+
const stats = this.tree.stats();
|
|
286
|
+
res.end(JSON.stringify({
|
|
287
|
+
status: 'ok',
|
|
288
|
+
clients: this.clients.size,
|
|
289
|
+
nodes: stats.total,
|
|
290
|
+
progress: stats.progress,
|
|
291
|
+
}));
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
295
|
+
res.end('Not Found');
|
|
296
|
+
}
|
|
297
|
+
// --------------------------------------------------------------------------
|
|
298
|
+
// WEBSOCKET UPGRADE
|
|
299
|
+
// --------------------------------------------------------------------------
|
|
300
|
+
handleUpgrade(req, socket) {
|
|
301
|
+
const key = req.headers['sec-websocket-key'];
|
|
302
|
+
if (!key) {
|
|
303
|
+
socket.destroy();
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const acceptKey = computeAcceptKey(key);
|
|
307
|
+
const headers = [
|
|
308
|
+
'HTTP/1.1 101 Switching Protocols',
|
|
309
|
+
'Upgrade: websocket',
|
|
310
|
+
'Connection: Upgrade',
|
|
311
|
+
`Sec-WebSocket-Accept: ${acceptKey}`,
|
|
312
|
+
'', '',
|
|
313
|
+
].join('\r\n');
|
|
314
|
+
socket.write(headers);
|
|
315
|
+
const clientId = `ws-${++this.clientCounter}`;
|
|
316
|
+
const client = {
|
|
317
|
+
id: clientId,
|
|
318
|
+
send: (data) => {
|
|
319
|
+
try {
|
|
320
|
+
socket.write(encodeWSFrame(data));
|
|
321
|
+
}
|
|
322
|
+
catch { /* disconnected */ }
|
|
323
|
+
},
|
|
324
|
+
close: () => {
|
|
325
|
+
try {
|
|
326
|
+
const closeFrame = Buffer.alloc(2);
|
|
327
|
+
closeFrame[0] = 0x88;
|
|
328
|
+
closeFrame[1] = 0x00;
|
|
329
|
+
socket.write(closeFrame);
|
|
330
|
+
socket.end();
|
|
331
|
+
}
|
|
332
|
+
catch { /* already closed */ }
|
|
333
|
+
},
|
|
334
|
+
alive: true,
|
|
335
|
+
};
|
|
336
|
+
this.clients.set(clientId, client);
|
|
337
|
+
this.emit('client:connected', clientId);
|
|
338
|
+
// Send initial snapshot
|
|
339
|
+
this.sendSnapshot(client);
|
|
340
|
+
// Handle incoming messages
|
|
341
|
+
let buffer = Buffer.alloc(0);
|
|
342
|
+
socket.on('data', (chunk) => {
|
|
343
|
+
buffer = Buffer.concat([buffer, chunk]);
|
|
344
|
+
const frame = decodeWSFrame(buffer);
|
|
345
|
+
if (!frame)
|
|
346
|
+
return;
|
|
347
|
+
buffer = Buffer.alloc(0);
|
|
348
|
+
if (frame.opcode === 0x08) {
|
|
349
|
+
this.clients.delete(clientId);
|
|
350
|
+
socket.end();
|
|
351
|
+
this.emit('client:disconnected', clientId);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
if (frame.opcode === 0x0a) {
|
|
355
|
+
client.alive = true;
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
if (frame.opcode === 0x01) {
|
|
359
|
+
try {
|
|
360
|
+
const msg = JSON.parse(frame.payload.toString('utf8'));
|
|
361
|
+
if (msg.action === 'snapshot') {
|
|
362
|
+
this.sendSnapshot(client);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
catch { /* ignore malformed */ }
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
socket.on('close', () => {
|
|
369
|
+
this.clients.delete(clientId);
|
|
370
|
+
this.emit('client:disconnected', clientId);
|
|
371
|
+
});
|
|
372
|
+
socket.on('error', () => {
|
|
373
|
+
this.clients.delete(clientId);
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
// --------------------------------------------------------------------------
|
|
377
|
+
// BROADCAST
|
|
378
|
+
// --------------------------------------------------------------------------
|
|
379
|
+
sendSnapshot(client) {
|
|
380
|
+
const snap = this.tree.snapshot();
|
|
381
|
+
const agents = this.buildAgentMap(snap);
|
|
382
|
+
const diagnostics = this.computeDiagnostics(snap, agents);
|
|
383
|
+
client.send(JSON.stringify({
|
|
384
|
+
type: 'snapshot',
|
|
385
|
+
rootId: snap.rootId,
|
|
386
|
+
nodes: snap.nodes,
|
|
387
|
+
stats: snap.stats,
|
|
388
|
+
agents,
|
|
389
|
+
orchestratorLogs: this.orchestratorLogs,
|
|
390
|
+
diagnostics,
|
|
391
|
+
}));
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Broadcast a delta (changed nodes + stats) to all clients.
|
|
395
|
+
* Debounced via queueMicrotask to batch rapid events per tick.
|
|
396
|
+
*/
|
|
397
|
+
broadcastUpdate() {
|
|
398
|
+
if (this.clients.size === 0)
|
|
399
|
+
return;
|
|
400
|
+
if (this.deltaPending)
|
|
401
|
+
return;
|
|
402
|
+
this.deltaPending = true;
|
|
403
|
+
queueMicrotask(() => {
|
|
404
|
+
this.deltaPending = false;
|
|
405
|
+
if (this.clients.size === 0)
|
|
406
|
+
return;
|
|
407
|
+
// For WorkTree we always send full snapshots since trees are typically
|
|
408
|
+
// small (hundreds of nodes max) and the snapshot is cheap.
|
|
409
|
+
const snap = this.tree.snapshot();
|
|
410
|
+
const agents = this.buildAgentMap(snap);
|
|
411
|
+
const diagnostics = this.computeDiagnostics(snap, agents);
|
|
412
|
+
const data = JSON.stringify({
|
|
413
|
+
type: 'snapshot',
|
|
414
|
+
rootId: snap.rootId,
|
|
415
|
+
nodes: snap.nodes,
|
|
416
|
+
stats: snap.stats,
|
|
417
|
+
agents,
|
|
418
|
+
orchestratorLogs: this.orchestratorLogs,
|
|
419
|
+
diagnostics,
|
|
420
|
+
});
|
|
421
|
+
for (const client of this.clients.values()) {
|
|
422
|
+
client.send(data);
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Build agent map from tree snapshot + stored logs.
|
|
428
|
+
*/
|
|
429
|
+
buildAgentMap(snap) {
|
|
430
|
+
const agents = {};
|
|
431
|
+
for (const id of Object.keys(snap.nodes)) {
|
|
432
|
+
const node = snap.nodes[id];
|
|
433
|
+
if (!node.agent)
|
|
434
|
+
continue;
|
|
435
|
+
const name = node.agent;
|
|
436
|
+
if (!agents[name]) {
|
|
437
|
+
agents[name] = {
|
|
438
|
+
name,
|
|
439
|
+
role: name === this.orchestratorAgent ? 'orchestrator' : 'worker',
|
|
440
|
+
status: 'idle',
|
|
441
|
+
tasks: [],
|
|
442
|
+
currentTask: null,
|
|
443
|
+
logs: this.agentLogs.get(name) ?? [],
|
|
444
|
+
tokens: 0,
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
const a = agents[name];
|
|
448
|
+
a.tasks.push({ id: node.id, label: node.label, status: node.status });
|
|
449
|
+
a.tokens += node.ownTokens ?? 0;
|
|
450
|
+
if (node.status === 'running') {
|
|
451
|
+
a.status = 'busy';
|
|
452
|
+
a.currentTask = node.label;
|
|
453
|
+
}
|
|
454
|
+
if (node.status === 'failed') {
|
|
455
|
+
a.status = 'error';
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// Include agents that have logs but no tree nodes
|
|
459
|
+
for (const [name, logs] of this.agentLogs.entries()) {
|
|
460
|
+
if (!agents[name]) {
|
|
461
|
+
agents[name] = {
|
|
462
|
+
name,
|
|
463
|
+
role: name === this.orchestratorAgent ? 'orchestrator' : 'worker',
|
|
464
|
+
status: 'idle',
|
|
465
|
+
tasks: [],
|
|
466
|
+
currentTask: null,
|
|
467
|
+
logs,
|
|
468
|
+
tokens: 0,
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return agents;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Analyze system state and detect issues, stalls, and failures.
|
|
476
|
+
*/
|
|
477
|
+
computeDiagnostics(snap, agents) {
|
|
478
|
+
const issues = [];
|
|
479
|
+
// Detect failed agents
|
|
480
|
+
for (const [name, agent] of Object.entries(agents)) {
|
|
481
|
+
if (agent.status === 'error') {
|
|
482
|
+
const errorLogs = agent.logs.filter(l => l.level === 'error');
|
|
483
|
+
const lastError = errorLogs.length > 0
|
|
484
|
+
? errorLogs[errorLogs.length - 1].message
|
|
485
|
+
: 'Unknown error';
|
|
486
|
+
issues.push({
|
|
487
|
+
level: 'error',
|
|
488
|
+
category: 'agent_failure',
|
|
489
|
+
message: `${name} failed: ${lastError}`,
|
|
490
|
+
agent: name,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
// Detect failed tasks
|
|
495
|
+
for (const [id, node] of Object.entries(snap.nodes)) {
|
|
496
|
+
if (node.status === 'failed') {
|
|
497
|
+
issues.push({
|
|
498
|
+
level: 'error',
|
|
499
|
+
category: 'task_failure',
|
|
500
|
+
message: `Task "${node.label}" failed${node.agent ? ` (${node.agent})` : ''}`,
|
|
501
|
+
agent: node.agent,
|
|
502
|
+
taskId: id,
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Detect blocked tasks
|
|
507
|
+
const blockedCount = snap.stats.blocked;
|
|
508
|
+
if (blockedCount > 0) {
|
|
509
|
+
issues.push({
|
|
510
|
+
level: 'warn',
|
|
511
|
+
category: 'blocked_tasks',
|
|
512
|
+
message: `${blockedCount} task${blockedCount > 1 ? 's' : ''} blocked`,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
// Detect stalled running tasks (no update for >60s)
|
|
516
|
+
for (const [id, node] of Object.entries(snap.nodes)) {
|
|
517
|
+
if (node.status === 'running') {
|
|
518
|
+
const age = Date.now() - new Date(node.updatedAt).getTime();
|
|
519
|
+
if (age > 60_000) {
|
|
520
|
+
issues.push({
|
|
521
|
+
level: 'warn',
|
|
522
|
+
category: 'stalled_task',
|
|
523
|
+
message: `"${node.label}" running ${Math.round(age / 1000)}s with no update`,
|
|
524
|
+
agent: node.agent,
|
|
525
|
+
taskId: id,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
// Detect idle agents with pending work available
|
|
531
|
+
const pendingCount = Object.values(snap.nodes).filter(n => n.status === 'pending').length;
|
|
532
|
+
if (pendingCount > 0) {
|
|
533
|
+
for (const [name, agent] of Object.entries(agents)) {
|
|
534
|
+
if (agent.status === 'idle' && agent.role !== 'orchestrator') {
|
|
535
|
+
issues.push({
|
|
536
|
+
level: 'info',
|
|
537
|
+
category: 'idle_agent',
|
|
538
|
+
message: `${name} idle — ${pendingCount} task${pendingCount > 1 ? 's' : ''} waiting`,
|
|
539
|
+
agent: name,
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
// Overall status
|
|
545
|
+
const hasErrors = issues.some(i => i.level === 'error');
|
|
546
|
+
const hasWarns = issues.some(i => i.level === 'warn');
|
|
547
|
+
const status = hasErrors ? 'critical' : hasWarns ? 'warning' : 'healthy';
|
|
548
|
+
// Generate summary
|
|
549
|
+
const { stats } = snap;
|
|
550
|
+
const parts = [];
|
|
551
|
+
parts.push(`${Math.round(stats.progress * 100)}% complete (${stats.completed}/${stats.total} tasks).`);
|
|
552
|
+
const busyAgents = Object.values(agents).filter(a => a.status === 'busy');
|
|
553
|
+
if (busyAgents.length > 0) {
|
|
554
|
+
parts.push(`${busyAgents.length} agent${busyAgents.length > 1 ? 's' : ''} active: ${busyAgents.map(a => a.name).join(', ')}.`);
|
|
555
|
+
}
|
|
556
|
+
if (stats.failed > 0) {
|
|
557
|
+
parts.push(`${stats.failed} task${stats.failed > 1 ? 's' : ''} failed.`);
|
|
558
|
+
}
|
|
559
|
+
if (stats.running > 0) {
|
|
560
|
+
parts.push(`${stats.running} in progress.`);
|
|
561
|
+
}
|
|
562
|
+
if (stats.pending > 0 && stats.running === 0 && stats.completed < stats.total) {
|
|
563
|
+
parts.push(`${stats.pending} waiting.`);
|
|
564
|
+
}
|
|
565
|
+
if (stats.progress >= 1) {
|
|
566
|
+
parts.push('All tasks complete.');
|
|
567
|
+
}
|
|
568
|
+
return { status, summary: parts.join(' '), diagnostics: issues };
|
|
569
|
+
}
|
|
570
|
+
pingClients() {
|
|
571
|
+
for (const [id, client] of this.clients.entries()) {
|
|
572
|
+
if (!client.alive) {
|
|
573
|
+
this.clients.delete(id);
|
|
574
|
+
client.close();
|
|
575
|
+
this.emit('client:disconnected', id);
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
client.alive = false;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
exports.WorkTreeDashboard = WorkTreeDashboard;
|
|
583
|
+
//# sourceMappingURL=work-tree-dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-tree-dashboard.js","sourceRoot":"","sources":["../../lib/work-tree-dashboard.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,+BAAqE;AACrE,mCAAoC;AACpC,mCAAsC;AACtC,2BAAk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