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.
- package/.claude/.proven-config-version +1 -0
- package/.claude/helpers/hook-handler.cjs +65 -3
- package/.claude/proven-config.json +42 -0
- package/node_modules/@claude-flow/mcp/dist/connection-pool.d.ts.map +1 -1
- package/node_modules/@claude-flow/mcp/dist/connection-pool.js +5 -2
- package/node_modules/@claude-flow/mcp/dist/connection-pool.js.map +1 -1
- package/node_modules/@claude-flow/mcp/dist/transport/http.d.ts +7 -1
- package/node_modules/@claude-flow/mcp/dist/transport/http.d.ts.map +1 -1
- package/node_modules/@claude-flow/mcp/dist/transport/http.js +60 -47
- package/node_modules/@claude-flow/mcp/dist/transport/http.js.map +1 -1
- package/node_modules/@claude-flow/mcp/package.json +1 -1
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js +1 -1
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js.map +1 -1
- package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +0 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts +3 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts.map +1 -1
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js +4 -1
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js.map +1 -1
- package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts.map +1 -1
- package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js.map +1 -1
- package/node_modules/@claude-flow/plugin-agent-federation/package.json +1 -1
- package/node_modules/@claude-flow/security/dist/policy/engine.d.ts +11 -1
- package/node_modules/@claude-flow/security/dist/policy/engine.d.ts.map +1 -1
- package/node_modules/@claude-flow/security/dist/policy/engine.js +19 -3
- package/node_modules/@claude-flow/security/dist/policy/engine.js.map +1 -1
- package/node_modules/@claude-flow/security/dist/policy/types.d.ts +4 -2
- package/node_modules/@claude-flow/security/dist/policy/types.d.ts.map +1 -1
- package/node_modules/@claude-flow/security/package.json +1 -1
- package/package.json +5 -5
- package/v3/@claude-flow/cli/bin/cli.js +1 -1
- package/v3/@claude-flow/cli/bin/mcp-server.js +1 -1
- package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
- package/v3/@claude-flow/cli/dist/src/blocking-stdio.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/blocking-stdio.js +23 -0
- package/v3/@claude-flow/cli/dist/src/commands/autopilot.js +2 -2
- package/v3/@claude-flow/cli/dist/src/commands/daemon.js +21 -1
- package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js +7 -0
- package/v3/@claude-flow/cli/dist/src/commands/mcp.js +35 -1
- package/v3/@claude-flow/cli/dist/src/commands/policy.js +10 -2
- package/v3/@claude-flow/cli/dist/src/commands/session.js +11 -37
- package/v3/@claude-flow/cli/dist/src/index.js +3 -0
- package/v3/@claude-flow/cli/dist/src/init/executor.js +1 -0
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +65 -3
- package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts +33 -0
- package/v3/@claude-flow/cli/dist/src/mcp-server.js +96 -4
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +13 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +2 -4
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +214 -40
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +1 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +4 -1
- package/v3/@claude-flow/cli/dist/src/memory/graph-edge-writer.js +3 -2
- package/v3/@claude-flow/cli/dist/src/memory/lucene-bm25.js +11 -19
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +14 -1
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +5 -4
- package/v3/@claude-flow/cli/dist/src/memory/shared-sqlite.d.ts +7 -0
- package/v3/@claude-flow/cli/dist/src/memory/shared-sqlite.js +45 -0
- package/v3/@claude-flow/cli/dist/src/mods/probe.d.ts +7 -0
- package/v3/@claude-flow/cli/dist/src/mods/probe.js +29 -1
- package/v3/@claude-flow/cli/dist/src/parser.d.ts +3 -0
- package/v3/@claude-flow/cli/dist/src/parser.js +64 -13
- package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts +2 -0
- package/v3/@claude-flow/cli/dist/src/production/monitoring.js +8 -3
- package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js +8 -5
- package/v3/@claude-flow/cli/dist/src/production/retry.js +3 -1
- package/v3/@claude-flow/cli/dist/src/services/bounded-worker-pool.js +3 -0
- package/v3/@claude-flow/cli/dist/src/services/config-file-manager.d.ts +3 -0
- package/v3/@claude-flow/cli/dist/src/services/config-file-manager.js +24 -7
- package/v3/@claude-flow/cli/dist/src/services/git-workspace-identity.js +20 -3
- package/v3/@claude-flow/cli/dist/src/services/policy-ledger-anchor.d.ts +42 -0
- package/v3/@claude-flow/cli/dist/src/services/policy-ledger-anchor.js +163 -0
- package/v3/@claude-flow/cli/dist/src/services/policy-runtime.d.ts +11 -5
- package/v3/@claude-flow/cli/dist/src/services/policy-runtime.js +70 -15
- package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts +1 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js +12 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts +1 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-queue.js +20 -3
- package/v3/@claude-flow/cli/package.json +7 -7
- package/v3/@claude-flow/shared/dist/events/event-store-pagination.test.d.ts +2 -0
- package/v3/@claude-flow/shared/dist/events/event-store-pagination.test.js +32 -0
- package/v3/@claude-flow/shared/dist/events/event-store.js +11 -4
- package/v3/@claude-flow/shared/dist/events/event-store.test.js +20 -0
- package/v3/@claude-flow/shared/dist/mcp/connection-pool.js +5 -2
- package/v3/@claude-flow/shared/dist/resilience/bulkhead-sync-throw.test.d.ts +2 -0
- package/v3/@claude-flow/shared/dist/resilience/bulkhead-sync-throw.test.js +33 -0
- package/v3/@claude-flow/shared/dist/resilience/bulkhead.js +2 -1
- package/v3/@claude-flow/shared/dist/resilience/retry-timeout-cleanup.test.d.ts +2 -0
- package/v3/@claude-flow/shared/dist/resilience/retry-timeout-cleanup.test.js +38 -0
- package/v3/@claude-flow/shared/dist/resilience/retry.js +9 -2
- 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
|
-
|
|
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
|