@claude-flow/cli 3.7.0-alpha.45 → 3.7.0-alpha.47
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/README.md +9 -0
- package/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +129 -0
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/memory/diskann-registry.d.ts +56 -0
- package/dist/src/memory/diskann-registry.d.ts.map +1 -0
- package/dist/src/memory/diskann-registry.js +88 -0
- package/dist/src/memory/diskann-registry.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/dist/src/ruvector/flash-attention.d.ts.map +0 -1
- package/dist/src/ruvector/flash-attention.js +0 -643
- package/dist/src/ruvector/flash-attention.js.map +0 -1
- package/dist/src/ruvector/moe-router.d.ts +0 -206
- package/dist/src/ruvector/moe-router.d.ts.map +0 -1
- package/dist/src/ruvector/moe-router.js +0 -626
- package/dist/src/ruvector/moe-router.js.map +0 -1
- package/dist/src/services/event-stream.d.ts +0 -25
- package/dist/src/services/event-stream.d.ts.map +0 -1
- package/dist/src/services/event-stream.js +0 -27
- package/dist/src/services/event-stream.js.map +0 -1
- package/dist/src/services/loop-worker-runner.d.ts +0 -16
- package/dist/src/services/loop-worker-runner.d.ts.map +0 -1
- package/dist/src/services/loop-worker-runner.js +0 -34
- package/dist/src/services/loop-worker-runner.js.map +0 -1
- package/dist/src/services/runtime-capabilities.d.ts +0 -22
- package/dist/src/services/runtime-capabilities.d.ts.map +0 -1
- package/dist/src/services/runtime-capabilities.js +0 -45
- package/dist/src/services/runtime-capabilities.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-stream.d.ts","sourceRoot":"","sources":["../../../src/services/event-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,IAAI,CAMzE;AAED,2DAA2D;AAC3D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG;IACjD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC3D,CAMA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NDJSON Event Stream for CLI --stream mode
|
|
3
|
-
*
|
|
4
|
-
* Emits newline-delimited JSON events to stdout for consumption
|
|
5
|
-
* by Claude Code's Monitor tool. Each event includes schema versioning.
|
|
6
|
-
*
|
|
7
|
-
* @see ADR-091: NDJSON event streaming infrastructure
|
|
8
|
-
*/
|
|
9
|
-
import { randomBytes } from 'crypto';
|
|
10
|
-
/** Generate a short unique run ID (e.g. run_m1abc_3f2a1b) */
|
|
11
|
-
export function createRunId() {
|
|
12
|
-
return `run_${Date.now().toString(36)}_${randomBytes(3).toString('hex')}`;
|
|
13
|
-
}
|
|
14
|
-
/** Write one NDJSON line to stdout with schema and timestamp auto-populated */
|
|
15
|
-
export function emitEvent(event) {
|
|
16
|
-
const full = Object.assign({ schema: 'ruflo.event.v1', ts: new Date().toISOString() }, event);
|
|
17
|
-
process.stdout.write(JSON.stringify(full) + '\n');
|
|
18
|
-
}
|
|
19
|
-
/** Convenience wrapper that binds a runId to an emitter */
|
|
20
|
-
export function createEventEmitter(runId) {
|
|
21
|
-
return {
|
|
22
|
-
emit(event, data) {
|
|
23
|
-
emitEvent({ runId, event, ...data });
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=event-stream.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-stream.js","sourceRoot":"","sources":["../../../src/services/event-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAWrC,6DAA6D;AAC7D,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;AAC5E,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,SAAS,CAAC,KAAyC;IACjE,MAAM,IAAI,GAAgB,MAAM,CAAC,MAAM,CACrC,EAAE,MAAM,EAAE,gBAAyB,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EACnE,KAAK,CACS,CAAC;IACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAG9C,OAAO;QACL,IAAI,CAAC,KAAa,EAAE,IAA8B;YAChD,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-091 Phase 2 -- Stateless Loop Worker Runner
|
|
3
|
-
*
|
|
4
|
-
* Designed for /loop execution: runs a single worker iteration and returns
|
|
5
|
-
* metadata that the caller can use with ScheduleWakeup.
|
|
6
|
-
*/
|
|
7
|
-
export interface LoopWorkerResult {
|
|
8
|
-
workerType: string;
|
|
9
|
-
success: boolean;
|
|
10
|
-
suggestedDelay: number;
|
|
11
|
-
reason: string;
|
|
12
|
-
loopPrompt: string;
|
|
13
|
-
metrics?: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
export declare function runLoopWorker(workerType: string): Promise<LoopWorkerResult>;
|
|
16
|
-
//# sourceMappingURL=loop-worker-runner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loop-worker-runner.d.ts","sourceRoot":"","sources":["../../../src/services/loop-worker-runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6BjF"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-091 Phase 2 -- Stateless Loop Worker Runner
|
|
3
|
-
*
|
|
4
|
-
* Designed for /loop execution: runs a single worker iteration and returns
|
|
5
|
-
* metadata that the caller can use with ScheduleWakeup.
|
|
6
|
-
*/
|
|
7
|
-
import { execSync } from 'child_process';
|
|
8
|
-
import { getCacheWarmDelay } from './runtime-capabilities.js';
|
|
9
|
-
export async function runLoopWorker(workerType) {
|
|
10
|
-
const startMs = Date.now();
|
|
11
|
-
let success = false;
|
|
12
|
-
let reason = '';
|
|
13
|
-
try {
|
|
14
|
-
const safeWorkerType = workerType.replace(/[^a-zA-Z0-9_-]/g, '');
|
|
15
|
-
const stdout = execSync(`npx @claude-flow/cli hooks worker dispatch --trigger ${safeWorkerType}`, { encoding: 'utf-8', timeout: 120_000, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
16
|
-
success = true;
|
|
17
|
-
reason = stdout.trim().slice(0, 200) || `${workerType} completed`;
|
|
18
|
-
}
|
|
19
|
-
catch (err) {
|
|
20
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
21
|
-
reason = `${workerType} failed: ${msg.slice(0, 200)}`;
|
|
22
|
-
}
|
|
23
|
-
const durationMs = Date.now() - startMs;
|
|
24
|
-
const suggestedDelay = getCacheWarmDelay();
|
|
25
|
-
return {
|
|
26
|
-
workerType,
|
|
27
|
-
success,
|
|
28
|
-
suggestedDelay,
|
|
29
|
-
reason,
|
|
30
|
-
loopPrompt: `Run ${workerType} worker and report results`,
|
|
31
|
-
metrics: { durationMs, timestamp: new Date().toISOString() },
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=loop-worker-runner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loop-worker-runner.js","sourceRoot":"","sources":["../../../src/services/loop-worker-runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAW9D,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,UAAkB;IACpD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,QAAQ,CACrB,wDAAwD,cAAc,EAAE,EACxE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAC3E,CAAC;QACF,OAAO,GAAG,IAAI,CAAC;QACf,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,UAAU,YAAY,CAAC;IACpE,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,MAAM,GAAG,GAAG,UAAU,YAAY,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IACxD,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE3C,OAAO;QACL,UAAU;QACV,OAAO;QACP,cAAc;QACd,MAAM;QACN,UAAU,EAAE,OAAO,UAAU,4BAA4B;QACzD,OAAO,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE;KAC7D,CAAC;AACJ,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-091 Phase 1 -- Runtime Capabilities Detection
|
|
3
|
-
*
|
|
4
|
-
* Detects the host environment and exposes which execution primitives are
|
|
5
|
-
* available so that higher-level services can choose the right path:
|
|
6
|
-
* 1. claude-code-native -- full Claude Code tooling (loop, monitor, cron, teams)
|
|
7
|
-
* 2. mcp-fallback -- MCP transport active but native tools missing
|
|
8
|
-
* 3. ci-daemon -- headless / CI, use detached daemon
|
|
9
|
-
*/
|
|
10
|
-
export interface RuntimeCapabilities {
|
|
11
|
-
loop: boolean;
|
|
12
|
-
monitor: boolean;
|
|
13
|
-
cron: boolean;
|
|
14
|
-
teams: boolean;
|
|
15
|
-
worktreeIsolation: boolean;
|
|
16
|
-
pushNotification: boolean;
|
|
17
|
-
}
|
|
18
|
-
export type RuntimeTier = 'claude-code-native' | 'mcp-fallback' | 'ci-daemon';
|
|
19
|
-
export declare function detectCapabilities(): RuntimeCapabilities;
|
|
20
|
-
export declare function getRuntimeTier(): RuntimeTier;
|
|
21
|
-
export declare function getCacheWarmDelay(providerCacheTtlSeconds?: number): number;
|
|
22
|
-
//# sourceMappingURL=runtime-capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-capabilities.d.ts","sourceRoot":"","sources":["../../../src/services/runtime-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,cAAc,GAAG,WAAW,CAAC;AAoB9E,wBAAgB,kBAAkB,IAAI,mBAAmB,CAYxD;AAED,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED,wBAAgB,iBAAiB,CAAC,uBAAuB,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1E"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-091 Phase 1 -- Runtime Capabilities Detection
|
|
3
|
-
*
|
|
4
|
-
* Detects the host environment and exposes which execution primitives are
|
|
5
|
-
* available so that higher-level services can choose the right path:
|
|
6
|
-
* 1. claude-code-native -- full Claude Code tooling (loop, monitor, cron, teams)
|
|
7
|
-
* 2. mcp-fallback -- MCP transport active but native tools missing
|
|
8
|
-
* 3. ci-daemon -- headless / CI, use detached daemon
|
|
9
|
-
*/
|
|
10
|
-
function isClaudeCodeNative() {
|
|
11
|
-
return !!(process.env.CLAUDE_CODE ||
|
|
12
|
-
process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS);
|
|
13
|
-
}
|
|
14
|
-
function isMcpTransportActive() {
|
|
15
|
-
return (!process.stdin.isTTY &&
|
|
16
|
-
process.env.CLAUDE_FLOW_MCP_TRANSPORT === 'stdio');
|
|
17
|
-
}
|
|
18
|
-
function isCiOrHeadless() {
|
|
19
|
-
return !!(process.env.CI || process.env.CLAUDE_FLOW_HEADLESS);
|
|
20
|
-
}
|
|
21
|
-
export function detectCapabilities() {
|
|
22
|
-
const native = isClaudeCodeNative();
|
|
23
|
-
const teamsEnabled = !!process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS;
|
|
24
|
-
return {
|
|
25
|
-
loop: native,
|
|
26
|
-
monitor: native,
|
|
27
|
-
cron: native,
|
|
28
|
-
teams: native && teamsEnabled,
|
|
29
|
-
worktreeIsolation: native,
|
|
30
|
-
pushNotification: native,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export function getRuntimeTier() {
|
|
34
|
-
if (isClaudeCodeNative())
|
|
35
|
-
return 'claude-code-native';
|
|
36
|
-
if (isMcpTransportActive())
|
|
37
|
-
return 'mcp-fallback';
|
|
38
|
-
if (isCiOrHeadless())
|
|
39
|
-
return 'ci-daemon';
|
|
40
|
-
return 'mcp-fallback';
|
|
41
|
-
}
|
|
42
|
-
export function getCacheWarmDelay(providerCacheTtlSeconds) {
|
|
43
|
-
return Math.min(270, (providerCacheTtlSeconds ?? 300) * 0.9);
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=runtime-capabilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-capabilities.js","sourceRoot":"","sources":["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