groove-dev 0.27.68 → 0.27.70
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/CLAUDE.md +7 -0
- package/node_modules/@groove-dev/cli/package.json +1 -1
- package/node_modules/@groove-dev/daemon/package.json +1 -1
- package/node_modules/@groove-dev/daemon/src/api.js +137 -3
- package/node_modules/@groove-dev/gui/dist/assets/{index-Cz4tj733.js → index-D5BpdcWS.js} +1738 -1738
- package/node_modules/@groove-dev/gui/dist/assets/index-oQ0ejlfH.css +1 -0
- package/node_modules/@groove-dev/gui/dist/index.html +2 -2
- package/node_modules/@groove-dev/gui/package.json +1 -1
- package/node_modules/@groove-dev/gui/src/components/network/activity-chart.jsx +209 -124
- package/node_modules/@groove-dev/gui/src/components/network/compute-header.jsx +12 -1
- package/node_modules/@groove-dev/gui/src/components/network/identity-bar.jsx +4 -40
- package/node_modules/@groove-dev/gui/src/components/network/performance-dashboard.jsx +600 -0
- package/node_modules/@groove-dev/gui/src/components/network/token-waterfall.jsx +111 -0
- package/node_modules/@groove-dev/gui/src/stores/groove.js +60 -0
- package/node_modules/@groove-dev/gui/src/views/network.jsx +6 -0
- package/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/daemon/package.json +1 -1
- package/packages/daemon/src/api.js +137 -3
- package/packages/gui/dist/assets/{index-Cz4tj733.js → index-D5BpdcWS.js} +1738 -1738
- package/packages/gui/dist/assets/index-oQ0ejlfH.css +1 -0
- package/packages/gui/dist/index.html +2 -2
- package/packages/gui/package.json +1 -1
- package/packages/gui/src/components/network/activity-chart.jsx +209 -124
- package/packages/gui/src/components/network/compute-header.jsx +12 -1
- package/packages/gui/src/components/network/identity-bar.jsx +4 -40
- package/packages/gui/src/components/network/performance-dashboard.jsx +600 -0
- package/packages/gui/src/components/network/token-waterfall.jsx +111 -0
- package/packages/gui/src/stores/groove.js +60 -0
- package/packages/gui/src/views/network.jsx +6 -0
- package/node_modules/@groove-dev/gui/dist/assets/index-YeunozTU.css +0 -1
- package/packages/gui/dist/assets/index-YeunozTU.css +0 -1
package/CLAUDE.md
CHANGED
|
@@ -263,3 +263,10 @@ Audit-driven release. Multi-agent orchestration system with 7 coordination layer
|
|
|
263
263
|
- Dashboard: routing donut, cache panel, context health gauges
|
|
264
264
|
- Monitor/QC agent mode (stay active, loop)
|
|
265
265
|
- Distribution: demo video, HN launch, Twitter content
|
|
266
|
+
|
|
267
|
+
<!-- GROOVE:START -->
|
|
268
|
+
## GROOVE Orchestration (auto-injected)
|
|
269
|
+
Active agents: 0
|
|
270
|
+
See AGENTS_REGISTRY.md for full agent state.
|
|
271
|
+
**Memory policy:** GROOVE manages project memory automatically. Do not read or write MEMORY.md or .groove/memory/ files directly.
|
|
272
|
+
<!-- GROOVE:END -->
|
|
@@ -8,6 +8,7 @@ import { existsSync, readFileSync, readdirSync, statSync, writeFileSync, mkdirSy
|
|
|
8
8
|
import { spawn, execFile, execFileSync } from 'child_process';
|
|
9
9
|
import { createHash, randomUUID } from 'crypto';
|
|
10
10
|
import { hostname, networkInterfaces, homedir } from 'os';
|
|
11
|
+
import { StringDecoder } from 'string_decoder';
|
|
11
12
|
import { lookup as mimeLookup } from './mimetypes.js';
|
|
12
13
|
import { listProviders, getProvider } from './providers/index.js';
|
|
13
14
|
import { OllamaProvider } from './providers/ollama.js';
|
|
@@ -4299,14 +4300,17 @@ Keep responses concise. Help them think, don't lecture them about the system the
|
|
|
4299
4300
|
hardware: getLocalHardware(),
|
|
4300
4301
|
startedAt: Date.now(),
|
|
4301
4302
|
events: [],
|
|
4303
|
+
lastTokenTiming: null,
|
|
4302
4304
|
};
|
|
4305
|
+
if (!daemon.networkBenchmarks) daemon.networkBenchmarks = [];
|
|
4303
4306
|
|
|
4304
4307
|
pushNodeEvent('starting', { pid: proc.pid, signal, device });
|
|
4305
4308
|
broadcastNodeStatus();
|
|
4306
4309
|
|
|
4307
4310
|
let stderrBuf = '';
|
|
4311
|
+
const stderrDecoder = new StringDecoder('utf8');
|
|
4308
4312
|
proc.stderr.on('data', (chunk) => {
|
|
4309
|
-
stderrBuf +=
|
|
4313
|
+
stderrBuf += stderrDecoder.write(chunk);
|
|
4310
4314
|
let idx;
|
|
4311
4315
|
while ((idx = stderrBuf.indexOf('\n')) !== -1) {
|
|
4312
4316
|
const line = stderrBuf.slice(0, idx).trim();
|
|
@@ -4367,14 +4371,49 @@ Keep responses concise. Help them think, don't lecture them about the system the
|
|
|
4367
4371
|
if (entry.capabilities || entry.hardware) {
|
|
4368
4372
|
daemon.networkNode.hardware = normalizeHardware(entry.capabilities || entry.hardware); changed = true;
|
|
4369
4373
|
}
|
|
4374
|
+
if (entry.type === 'token') {
|
|
4375
|
+
const timing = {
|
|
4376
|
+
token_ms: entry.token_ms, pipeline_ms: entry.pipeline_ms,
|
|
4377
|
+
prefill_ms: entry.prefill_ms, logits_deser_ms: entry.logits_deser_ms,
|
|
4378
|
+
sample_ms: entry.sample_ms, decode_ms: entry.decode_ms,
|
|
4379
|
+
tps: entry.tps, ttft_ms: entry.ttft_ms, is_prefill: entry.is_prefill,
|
|
4380
|
+
tokens_generated: entry.tokens_generated,
|
|
4381
|
+
stages: Array.isArray(entry.stages) ? entry.stages : [],
|
|
4382
|
+
};
|
|
4383
|
+
daemon.networkNode.lastTokenTiming = timing;
|
|
4384
|
+
daemon.broadcast({ type: 'network:token:timing', data: timing });
|
|
4385
|
+
}
|
|
4386
|
+
if (entry.type === 'timing') {
|
|
4387
|
+
const summary = {
|
|
4388
|
+
ttft_ms: entry.ttft_ms, tps: entry.tps,
|
|
4389
|
+
tokens_generated: entry.tokens_generated,
|
|
4390
|
+
total_network_ms: entry.total_network_ms,
|
|
4391
|
+
total_compute_ms: entry.total_compute_ms,
|
|
4392
|
+
p2p_sends: entry.p2p_sends, relay_sends: entry.relay_sends,
|
|
4393
|
+
stage_0_avg_ms: entry.stage_0_avg_ms, stage_0_count: entry.stage_0_count,
|
|
4394
|
+
stage_1_avg_ms: entry.stage_1_avg_ms, stage_1_count: entry.stage_1_count,
|
|
4395
|
+
t: Date.now(),
|
|
4396
|
+
};
|
|
4397
|
+
if (!daemon.networkBenchmarks) daemon.networkBenchmarks = [];
|
|
4398
|
+
daemon.networkBenchmarks.push(summary);
|
|
4399
|
+
if (daemon.networkBenchmarks.length > 100) daemon.networkBenchmarks.shift();
|
|
4400
|
+
daemon.broadcast({ type: 'network:timing:summary', data: summary });
|
|
4401
|
+
}
|
|
4370
4402
|
pushNodeEvent(msg || 'log', entry);
|
|
4371
4403
|
if (changed) broadcastNodeStatus();
|
|
4372
4404
|
}
|
|
4373
4405
|
});
|
|
4374
4406
|
|
|
4407
|
+
let stdoutBuf = '';
|
|
4408
|
+
const stdoutDecoder = new StringDecoder('utf8');
|
|
4375
4409
|
proc.stdout.on('data', (chunk) => {
|
|
4376
|
-
|
|
4377
|
-
|
|
4410
|
+
stdoutBuf += stdoutDecoder.write(chunk);
|
|
4411
|
+
let idx;
|
|
4412
|
+
while ((idx = stdoutBuf.indexOf('\n')) !== -1) {
|
|
4413
|
+
const line = stdoutBuf.slice(0, idx).trim();
|
|
4414
|
+
stdoutBuf = stdoutBuf.slice(idx + 1);
|
|
4415
|
+
if (line) pushNodeEvent('stdout', { line });
|
|
4416
|
+
}
|
|
4378
4417
|
});
|
|
4379
4418
|
|
|
4380
4419
|
proc.on('error', (err) => {
|
|
@@ -4384,6 +4423,11 @@ Keep responses concise. Help them think, don't lecture them about the system the
|
|
|
4384
4423
|
});
|
|
4385
4424
|
|
|
4386
4425
|
proc.on('exit', (code, signal) => {
|
|
4426
|
+
const trailing = stdoutDecoder.end();
|
|
4427
|
+
if (trailing) stdoutBuf += trailing;
|
|
4428
|
+
if (stdoutBuf.trim()) pushNodeEvent('stdout', { line: stdoutBuf.trim() });
|
|
4429
|
+
const trailingErr = stderrDecoder.end();
|
|
4430
|
+
if (trailingErr) stderrBuf += trailingErr;
|
|
4387
4431
|
daemon.networkNode.active = false;
|
|
4388
4432
|
daemon.networkNode.status = 'stopped';
|
|
4389
4433
|
daemon.networkNode.pid = null;
|
|
@@ -4409,6 +4453,96 @@ Keep responses concise. Help them think, don't lecture them about the system the
|
|
|
4409
4453
|
res.json({ stopping: true });
|
|
4410
4454
|
});
|
|
4411
4455
|
|
|
4456
|
+
app.get('/api/network/benchmarks', networkGate, (req, res) => {
|
|
4457
|
+
res.json(daemon.networkBenchmarks || []);
|
|
4458
|
+
});
|
|
4459
|
+
|
|
4460
|
+
app.get('/api/network/timing', networkGate, (req, res) => {
|
|
4461
|
+
res.json({
|
|
4462
|
+
current: daemon.networkNode?.lastTokenTiming || null,
|
|
4463
|
+
benchmarkCount: (daemon.networkBenchmarks || []).length,
|
|
4464
|
+
});
|
|
4465
|
+
});
|
|
4466
|
+
|
|
4467
|
+
app.get('/api/network/traces', networkGate, (req, res) => {
|
|
4468
|
+
const tracesDir = resolve(homedir(), '.groove', 'traces');
|
|
4469
|
+
if (!existsSync(tracesDir)) return res.json([]);
|
|
4470
|
+
try {
|
|
4471
|
+
const files = readdirSync(tracesDir)
|
|
4472
|
+
.filter((f) => f.endsWith('.jsonl'))
|
|
4473
|
+
.map((f) => {
|
|
4474
|
+
const st = statSync(resolve(tracesDir, f));
|
|
4475
|
+
return { filename: f, size: st.size, mtime: st.mtimeMs };
|
|
4476
|
+
})
|
|
4477
|
+
.sort((a, b) => b.mtime - a.mtime);
|
|
4478
|
+
res.json(files);
|
|
4479
|
+
} catch { res.json([]); }
|
|
4480
|
+
});
|
|
4481
|
+
|
|
4482
|
+
app.get('/api/network/traces/live', networkGate, (req, res) => {
|
|
4483
|
+
const tracesDir = resolve(homedir(), '.groove', 'traces');
|
|
4484
|
+
if (!existsSync(tracesDir)) {
|
|
4485
|
+
return res.json({ lines: [], nextOffset: 0, filename: null, active: false });
|
|
4486
|
+
}
|
|
4487
|
+
try {
|
|
4488
|
+
const files = readdirSync(tracesDir)
|
|
4489
|
+
.filter((f) => f.endsWith('.jsonl'))
|
|
4490
|
+
.map((f) => {
|
|
4491
|
+
const st = statSync(resolve(tracesDir, f));
|
|
4492
|
+
return { filename: f, mtime: st.mtimeMs };
|
|
4493
|
+
})
|
|
4494
|
+
.sort((a, b) => b.mtime - a.mtime);
|
|
4495
|
+
if (files.length === 0) {
|
|
4496
|
+
return res.json({ lines: [], nextOffset: 0, filename: null, active: false });
|
|
4497
|
+
}
|
|
4498
|
+
const newest = files[0];
|
|
4499
|
+
const offset = Math.max(0, parseInt(req.query.offset, 10) || 0);
|
|
4500
|
+
const filePath = resolve(tracesDir, newest.filename);
|
|
4501
|
+
const raw = readFileSync(filePath, 'utf8');
|
|
4502
|
+
const allLines = raw.split('\n').filter(Boolean);
|
|
4503
|
+
const sliced = allLines.slice(offset);
|
|
4504
|
+
const parsed = [];
|
|
4505
|
+
for (const line of sliced) {
|
|
4506
|
+
try { parsed.push(JSON.parse(line)); } catch { /* skip malformed */ }
|
|
4507
|
+
}
|
|
4508
|
+
const active = !!(daemon.networkNode?.active && (daemon.networkNode.sessions || 0) > 0);
|
|
4509
|
+
res.json({
|
|
4510
|
+
lines: parsed,
|
|
4511
|
+
nextOffset: offset + sliced.length,
|
|
4512
|
+
filename: newest.filename,
|
|
4513
|
+
active,
|
|
4514
|
+
});
|
|
4515
|
+
} catch {
|
|
4516
|
+
res.json({ lines: [], nextOffset: 0, filename: null, active: false });
|
|
4517
|
+
}
|
|
4518
|
+
});
|
|
4519
|
+
|
|
4520
|
+
app.get('/api/network/traces/:filename', networkGate, (req, res) => {
|
|
4521
|
+
const { filename } = req.params;
|
|
4522
|
+
if (!filename || /[/\\]/.test(filename) || !filename.endsWith('.jsonl')) {
|
|
4523
|
+
return res.status(400).json({ error: 'Invalid filename' });
|
|
4524
|
+
}
|
|
4525
|
+
const tracesDir = resolve(homedir(), '.groove', 'traces');
|
|
4526
|
+
const filePath = resolve(tracesDir, filename);
|
|
4527
|
+
if (!filePath.startsWith(tracesDir + sep)) {
|
|
4528
|
+
return res.status(400).json({ error: 'Invalid filename' });
|
|
4529
|
+
}
|
|
4530
|
+
if (!existsSync(filePath)) {
|
|
4531
|
+
return res.status(404).json({ error: 'Trace file not found' });
|
|
4532
|
+
}
|
|
4533
|
+
try {
|
|
4534
|
+
const raw = readFileSync(filePath, 'utf8');
|
|
4535
|
+
const lines = raw.split('\n').filter(Boolean).slice(0, 5000);
|
|
4536
|
+
const entries = [];
|
|
4537
|
+
for (const line of lines) {
|
|
4538
|
+
try { entries.push(JSON.parse(line)); } catch { /* skip malformed lines */ }
|
|
4539
|
+
}
|
|
4540
|
+
res.json(entries);
|
|
4541
|
+
} catch (err) {
|
|
4542
|
+
res.status(500).json({ error: `Failed to read trace: ${err.message}` });
|
|
4543
|
+
}
|
|
4544
|
+
});
|
|
4545
|
+
|
|
4412
4546
|
function isAllowedSignalHost(host) {
|
|
4413
4547
|
const h = (host || '').replace(/^(wss?|https?):\/\//i, '').replace(/\/.*$/, '').toLowerCase();
|
|
4414
4548
|
return h === 'signal.groovedev.ai' || h.endsWith('.groovedev.ai');
|