@claude-flow/cli 3.33.0 → 3.35.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 (49) hide show
  1. package/.claude/.proven-config-version +1 -0
  2. package/.claude/helpers/.helpers-version +1 -1
  3. package/.claude/helpers/helpers.manifest.json +2 -2
  4. package/.claude/helpers/statusline.cjs +0 -0
  5. package/.claude/proven-config.json +42 -0
  6. package/catalog-manifest.json +2 -2
  7. package/dist/src/commands/agent.js +2 -1
  8. package/dist/src/commands/agntcy/index.d.ts +64 -0
  9. package/dist/src/commands/agntcy/index.js +64 -0
  10. package/dist/src/commands/agntcy/publish.d.ts +43 -0
  11. package/dist/src/commands/agntcy/publish.js +121 -0
  12. package/dist/src/commands/agntcy/runtime.d.ts +90 -0
  13. package/dist/src/commands/agntcy/runtime.js +115 -0
  14. package/dist/src/commands/agntcy/swarm-join.d.ts +28 -0
  15. package/dist/src/commands/agntcy/swarm-join.js +85 -0
  16. package/dist/src/commands/agntcy/transport.d.ts +24 -0
  17. package/dist/src/commands/agntcy/transport.js +95 -0
  18. package/dist/src/commands/daemon.js +12 -7
  19. package/dist/src/commands/doctor.js +72 -1
  20. package/dist/src/commands/index.d.ts +1 -0
  21. package/dist/src/commands/index.js +5 -0
  22. package/dist/src/commands/metaharness.js +37 -2
  23. package/dist/src/commands/swarm.js +2 -1
  24. package/dist/src/log-filters.d.ts +3 -3
  25. package/dist/src/mcp-tools/metaharness-tools.js +35 -2
  26. package/dist/src/memory/memory-bridge.d.ts +25 -0
  27. package/dist/src/memory/memory-bridge.js +61 -8
  28. package/dist/src/memory/memory-initializer.d.ts +9 -3
  29. package/dist/src/memory/memory-initializer.js +344 -277
  30. package/dist/src/services/daemon-autostart.d.ts +31 -3
  31. package/dist/src/services/daemon-autostart.js +45 -3
  32. package/dist/src/services/distill-oracle.d.ts +1 -1
  33. package/dist/src/services/distill-oracle.js +2 -2
  34. package/dist/src/services/evolve-proof.d.ts +40 -1
  35. package/dist/src/services/evolve-proof.js +76 -14
  36. package/dist/src/services/flywheel-receipt.d.ts +15 -0
  37. package/dist/src/services/flywheel-receipt.js +22 -0
  38. package/dist/src/services/flywheel-sequential-evidence.d.ts +102 -0
  39. package/dist/src/services/flywheel-sequential-evidence.js +148 -0
  40. package/dist/src/services/flywheel-transaction.d.ts +71 -0
  41. package/dist/src/services/flywheel-transaction.js +121 -0
  42. package/dist/src/services/harness-flywheel-generations.d.ts +14 -0
  43. package/dist/src/services/harness-flywheel-generations.js +76 -4
  44. package/dist/src/services/harness-flywheel.d.ts +13 -0
  45. package/dist/src/services/harness-flywheel.js +31 -1
  46. package/node_modules/@claude-flow/codex/dist/cli.js +0 -0
  47. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +0 -0
  48. package/package.json +5 -9
  49. package/plugins/ruflo-metaharness/scripts/smoke.sh +4 -2
@@ -2392,7 +2392,18 @@ export async function bridgeHealthCheck(dbPath) {
2392
2392
  const s = cache.stats();
2393
2393
  cacheStats = { size: s.size ?? 0, hits: s.hits ?? 0, misses: s.misses ?? 0 };
2394
2394
  }
2395
- return { available: true, controllers, attestationCount, cacheStats };
2395
+ // #2887: cacheStats alone let a "successful" hierarchical-store coexist
2396
+ // with an empty store. Report the backing table's real row count so the
2397
+ // inconsistency is visible instead of inferred.
2398
+ let hierarchicalMemory;
2399
+ const hm = registry.get('hierarchicalMemory');
2400
+ if (hm) {
2401
+ hierarchicalMemory = {
2402
+ ...describeHierarchicalStore(hm, getHierarchicalFallback(registry)),
2403
+ persistedRows: typeof hm.countPersisted === 'function' ? hm.countPersisted() : null,
2404
+ };
2405
+ }
2406
+ return { available: true, controllers, attestationCount, cacheStats, hierarchicalMemory };
2396
2407
  }
