@claude-flow/cli 3.32.35 → 3.32.37

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.
Files changed (56) hide show
  1. package/.claude/helpers/helpers.manifest.json +5 -5
  2. package/.claude/helpers/hook-handler.cjs +30 -0
  3. package/.claude/helpers/intelligence.cjs +83 -5
  4. package/.claude/helpers/statusline.cjs +169 -6
  5. package/bin/cli.js +25 -1
  6. package/catalog-manifest.json +2 -2
  7. package/dist/src/commands/agent.js +1 -1
  8. package/dist/src/commands/doctor.js +159 -11
  9. package/dist/src/commands/hooks.js +39 -4
  10. package/dist/src/commands/init.js +52 -8
  11. package/dist/src/commands/mcp.js +1 -1
  12. package/dist/src/commands/memory-distill.js +1 -0
  13. package/dist/src/commands/swarm.js +28 -0
  14. package/dist/src/init/executor.js +45 -10
  15. package/dist/src/init/helpers-generator.js +15 -4
  16. package/dist/src/init/statusline-generator.js +18 -5
  17. package/dist/src/mcp-server.d.ts +25 -0
  18. package/dist/src/mcp-server.js +57 -2
  19. package/dist/src/mcp-tools/embeddings-tools.js +51 -10
  20. package/dist/src/mcp-tools/hooks-tools.js +34 -8
  21. package/dist/src/mcp-tools/metaharness-tools.js +1 -1
  22. package/dist/src/memory/memory-bridge.d.ts +12 -0
  23. package/dist/src/memory/memory-bridge.js +29 -6
  24. package/dist/src/memory/memory-initializer.js +11 -8
  25. package/dist/src/services/memory-distillation.d.ts +1 -0
  26. package/dist/src/services/memory-distillation.js +81 -5
  27. package/dist/src/services/worker-daemon.js +1 -0
  28. package/node_modules/@claude-flow/codex/.agents/skills/github-automation/SKILL.md +32 -0
  29. package/node_modules/@claude-flow/codex/.agents/skills/performance-analysis/SKILL.md +32 -0
  30. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts +4 -0
  31. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts.map +1 -1
  32. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js +20 -1
  33. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js.map +1 -1
  34. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts +4 -0
  35. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts.map +1 -1
  36. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js +18 -2
  37. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js.map +1 -1
  38. package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts +11 -5
  39. package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts.map +1 -1
  40. package/node_modules/@claude-flow/codex/dist/generators/skill-md.js +84 -849
  41. package/node_modules/@claude-flow/codex/dist/generators/skill-md.js.map +1 -1
  42. package/node_modules/@claude-flow/codex/dist/initializer.d.ts +5 -0
  43. package/node_modules/@claude-flow/codex/dist/initializer.d.ts.map +1 -1
  44. package/node_modules/@claude-flow/codex/dist/initializer.js +54 -20
  45. package/node_modules/@claude-flow/codex/dist/initializer.js.map +1 -1
  46. package/package.json +1 -1
  47. package/plugins/ruflo-metaharness/commands/ruflo-metaharness.md +4 -2
  48. package/plugins/ruflo-metaharness/scripts/_harness.mjs +5 -1
  49. package/plugins/ruflo-metaharness/scripts/_invoke.mjs +12 -13
  50. package/plugins/ruflo-metaharness/scripts/genome.mjs +29 -4
  51. package/plugins/ruflo-metaharness/scripts/mcp-scan.mjs +7 -8
  52. package/plugins/ruflo-metaharness/scripts/smoke.sh +58 -2
  53. package/plugins/ruflo-metaharness/scripts/test-mcp-tools.mjs +25 -1
  54. package/plugins/ruflo-metaharness/scripts/test-similarity.mjs +38 -0
  55. package/plugins/ruflo-metaharness/scripts/threat-model.mjs +4 -1
  56. package/plugins/ruflo-metaharness/skills/harness-genome/SKILL.md +5 -2
@@ -26,6 +26,7 @@ import {
26
26
  } from './_similarity.mjs';
27
27
  // iter 64 — also test the iter-63 shared severity primitives
28
28
  import { SEVERITY_RANK, rankSeverity, parseMcpScanText } from './_harness.mjs';
29
+ import { parseTrailingJson } from './_invoke.mjs';
29
30
 
