claude-flow 3.54.0 → 3.55.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 (91) hide show
  1. package/.claude/.proven-config-version +1 -0
  2. package/.claude/helpers/hook-handler.cjs +65 -3
  3. package/.claude/proven-config.json +42 -0
  4. package/node_modules/@claude-flow/mcp/dist/connection-pool.d.ts.map +1 -1
  5. package/node_modules/@claude-flow/mcp/dist/connection-pool.js +5 -2
  6. package/node_modules/@claude-flow/mcp/dist/connection-pool.js.map +1 -1
  7. package/node_modules/@claude-flow/mcp/dist/transport/http.d.ts +7 -1
  8. package/node_modules/@claude-flow/mcp/dist/transport/http.d.ts.map +1 -1
  9. package/node_modules/@claude-flow/mcp/dist/transport/http.js +60 -47
  10. package/node_modules/@claude-flow/mcp/dist/transport/http.js.map +1 -1
  11. package/node_modules/@claude-flow/mcp/package.json +1 -1
  12. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js +1 -1
  13. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js.map +1 -1
  14. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +0 -0
  15. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts +3 -0
  16. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts.map +1 -1
  17. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js +4 -1
  18. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js.map +1 -1
  19. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts.map +1 -1
  20. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js +1 -0
  21. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.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/policy/engine.d.ts +11 -1
  24. package/node_modules/@claude-flow/security/dist/policy/engine.d.ts.map +1 -1
  25. package/node_modules/@claude-flow/security/dist/policy/engine.js +19 -3
  26. package/node_modules/@claude-flow/security/dist/policy/engine.js.map +1 -1
  27. package/node_modules/@claude-flow/security/dist/policy/types.d.ts +4 -2
  28. package/node_modules/@claude-flow/security/dist/policy/types.d.ts.map +1 -1
  29. package/node_modules/@claude-flow/security/package.json +1 -1
  30. package/package.json +5 -5
  31. package/v3/@claude-flow/cli/bin/cli.js +1 -1
  32. package/v3/@claude-flow/cli/bin/mcp-server.js +1 -1
  33. package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
  34. package/v3/@claude-flow/cli/dist/src/blocking-stdio.d.ts +11 -0
  35. package/v3/@claude-flow/cli/dist/src/blocking-stdio.js +23 -0
  36. package/v3/@claude-flow/cli/dist/src/commands/autopilot.js +2 -2
  37. package/v3/@claude-flow/cli/dist/src/commands/daemon.js +21 -1
  38. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js +7 -0
  39. package/v3/@claude-flow/cli/dist/src/commands/mcp.js +35 -1
  40. package/v3/@claude-flow/cli/dist/src/commands/policy.js +10 -2
  41. package/v3/@claude-flow/cli/dist/src/commands/session.js +11 -37
  42. package/v3/@claude-flow/cli/dist/src/index.js +3 -0
  43. package/v3/@claude-flow/cli/dist/src/init/executor.js +1 -0
  44. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +65 -3
  45. package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts +33 -0
  46. package/v3/@claude-flow/cli/dist/src/mcp-server.js +96 -4
  47. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +13 -1
  48. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +2 -4
  49. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +214 -40
  50. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +1 -1
  51. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +4 -1
  52. package/v3/@claude-flow/cli/dist/src/memory/graph-edge-writer.js +3 -2
  53. package/v3/@claude-flow/cli/dist/src/memory/lucene-bm25.js +11 -19
  54. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +1 -0
  55. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +14 -1
  56. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +5 -4
  57. package/v3/@claude-flow/cli/dist/src/memory/shared-sqlite.d.ts +7 -0
  58. package/v3/@claude-flow/cli/dist/src/memory/shared-sqlite.js +45 -0
  59. package/v3/@claude-flow/cli/dist/src/mods/probe.d.ts +7 -0
  60. package/v3/@claude-flow/cli/dist/src/mods/probe.js +29 -1
  61. package/v3/@claude-flow/cli/dist/src/parser.d.ts +3 -0
  62. package/v3/@claude-flow/cli/dist/src/parser.js +64 -13
  63. package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts +2 -0
  64. package/v3/@claude-flow/cli/dist/src/production/monitoring.js +8 -3
  65. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js +8 -5
  66. package/v3/@claude-flow/cli/dist/src/production/retry.js +3 -1
  67. package/v3/@claude-flow/cli/dist/src/services/bounded-worker-pool.js +3 -0
  68. package/v3/@claude-flow/cli/dist/src/services/config-file-manager.d.ts +3 -0
  69. package/v3/@claude-flow/cli/dist/src/services/config-file-manager.js +24 -7
  70. package/v3/@claude-flow/cli/dist/src/services/git-workspace-identity.js +20 -3
  71. package/v3/@claude-flow/cli/dist/src/services/policy-ledger-anchor.d.ts +42 -0
  72. package/v3/@claude-flow/cli/dist/src/services/policy-ledger-anchor.js +163 -0
  73. package/v3/@claude-flow/cli/dist/src/services/policy-runtime.d.ts +11 -5
  74. package/v3/@claude-flow/cli/dist/src/services/policy-runtime.js +70 -15
  75. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts +1 -0
  76. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js +12 -0
  77. package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts +1 -0
  78. package/v3/@claude-flow/cli/dist/src/services/worker-queue.js +20 -3
  79. package/v3/@claude-flow/cli/package.json +7 -7
  80. package/v3/@claude-flow/shared/dist/events/event-store-pagination.test.d.ts +2 -0
  81. package/v3/@claude-flow/shared/dist/events/event-store-pagination.test.js +32 -0
  82. package/v3/@claude-flow/shared/dist/events/event-store.js +11 -4
  83. package/v3/@claude-flow/shared/dist/events/event-store.test.js +20 -0
  84. package/v3/@claude-flow/shared/dist/mcp/connection-pool.js +5 -2
  85. package/v3/@claude-flow/shared/dist/resilience/bulkhead-sync-throw.test.d.ts +2 -0
  86. package/v3/@claude-flow/shared/dist/resilience/bulkhead-sync-throw.test.js +33 -0
  87. package/v3/@claude-flow/shared/dist/resilience/bulkhead.js +2 -1
  88. package/v3/@claude-flow/shared/dist/resilience/retry-timeout-cleanup.test.d.ts +2 -0
  89. package/v3/@claude-flow/shared/dist/resilience/retry-timeout-cleanup.test.js +38 -0
  90. package/v3/@claude-flow/shared/dist/resilience/retry.js +9 -2
  91. package/v3/@claude-flow/shared/package.json +1 -1
