claude-flow 3.57.2 → 3.58.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.
Files changed (57) hide show
  1. package/.claude/proven-config.json +1 -1
  2. package/.claude-plugin/marketplace.json +11 -0
  3. package/README.md +1 -0
  4. package/node_modules/@claude-flow/codex/README.md +78 -0
  5. package/node_modules/@claude-flow/codex/dist/activity/cli.d.ts +3 -0
  6. package/node_modules/@claude-flow/codex/dist/activity/cli.d.ts.map +1 -0
  7. package/node_modules/@claude-flow/codex/dist/activity/cli.js +115 -0
  8. package/node_modules/@claude-flow/codex/dist/activity/cli.js.map +1 -0
  9. package/node_modules/@claude-flow/codex/dist/activity/files.d.ts +14 -0
  10. package/node_modules/@claude-flow/codex/dist/activity/files.d.ts.map +1 -0
  11. package/node_modules/@claude-flow/codex/dist/activity/files.js +142 -0
  12. package/node_modules/@claude-flow/codex/dist/activity/files.js.map +1 -0
  13. package/node_modules/@claude-flow/codex/dist/activity/parser.d.ts +21 -0
  14. package/node_modules/@claude-flow/codex/dist/activity/parser.d.ts.map +1 -0
  15. package/node_modules/@claude-flow/codex/dist/activity/parser.js +179 -0
  16. package/node_modules/@claude-flow/codex/dist/activity/parser.js.map +1 -0
  17. package/node_modules/@claude-flow/codex/dist/activity/reader.d.ts +20 -0
  18. package/node_modules/@claude-flow/codex/dist/activity/reader.d.ts.map +1 -0
  19. package/node_modules/@claude-flow/codex/dist/activity/reader.js +106 -0
  20. package/node_modules/@claude-flow/codex/dist/activity/reader.js.map +1 -0
  21. package/node_modules/@claude-flow/codex/dist/activity/sanitize.d.ts +4 -0
  22. package/node_modules/@claude-flow/codex/dist/activity/sanitize.d.ts.map +1 -0
  23. package/node_modules/@claude-flow/codex/dist/activity/sanitize.js +27 -0
  24. package/node_modules/@claude-flow/codex/dist/activity/sanitize.js.map +1 -0
  25. package/node_modules/@claude-flow/codex/dist/activity/types.d.ts +31 -0
  26. package/node_modules/@claude-flow/codex/dist/activity/types.d.ts.map +1 -0
  27. package/node_modules/@claude-flow/codex/dist/activity/types.js +5 -0
  28. package/node_modules/@claude-flow/codex/dist/activity/types.js.map +1 -0
  29. package/node_modules/@claude-flow/codex/dist/activity/viewer.d.ts +21 -0
  30. package/node_modules/@claude-flow/codex/dist/activity/viewer.d.ts.map +1 -0
  31. package/node_modules/@claude-flow/codex/dist/activity/viewer.js +168 -0
  32. package/node_modules/@claude-flow/codex/dist/activity/viewer.js.map +1 -0
  33. package/node_modules/@claude-flow/codex/dist/cli.js +3 -0
  34. package/node_modules/@claude-flow/codex/dist/cli.js.map +1 -1
  35. package/node_modules/@claude-flow/mcp/dist/server.d.ts.map +1 -1
  36. package/node_modules/@claude-flow/mcp/dist/server.js +5 -3
  37. package/node_modules/@claude-flow/mcp/dist/server.js.map +1 -1
  38. package/node_modules/@claude-flow/mcp/dist/types.d.ts +11 -0
  39. package/node_modules/@claude-flow/mcp/dist/types.d.ts.map +1 -1
  40. package/node_modules/@claude-flow/mcp/dist/types.js.map +1 -1
  41. package/package.json +1 -1
  42. package/v3/@claude-flow/cli/README.md +1 -0
  43. package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
  44. package/v3/@claude-flow/cli/dist/src/commands/agent.js +4 -1
  45. package/v3/@claude-flow/cli/dist/src/commands/mcp.js +66 -6
  46. package/v3/@claude-flow/cli/dist/src/commands/memory.js +53 -2
  47. package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts +5 -0
  48. package/v3/@claude-flow/cli/dist/src/mcp-server.js +39 -0
  49. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +28 -0
  50. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js +25 -15
  51. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +43 -4
  52. package/v3/@claude-flow/cli/dist/src/memory/memory-peek.d.ts +28 -0
  53. package/v3/@claude-flow/cli/dist/src/memory/memory-peek.js +222 -0
  54. package/v3/@claude-flow/cli/dist/src/memory/model-cache-dir.d.ts +11 -0
  55. package/v3/@claude-flow/cli/dist/src/memory/model-cache-dir.js +17 -0
  56. package/v3/@claude-flow/cli/dist/src/ruvector/task-embedder.js +38 -4
  57. package/v3/@claude-flow/cli/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ import * as os from 'node:os';