30
31
  const ARGS = (() => {
31
32
  const a = { format: 'table' };
@@ -273,6 +274,22 @@ assert(single.summary?.overallSeverity === 'info',
273
274
  assert(single.summary?.totalCount === 1,
274
275
  'summary.totalCount === 1 from "(1 finding,"');
275
276
 
277
+ // Newer metaharness releases align severity labels to a fixed-width column.
278
+ // Keep parsing the legacy compact form above while accepting `[LOW ]`.
279
+ const padded = parseMcpScanText(`harness mcp-scan — /repo
280
+
281
+ [LOW ] 8 unpinned dependency range(s)
282
+ Floating ranges weaken supply-chain reproducibility.
283
+
284
+ Result: LOW (1 finding, 0 high)
285
+ `);
286
+ assert(padded.findings.length === 1, 'padded [LOW ] block → 1 finding');
287
+ assert(padded.findings[0].severity === 'low',
288
+ 'padded severity lowercased without trailing whitespace');
289
+ assert(padded.findings[0].message.includes('8 unpinned dependency range(s)') &&
290
+ padded.findings[0].message.includes('supply-chain reproducibility'),
291
+ 'padded finding message and continuation extracted');
292
+
276
293
  // Continuation line — indented text appends to previous finding
277
294
  const cont = parseMcpScanText(`
278
295
  [HIGH] Exposed credential path
@@ -314,6 +331,27 @@ assert(mixed.findings.length === 1,
314
331
  assert(mixed.findings[0].severity === 'high',
315
332
  'strict regex captured the uppercase entry');
316
333
 
334
+ console.log('\nPhase 11 — complete trailing JSON extraction');
335
+
336
+ const nestedJson = parseTrailingJson(`progress: scanning {not-json}
337
+ {
338
+ "dir": "/repo",
339
+ "findings": [
340
+ { "id": "allow-shell", "severity": "high" },
341
+ { "id": "no-audit-log", "severity": "medium" }
342
+ ],
343
+ "worst": "high"
344
+ }
345
+ `);
346
+ assert(nestedJson?.dir === '/repo', 'mixed stdout returns root JSON object');
347
+ assert(nestedJson?.findings?.length === 2,
348
+ 'nested findings remain attached to root payload');
349
+ assert(nestedJson?.findings?.[1]?.id === 'no-audit-log',
350
+ 'extractor does not return the last nested object');
351
+ assert(nestedJson?.worst === 'high', 'root-level severity is preserved');
352
+ assert(parseTrailingJson('progress only {not-json}') === null,
353
+ 'non-JSON progress braces return null');
354
+
317
355
  // ──────────────────────────────────────────────────────────────────
318
356
  const summary = {
319
357
  passed, failed,
@@ -26,7 +26,10 @@ function main() {
26
26
  }
27
27
  const r = runHarness(['threat-model', ARGS.path]);
28
28
  if (r.degraded) { emitDegradedJsonAndExit(r.reason); return; }
29
- if (r.exitCode !== 0 && r.exitCode !== 1) {
29
+ // Upstream uses exit 2 for a valid HIGH verdict. A parsed JSON payload is
30
+ // authoritative regardless of that domain exit code; only reject a
31
+ // non-zero invocation when it produced no structured result.
32
+ if (!r.json && r.exitCode !== 0 && r.exitCode !== 1) {
30
33
  console.error(`threat-model: harness exited ${r.exitCode}`);
31
34
  if (r.stderr) console.error(r.stderr.slice(0, 400));
32
35
  process.exit(2);
@@ -17,8 +17,11 @@ Implementation: [`scripts/genome.mjs`](../../scripts/genome.mjs).
17
17
  1. Shell out to `npx metaharness genome <path> --json` (60s hard timeout).
18
18
  2. Parse the shape: `{ repo_type, agent_topology[], risk_score,
19
19
  mcp_surface, test_confidence, publish_readiness }`.
20
- 3. If `--alert-on-risk-above N`: exit 1 when `risk_score > N`.
21
- 4. Output JSON (default) or markdown.
20
+ 3. Preserve upstream's readiness verdict as `verdict` and
21
+ `verdictExitCode`. Upstream exits 1 for `needs-work` and 2 for `blocked`;
22
+ these are valid reports, so the wrapper returns them successfully.
23
+ 4. If `--alert-on-risk-above N`: exit 1 when `risk_score > N`.
24
+ 5. Output JSON (default) or markdown.
22
25
 
23
26
  ## Phase-0 baseline (ruflo, measured 2026-06-16)
24
27