@@ -0,0 +1,38 @@
1
+ import { afterEach, describe, it, expect, vi } from 'vitest';
2
+ import { retry } from './retry.js';
3
+ afterEach(() => vi.useRealTimers());
4
+ describe('retry timeout lifetime', () => {
5
+ it('does not keep a success timer alive after an attempt settles', async () => {
6
+ vi.useFakeTimers();
7
+ const result = await retry(async () => 42, {
8
+ maxAttempts: 1,
9
+ timeout: 30000,
10
+ });
11
+ expect(result.success).toBe(true);
12
+ expect(result.result).toBe(42);
13
+ expect(vi.getTimerCount()).toBe(0);
14
+ });
15
+ it('releases timers for rejected attempts without suppressing their errors', async () => {
16
+ vi.useFakeTimers();
17
+ const err = new Error('no');
18
+ const result = await retry(async () => {
19
+ throw err;
20
+ }, { maxAttempts: 1 });
21
+ expect(result.success).toBe(false);
22
+ expect(result.errors).toEqual([err]);
23
+ expect(vi.getTimerCount()).toBe(0);
24
+ });
25
+ it('still bounds a pending operation and reports the timeout', async () => {
26
+ vi.useFakeTimers();
27
+ const promise = retry(() => new Promise(() => { }), {
28
+ maxAttempts: 1,
29
+ timeout: 10,
30
+ });
31
+ await vi.advanceTimersByTimeAsync(10);
32
+ const result = await promise;
33
+ expect(result.success).toBe(false);
34
+ expect(result.errors[0].message).toContain('timed out');
35
+ expect(vi.getTimerCount()).toBe(0);
36
+ });
37
+ });
38
+ //# sourceMappingURL=retry-timeout-cleanup.test.js.map
@@ -117,12 +117,19 @@ export function withRetry(fn, options = {}) {
117
117
  * Execute with timeout
118
118
  */
119
119
  async function withTimeout(promise, timeout, attempt) {
120
+ let timer;
120
121
  const timeoutPromise = new Promise((_, reject) => {
121
- setTimeout(() => {
122
+ timer = setTimeout(() => {
122
123
  reject(new Error(`Attempt ${attempt} timed out after ${timeout}ms`));
123
124
  }, timeout);
124
125
  });
125
- return Promise.race([promise, timeoutPromise]);
126
+ try {
127
+ return await Promise.race([promise, timeoutPromise]);
128
+ }
129
+ finally {
130
+ if (timer !== undefined)
131
+ clearTimeout(timer);
132
+ }
126
133
  }
127
134
  /**
128
135
  * Sleep for specified milliseconds
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/shared",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "type": "module",
5
5
  "description": "Shared module - common types, events, utilities, core interfaces",
6
6
  "main": "dist/index.js",