2
+ import * as path from 'node:path';
3
+ /**
4
+ * Resolve a writable cache directory for ONNX model downloads.
5
+ *
6
+ * ADR-454: duplicated intentionally from
7
+ * `@claude-flow/embeddings/src/transformers-loader.ts`'s
8
+ * `resolveModelCacheDir()` rather than imported, since `@claude-flow/cli`
9
+ * has no dependency on `@claude-flow/embeddings` (see the circular
10
+ * optional-dep note in `memory-initializer.ts`).
11
+ */
12
+ export function resolveModelCacheDir() {
13
+ return (process.env.TRANSFORMERS_CACHE ||
14
+ process.env.HF_HOME ||
15
+ path.join(os.homedir(), '.cache', 'ruflo', 'models'));
16
+ }
17
+ //# sourceMappingURL=model-cache-dir.js.map
@@ -19,6 +19,8 @@
19
19
  *
20
20
  * @module task-embedder
21
21
  */
22
+ import * as fs from 'node:fs';
23
+ import { resolveModelCacheDir } from '../memory/model-cache-dir.js';
22
24
  // ============================================================================
23
25
  // FNV-1a-32 hash (matches scripts/gen-seed-corpus.mjs + router-trajectory.ts)
24
26
  // ============================================================================
@@ -38,18 +40,48 @@ function cacheKey(task) {
38
40
  // same function (xenova's pipeline returns a callable that accepts either),
39
41
  // so we don't pay the ONNX model-load cost twice.
40
42
  let _extractorPromise = null;
43
+ /**
44
+ * ADR-454: distinguishes a null-extractor result caused by a genuinely
45
+ * missing dependency (permanent — nothing changes without a reinstall) from
46
+ * one caused by an environmental/fixable failure during `pipeline(...)`
47
+ * init, such as EACCES on the model cache dir (retryable).
48
+ */
49
+ let _extractorDegradedReason = null;
50
+ let _extractorLastAttemptAt = 0;
51
+ const EXTRACTOR_RETRY_INTERVAL_MS = 60_000;
41
52
  function loadExtractor() {
42
- if (_extractorPromise !== null)
43
- return _extractorPromise;
53
+ if (_extractorPromise !== null) {
54
+ const isRetryableDue = _extractorDegradedReason === 'retryable' &&
55
+ Date.now() - _extractorLastAttemptAt >= EXTRACTOR_RETRY_INTERVAL_MS;
56
+ if (!isRetryableDue)
57
+ return _extractorPromise;
58
+ // Fall through to re-attempt — the retryable failure may now be fixed.
59
+ }
60
+ _extractorLastAttemptAt = Date.now();
44
61
  _extractorPromise = (async () => {
62
+ let packageImportable = false;
45
63
  try {
46
64
  const specifier = '@xenova/transformers';
47
65
  const mod = await import(/* @vite-ignore */ specifier).catch(() => null);
48
- if (!mod || typeof mod.pipeline !== 'function')
66
+ if (!mod || typeof mod.pipeline !== 'function') {
67
+ _extractorDegradedReason = 'permanent';
49
68
  return null;
50
- return await mod.pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', { quantized: true });
69
+ }
70
+ packageImportable = true;
71
+ // ADR-454: route model downloads to a user-writable cache dir — the
72
+ // package-relative default is root-owned under a system-prefix
73
+ // global install, which throws EACCES for the runtime user.
74
+ const cacheDir = resolveModelCacheDir();
75
+ fs.mkdirSync(cacheDir, { recursive: true });
76
+ const env = mod.env;
77
+ if (env)
78
+ env.cacheDir = cacheDir;
79
+ const extractor = await mod.pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', { quantized: true });
80
+ _extractorDegradedReason = null;
81
+ return extractor;
51
82
  }
52
83
  catch {
84
+ _extractorDegradedReason = packageImportable ? 'retryable' : 'permanent';
53
85
  return null;
54
86
  }
55
87
  })();
@@ -233,5 +265,7 @@ export function __resetTaskEmbedderForTests() {
233
265
  _hits = 0;
234
266
  _misses = 0;
235
267
  _extractorPromise = null;
268
+ _extractorDegradedReason = null;
269
+ _extractorLastAttemptAt = 0;
236
270
  }
237
271
  //# sourceMappingURL=task-embedder.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.57.2",
3
+ "version": "3.58.0",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",