crewswarm 0.9.1 → 0.9.3
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 +22 -9
- package/apps/dashboard/dist/assets/{chat-core-Cx4sTxDd.js → chat-core-3KirthZA.js} +1 -1
- package/apps/dashboard/dist/assets/index-GSWxxEPO.js +2 -0
- package/apps/dashboard/dist/assets/{tab-pm-loop-tab-Bfd449B4.js → tab-pm-loop-tab-DiAPTJXu.js} +1 -1
- package/apps/dashboard/dist/assets/{tab-projects-tab-DhNWnlzt.js → tab-projects-tab-SFH4E--a.js} +1 -1
- package/apps/dashboard/dist/assets/tab-settings-tab-BselH1c0.js +1 -0
- package/apps/dashboard/dist/index.html +82 -11
- package/apps/vibe/README.md +2 -2
- package/apps/vibe/package.json +1 -1
- package/apps/vibe/server.mjs +3 -3
- package/crew-lead.mjs +48 -5
- package/lib/bridges/gateway-ws.mjs +4 -0
- package/lib/bridges/tmux-bridge.mjs +200 -0
- package/lib/cli-process-tracker.mjs +2 -1
- package/lib/crew-lead/chat-handler.mjs +34 -0
- package/lib/crew-lead/http-server.mjs +340 -14
- package/lib/crew-lead/llm-caller.mjs +24 -8
- package/lib/crew-lead/prompts.mjs +7 -0
- package/lib/crew-lead/wave-dispatcher.mjs +53 -3
- package/lib/crew-lead/ws-router.mjs +219 -27
- package/lib/engines/engine-registry.mjs +9 -0
- package/lib/engines/rt-envelope.mjs +1 -0
- package/lib/engines/runners.mjs +26 -2
- package/lib/runtime/config.mjs +7 -0
- package/lib/runtime/paths.mjs +12 -8
- package/lib/sessions/session-manager.mjs +287 -0
- package/package.json +35 -15
- package/scripts/capture-build-flow.mjs +118 -0
- package/scripts/coverage-report.mjs +209 -0
- package/scripts/coverage-summary.mjs +47 -0
- package/scripts/dashboard-validation.mjs +74 -0
- package/scripts/dashboard.mjs +560 -70
- package/scripts/live-bridge-matrix.mjs +79 -0
- package/scripts/live-cli-matrix.mjs +166 -0
- package/scripts/live-crewchat-check.mjs +42 -0
- package/scripts/live-engine-matrix.mjs +50 -0
- package/scripts/live-provider-failover-matrix.mjs +107 -0
- package/scripts/live-provider-matrix.mjs +228 -0
- package/scripts/restart-all-from-repo.sh +4 -4
- package/scripts/smoke-dispatch.mjs +4 -1
- package/scripts/test-blast-radius.mjs +204 -0
- package/scripts/test-report-summary.mjs +88 -0
- package/scripts/test-reporter.mjs +651 -0
- package/scripts/test-rerun.mjs +136 -0
- package/scripts/tmux-bridge +130 -0
- package/apps/dashboard/dist/assets/chat-core-Cx4sTxDd.js.br +0 -0
- package/apps/dashboard/dist/assets/cli-process-COMRNPqr.js.br +0 -0
- package/apps/dashboard/dist/assets/components-BS9fQjE_.js.br +0 -0
- package/apps/dashboard/dist/assets/core-utils-CmOkXgzi.js.br +0 -0
- package/apps/dashboard/dist/assets/index-CF0aJRtC.css.br +0 -0
- package/apps/dashboard/dist/assets/index-DnClJ1ee.js +0 -2
- package/apps/dashboard/dist/assets/index-DnClJ1ee.js.br +0 -0
- package/apps/dashboard/dist/assets/orchestration-Ca2DLWN-.js.br +0 -0
- package/apps/dashboard/dist/assets/setup-wizard-CA0Or47w.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-agents-tab-BgpIsjkw.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-comms-tab-kguqTIzD.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-contacts-tab-DiOyMYth.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-engines-tab-BsdZVvU0.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-memory-tab-Cu6u13EQ.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-models-tab-BLEjmd19.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-pm-loop-tab-Bfd449B4.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-projects-tab-DhNWnlzt.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-prompts-tab-DVkUNaJd.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-services-tab-DU_LH3uG.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-settings-tab-Bn4nXtDe.js +0 -1
- package/apps/dashboard/dist/assets/tab-settings-tab-Bn4nXtDe.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-skills-tab-BpY0uZHW.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-spending-tab-DEccQHnt.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-swarm-chat-tab-BNrd88-r.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-swarm-tab-B1AcjL1W.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-usage-tab-BIOOnB-Y.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-waves-tab-SaJDkb4x.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-workflows-tab-B-soSy1k.js.br +0 -0
- package/apps/dashboard/dist/index.html.br +0 -0
- package/apps/dashboard/index.html +0 -6459
- package/apps/dashboard/package.json +0 -15
- package/apps/dashboard/src/app.js +0 -2823
- package/apps/dashboard/src/app.js.br +0 -0
- package/apps/dashboard/src/app.js.gz +0 -0
- package/apps/dashboard/src/chat/chat-actions.js +0 -1847
- package/apps/dashboard/src/chat/chat-actions.js.br +0 -0
- package/apps/dashboard/src/chat/unified-messages.js +0 -327
- package/apps/dashboard/src/chat/unified-messages.js.br +0 -0
- package/apps/dashboard/src/cli-process.js +0 -208
- package/apps/dashboard/src/cli-process.js.br +0 -0
- package/apps/dashboard/src/cli-process.js.gz +0 -0
- package/apps/dashboard/src/components/active-tasks-panel.js +0 -175
- package/apps/dashboard/src/components/active-tasks-panel.js.br +0 -0
- package/apps/dashboard/src/core/api.js +0 -18
- package/apps/dashboard/src/core/api.js.br +0 -0
- package/apps/dashboard/src/core/dom.js +0 -228
- package/apps/dashboard/src/core/dom.js.br +0 -0
- package/apps/dashboard/src/core/state.js +0 -91
- package/apps/dashboard/src/core/state.js.br +0 -0
- package/apps/dashboard/src/core/task-manager.js +0 -134
- package/apps/dashboard/src/core/task-manager.js.br +0 -0
- package/apps/dashboard/src/orchestration-status.js +0 -127
- package/apps/dashboard/src/orchestration-status.js.br +0 -0
- package/apps/dashboard/src/setup-wizard.js +0 -562
- package/apps/dashboard/src/setup-wizard.js.br +0 -0
- package/apps/dashboard/src/styles.css +0 -2085
- package/apps/dashboard/src/styles.css.br +0 -0
- package/apps/dashboard/src/styles.css.gz +0 -0
- package/apps/dashboard/src/tabs/agents-tab.js +0 -2237
- package/apps/dashboard/src/tabs/agents-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/benchmarks-tab.js +0 -229
- package/apps/dashboard/src/tabs/benchmarks-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/comms-tab.js +0 -955
- package/apps/dashboard/src/tabs/comms-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/contacts-tab.js +0 -654
- package/apps/dashboard/src/tabs/contacts-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/engines-tab.js +0 -175
- package/apps/dashboard/src/tabs/engines-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/memory-tab.js +0 -182
- package/apps/dashboard/src/tabs/memory-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/models-tab.js +0 -450
- package/apps/dashboard/src/tabs/models-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/pm-loop-tab.js +0 -185
- package/apps/dashboard/src/tabs/pm-loop-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/projects-tab.js +0 -663
- package/apps/dashboard/src/tabs/projects-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/projects-tab.js.gz +0 -0
- package/apps/dashboard/src/tabs/prompts-tab.js +0 -160
- package/apps/dashboard/src/tabs/prompts-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/services-tab.js +0 -202
- package/apps/dashboard/src/tabs/services-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/settings-tab.js +0 -803
- package/apps/dashboard/src/tabs/settings-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/skills-tab.js +0 -284
- package/apps/dashboard/src/tabs/skills-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/spending-tab.js +0 -173
- package/apps/dashboard/src/tabs/spending-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/swarm-chat-tab.js +0 -660
- package/apps/dashboard/src/tabs/swarm-chat-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/swarm-tab.js +0 -538
- package/apps/dashboard/src/tabs/swarm-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/usage-tab.js +0 -390
- package/apps/dashboard/src/tabs/usage-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/waves-tab.js +0 -238
- package/apps/dashboard/src/tabs/waves-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/workflows-tab.js +0 -747
- package/apps/dashboard/src/tabs/workflows-tab.js.br +0 -0
- package/apps/vibe/.crew/agent-memory/pipeline.json +0 -304
- package/apps/vibe/.crew/cost.json +0 -17
- package/apps/vibe/.crew/json-parse-metrics.jsonl +0 -27
- package/apps/vibe/.crew/pipeline-metrics.jsonl +0 -27
- package/apps/vibe/.crew/pipeline-runs/pipeline-0f90c392-2425-4ae5-850c-bd9d17b1d690.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-1c269dd9-a63f-4fba-af81-5cf08048ef06.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-288a7765-da24-4a22-89bc-1f3cc9b0562c.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-2c78fd22-a657-4bd1-bc49-0679fb384409.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-3da23550-22ed-4904-9a0a-8e79c1f3024c.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-3e6fe08d-3264-404a-8df3-aab7efef10e7.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-42eec610-57fe-4e09-9e7e-b315038495c2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-4438eb4c-ae13-42b1-90e2-b043d8983be8.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-4740a9f5-86e7-44b6-a394-de433e291727.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-49e1da6a-957e-48fd-9220-415019e4f8e2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-4c9251db-be68-427b-a3fc-a264f2b5778d.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-6413fa33-a802-4b57-a8c0-a9056ad67842.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-65e29a57-664d-4196-8109-017e364f182e.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-6aa04bc5-9593-4b1f-b58d-3bf2978cb602.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-6e1cba53-9b70-457e-99e0-59199149dd21.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-749f41cc-4dac-4204-be64-873a6080a0d2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-74d68121-e181-4864-bd9a-c3211341dfaf.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-8509bc24-142d-4e07-b44a-a50bf99d1103.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-960339c6-07ca-43ce-9900-f6e1702b39b9.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-9bef2dd2-6122-42e5-b3d9-19f4d80f9e40.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-9c6480a9-7031-4146-b241-825b9a2d1de1.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-9fd42426-8492-4157-9d5f-e1537c060489.jsonl +0 -2
- package/apps/vibe/.crew/pipeline-runs/pipeline-ad6d40a3-2f5e-46a9-a345-47caaccc51aa.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-bc606133-8d5b-4535-8d85-f1a29cdaa981.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-c1418f4e-b773-4ca1-84a3-216acf36e2f2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-c1a13ccd-634a-4d01-a4a7-1177b8a752ff.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-c7d27b42-249e-4bd4-8f26-6aa998110b8a.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-cca2e9b9-4a34-4d25-a311-5c793fa7e91e.jsonl +0 -5
- package/apps/vibe/.crew/sandbox.json +0 -7
- package/apps/vibe/.crew/session.json +0 -330
- package/apps/vibe/.crew/training-data.jsonl +0 -0
- package/apps/vibe/.github/workflows/studio-quality.yml +0 -37
- package/apps/vibe/.studio-data/project-messages/chuck-norris.jsonl +0 -18
- package/apps/vibe/.studio-data/project-messages/general.jsonl +0 -81
- package/apps/vibe/.studio-data/project-messages/studio-local.jsonl +0 -18
- package/apps/vibe/ARCHITECTURE.md +0 -3393
- package/apps/vibe/QUICK-REFERENCE.md +0 -211
- package/apps/vibe/ROADMAP.md +0 -41
- package/apps/vibe/STUDIO-SETUP-COMPLETE.md +0 -35
- package/apps/vibe/VISUAL-GUIDE.md +0 -378
- package/apps/vibe/capture-demo.mjs +0 -160
- package/apps/vibe/capture-full-demo.mjs +0 -255
- package/apps/vibe/capture-quickstart.mjs +0 -256
- package/apps/vibe/capture-vibe-assets.mjs +0 -71
- package/apps/vibe/capture-vibe-video.mjs +0 -260
- package/apps/vibe/check-buttons.js +0 -41
- package/apps/vibe/diagnose.html +0 -106
- package/apps/vibe/fix-buttons.js +0 -103
- package/apps/vibe/index.html +0 -3404
- package/apps/vibe/package-lock.json +0 -920
- package/apps/vibe/scripts/studio-pty-host.py +0 -117
- package/apps/vibe/src/main.js +0 -2940
- package/apps/vibe/src/register-all-languages.js +0 -98
- package/apps/vibe/start-studio.sh +0 -11
- package/apps/vibe/test/accessibility-tests.js +0 -77
- package/apps/vibe/test/browser-performance-audit.mjs +0 -205
- package/apps/vibe/test/performance-tests.js +0 -120
- package/apps/vibe/test/security-tests.js +0 -213
- package/apps/vibe/tests/e2e.local.mjs +0 -54
- package/apps/vibe/tests/server.smoke.mjs +0 -106
- package/apps/vibe/update_website.mjs +0 -74
- package/apps/vibe/vite.config.js +0 -19
- package/lib/crew-lead/chat-handler.mjs.bak +0 -1274
- package/lib/engines/rt-envelope.mjs.backup-current +0 -870
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
|
|
7
|
+
const ROOT = process.cwd();
|
|
8
|
+
const OUT_DIR = path.join(ROOT, "coverage");
|
|
9
|
+
fs.mkdirSync(OUT_DIR, { recursive: true });
|
|
10
|
+
|
|
11
|
+
function runStep(name, command, cwd = ROOT, allowFailure = false) {
|
|
12
|
+
console.log(`\n== ${name} ==`);
|
|
13
|
+
const result = spawnSync(command, {
|
|
14
|
+
cwd,
|
|
15
|
+
shell: true,
|
|
16
|
+
encoding: "utf8",
|
|
17
|
+
env: process.env,
|
|
18
|
+
maxBuffer: 20 * 1024 * 1024,
|
|
19
|
+
});
|
|
20
|
+
const combined = `${result.stdout || ""}${result.stderr || ""}`;
|
|
21
|
+
fs.writeFileSync(path.join(OUT_DIR, `${name}.log`), combined);
|
|
22
|
+
if (combined.trim()) process.stdout.write(combined);
|
|
23
|
+
if (result.status !== 0 && !allowFailure) {
|
|
24
|
+
throw new Error(`${name} failed with exit code ${result.status}`);
|
|
25
|
+
}
|
|
26
|
+
return { output: combined, status: result.status ?? 0 };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function extractCoverageTail(output) {
|
|
30
|
+
const lines = output.split("\n");
|
|
31
|
+
const start = lines.findIndex((line) => /^\s*file\s*\|/i.test(line) || /^\s*all files\s*\|/i.test(line));
|
|
32
|
+
if (start === -1) return "Coverage summary not found in command output.";
|
|
33
|
+
return lines.slice(start).join("\n").trim();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Parse the "all files" summary line from Node's --experimental-test-coverage output.
|
|
38
|
+
* Format: `ℹ all files | <line%> | <branch%> | <funcs%> |`
|
|
39
|
+
* Returns { lines, branches, functions } or null if not found.
|
|
40
|
+
*/
|
|
41
|
+
function parseCoverageSummary(output) {
|
|
42
|
+
const lines = output.split("\n");
|
|
43
|
+
for (const line of lines) {
|
|
44
|
+
const match = line.match(/all files\s*\|\s*([\d.]+)\s*\|\s*([\d.]+)\s*\|\s*([\d.]+)/);
|
|
45
|
+
if (match) {
|
|
46
|
+
return {
|
|
47
|
+
lines: parseFloat(match[1]),
|
|
48
|
+
branches: parseFloat(match[2]),
|
|
49
|
+
functions: parseFloat(match[3]),
|
|
50
|
+
// Node's built-in coverage reports line% (which is effectively statements)
|
|
51
|
+
statements: parseFloat(match[1]),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Compute a weighted average of two metric objects.
|
|
60
|
+
* Uses a simple average (equal weight) since we don't have file counts per suite.
|
|
61
|
+
*/
|
|
62
|
+
function averageMetrics(a, b) {
|
|
63
|
+
if (!a && !b) return { statements: 0, branches: 0, functions: 0, lines: 0 };
|
|
64
|
+
if (!a) return b;
|
|
65
|
+
if (!b) return a;
|
|
66
|
+
const round1 = (n) => Math.round(n * 10) / 10;
|
|
67
|
+
return {
|
|
68
|
+
statements: round1((a.statements + b.statements) / 2),
|
|
69
|
+
branches: round1((a.branches + b.branches) / 2),
|
|
70
|
+
functions: round1((a.functions + b.functions) / 2),
|
|
71
|
+
lines: round1((a.lines + b.lines) / 2),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const rootCoverage = runStep(
|
|
77
|
+
"root-unit-coverage",
|
|
78
|
+
"node --test --experimental-test-coverage test/unit/*.test.mjs"
|
|
79
|
+
);
|
|
80
|
+
const rootIntegration = runStep(
|
|
81
|
+
"root-integration-bounded",
|
|
82
|
+
"node scripts/run-integration-bounded.mjs",
|
|
83
|
+
ROOT,
|
|
84
|
+
true
|
|
85
|
+
);
|
|
86
|
+
const crewCliCoverage = runStep(
|
|
87
|
+
"crew-cli-coverage",
|
|
88
|
+
"npm run test:coverage",
|
|
89
|
+
path.join(ROOT, "crew-cli")
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// Parse metrics from each suite
|
|
93
|
+
const rootMetrics = parseCoverageSummary(rootCoverage.output);
|
|
94
|
+
const crewCliMetrics = parseCoverageSummary(crewCliCoverage.output);
|
|
95
|
+
const overallMetrics = averageMetrics(rootMetrics, crewCliMetrics);
|
|
96
|
+
|
|
97
|
+
// Build machine-readable summary JSON
|
|
98
|
+
const summaryJson = {
|
|
99
|
+
timestamp: new Date().toISOString(),
|
|
100
|
+
root: rootMetrics
|
|
101
|
+
? { statements: rootMetrics.statements, branches: rootMetrics.branches, functions: rootMetrics.functions, lines: rootMetrics.lines }
|
|
102
|
+
: null,
|
|
103
|
+
crewCli: crewCliMetrics
|
|
104
|
+
? { statements: crewCliMetrics.statements, branches: crewCliMetrics.branches, functions: crewCliMetrics.functions, lines: crewCliMetrics.lines }
|
|
105
|
+
: null,
|
|
106
|
+
overall: overallMetrics
|
|
107
|
+
? { statements: overallMetrics.statements, branches: overallMetrics.branches, functions: overallMetrics.functions, lines: overallMetrics.lines }
|
|
108
|
+
: null,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const summaryPath = path.join(OUT_DIR, "coverage-summary.json");
|
|
112
|
+
fs.writeFileSync(summaryPath, JSON.stringify(summaryJson, null, 2) + "\n");
|
|
113
|
+
|
|
114
|
+
// Build markdown report
|
|
115
|
+
function metricsTable(metrics) {
|
|
116
|
+
if (!metrics) return "Coverage metrics could not be parsed.";
|
|
117
|
+
return `| Metric | Value |
|
|
118
|
+
|------------|---------|
|
|
119
|
+
| Statements | ${metrics.statements.toFixed(1)}% |
|
|
120
|
+
| Branches | ${metrics.branches.toFixed(1)}% |
|
|
121
|
+
| Functions | ${metrics.functions.toFixed(1)}% |
|
|
122
|
+
| Lines | ${metrics.lines.toFixed(1)}% |`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const report = `# Repo Coverage Report
|
|
126
|
+
|
|
127
|
+
Generated: ${summaryJson.timestamp}
|
|
128
|
+
|
|
129
|
+
## Root unit coverage
|
|
130
|
+
|
|
131
|
+
${metricsTable(rootMetrics)}
|
|
132
|
+
|
|
133
|
+
<details><summary>Full file-by-file report</summary>
|
|
134
|
+
|
|
135
|
+
\`\`\`
|
|
136
|
+
${extractCoverageTail(rootCoverage.output)}
|
|
137
|
+
\`\`\`
|
|
138
|
+
|
|
139
|
+
</details>
|
|
140
|
+
|
|
141
|
+
## Root integration verification
|
|
142
|
+
|
|
143
|
+
Exit code: ${rootIntegration.status}
|
|
144
|
+
|
|
145
|
+
<details><summary>Output</summary>
|
|
146
|
+
|
|
147
|
+
\`\`\`
|
|
148
|
+
${rootIntegration.output.trim() || "No output."}
|
|
149
|
+
\`\`\`
|
|
150
|
+
|
|
151
|
+
</details>
|
|
152
|
+
|
|
153
|
+
## crew-cli coverage
|
|
154
|
+
|
|
155
|
+
${metricsTable(crewCliMetrics)}
|
|
156
|
+
|
|
157
|
+
<details><summary>Full file-by-file report</summary>
|
|
158
|
+
|
|
159
|
+
\`\`\`
|
|
160
|
+
${extractCoverageTail(crewCliCoverage.output)}
|
|
161
|
+
\`\`\`
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
## Overall (average across suites)
|
|
166
|
+
|
|
167
|
+
${metricsTable(overallMetrics)}
|
|
168
|
+
|
|
169
|
+
## Notes
|
|
170
|
+
|
|
171
|
+
- Root coverage currently reports hermetic unit coverage only.
|
|
172
|
+
- Integration and E2E surfaces are reported separately because many depend on running services or external credentials.
|
|
173
|
+
- Use \`docs/CANONICAL/COVERAGE-MATRIX.md\` for feature-by-feature status.
|
|
174
|
+
- Machine-readable metrics: \`coverage/coverage-summary.json\`
|
|
175
|
+
|
|
176
|
+
## Logs
|
|
177
|
+
|
|
178
|
+
- coverage/root-unit-coverage.log
|
|
179
|
+
- coverage/root-integration-bounded.log
|
|
180
|
+
- coverage/crew-cli-coverage.log
|
|
181
|
+
`;
|
|
182
|
+
|
|
183
|
+
const reportPath = path.join(OUT_DIR, "coverage-report.md");
|
|
184
|
+
fs.writeFileSync(reportPath, report);
|
|
185
|
+
|
|
186
|
+
// Print summary to stdout
|
|
187
|
+
console.log("\n========================================");
|
|
188
|
+
console.log(" Coverage Summary");
|
|
189
|
+
console.log("========================================");
|
|
190
|
+
if (rootMetrics) {
|
|
191
|
+
console.log(` Root: ${rootMetrics.lines.toFixed(1)}% lines | ${rootMetrics.branches.toFixed(1)}% branches | ${rootMetrics.functions.toFixed(1)}% funcs`);
|
|
192
|
+
} else {
|
|
193
|
+
console.log(" Root: (metrics not available)");
|
|
194
|
+
}
|
|
195
|
+
if (crewCliMetrics) {
|
|
196
|
+
console.log(` crew-cli: ${crewCliMetrics.lines.toFixed(1)}% lines | ${crewCliMetrics.branches.toFixed(1)}% branches | ${crewCliMetrics.functions.toFixed(1)}% funcs`);
|
|
197
|
+
} else {
|
|
198
|
+
console.log(" crew-cli: (metrics not available)");
|
|
199
|
+
}
|
|
200
|
+
if (overallMetrics) {
|
|
201
|
+
console.log(` Overall: ${overallMetrics.lines.toFixed(1)}% lines | ${overallMetrics.branches.toFixed(1)}% branches | ${overallMetrics.functions.toFixed(1)}% funcs`);
|
|
202
|
+
}
|
|
203
|
+
console.log("========================================");
|
|
204
|
+
console.log(`\nWrote ${path.relative(ROOT, reportPath)}`);
|
|
205
|
+
console.log(`Wrote ${path.relative(ROOT, summaryPath)}`);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
console.error(`\nCoverage report failed: ${error.message}`);
|
|
208
|
+
process.exit(1);
|
|
209
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Prints the most recent coverage summary from coverage/coverage-summary.json
|
|
5
|
+
* without re-running any tests.
|
|
6
|
+
*
|
|
7
|
+
* Usage: node scripts/coverage-summary.mjs
|
|
8
|
+
* or: npm run test:coverage:summary
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import fs from "node:fs";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
|
|
14
|
+
const ROOT = process.cwd();
|
|
15
|
+
const summaryPath = path.join(ROOT, "coverage", "coverage-summary.json");
|
|
16
|
+
|
|
17
|
+
if (!fs.existsSync(summaryPath)) {
|
|
18
|
+
console.error(
|
|
19
|
+
`No coverage summary found at ${summaryPath}\n` +
|
|
20
|
+
`Run "npm run test:coverage" first to generate coverage data.`
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let data;
|
|
26
|
+
try {
|
|
27
|
+
data = JSON.parse(fs.readFileSync(summaryPath, "utf8"));
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.error(`Failed to parse ${summaryPath}: ${err.message}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function fmtRow(label, metrics) {
|
|
34
|
+
if (!metrics) return ` ${label.padEnd(12)} (no data)`;
|
|
35
|
+
return ` ${label.padEnd(12)} ${String(metrics.lines.toFixed(1) + "%").padStart(7)} lines | ${String(metrics.branches.toFixed(1) + "%").padStart(7)} branches | ${String(metrics.functions.toFixed(1) + "%").padStart(7)} funcs`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
console.log("========================================");
|
|
39
|
+
console.log(" Coverage Summary");
|
|
40
|
+
console.log(` Generated: ${data.timestamp}`);
|
|
41
|
+
console.log("========================================");
|
|
42
|
+
console.log(fmtRow("Root", data.root));
|
|
43
|
+
console.log(fmtRow("crew-cli", data.crewCli));
|
|
44
|
+
console.log(fmtRow("Overall", data.overall));
|
|
45
|
+
console.log("========================================");
|
|
46
|
+
console.log(`\nFull report: coverage/coverage-report.md`);
|
|
47
|
+
console.log(`JSON data: coverage/coverage-summary.json`);
|
|
@@ -88,6 +88,13 @@ export const StartBuildSchema = z.object({
|
|
|
88
88
|
projectId: ProjectIdSchema.optional(),
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
export const EnhancePromptSchema = z.object({
|
|
92
|
+
text: z.string().min(1).max(10000),
|
|
93
|
+
projectId: ProjectIdSchema.optional(),
|
|
94
|
+
engine: z.enum(['claude', 'codex', 'cursor', 'gemini', 'gemini-cli', 'opencode', 'crew-cli']).optional(),
|
|
95
|
+
model: z.string().max(200).optional(),
|
|
96
|
+
});
|
|
97
|
+
|
|
91
98
|
export const StopBuildSchema = z.object({
|
|
92
99
|
projectId: ProjectIdSchema.optional(),
|
|
93
100
|
});
|
|
@@ -187,6 +194,73 @@ export const UpdateConfigSchema = z.object({
|
|
|
187
194
|
geminiCliModel: z.string().optional(),
|
|
188
195
|
});
|
|
189
196
|
|
|
197
|
+
// ── Agent Config (create / delete / reset) ───────────────────────────────
|
|
198
|
+
export const AgentConfigCreateSchema = z.object({
|
|
199
|
+
id: z.string().min(1).max(50),
|
|
200
|
+
model: ModelNameSchema.optional(),
|
|
201
|
+
name: z.string().max(100).optional(),
|
|
202
|
+
emoji: z.string().max(10).optional(),
|
|
203
|
+
theme: z.string().max(200).optional(),
|
|
204
|
+
systemPrompt: z.string().max(50000).optional(),
|
|
205
|
+
alsoAllow: z.array(z.string()).optional(),
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
export const AgentConfigDeleteSchema = z.object({
|
|
209
|
+
agentId: z.string().min(1).max(50),
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
export const AgentResetSessionSchema = z.object({
|
|
213
|
+
agentId: z.string().min(1).max(50),
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// ── Providers ────────────────────────────────────────────────────────────
|
|
217
|
+
export const ProviderAddSchema = z.object({
|
|
218
|
+
id: z.string().min(1).max(100),
|
|
219
|
+
baseUrl: z.string().min(1).max(1000),
|
|
220
|
+
apiKey: z.string().optional(),
|
|
221
|
+
api: z.string().max(100).optional(),
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
export const ProviderSaveSchema = z.object({
|
|
225
|
+
providerId: z.string().min(1).max(100),
|
|
226
|
+
apiKey: z.string().min(1),
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
export const ProviderTestSchema = z.object({
|
|
230
|
+
providerId: z.string().min(1).max(100),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
export const ProviderBuiltinTestSchema = z.object({
|
|
234
|
+
providerId: z.string().min(1).max(100),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// ── Continuous Build ─────────────────────────────────────────────────────
|
|
238
|
+
export const ContinuousBuildSchema = z.object({
|
|
239
|
+
requirement: z.string().min(1).max(10000),
|
|
240
|
+
projectId: ProjectIdSchema.optional(),
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// ── Roadmap ──────────────────────────────────────────────────────────────
|
|
244
|
+
export const RoadmapWriteSchema = z.object({
|
|
245
|
+
roadmapFile: z.string().min(1).max(500),
|
|
246
|
+
content: z.string(),
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
export const RoadmapRetryFailedSchema = z.object({
|
|
250
|
+
roadmapFile: z.string().min(1).max(500),
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// ── Contacts ─────────────────────────────────────────────────────────────
|
|
254
|
+
export const ContactDeleteSchema = z.object({
|
|
255
|
+
contactId: z.string().min(1).max(200),
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
export const ContactSendSchema = z.object({
|
|
259
|
+
contactId: z.string().min(1).max(200),
|
|
260
|
+
message: z.string().min(1).max(10000),
|
|
261
|
+
platform: z.string().max(50).optional(),
|
|
262
|
+
});
|
|
263
|
+
|
|
190
264
|
// ── Validation Helper ─────────────────────────────────────────────────────
|
|
191
265
|
export function validate(schema, data) {
|
|
192
266
|
try {
|