2397
2408
  catch {
2398
2409
  return null;
@@ -2417,6 +2428,34 @@ export async function bridgeHealthCheck(dbPath) {
2417
2428
  * temporal fields are stored in metadata, and supersede is reported as
2418
2429
  * unsupported (no public update API) rather than silently dropped.
2419
2430
  */
2431
+ /**
2432
+ * Describe which store `agentdb_hierarchical-*` actually landed on and
2433
+ * whether its writes survive the process (#2887).
2434
+ *
2435
+ * agentdb removed its `HierarchicalMemory` export at 3.0.0-alpha.17, so the
2436
+ * @claude-flow/memory TieredMemoryStore fallback is the live path. It is only
2437
+ * durable when it was handed a SQLite connection — callers must not report a
2438
+ * volatile write as a success.
2439
+ */
2440
+ export function describeHierarchicalStore(hm, fallback) {
2441
+ // Only the tiered fallback exposes isDurable(); the native controller
2442
+ // (should agentdb reintroduce it) writes to agentdb's own tables.
2443
+ if (typeof hm?.isDurable !== 'function') {
2444
+ return { controller: 'hierarchicalMemory', durable: true, persistence: 'agentdb' };
2445
+ }
2446
+ return {
2447
+ controller: 'tieredMemoryStore',
2448
+ fallbackFrom: fallback?.reason ?? 'hierarchicalMemory',
2449
+ durable: hm.isDurable() === true,
2450
+ persistence: typeof hm.getPersistence === 'function' ? hm.getPersistence() : 'unknown',
2451
+ };
2452
+ }
2453
+ /** Read `getHierarchicalFallback()` off a registry that may predate it. */
2454
+ function getHierarchicalFallback(registry) {
2455
+ return typeof registry?.getHierarchicalFallback === 'function'
2456
+ ? registry.getHierarchicalFallback()
2457
+ : null;
2458
+ }
2420
2459
  export async function bridgeHierarchicalStore(params) {
2421
2460
  const registry = await getRegistry();
2422
2461
  if (!registry)
@@ -2439,7 +2478,10 @@ export async function bridgeHierarchicalStore(params) {
2439
2478
  metadata,
2440
2479
  tags: [params.key],
2441
2480
  });
2442
- const result = { success: true, id, key: params.key, tier };
2481
+ const result = {
2482
+ success: true, id, key: params.key, tier,
2483
+ controller: 'hierarchicalMemory', durable: true, persistence: 'agentdb',
2484
+ };
2443
2485
  if (params.supersedes) {
2444
2486
  // No public update/invalidate API on agentdb HierarchicalMemory —
2445
2487
  // surface the limitation honestly instead of silently dropping it.
@@ -2448,17 +2490,28 @@ export async function bridgeHierarchicalStore(params) {
2448
2490
  }
2449
2491
  return result;
2450
2492
  }
2451
- // TieredMemoryStore fallback (temporal-aware) / legacy stub
2493
+ // TieredMemoryStore fallback (temporal-aware) / legacy stub.
2494
+ // agentdb dropped its HierarchicalMemory export at 3.0.0-alpha.17, so
2495
+ // this is the live path — and it is only trustworthy when the store is
2496
+ // backed by SQLite. A volatile write must NOT report success (#2887).
2452
2497
  const storeResult = hm.store(params.key, params.value, tier, {
2453
2498
  validFrom: params.validFrom,
2454
2499
  validUntil: params.validUntil,
2455
2500
  supersedes: params.supersedes,
2456
2501
  });
2457
- if (storeResult && typeof storeResult === 'object') {
2458
- return { success: true, ...storeResult };
2502
+ const info = describeHierarchicalStore(hm, getHierarchicalFallback(registry));
2503
+ const base = {
2504
+ ...info,
2505
+ ...(storeResult && typeof storeResult === 'object' ? storeResult : { key: params.key, tier }),
2506
+ };
2507
+ if (!info.durable) {
2508
+ return {
2509
+ ...base,
2510
+ success: false,
2511
+ error: `hierarchical-store is running on the ${info.persistence} tiered fallback (${info.fallbackFrom}); the entry is NOT persisted to disk and will be lost when this process exits. Use memory_store for durable key-value persistence.`,
2512
+ };
2459
2513
  }
2460
- // Legacy stub (returns void) — temporal options were ignored
2461
- return { success: true, key: params.key, tier };
2514
+ return { success: true, ...base };
2462
2515
  }
2463
2516
  catch (e) {
2464
2517
  return { success: false, error: e.message };
@@ -2523,7 +2576,7 @@ export async function bridgeHierarchicalRecall(params) {
2523
2576
  const filtered = params.tier
2524
2577
  ? results.filter((r) => r.tier === params.tier)
2525
2578
  : results;
2526
- return { results: filtered, controller: 'hierarchicalMemory' };
2579
+ return { results: filtered, ...describeHierarchicalStore(hm, getHierarchicalFallback(registry)) };
2527
2580
  }
2528
2581
  catch (e) {
2529
2582
  return { results: [], error: e.message };
@@ -547,9 +547,15 @@ export declare function deleteEntry(options: {
547
547
  }>;
548
548
  /**
549
549
  * Advisory O_EXCL lock scoped to a single memory.db file (`<dbPath>.lock`),
550
- * same stale-takeover pattern as services/global-ai-budget.ts. Only
551
- * meaningful between callers that opt into it (purgeNamespace does); it
552
- * cannot coordinate against writers that don't call this helper.
550
+ * same stale-takeover pattern as services/global-ai-budget.ts.
551
+ *
552
+ * #2878: sql.js persists by rewriting the whole database image, so every
553
+ * `load → mutate → export → write` sequence is a read-modify-write that a
554
+ * concurrent writer can clobber — both callers report success and the loser's
555
+ * rows vanish, with `PRAGMA integrity_check` still clean. Every such sequence
556
+ * in this module now runs inside this lock. It is advisory, so it still
557
+ * cannot coordinate against a writer that bypasses this module entirely
558
+ * (a native WAL connection — see hasNativeWalSidecars).
553
559
  */
554
560
  export declare function withMemoryDbLock<T>(dbPath: string, fn: () => Promise<T> | T): Promise<T>;
555
561
  export declare function purgeNamespace(options: {