@gjczone/pi-swarm 0.3.5 → 0.4.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/README.md +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/shared/controller.d.ts +1 -0
- package/dist/shared/controller.d.ts.map +1 -1
- package/dist/shared/controller.js +46 -0
- package/dist/shared/controller.js.map +1 -1
- package/dist/shared/spawner.d.ts.map +1 -1
- package/dist/shared/spawner.js +212 -17
- package/dist/shared/spawner.js.map +1 -1
- package/dist/shared/types.d.ts +28 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js.map +1 -1
- package/dist/shared/worktree.d.ts +81 -0
- package/dist/shared/worktree.d.ts.map +1 -0
- package/dist/shared/worktree.js +417 -0
- package/dist/shared/worktree.js.map +1 -0
- package/dist/swarm/tool.d.ts.map +1 -1
- package/dist/swarm/tool.js +44 -5
- package/dist/swarm/tool.js.map +1 -1
- package/dist/team/mailbox.d.ts +5 -0
- package/dist/team/mailbox.d.ts.map +1 -1
- package/dist/team/mailbox.js +43 -2
- package/dist/team/mailbox.js.map +1 -1
- package/dist/team/supervisor.d.ts +27 -2
- package/dist/team/supervisor.d.ts.map +1 -1
- package/dist/team/supervisor.js +75 -17
- package/dist/team/supervisor.js.map +1 -1
- package/dist/team/task-graph.d.ts +5 -2
- package/dist/team/task-graph.d.ts.map +1 -1
- package/dist/team/task-graph.js +27 -1
- package/dist/team/task-graph.js.map +1 -1
- package/dist/team/tool.d.ts.map +1 -1
- package/dist/team/tool.js +53 -5
- package/dist/team/tool.js.map +1 -1
- package/dist/tui/progress.d.ts +6 -43
- package/dist/tui/progress.d.ts.map +1 -1
- package/dist/tui/progress.js +101 -165
- package/dist/tui/progress.js.map +1 -1
- package/dist/tui/team-dashboard.d.ts +5 -22
- package/dist/tui/team-dashboard.d.ts.map +1 -1
- package/dist/tui/team-dashboard.js +87 -132
- package/dist/tui/team-dashboard.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,39 +2,30 @@
|
|
|
2
2
|
* tui/team-dashboard — SwarmTeam live phase progress dashboard.
|
|
3
3
|
*
|
|
4
4
|
* Renders a real-time dashboard above the input area when a SwarmTeam
|
|
5
|
-
* run is in progress. Shows phase statuses with braille
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Follows the same wiring pattern as AgentSwarmProgressComponent:
|
|
9
|
-
* supervisor emits snapshots -> tool converts -> pushes to widget.
|
|
5
|
+
* run is in progress. Shows phase statuses with compact braille spinner
|
|
6
|
+
* for active phases, mailbox message count, token usage, and elapsed time.
|
|
10
7
|
*/
|
|
11
8
|
// ---------------------------------------------------------------------------
|
|
12
|
-
// Constants
|
|
9
|
+
// Constants
|
|
13
10
|
// ---------------------------------------------------------------------------
|
|
14
|
-
const BRAILLE_BAR_MAX_WIDTH = 8;
|
|
15
11
|
const FRAME_INTERVAL_MS = 80;
|
|
16
12
|
const MAX_PHASES = 20;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
"\
|
|
20
|
-
"\
|
|
21
|
-
"\
|
|
22
|
-
"\
|
|
13
|
+
const ICON_COL_WIDTH = 3;
|
|
14
|
+
const BRAILLE_SPINNER = [
|
|
15
|
+
"\u28BF",
|
|
16
|
+
"\u28FB",
|
|
17
|
+
"\u28FD",
|
|
18
|
+
"\u28FE",
|
|
23
19
|
"\u28F7",
|
|
24
|
-
"\
|
|
20
|
+
"\u28EF",
|
|
21
|
+
"\u28DF",
|
|
22
|
+
"\u287F",
|
|
25
23
|
];
|
|
26
|
-
const BRAILLE_EMPTY = BRAILLE_LEVELS[0];
|
|
27
|
-
const BRAILLE_FULL = BRAILLE_LEVELS[6];
|
|
28
24
|
// ---------------------------------------------------------------------------
|
|
29
25
|
// Snapshot conversion
|
|
30
26
|
// ---------------------------------------------------------------------------
|
|
31
|
-
/**
|
|
32
|
-
* Convert a TeamProgressSnapshot from the supervisor into the
|
|
33
|
-
* TeamDashboardState expected by TeamDashboardComponent.
|
|
34
|
-
*/
|
|
35
27
|
export function snapshotToDashboardState(snapshot) {
|
|
36
28
|
const now = Date.now();
|
|
37
|
-
// Collect all currently running phase names for multi-running display
|
|
38
29
|
const runningPhases = snapshot.phases
|
|
39
30
|
.filter((p) => p.status === "running")
|
|
40
31
|
.map((p) => p.name);
|
|
@@ -64,6 +55,7 @@ export function snapshotToDashboardState(snapshot) {
|
|
|
64
55
|
phaseStartedAt: p.status === "running" ? now : 0,
|
|
65
56
|
})),
|
|
66
57
|
mailboxCount: snapshot.mailboxCount,
|
|
58
|
+
totalUsage: snapshot.totalUsage,
|
|
67
59
|
startedAt: snapshot.startedAt,
|
|
68
60
|
};
|
|
69
61
|
}
|
|
@@ -76,23 +68,11 @@ export class TeamDashboardComponent {
|
|
|
76
68
|
renderedWidth;
|
|
77
69
|
cachedLines;
|
|
78
70
|
onRequestRender;
|
|
79
|
-
|
|
80
|
-
* @param onRequestRender Optional callback to request a TUI re-render.
|
|
81
|
-
* When provided, called on every animation tick so the braille bars
|
|
82
|
-
* animate. Without it the component still renders correctly but the
|
|
83
|
-
* animation won't be visible to the user.
|
|
84
|
-
*
|
|
85
|
-
* 业务说明:TUI 框架不会自动轮询组件;需要通过 requestRender() 主动
|
|
86
|
-
* 触发重绘才能使 braille 进度条动起来。此回调由 setWidget 工厂函数
|
|
87
|
-
* 在捕获 tui 引用后传入。
|
|
88
|
-
*/
|
|
71
|
+
frameIndex = 0;
|
|
89
72
|
constructor(onRequestRender) {
|
|
90
73
|
this.onRequestRender = onRequestRender;
|
|
91
74
|
this.startAnimation();
|
|
92
75
|
}
|
|
93
|
-
// -------------------------------------------------------------------
|
|
94
|
-
// Public API
|
|
95
|
-
// -------------------------------------------------------------------
|
|
96
76
|
update(state) {
|
|
97
77
|
this.state_ = state;
|
|
98
78
|
this.invalidate();
|
|
@@ -117,18 +97,14 @@ export class TeamDashboardComponent {
|
|
|
117
97
|
clearInterval(this.animationFrame);
|
|
118
98
|
this.animationFrame = undefined;
|
|
119
99
|
}
|
|
120
|
-
// 断开与 TUI 框架的连接,防止内存泄漏
|
|
121
100
|
this.onRequestRender = undefined;
|
|
122
101
|
}
|
|
123
|
-
// -------------------------------------------------------------------
|
|
124
|
-
// Component interface
|
|
125
|
-
// -------------------------------------------------------------------
|
|
126
102
|
invalidate() {
|
|
127
103
|
this.renderedWidth = undefined;
|
|
128
104
|
this.cachedLines = undefined;
|
|
129
105
|
}
|
|
130
106
|
render(width) {
|
|
131
|
-
const safeWidth = Math.max(
|
|
107
|
+
const safeWidth = Math.max(20, width);
|
|
132
108
|
if (this.cachedLines && this.renderedWidth === safeWidth) {
|
|
133
109
|
return this.cachedLines;
|
|
134
110
|
}
|
|
@@ -138,41 +114,44 @@ export class TeamDashboardComponent {
|
|
|
138
114
|
}
|
|
139
115
|
const state = this.state_;
|
|
140
116
|
const lines = [];
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
117
|
+
const contentWidth = safeWidth - 4;
|
|
118
|
+
// Header: just title, truncated to fit
|
|
119
|
+
const header = truncateText(state.title, contentWidth);
|
|
120
|
+
lines.push(` ${header}`);
|
|
144
121
|
// Overall progress bar
|
|
145
|
-
const
|
|
146
|
-
|
|
122
|
+
const barWidth = Math.max(1, contentWidth);
|
|
123
|
+
const total = state.totalPhases || 1;
|
|
124
|
+
const doneRatio = (state.completedPhases + state.failedPhases) / total;
|
|
125
|
+
const doneChars = Math.round(doneRatio * barWidth);
|
|
126
|
+
const done = "\u2501".repeat(doneChars);
|
|
127
|
+
const remaining = "\u2501".repeat(barWidth - doneChars);
|
|
128
|
+
lines.push(` ${done}${remaining}`);
|
|
147
129
|
// Phase rows
|
|
148
130
|
const maxPhases = Math.min(state.phases.length, MAX_PHASES);
|
|
149
131
|
for (let i = 0; i < maxPhases; i += 1) {
|
|
150
132
|
const phase = state.phases[i];
|
|
151
133
|
if (!phase)
|
|
152
134
|
continue;
|
|
153
|
-
const row = renderPhaseRow(phase,
|
|
135
|
+
const row = renderPhaseRow(phase, contentWidth, this.frameIndex);
|
|
154
136
|
lines.push(` ${row}`);
|
|
155
137
|
}
|
|
156
138
|
// Separator
|
|
157
|
-
const sep = "\u2500".repeat(
|
|
139
|
+
const sep = "\u2500".repeat(contentWidth);
|
|
158
140
|
lines.push(` ${sep}`);
|
|
159
|
-
// Footer
|
|
160
|
-
const footerLine = buildFooter(state,
|
|
141
|
+
// Footer with all info
|
|
142
|
+
const footerLine = buildFooter(state, contentWidth);
|
|
161
143
|
lines.push(` ${footerLine}`);
|
|
162
144
|
// Bottom border
|
|
163
|
-
const bottom =
|
|
145
|
+
const bottom = `\u2514${"\u2500".repeat(contentWidth)}\u2518`;
|
|
164
146
|
lines.push(bottom);
|
|
165
147
|
this.cachedLines = lines;
|
|
166
148
|
this.renderedWidth = safeWidth;
|
|
167
149
|
return this.cachedLines;
|
|
168
150
|
}
|
|
169
|
-
// -------------------------------------------------------------------
|
|
170
|
-
// Animation
|
|
171
|
-
// -------------------------------------------------------------------
|
|
172
151
|
startAnimation() {
|
|
173
152
|
this.animationFrame = setInterval(() => {
|
|
153
|
+
this.frameIndex = (this.frameIndex + 1) % BRAILLE_SPINNER.length;
|
|
174
154
|
this.invalidate();
|
|
175
|
-
// 通知 TUI 框架重绘,使 braille 动画可见
|
|
176
155
|
this.onRequestRender?.();
|
|
177
156
|
}, FRAME_INTERVAL_MS);
|
|
178
157
|
}
|
|
@@ -180,105 +159,79 @@ export class TeamDashboardComponent {
|
|
|
180
159
|
// ---------------------------------------------------------------------------
|
|
181
160
|
// Rendering helpers
|
|
182
161
|
// ---------------------------------------------------------------------------
|
|
183
|
-
function
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return
|
|
193
|
-
// Truncate from the end — preserve title and status
|
|
194
|
-
return full.slice(0, width);
|
|
195
|
-
}
|
|
196
|
-
function buildProgressBar(state, width) {
|
|
197
|
-
const barWidth = Math.max(1, width - 4);
|
|
198
|
-
const total = state.totalPhases || 1;
|
|
199
|
-
const doneRatio = (state.completedPhases + state.failedPhases) / total;
|
|
200
|
-
const doneChars = Math.round(doneRatio * barWidth);
|
|
201
|
-
const remainingChars = barWidth - doneChars;
|
|
202
|
-
const done = "\u2501".repeat(doneChars);
|
|
203
|
-
const remaining = "\u2501".repeat(remainingChars);
|
|
204
|
-
return ` ${done}${remaining}`;
|
|
205
|
-
}
|
|
206
|
-
function renderPhaseRow(phase, width) {
|
|
207
|
-
const statusIcon = phaseStatusIcon(phase);
|
|
208
|
-
const maxNameLen = Math.max(4, Math.min(14, Math.floor(width / 3)));
|
|
209
|
-
const phaseName = truncateText(phase.name, maxNameLen);
|
|
210
|
-
const statusLabel = phase.status;
|
|
211
|
-
const roleLabel = `(${phase.role})`;
|
|
212
|
-
// Layout: <icon> <phaseName> <status> <role>
|
|
213
|
-
const fixed = `${statusIcon} ${phaseName} ${statusLabel} ${roleLabel}`;
|
|
214
|
-
// If the fixed part alone exceeds width, truncate by component priority
|
|
215
|
-
if (visibleLen(fixed) >= width) {
|
|
216
|
-
const bare = `${statusIcon} ${phaseName}`;
|
|
217
|
-
if (visibleLen(bare) >= width)
|
|
218
|
-
return bare.slice(0, Math.max(0, width));
|
|
219
|
-
const withStatus = `${bare} ${statusLabel}`;
|
|
220
|
-
if (visibleLen(withStatus) >= width)
|
|
221
|
-
return withStatus.slice(0, Math.max(0, width));
|
|
222
|
-
return fixed.slice(0, Math.max(0, width));
|
|
162
|
+
function renderPhaseRow(phase, width, frameIndex) {
|
|
163
|
+
const icon = phaseStatusIcon(phase, frameIndex).padEnd(ICON_COL_WIDTH, " ");
|
|
164
|
+
const displayName = shortenPhaseName(phase.name, phase.role);
|
|
165
|
+
const nameWidth = Math.max(6, Math.min(16, Math.floor(width * 0.35)));
|
|
166
|
+
const name = truncateText(displayName, nameWidth).padEnd(nameWidth, " ");
|
|
167
|
+
const fixed = `${icon} ${name}`;
|
|
168
|
+
const remaining = Math.max(0, width - visibleLen(fixed) - 1);
|
|
169
|
+
if (phase.status === "running") {
|
|
170
|
+
const roleLabel = `${phase.role}`;
|
|
171
|
+
return `${fixed} ${truncateText(roleLabel, remaining)}`;
|
|
223
172
|
}
|
|
224
173
|
if (phase.status === "failed" && phase.error) {
|
|
225
|
-
const errorPart =
|
|
226
|
-
|
|
227
|
-
if (avail > 0) {
|
|
228
|
-
const full = `${fixed}${errorPart.slice(0, avail)}`;
|
|
229
|
-
return full.slice(0, Math.max(0, width));
|
|
230
|
-
}
|
|
231
|
-
return fixed.slice(0, Math.max(0, width));
|
|
174
|
+
const errorPart = phase.error;
|
|
175
|
+
return `${fixed} ${truncateText(errorPart, remaining)}`;
|
|
232
176
|
}
|
|
233
|
-
|
|
177
|
+
if (phase.status === "completed") {
|
|
178
|
+
return `${fixed} ok`;
|
|
179
|
+
}
|
|
180
|
+
if (phase.status === "skipped") {
|
|
181
|
+
return `${fixed} skip`;
|
|
182
|
+
}
|
|
183
|
+
return `${fixed} ...`;
|
|
184
|
+
}
|
|
185
|
+
function shortenPhaseName(name, role) {
|
|
186
|
+
if (name.length <= 12)
|
|
187
|
+
return name;
|
|
188
|
+
if (name.startsWith(role))
|
|
189
|
+
return name.slice(0, Math.max(role.length, 12));
|
|
190
|
+
const parts = name.split("-");
|
|
191
|
+
if (parts.length > 1) {
|
|
192
|
+
return parts.slice(0, 2).join("-");
|
|
193
|
+
}
|
|
194
|
+
return name.slice(0, 12);
|
|
234
195
|
}
|
|
235
|
-
function phaseStatusIcon(phase) {
|
|
196
|
+
function phaseStatusIcon(phase, frameIndex) {
|
|
236
197
|
switch (phase.status) {
|
|
237
198
|
case "completed":
|
|
238
|
-
return "\u2713";
|
|
199
|
+
return "\u2713";
|
|
239
200
|
case "running":
|
|
240
|
-
return
|
|
201
|
+
return BRAILLE_SPINNER[frameIndex % BRAILLE_SPINNER.length];
|
|
241
202
|
case "failed":
|
|
242
|
-
return "\u2717";
|
|
203
|
+
return "\u2717";
|
|
243
204
|
case "skipped":
|
|
244
|
-
return "\u2298";
|
|
205
|
+
return "\u2298";
|
|
245
206
|
case "queued":
|
|
246
|
-
return "\u25CB";
|
|
207
|
+
return "\u25CB";
|
|
247
208
|
}
|
|
248
209
|
}
|
|
249
|
-
function renderBrailleBar(phase) {
|
|
250
|
-
const elapsed = Date.now() - phase.phaseStartedAt;
|
|
251
|
-
const cycleMs = 800;
|
|
252
|
-
const progress = (elapsed % cycleMs) / cycleMs;
|
|
253
|
-
const maxWidth = BRAILLE_BAR_MAX_WIDTH;
|
|
254
|
-
const totalDots = maxWidth * 6;
|
|
255
|
-
const filledDots = Math.floor(progress * totalDots);
|
|
256
|
-
let result = "";
|
|
257
|
-
for (let i = 0; i < maxWidth; i += 1) {
|
|
258
|
-
const cellStart = i * 6;
|
|
259
|
-
const dotsInCell = Math.max(0, Math.min(6, filledDots - cellStart));
|
|
260
|
-
result += dotsInCell === 0 ? BRAILLE_EMPTY : BRAILLE_LEVELS[dotsInCell];
|
|
261
|
-
}
|
|
262
|
-
return result;
|
|
263
|
-
}
|
|
264
210
|
function buildFooter(state, width) {
|
|
265
|
-
const
|
|
211
|
+
const usage = state.totalUsage ?? {
|
|
212
|
+
input: 0,
|
|
213
|
+
output: 0,
|
|
214
|
+
cacheRead: 0,
|
|
215
|
+
cacheWrite: 0,
|
|
216
|
+
totalTokens: 0,
|
|
217
|
+
};
|
|
218
|
+
const phaseCount = `${state.completedPhases + state.failedPhases}/${state.totalPhases}`;
|
|
219
|
+
const tokens = `${Math.round(usage.input)}in/${Math.round(usage.output)}out`;
|
|
220
|
+
const mailbox = state.mailboxCount > 0 ? ` ${state.mailboxCount}msg` : "";
|
|
266
221
|
const elapsed = formatElapsed(Date.now() - state.startedAt);
|
|
267
|
-
const
|
|
222
|
+
const parts = [`${phaseCount} ph`, tokens, mailbox.trim(), elapsed].filter(Boolean);
|
|
223
|
+
const full = parts.join(" | ");
|
|
268
224
|
if (full.length <= width)
|
|
269
225
|
return full;
|
|
270
|
-
|
|
271
|
-
return `Elapsed: ${elapsed}`.slice(0, Math.max(0, width));
|
|
226
|
+
return truncateText(full, width);
|
|
272
227
|
}
|
|
273
228
|
function formatElapsed(ms) {
|
|
274
229
|
const totalSec = Math.floor(ms / 1000);
|
|
230
|
+
if (totalSec < 60)
|
|
231
|
+
return `${totalSec}s`;
|
|
275
232
|
const m = Math.floor(totalSec / 60);
|
|
276
233
|
const s = totalSec % 60;
|
|
277
|
-
return `${m}m
|
|
278
|
-
}
|
|
279
|
-
function bottomBorder(width) {
|
|
280
|
-
const safeWidth = Math.max(2, width);
|
|
281
|
-
return `\u2514${"\u2500".repeat(safeWidth - 2)}\u2518`;
|
|
234
|
+
return `${m}m${s}s`;
|
|
282
235
|
}
|
|
283
236
|
// ---------------------------------------------------------------------------
|
|
284
237
|
// Text utilities
|
|
@@ -289,6 +242,8 @@ function visibleLen(text) {
|
|
|
289
242
|
function truncateText(text, maxLen) {
|
|
290
243
|
if (text.length <= maxLen)
|
|
291
244
|
return text;
|
|
292
|
-
|
|
245
|
+
if (maxLen <= 1)
|
|
246
|
+
return text.slice(0, 1);
|
|
247
|
+
return text.slice(0, maxLen - 1) + "\u2026";
|
|
293
248
|
}
|
|
294
249
|
//# sourceMappingURL=team-dashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-dashboard.js","sourceRoot":"","sources":["../../src/tui/team-dashboard.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"team-dashboard.js","sourceRoot":"","sources":["../../src/tui/team-dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,MAAM,eAAe,GAAG;IACt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CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjczone/pi-swarm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Agent Swarm & Team for pi-coding-agent. Single to 128 subagents: parallel swarm or collaborative team with mailbox. Live TUI, rate-limit retries, crash recovery. Ported from kimi-code, inspired by pi-crew.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|