claude-flow 3.7.0-alpha.1 → 3.7.0-alpha.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "3.7.0-alpha.1",
3
+ "version": "3.7.0-alpha.4",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -232,8 +232,14 @@ async function startBackgroundDaemon(projectRoot, quiet, maxCpuLoad, minFreeMemo
232
232
  const isWin = process.platform === 'win32';
233
233
  const forkOpts = {
234
234
  cwd: resolvedRoot,
235
- // detached is POSIX-only; on Windows we rely on windowsHide
236
- detached: !isWin,
235
+ // detached: true on every platform (#1766). On Windows, leaving detached:false
236
+ // kept the child in the parent's process group AND the IPC pipe held the
237
+ // child to npx — when npx exited, the IPC pipe tore down and the daemon
238
+ // died within ~1s. detached:true + child.disconnect() (below) gives the
239
+ // child its own session/pgid and breaks the IPC pipe so the daemon
240
+ // genuinely survives parent exit. On POSIX, detached:true was already the
241
+ // path; this just makes Windows match.
242
+ detached: true,
237
243
  // Use 'ignore' for all stdio + 'ignore' for the IPC channel via silent:true off.
238
244
  // fork() defaults to creating an IPC channel; we don't need it here, so we
239
245
  // pass stdio explicitly. Passing fs.openSync() FDs causes the child to die
@@ -268,8 +274,18 @@ async function startBackgroundDaemon(projectRoot, quiet, maxCpuLoad, minFreeMemo
268
274
  return { success: false, exitCode: 1 };
269
275
  }
270
276
  // Unref BEFORE writing PID file — prevents race where parent exits
271
- // but child hasn't fully detached yet (fixes macOS daemon death #1283)
277
+ // but child hasn't fully detached yet (fixes macOS daemon death #1283).
272
278
  child.unref();
279
+ // #1766: also break the IPC pipe explicitly. unref() releases the libuv
280
+ // handle but does NOT close the IPC channel; on Windows the open IPC
281
+ // pipe keeps the daemon tied to its parent npx, and when npx exits the
282
+ // pipe is torn down and the daemon exits with it. disconnect() severs
283
+ // the IPC pipe so the daemon truly stands on its own. Wrapped in try
284
+ // because disconnect() throws if the IPC channel is already gone.
285
+ try {
286
+ child.disconnect();
287
+ }
288
+ catch { /* IPC channel already closed */ }
273
289
  // Longer delay to let the child process start and write its own PID file.
274
290
  // 100ms was too short on Windows; the child's checkExistingDaemon() would
275
291
  // find the parent-written PID and return early (#1478 Bug 1).
@@ -662,7 +662,19 @@ export const neuralTools = [
662
662
  features: {
663
663
  hnsw: true,
664
664
  quantization: true,
665
- flashAttention: false,
665
+ // #1770: probe the real loader instead of returning a literal false.
666
+ // Was hardcoded false, which contradicted hooks_intelligence_stats's
667
+ // simultaneous claim of `implementation: real-flash-attention`.
668
+ // The two surfaces now agree on a single source of truth.
669
+ flashAttention: await (async () => {
670
+ try {
671
+ const { getFlashAttention } = await import('../ruvector/flash-attention.js');
672
+ return getFlashAttention() !== null;
673
+ }
674
+ catch {
675
+ return false;
676
+ }
677
+ })(),
666
678
  reasoningBank: true,
667
679
  },
668
680
  };
@@ -12,6 +12,7 @@
12
12
  */
13
13
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
14
14
  import { homedir } from 'node:os';
15
+ import { createRequire } from 'node:module';
15
16
  import { join } from 'node:path';
16
17
  // ============================================================================
17
18
  // Persistence Configuration
@@ -563,21 +564,37 @@ class LocalReasoningBank {
563
564
  // ============================================================================
564
565
  let ruvllmCoordinator = null;
565
566
  let ruvllmLoaded = false;
566
- async function loadRuvllmCoordinator() {
567
+ /**
568
+ * Synchronously load the @ruvector/ruvllm SonaCoordinator. Used both by the
569
+ * async init path (initializeIntelligence) and by sync stat readers like
570
+ * getIntelligenceStats — the dashboard would otherwise report "unavailable"
571
+ * when stats are queried before any async init has fired (#1770).
572
+ */
573
+ function loadRuvllmCoordinatorSync() {
567
574
  if (ruvllmLoaded)
568
575
  return ruvllmCoordinator;
569
576
  ruvllmLoaded = true;
570
577
  try {
571
- const { createRequire } = await import('module');
572
578
  const requireCjs = createRequire(import.meta.url);
573
579
  const ruvllm = requireCjs('@ruvector/ruvllm');
574
580
  ruvllmCoordinator = new ruvllm.SonaCoordinator(ruvllm.DEFAULT_SONA_CONFIG);
575
581
  return ruvllmCoordinator;
576
582
  }
577
- catch {
583
+ catch (err) {
584
+ // Surface the reason on debug builds so future regressions of #1770 don't
585
+ // disappear silently. Stays quiet by default to avoid noise on the cli's
586
+ // hot path (e.g., npx invocations).
587
+ if (process.env.CLAUDE_FLOW_DEBUG) {
588
+ // eslint-disable-next-line no-console
589
+ console.error('[ruvllm] SonaCoordinator load failed, falling back to JS:', err.message);
590
+ }
591
+ ruvllmCoordinator = null;
578
592
  return null;
579
593
  }
580
594
  }
595
+ async function loadRuvllmCoordinator() {
596
+ return loadRuvllmCoordinatorSync();
597
+ }
581
598
  // ============================================================================
582
599
  // Module State
583
600
  // ============================================================================
@@ -879,6 +896,14 @@ export async function findSimilarPatterns(query, options) {
879
896
  export function getIntelligenceStats() {
880
897
  const sonaStats = sonaCoordinator?.stats();
881
898
  const bankStats = reasoningBank?.stats();
899
+ // Lazy-init the ruvllm coordinator if it hasn't been loaded yet. The MCP
900
+ // dashboard (`hooks_intelligence_stats`) hits this path before any
901
+ // initializeIntelligence() call has fired, so the coordinator field would
902
+ // otherwise stay null and the dashboard would report "unavailable" even
903
+ // when @ruvector/ruvllm is fully resolvable. Sync require — cheap, idempotent.
904
+ if (!ruvllmLoaded) {
905
+ loadRuvllmCoordinatorSync();
906
+ }
882
907
  const ruvllmStats = ruvllmCoordinator?.stats?.() || null;
883
908
  // Fetch cross-module stats for unified reporting
884
909
  let contrastiveTrainer = 'unavailable';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.7.0-alpha.1",
3
+ "version": "3.7.0-alpha.4",
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",