attocode 0.1.8 → 0.2.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/CHANGELOG.md +143 -1
- package/dist/src/adapters.d.ts.map +1 -1
- package/dist/src/adapters.js +1 -0
- package/dist/src/adapters.js.map +1 -1
- package/dist/src/agent.d.ts +20 -1
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +364 -62
- package/dist/src/agent.js.map +1 -1
- package/dist/src/cli.d.ts +6 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +37 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/init-commands.d.ts.map +1 -1
- package/dist/src/commands/init-commands.js +57 -0
- package/dist/src/commands/init-commands.js.map +1 -1
- package/dist/src/core/protocol/types.d.ts +14 -14
- package/dist/src/defaults.d.ts +1 -1
- package/dist/src/defaults.d.ts.map +1 -1
- package/dist/src/defaults.js +1 -0
- package/dist/src/defaults.js.map +1 -1
- package/dist/src/integrations/budget-pool.d.ts +96 -0
- package/dist/src/integrations/budget-pool.d.ts.map +1 -0
- package/dist/src/integrations/budget-pool.js +145 -0
- package/dist/src/integrations/budget-pool.js.map +1 -0
- package/dist/src/integrations/context-engineering.d.ts +16 -1
- package/dist/src/integrations/context-engineering.d.ts.map +1 -1
- package/dist/src/integrations/context-engineering.js +17 -0
- package/dist/src/integrations/context-engineering.js.map +1 -1
- package/dist/src/integrations/economics.d.ts +9 -0
- package/dist/src/integrations/economics.d.ts.map +1 -1
- package/dist/src/integrations/economics.js +25 -0
- package/dist/src/integrations/economics.js.map +1 -1
- package/dist/src/integrations/file-cache.d.ts +90 -0
- package/dist/src/integrations/file-cache.d.ts.map +1 -0
- package/dist/src/integrations/file-cache.js +164 -0
- package/dist/src/integrations/file-cache.js.map +1 -0
- package/dist/src/integrations/index.d.ts +6 -3
- package/dist/src/integrations/index.d.ts.map +1 -1
- package/dist/src/integrations/index.js +7 -1
- package/dist/src/integrations/index.js.map +1 -1
- package/dist/src/integrations/learning-store.d.ts.map +1 -1
- package/dist/src/integrations/learning-store.js +6 -0
- package/dist/src/integrations/learning-store.js.map +1 -1
- package/dist/src/integrations/safety.d.ts +25 -0
- package/dist/src/integrations/safety.d.ts.map +1 -1
- package/dist/src/integrations/safety.js +47 -0
- package/dist/src/integrations/safety.js.map +1 -1
- package/dist/src/integrations/smart-decomposer.d.ts.map +1 -1
- package/dist/src/integrations/smart-decomposer.js +7 -0
- package/dist/src/integrations/smart-decomposer.js.map +1 -1
- package/dist/src/integrations/swarm/index.d.ts +29 -0
- package/dist/src/integrations/swarm/index.d.ts.map +1 -0
- package/dist/src/integrations/swarm/index.js +29 -0
- package/dist/src/integrations/swarm/index.js.map +1 -0
- package/dist/src/integrations/swarm/model-selector.d.ts +55 -0
- package/dist/src/integrations/swarm/model-selector.d.ts.map +1 -0
- package/dist/src/integrations/swarm/model-selector.js +342 -0
- package/dist/src/integrations/swarm/model-selector.js.map +1 -0
- package/dist/src/integrations/swarm/request-throttle.d.ts +112 -0
- package/dist/src/integrations/swarm/request-throttle.d.ts.map +1 -0
- package/dist/src/integrations/swarm/request-throttle.js +263 -0
- package/dist/src/integrations/swarm/request-throttle.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-budget.d.ts +31 -0
- package/dist/src/integrations/swarm/swarm-budget.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-budget.js +36 -0
- package/dist/src/integrations/swarm/swarm-budget.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-config-loader.d.ts +51 -0
- package/dist/src/integrations/swarm/swarm-config-loader.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-config-loader.js +458 -0
- package/dist/src/integrations/swarm/swarm-config-loader.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-event-bridge.d.ts +145 -0
- package/dist/src/integrations/swarm/swarm-event-bridge.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-event-bridge.js +443 -0
- package/dist/src/integrations/swarm/swarm-event-bridge.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-events.d.ts +157 -0
- package/dist/src/integrations/swarm/swarm-events.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-events.js +81 -0
- package/dist/src/integrations/swarm/swarm-events.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-orchestrator.d.ts +166 -0
- package/dist/src/integrations/swarm/swarm-orchestrator.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-orchestrator.js +1114 -0
- package/dist/src/integrations/swarm/swarm-orchestrator.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-quality-gate.d.ts +29 -0
- package/dist/src/integrations/swarm/swarm-quality-gate.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-quality-gate.js +85 -0
- package/dist/src/integrations/swarm/swarm-quality-gate.js.map +1 -0
- package/dist/src/integrations/swarm/swarm-state-store.d.ts +31 -0
- package/dist/src/integrations/swarm/swarm-state-store.d.ts.map +1 -0
- package/dist/src/integrations/swarm/swarm-state-store.js +91 -0
- package/dist/src/integrations/swarm/swarm-state-store.js.map +1 -0
- package/dist/src/integrations/swarm/task-queue.d.ts +128 -0
- package/dist/src/integrations/swarm/task-queue.d.ts.map +1 -0
- package/dist/src/integrations/swarm/task-queue.js +379 -0
- package/dist/src/integrations/swarm/task-queue.js.map +1 -0
- package/dist/src/integrations/swarm/types.d.ts +425 -0
- package/dist/src/integrations/swarm/types.d.ts.map +1 -0
- package/dist/src/integrations/swarm/types.js +96 -0
- package/dist/src/integrations/swarm/types.js.map +1 -0
- package/dist/src/integrations/swarm/worker-pool.d.ts +96 -0
- package/dist/src/integrations/swarm/worker-pool.d.ts.map +1 -0
- package/dist/src/integrations/swarm/worker-pool.js +269 -0
- package/dist/src/integrations/swarm/worker-pool.js.map +1 -0
- package/dist/src/main.js +88 -0
- package/dist/src/main.js.map +1 -1
- package/dist/src/modes/repl.d.ts +1 -0
- package/dist/src/modes/repl.d.ts.map +1 -1
- package/dist/src/modes/repl.js +2 -1
- package/dist/src/modes/repl.js.map +1 -1
- package/dist/src/modes/tui.d.ts +1 -0
- package/dist/src/modes/tui.d.ts.map +1 -1
- package/dist/src/modes/tui.js +3 -1
- package/dist/src/modes/tui.js.map +1 -1
- package/dist/src/providers/adapters/anthropic.d.ts +1 -1
- package/dist/src/providers/adapters/anthropic.d.ts.map +1 -1
- package/dist/src/providers/adapters/anthropic.js +15 -2
- package/dist/src/providers/adapters/anthropic.js.map +1 -1
- package/dist/src/providers/adapters/mock.d.ts +2 -2
- package/dist/src/providers/adapters/mock.d.ts.map +1 -1
- package/dist/src/providers/adapters/mock.js +2 -1
- package/dist/src/providers/adapters/mock.js.map +1 -1
- package/dist/src/providers/adapters/openai.d.ts +1 -1
- package/dist/src/providers/adapters/openai.d.ts.map +1 -1
- package/dist/src/providers/adapters/openai.js +2 -2
- package/dist/src/providers/adapters/openai.js.map +1 -1
- package/dist/src/providers/adapters/openrouter.d.ts +15 -1
- package/dist/src/providers/adapters/openrouter.d.ts.map +1 -1
- package/dist/src/providers/adapters/openrouter.js +60 -5
- package/dist/src/providers/adapters/openrouter.js.map +1 -1
- package/dist/src/providers/resilient-fetch.d.ts +2 -0
- package/dist/src/providers/resilient-fetch.d.ts.map +1 -1
- package/dist/src/providers/resilient-fetch.js +27 -3
- package/dist/src/providers/resilient-fetch.js.map +1 -1
- package/dist/src/providers/types.d.ts +12 -1
- package/dist/src/providers/types.d.ts.map +1 -1
- package/dist/src/providers/types.js.map +1 -1
- package/dist/src/tools/bash.d.ts +2 -2
- package/dist/src/tools/file.d.ts +4 -4
- package/dist/src/tricks/kv-cache-context.d.ts +24 -0
- package/dist/src/tricks/kv-cache-context.d.ts.map +1 -1
- package/dist/src/tricks/kv-cache-context.js +68 -0
- package/dist/src/tricks/kv-cache-context.js.map +1 -1
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +75 -4
- package/dist/src/tui/app.js.map +1 -1
- package/dist/src/tui/components/SwarmStatusPanel.d.ts +27 -0
- package/dist/src/tui/components/SwarmStatusPanel.d.ts.map +1 -0
- package/dist/src/tui/components/SwarmStatusPanel.js +108 -0
- package/dist/src/tui/components/SwarmStatusPanel.js.map +1 -0
- package/dist/src/types.d.ts +35 -2
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Event Bridge
|
|
3
|
+
*
|
|
4
|
+
* Bridges swarm events to the filesystem for the trace dashboard to consume.
|
|
5
|
+
* Writes events to .agent/swarm-live/events.jsonl (append-only)
|
|
6
|
+
* and state snapshots to .agent/swarm-live/state.json (overwritten).
|
|
7
|
+
*/
|
|
8
|
+
import * as fs from 'node:fs';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
// ─── Implementation ───────────────────────────────────────────────────────────
|
|
11
|
+
export class SwarmEventBridge {
|
|
12
|
+
outputDir;
|
|
13
|
+
maxLines;
|
|
14
|
+
minStateIntervalMs;
|
|
15
|
+
seq = 0;
|
|
16
|
+
lineCount = 0;
|
|
17
|
+
eventsStream = null;
|
|
18
|
+
lastStateWrite = 0;
|
|
19
|
+
stateWriteTimer = null;
|
|
20
|
+
pendingState = null;
|
|
21
|
+
closed = false;
|
|
22
|
+
// Accumulated state for building snapshots
|
|
23
|
+
tasks = new Map();
|
|
24
|
+
edges = [];
|
|
25
|
+
config = { maxConcurrency: 0, totalBudget: 0, maxCost: 0, workerModels: [] };
|
|
26
|
+
timeline = [];
|
|
27
|
+
errors = [];
|
|
28
|
+
lastStatus = null;
|
|
29
|
+
// V2
|
|
30
|
+
decisions = [];
|
|
31
|
+
plan;
|
|
32
|
+
verification;
|
|
33
|
+
modelHealth = [];
|
|
34
|
+
workerLogFiles = [];
|
|
35
|
+
constructor(options = {}) {
|
|
36
|
+
this.outputDir = options.outputDir ?? '.agent/swarm-live';
|
|
37
|
+
this.maxLines = options.maxLines ?? 5000;
|
|
38
|
+
this.minStateIntervalMs = 1000 / (options.maxStateWritesPerSec ?? 5);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Attach to an orchestrator and subscribe to its events.
|
|
42
|
+
* Returns an unsubscribe function.
|
|
43
|
+
*/
|
|
44
|
+
attach(orchestrator) {
|
|
45
|
+
return orchestrator.subscribe((event) => {
|
|
46
|
+
this.handleEvent(event);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Handle a single swarm event.
|
|
51
|
+
*/
|
|
52
|
+
handleEvent(event) {
|
|
53
|
+
if (this.closed)
|
|
54
|
+
return;
|
|
55
|
+
const ts = new Date().toISOString();
|
|
56
|
+
this.seq++;
|
|
57
|
+
// Initialize on swarm.start
|
|
58
|
+
if (event.type === 'swarm.start') {
|
|
59
|
+
this.initOutputDir();
|
|
60
|
+
this.config = {
|
|
61
|
+
maxConcurrency: event.config.maxConcurrency,
|
|
62
|
+
totalBudget: event.config.totalBudget,
|
|
63
|
+
maxCost: event.config.maxCost,
|
|
64
|
+
workerModels: [],
|
|
65
|
+
};
|
|
66
|
+
this.tasks.clear();
|
|
67
|
+
this.edges = [];
|
|
68
|
+
this.timeline = [];
|
|
69
|
+
this.errors = [];
|
|
70
|
+
this.lastStatus = null;
|
|
71
|
+
this.seq = 1;
|
|
72
|
+
this.lineCount = 0;
|
|
73
|
+
}
|
|
74
|
+
// Append to events.jsonl
|
|
75
|
+
this.appendEvent({ ts, seq: this.seq, event });
|
|
76
|
+
// Update accumulated state based on event type
|
|
77
|
+
this.updateAccumulatedState(event, ts);
|
|
78
|
+
// Write state snapshot (debounced for status/task events, immediate for milestones)
|
|
79
|
+
const immediateTriggers = ['swarm.complete', 'swarm.plan.complete', 'swarm.review.complete', 'swarm.verify.complete', 'swarm.state.checkpoint'];
|
|
80
|
+
const debouncedTriggers = [
|
|
81
|
+
'swarm.task.dispatched', 'swarm.task.completed', 'swarm.task.failed', 'swarm.task.skipped',
|
|
82
|
+
'swarm.budget.update', 'swarm.wave.start', 'swarm.wave.complete',
|
|
83
|
+
];
|
|
84
|
+
if (immediateTriggers.includes(event.type)) {
|
|
85
|
+
this.writeStateDebouncedOrImmediate(true);
|
|
86
|
+
}
|
|
87
|
+
else if (event.type === 'swarm.status' || debouncedTriggers.includes(event.type)) {
|
|
88
|
+
this.writeStateDebouncedOrImmediate(false);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Update accumulated state from an event.
|
|
93
|
+
*/
|
|
94
|
+
updateAccumulatedState(event, ts) {
|
|
95
|
+
switch (event.type) {
|
|
96
|
+
case 'swarm.status':
|
|
97
|
+
this.lastStatus = event.status;
|
|
98
|
+
// Extract tasks from status if we have them via the queue
|
|
99
|
+
break;
|
|
100
|
+
case 'swarm.tasks.loaded':
|
|
101
|
+
this.setTasks(event.tasks);
|
|
102
|
+
// Write state immediately so dashboard picks up the DAG
|
|
103
|
+
this.writeStateDebouncedOrImmediate(true);
|
|
104
|
+
break;
|
|
105
|
+
case 'swarm.task.dispatched':
|
|
106
|
+
this.updateTask(event.taskId, {
|
|
107
|
+
status: 'dispatched',
|
|
108
|
+
assignedModel: event.model,
|
|
109
|
+
description: event.description,
|
|
110
|
+
});
|
|
111
|
+
if (!this.config.workerModels.includes(event.model)) {
|
|
112
|
+
this.config.workerModels.push(event.model);
|
|
113
|
+
}
|
|
114
|
+
this.timeline.push({
|
|
115
|
+
ts,
|
|
116
|
+
seq: this.seq,
|
|
117
|
+
type: 'task.dispatched',
|
|
118
|
+
tokensUsed: this.lastStatus?.budget.tokensUsed ?? 0,
|
|
119
|
+
costUsed: this.lastStatus?.budget.costUsed ?? 0,
|
|
120
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
121
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
122
|
+
});
|
|
123
|
+
break;
|
|
124
|
+
case 'swarm.task.completed':
|
|
125
|
+
this.updateTask(event.taskId, {
|
|
126
|
+
status: 'completed',
|
|
127
|
+
result: {
|
|
128
|
+
success: event.success,
|
|
129
|
+
output: '',
|
|
130
|
+
tokensUsed: event.tokensUsed,
|
|
131
|
+
costUsed: event.costUsed,
|
|
132
|
+
durationMs: event.durationMs,
|
|
133
|
+
qualityScore: event.qualityScore,
|
|
134
|
+
model: '',
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
this.timeline.push({
|
|
138
|
+
ts,
|
|
139
|
+
seq: this.seq,
|
|
140
|
+
type: 'task.completed',
|
|
141
|
+
tokensUsed: event.tokensUsed,
|
|
142
|
+
costUsed: event.costUsed,
|
|
143
|
+
completedCount: (this.lastStatus?.queue.completed ?? 0) + 1,
|
|
144
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
145
|
+
});
|
|
146
|
+
break;
|
|
147
|
+
case 'swarm.task.failed':
|
|
148
|
+
if (!event.willRetry) {
|
|
149
|
+
this.updateTask(event.taskId, { status: 'failed' });
|
|
150
|
+
}
|
|
151
|
+
this.errors.push({
|
|
152
|
+
ts,
|
|
153
|
+
taskId: event.taskId,
|
|
154
|
+
phase: 'execution',
|
|
155
|
+
message: event.error,
|
|
156
|
+
});
|
|
157
|
+
break;
|
|
158
|
+
case 'swarm.task.skipped':
|
|
159
|
+
this.updateTask(event.taskId, { status: 'skipped' });
|
|
160
|
+
break;
|
|
161
|
+
case 'swarm.quality.rejected':
|
|
162
|
+
this.errors.push({
|
|
163
|
+
ts,
|
|
164
|
+
taskId: event.taskId,
|
|
165
|
+
phase: 'quality-gate',
|
|
166
|
+
message: `Score ${event.score}/5: ${event.feedback}`,
|
|
167
|
+
});
|
|
168
|
+
break;
|
|
169
|
+
case 'swarm.budget.update':
|
|
170
|
+
this.timeline.push({
|
|
171
|
+
ts,
|
|
172
|
+
seq: this.seq,
|
|
173
|
+
type: 'budget.update',
|
|
174
|
+
tokensUsed: event.tokensUsed,
|
|
175
|
+
costUsed: event.costUsed,
|
|
176
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
177
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
178
|
+
});
|
|
179
|
+
break;
|
|
180
|
+
case 'swarm.error':
|
|
181
|
+
this.errors.push({
|
|
182
|
+
ts,
|
|
183
|
+
taskId: event.taskId,
|
|
184
|
+
phase: event.phase,
|
|
185
|
+
message: event.error,
|
|
186
|
+
});
|
|
187
|
+
break;
|
|
188
|
+
case 'swarm.complete':
|
|
189
|
+
// Mark remaining pending tasks
|
|
190
|
+
break;
|
|
191
|
+
// V2 events
|
|
192
|
+
case 'swarm.plan.complete':
|
|
193
|
+
this.timeline.push({
|
|
194
|
+
ts, seq: this.seq, type: 'plan.complete',
|
|
195
|
+
tokensUsed: this.lastStatus?.budget.tokensUsed ?? 0,
|
|
196
|
+
costUsed: this.lastStatus?.budget.costUsed ?? 0,
|
|
197
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
198
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
199
|
+
});
|
|
200
|
+
break;
|
|
201
|
+
case 'swarm.review.start':
|
|
202
|
+
case 'swarm.review.complete':
|
|
203
|
+
this.timeline.push({
|
|
204
|
+
ts, seq: this.seq, type: event.type.replace('swarm.', ''),
|
|
205
|
+
tokensUsed: this.lastStatus?.budget.tokensUsed ?? 0,
|
|
206
|
+
costUsed: this.lastStatus?.budget.costUsed ?? 0,
|
|
207
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
208
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
209
|
+
});
|
|
210
|
+
break;
|
|
211
|
+
case 'swarm.verify.start':
|
|
212
|
+
case 'swarm.verify.step':
|
|
213
|
+
this.timeline.push({
|
|
214
|
+
ts, seq: this.seq, type: event.type.replace('swarm.', ''),
|
|
215
|
+
tokensUsed: this.lastStatus?.budget.tokensUsed ?? 0,
|
|
216
|
+
costUsed: this.lastStatus?.budget.costUsed ?? 0,
|
|
217
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
218
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
219
|
+
});
|
|
220
|
+
break;
|
|
221
|
+
case 'swarm.verify.complete':
|
|
222
|
+
this.verification = event.result;
|
|
223
|
+
break;
|
|
224
|
+
case 'swarm.model.health':
|
|
225
|
+
// Update or add model health record
|
|
226
|
+
this.modelHealth = this.modelHealth.filter(r => r.model !== event.record.model);
|
|
227
|
+
this.modelHealth.push(event.record);
|
|
228
|
+
break;
|
|
229
|
+
case 'swarm.model.failover':
|
|
230
|
+
this.timeline.push({
|
|
231
|
+
ts, seq: this.seq, type: 'model.failover',
|
|
232
|
+
tokensUsed: this.lastStatus?.budget.tokensUsed ?? 0,
|
|
233
|
+
costUsed: this.lastStatus?.budget.costUsed ?? 0,
|
|
234
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
235
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
236
|
+
});
|
|
237
|
+
break;
|
|
238
|
+
case 'swarm.orchestrator.decision':
|
|
239
|
+
this.decisions.push(event.decision);
|
|
240
|
+
break;
|
|
241
|
+
case 'swarm.role.action':
|
|
242
|
+
// V3: Record hierarchy role actions in timeline
|
|
243
|
+
this.timeline.push({
|
|
244
|
+
ts, seq: this.seq, type: `role.${event.role}.${event.action}`,
|
|
245
|
+
tokensUsed: this.lastStatus?.budget.tokensUsed ?? 0,
|
|
246
|
+
costUsed: this.lastStatus?.budget.costUsed ?? 0,
|
|
247
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
248
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
249
|
+
});
|
|
250
|
+
break;
|
|
251
|
+
case 'swarm.fixup.spawned':
|
|
252
|
+
case 'swarm.worker.stuck':
|
|
253
|
+
case 'swarm.state.checkpoint':
|
|
254
|
+
case 'swarm.state.resume':
|
|
255
|
+
// Record in timeline
|
|
256
|
+
this.timeline.push({
|
|
257
|
+
ts, seq: this.seq, type: event.type.replace('swarm.', ''),
|
|
258
|
+
tokensUsed: this.lastStatus?.budget.tokensUsed ?? 0,
|
|
259
|
+
costUsed: this.lastStatus?.budget.costUsed ?? 0,
|
|
260
|
+
completedCount: this.lastStatus?.queue.completed ?? 0,
|
|
261
|
+
failedCount: this.lastStatus?.queue.failed ?? 0,
|
|
262
|
+
});
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Update a task in the accumulated map (partial update).
|
|
268
|
+
*/
|
|
269
|
+
updateTask(taskId, update) {
|
|
270
|
+
const existing = this.tasks.get(taskId);
|
|
271
|
+
if (existing) {
|
|
272
|
+
Object.assign(existing, update);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
this.tasks.set(taskId, {
|
|
276
|
+
id: taskId,
|
|
277
|
+
description: update.description ?? '',
|
|
278
|
+
type: 'implement',
|
|
279
|
+
dependencies: [],
|
|
280
|
+
status: update.status ?? 'pending',
|
|
281
|
+
complexity: 5,
|
|
282
|
+
wave: 0,
|
|
283
|
+
attempts: 0,
|
|
284
|
+
...update,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Build the current SwarmLiveState snapshot.
|
|
290
|
+
*/
|
|
291
|
+
buildState() {
|
|
292
|
+
return {
|
|
293
|
+
active: this.lastStatus?.phase !== 'completed' && this.lastStatus?.phase !== 'failed',
|
|
294
|
+
updatedAt: new Date().toISOString(),
|
|
295
|
+
lastSeq: this.seq,
|
|
296
|
+
status: this.lastStatus,
|
|
297
|
+
tasks: Array.from(this.tasks.values()),
|
|
298
|
+
edges: this.edges,
|
|
299
|
+
config: { ...this.config },
|
|
300
|
+
timeline: this.timeline.slice(-200), // Keep last 200 entries
|
|
301
|
+
errors: this.errors.slice(-100),
|
|
302
|
+
// V2
|
|
303
|
+
decisions: this.decisions.slice(-100),
|
|
304
|
+
plan: this.plan,
|
|
305
|
+
verification: this.verification,
|
|
306
|
+
modelHealth: this.modelHealth,
|
|
307
|
+
workerLogFiles: this.workerLogFiles,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
// ─── File I/O ─────────────────────────────────────────────────────────────
|
|
311
|
+
/**
|
|
312
|
+
* Initialize output directory and reset files.
|
|
313
|
+
*/
|
|
314
|
+
initOutputDir() {
|
|
315
|
+
fs.mkdirSync(this.outputDir, { recursive: true });
|
|
316
|
+
// Archive old events file if it exists
|
|
317
|
+
const eventsPath = path.join(this.outputDir, 'events.jsonl');
|
|
318
|
+
if (fs.existsSync(eventsPath)) {
|
|
319
|
+
const archivePath = path.join(this.outputDir, `events-${Date.now()}.jsonl`);
|
|
320
|
+
try {
|
|
321
|
+
fs.renameSync(eventsPath, archivePath);
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
// Best effort
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// Close existing stream
|
|
328
|
+
if (this.eventsStream) {
|
|
329
|
+
this.eventsStream.end();
|
|
330
|
+
}
|
|
331
|
+
this.eventsStream = fs.createWriteStream(eventsPath, { flags: 'a' });
|
|
332
|
+
this.lineCount = 0;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Append a timestamped event to events.jsonl.
|
|
336
|
+
*/
|
|
337
|
+
appendEvent(entry) {
|
|
338
|
+
if (!this.eventsStream) {
|
|
339
|
+
// Lazy init if swarm.start wasn't the first event
|
|
340
|
+
this.initOutputDir();
|
|
341
|
+
}
|
|
342
|
+
const line = JSON.stringify(entry) + '\n';
|
|
343
|
+
this.eventsStream.write(line);
|
|
344
|
+
this.lineCount++;
|
|
345
|
+
// Rotate if over limit
|
|
346
|
+
if (this.lineCount >= this.maxLines) {
|
|
347
|
+
this.rotateEvents();
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Rotate events.jsonl by archiving and starting fresh.
|
|
352
|
+
*/
|
|
353
|
+
rotateEvents() {
|
|
354
|
+
const eventsPath = path.join(this.outputDir, 'events.jsonl');
|
|
355
|
+
const archivePath = path.join(this.outputDir, `events-${Date.now()}.jsonl`);
|
|
356
|
+
// Close current stream
|
|
357
|
+
this.eventsStream?.end();
|
|
358
|
+
try {
|
|
359
|
+
fs.renameSync(eventsPath, archivePath);
|
|
360
|
+
}
|
|
361
|
+
catch {
|
|
362
|
+
// Best effort
|
|
363
|
+
}
|
|
364
|
+
this.eventsStream = fs.createWriteStream(eventsPath, { flags: 'a' });
|
|
365
|
+
this.lineCount = 0;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Write state.json, debounced to max N writes/sec.
|
|
369
|
+
*/
|
|
370
|
+
writeStateDebouncedOrImmediate(immediate) {
|
|
371
|
+
const state = this.buildState();
|
|
372
|
+
if (immediate) {
|
|
373
|
+
this.writeStateSync(state);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
const now = Date.now();
|
|
377
|
+
const elapsed = now - this.lastStateWrite;
|
|
378
|
+
if (elapsed >= this.minStateIntervalMs) {
|
|
379
|
+
this.writeStateSync(state);
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
// Debounce: schedule write for later
|
|
383
|
+
this.pendingState = state;
|
|
384
|
+
if (!this.stateWriteTimer) {
|
|
385
|
+
this.stateWriteTimer = setTimeout(() => {
|
|
386
|
+
this.stateWriteTimer = null;
|
|
387
|
+
if (this.pendingState) {
|
|
388
|
+
this.writeStateSync(this.pendingState);
|
|
389
|
+
this.pendingState = null;
|
|
390
|
+
}
|
|
391
|
+
}, this.minStateIntervalMs - elapsed);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Synchronously write state.json.
|
|
397
|
+
*/
|
|
398
|
+
writeStateSync(state) {
|
|
399
|
+
const statePath = path.join(this.outputDir, 'state.json');
|
|
400
|
+
try {
|
|
401
|
+
fs.writeFileSync(statePath, JSON.stringify(state, null, 2));
|
|
402
|
+
this.lastStateWrite = Date.now();
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
// Best effort - don't crash the agent
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Close the bridge, flush pending writes.
|
|
410
|
+
*/
|
|
411
|
+
close() {
|
|
412
|
+
this.closed = true;
|
|
413
|
+
if (this.stateWriteTimer) {
|
|
414
|
+
clearTimeout(this.stateWriteTimer);
|
|
415
|
+
this.stateWriteTimer = null;
|
|
416
|
+
}
|
|
417
|
+
// Write final state
|
|
418
|
+
if (this.pendingState) {
|
|
419
|
+
this.writeStateSync(this.pendingState);
|
|
420
|
+
this.pendingState = null;
|
|
421
|
+
}
|
|
422
|
+
// Close events stream
|
|
423
|
+
if (this.eventsStream) {
|
|
424
|
+
this.eventsStream.end();
|
|
425
|
+
this.eventsStream = null;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Set task list and dependency edges from the orchestrator's task queue.
|
|
430
|
+
* Call this after decomposition to populate the DAG.
|
|
431
|
+
*/
|
|
432
|
+
setTasks(tasks) {
|
|
433
|
+
this.tasks.clear();
|
|
434
|
+
this.edges = [];
|
|
435
|
+
for (const task of tasks) {
|
|
436
|
+
this.tasks.set(task.id, { ...task });
|
|
437
|
+
for (const dep of task.dependencies) {
|
|
438
|
+
this.edges.push([dep, task.id]);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
//# sourceMappingURL=swarm-event-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm-event-bridge.js","sourceRoot":"","sources":["../../../../src/integrations/swarm/swarm-event-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAgElC,iFAAiF;AAEjF,MAAM,OAAO,gBAAgB;IACnB,SAAS,CAAS;IAClB,QAAQ,CAAS;IACjB,kBAAkB,CAAS;IAE3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AI,CAAC,YAAY,CAAC,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC3B,CAAC;QAED,sBAAsB;QACtB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC3B,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,KAAkB;QACzB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;YACrC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Event Types
|
|
3
|
+
*
|
|
4
|
+
* Event definitions for swarm mode observability and TUI integration.
|
|
5
|
+
* These events are emitted through the existing agent event system.
|
|
6
|
+
*/
|
|
7
|
+
import type { SwarmStatus, SwarmExecutionStats, SwarmError, SwarmTask, OrchestratorDecision, ModelHealthRecord, VerificationResult, WaveReviewResult, WorkerRole } from './types.js';
|
|
8
|
+
export type SwarmEvent = {
|
|
9
|
+
type: 'swarm.start';
|
|
10
|
+
taskCount: number;
|
|
11
|
+
waveCount: number;
|
|
12
|
+
config: {
|
|
13
|
+
maxConcurrency: number;
|
|
14
|
+
totalBudget: number;
|
|
15
|
+
maxCost: number;
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
type: 'swarm.tasks.loaded';
|
|
19
|
+
tasks: SwarmTask[];
|
|
20
|
+
} | {
|
|
21
|
+
type: 'swarm.wave.start';
|
|
22
|
+
wave: number;
|
|
23
|
+
totalWaves: number;
|
|
24
|
+
taskCount: number;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'swarm.wave.complete';
|
|
27
|
+
wave: number;
|
|
28
|
+
totalWaves: number;
|
|
29
|
+
completed: number;
|
|
30
|
+
failed: number;
|
|
31
|
+
skipped: number;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'swarm.task.dispatched';
|
|
34
|
+
taskId: string;
|
|
35
|
+
description: string;
|
|
36
|
+
model: string;
|
|
37
|
+
workerName: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'swarm.task.completed';
|
|
40
|
+
taskId: string;
|
|
41
|
+
success: boolean;
|
|
42
|
+
tokensUsed: number;
|
|
43
|
+
costUsed: number;
|
|
44
|
+
durationMs: number;
|
|
45
|
+
qualityScore?: number;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'swarm.task.failed';
|
|
48
|
+
taskId: string;
|
|
49
|
+
error: string;
|
|
50
|
+
attempt: number;
|
|
51
|
+
maxAttempts: number;
|
|
52
|
+
willRetry: boolean;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'swarm.task.skipped';
|
|
55
|
+
taskId: string;
|
|
56
|
+
reason: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'swarm.quality.rejected';
|
|
59
|
+
taskId: string;
|
|
60
|
+
score: number;
|
|
61
|
+
feedback: string;
|
|
62
|
+
} | {
|
|
63
|
+
type: 'swarm.budget.update';
|
|
64
|
+
tokensUsed: number;
|
|
65
|
+
tokensTotal: number;
|
|
66
|
+
costUsed: number;
|
|
67
|
+
costTotal: number;
|
|
68
|
+
} | {
|
|
69
|
+
type: 'swarm.status';
|
|
70
|
+
status: SwarmStatus;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'swarm.complete';
|
|
73
|
+
stats: SwarmExecutionStats;
|
|
74
|
+
errors: SwarmError[];
|
|
75
|
+
} | {
|
|
76
|
+
type: 'swarm.error';
|
|
77
|
+
error: string;
|
|
78
|
+
phase: string;
|
|
79
|
+
taskId?: string;
|
|
80
|
+
} | {
|
|
81
|
+
type: 'swarm.plan.complete';
|
|
82
|
+
criteriaCount: number;
|
|
83
|
+
hasIntegrationPlan: boolean;
|
|
84
|
+
} | {
|
|
85
|
+
type: 'swarm.review.start';
|
|
86
|
+
wave: number;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'swarm.review.complete';
|
|
89
|
+
wave: number;
|
|
90
|
+
assessment: WaveReviewResult['assessment'];
|
|
91
|
+
fixupCount: number;
|
|
92
|
+
} | {
|
|
93
|
+
type: 'swarm.verify.start';
|
|
94
|
+
stepCount: number;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'swarm.verify.step';
|
|
97
|
+
stepIndex: number;
|
|
98
|
+
description: string;
|
|
99
|
+
passed: boolean;
|
|
100
|
+
} | {
|
|
101
|
+
type: 'swarm.verify.complete';
|
|
102
|
+
result: VerificationResult;
|
|
103
|
+
} | {
|
|
104
|
+
type: 'swarm.worker.stuck';
|
|
105
|
+
taskId: string;
|
|
106
|
+
repeatedTool: string;
|
|
107
|
+
count: number;
|
|
108
|
+
} | {
|
|
109
|
+
type: 'swarm.model.failover';
|
|
110
|
+
taskId: string;
|
|
111
|
+
fromModel: string;
|
|
112
|
+
toModel: string;
|
|
113
|
+
reason: string;
|
|
114
|
+
} | {
|
|
115
|
+
type: 'swarm.model.health';
|
|
116
|
+
record: ModelHealthRecord;
|
|
117
|
+
} | {
|
|
118
|
+
type: 'swarm.state.checkpoint';
|
|
119
|
+
sessionId: string;
|
|
120
|
+
wave: number;
|
|
121
|
+
} | {
|
|
122
|
+
type: 'swarm.state.resume';
|
|
123
|
+
sessionId: string;
|
|
124
|
+
fromWave: number;
|
|
125
|
+
} | {
|
|
126
|
+
type: 'swarm.orchestrator.decision';
|
|
127
|
+
decision: OrchestratorDecision;
|
|
128
|
+
} | {
|
|
129
|
+
type: 'swarm.fixup.spawned';
|
|
130
|
+
taskId: string;
|
|
131
|
+
fixesTaskId: string;
|
|
132
|
+
description: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: 'swarm.circuit.open';
|
|
135
|
+
recentCount: number;
|
|
136
|
+
pauseMs: number;
|
|
137
|
+
} | {
|
|
138
|
+
type: 'swarm.circuit.closed';
|
|
139
|
+
} | {
|
|
140
|
+
type: 'swarm.role.action';
|
|
141
|
+
role: WorkerRole;
|
|
142
|
+
action: 'review' | 'quality-gate' | 'verify' | 'plan';
|
|
143
|
+
model: string;
|
|
144
|
+
taskId?: string;
|
|
145
|
+
wave?: number;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Type guard for swarm events.
|
|
149
|
+
*/
|
|
150
|
+
export declare function isSwarmEvent(event: {
|
|
151
|
+
type: string;
|
|
152
|
+
}): event is SwarmEvent;
|
|
153
|
+
/**
|
|
154
|
+
* Format a swarm event for log display.
|
|
155
|
+
*/
|
|
156
|
+
export declare function formatSwarmEvent(event: SwarmEvent): string;
|
|
157
|
+
//# sourceMappingURL=swarm-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm-events.d.ts","sourceRoot":"","sources":["../../../../src/integrations/swarm/swarm-events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIrL,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,O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