@claude-flow/cli 3.66.0 → 3.66.2

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 (30) hide show
  1. package/.claude/helpers/helpers.manifest.json +2 -2
  2. package/catalog-manifest.json +2 -2
  3. package/dist/src/mcp-tools/memory-tools.js +14 -0
  4. package/dist/src/mcp-tools/terminal-tools.js +3 -2
  5. package/dist/src/memory/memory-bridge.js +21 -1
  6. package/dist/src/missions/schemas.d.ts +134 -134
  7. package/dist/src/mods/command-registry/schema.d.ts +189 -189
  8. package/node_modules/@claude-flow/mcp/dist/transport/guard.d.ts +10 -0
  9. package/node_modules/@claude-flow/mcp/dist/transport/guard.d.ts.map +1 -1
  10. package/node_modules/@claude-flow/mcp/dist/transport/guard.js +17 -0
  11. package/node_modules/@claude-flow/mcp/dist/transport/guard.js.map +1 -1
  12. package/node_modules/@claude-flow/mcp/dist/transport/http.d.ts.map +1 -1
  13. package/node_modules/@claude-flow/mcp/dist/transport/http.js +4 -8
  14. package/node_modules/@claude-flow/mcp/dist/transport/http.js.map +1 -1
  15. package/node_modules/@claude-flow/mcp/dist/transport/websocket.d.ts.map +1 -1
  16. package/node_modules/@claude-flow/mcp/dist/transport/websocket.js +2 -3
  17. package/node_modules/@claude-flow/mcp/dist/transport/websocket.js.map +1 -1
  18. package/node_modules/@claude-flow/mcp/package.json +1 -1
  19. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.d.ts.map +1 -1
  20. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js +31 -0
  21. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js.map +1 -1
  22. package/node_modules/@claude-flow/plugin-agent-federation/package.json +1 -1
  23. package/node_modules/@claude-flow/security/dist/input-validator.d.ts.map +1 -1
  24. package/node_modules/@claude-flow/security/dist/input-validator.js +10 -5
  25. package/node_modules/@claude-flow/security/dist/input-validator.js.map +1 -1
  26. package/node_modules/@claude-flow/security/dist/token-generator.d.ts.map +1 -1
  27. package/node_modules/@claude-flow/security/dist/token-generator.js +4 -3
  28. package/node_modules/@claude-flow/security/dist/token-generator.js.map +1 -1
  29. package/node_modules/@claude-flow/security/package.json +1 -1
  30. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": {
3
- "version": "3.66.0",
3
+ "version": "3.66.2",
4
4
  "files": {
5
5
  "auto-memory-hook.mjs": "631fac9d518835e2852a406888316bbbddddb49e7ed8e406d2e971f46833df9a",
6
6
  "hook-handler.cjs": "0ce70981aa33f76d008b6f49626effaf4269918c4094f1a28c1ef6fceb097d6f",
@@ -10,6 +10,6 @@
10
10
  "learning-loop.cjs": "d046cd6f8efb7dd40e1d2451516c181fc8b26477aefb1124c0df5f52a23f9190"
11
11
  }
12
12
  },
13
- "signature": "0JTgpgicsDJAdV6HhU9yPawpjklEbbSsyFjLJAqSh2jX9Jx8w4I5wS/EPnd5yp66HNpgU0up0Shay0qTdHeZAA==",
13
+ "signature": "if1ToBugZK6ce9z+01Bfo3otxr+WTji2wwDw5u13NQjm0g2pKboaTUOQ9t/LRV1Gq52NPX9abgU3/KEQn6AeAw==",
14
14
  "algorithm": "ed25519"
15
15
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "generation": 7,
4
- "generatedAt": "2026-10-31T05:51:35.623Z",
5
- "gitSha": "0d94037e",
4
+ "generatedAt": "2026-10-31T18:12:16.494Z",
5
+ "gitSha": "bd77bced",
6
6
  "catalog": {
7
7
  "agents": 177,
8
8
  "tools": 445,
@@ -878,6 +878,19 @@ export const memoryTools = [
878
878
  offset,
879
879
  dbPath,
880
880
  });
881
+ // #4622: a failed query is not an empty store. Without this, a
882
+ // listing that could not read the database came back as a
883
+ // successful, empty inventory.
884
+ if (result.success === false) {
885
+ return {
886
+ success: false,
887
+ entries: [],
888
+ total: 0,
889
+ limit,
890
+ offset,
891
+ error: result.error || 'listEntries reported failure',
892
+ };
893
+ }
881
894
  const entries = result.entries.map(e => ({
882
895
  key: e.key,
883
896
  namespace: e.namespace,
@@ -898,6 +911,7 @@ export const memoryTools = [
898
911
  }
899
912
  catch (error) {
900
913
  return {
914
+ success: false,
901
915
  entries: [],
902
916
  total: 0,
903
917
  limit,
@@ -9,6 +9,7 @@ import { mkdirRestricted, readFileMaybeEncrypted, writeFileRestricted, } from '.
9
9
  import { validateEnv, validateIdentifier, validatePath, validateText } from './validate-input.js';
10
10
  import { join } from 'node:path';
11
11
  import { execSync } from 'node:child_process';
12
+ import { randomBytes } from 'node:crypto';
12
13
  // Storage paths
13
14
  const STORAGE_DIR = '.claude-flow';
14
15
  const TERMINAL_DIR = 'terminals';
@@ -81,7 +82,7 @@ export const terminalTools = [
81
82
  if (!vEnv.valid)
82
83
  return { success: false, error: vEnv.error };
83
84
  const store = loadTerminalStore();
84
- const id = `term-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
85
+ const id = `term-${Date.now()}-${randomBytes(4).toString('hex')}`;
85
86
  const session = {
86
87
  id,
87
88
  name: input.name || `Terminal ${Object.keys(store.sessions).length + 1}`,
@@ -135,7 +136,7 @@ export const terminalTools = [
135
136
  let session = sessionId ? store.sessions[sessionId] : Object.values(store.sessions).find(s => s.status === 'active');
136
137
  if (!session) {
137
138
  // Create default session
138
- const id = `term-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
139
+ const id = `term-${Date.now()}-${randomBytes(4).toString('hex')}`;
139
140
  session = {
140
141
  id,
141
142
  name: 'Default Terminal',
@@ -238,6 +238,17 @@ export function shouldSuppressInitLog(msg) {
238
238
  * Lazily initialize the ControllerRegistry singleton.
239
239
  * Returns null if @claude-flow/memory is not available.
240
240
  */
241
+ /**
242
+ * Why the registry's AgentDB did not open, or null when it did (#4622).
243
+ * Read from the registry's own record (@claude-flow/memory >= 3.2.0); an
244
+ * older registry has none, and nothing changes for it.
245
+ */
246
+ function agentdbInitFailure(registry, resolvedPath) {
247
+ if (typeof registry?.getAgentDBInitError !== 'function')
248
+ return null;
249
+ const reason = registry.getAgentDBInitError();
250
+ return typeof reason === 'string' && reason ? `AgentDB did not open ${resolvedPath}: ${reason}` : null;
251
+ }
241
252
  async function getRegistry(dbPath) {
242
253
  if (shouldDisableNativeBridge())
243
254
  return null;
@@ -527,6 +538,12 @@ async function getRegistry(dbPath) {
527
538
  }
528
539
  registryInstances.set(resolvedPath, registry);
529
540
  bridgeFailureReasons.delete(resolvedPath);
541
+ // #4622: the registry survives an AgentDB open failure (its other
542
+ // controllers still work), but every database operation then falls
543
+ // back to sql.js. Record why, so the fallback's own refusal names it.
544
+ const agentdbFailure = agentdbInitFailure(registry, resolvedPath);
545
+ if (agentdbFailure)
546
+ bridgeFailureReasons.set(resolvedPath, agentdbFailure);
530
547
  return registry;
531
548
  }
532
549
  catch (err) {
@@ -2188,7 +2205,10 @@ export async function isBridgeAvailable(dbPath) {
2188
2205
  if (!operationContext.getStore()?.active)
2189
2206
  return withBridgeOperation(() => isBridgeAvailable(dbPath));
2190
2207
  const registry = await getRegistry(dbPath);
2191
- return registry !== null;
2208
+ if (registry === null)
2209
+ return false;
2210
+ // #4622: a registry whose AgentDB failed to open serves no stored memory.
2211
+ return agentdbInitFailure(registry, canonicalDbPath(dbPath)) === null;
2192
2212
  }
2193
2213
  /**
2194
2214
  * Get the ControllerRegistry instance (for advanced consumers).