@claude-flow/cli 3.5.80 → 3.5.82

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.
@@ -2196,6 +2196,21 @@ export const hooksTrajectoryStart = {
2196
2196
  startedAt,
2197
2197
  };
2198
2198
  activeTrajectories.set(trajectoryId, trajectory);
2199
+ // Persist pending trajectory to disk so it survives MCP restarts
2200
+ const storeFn = await getRealStoreFunction();
2201
+ if (storeFn) {
2202
+ try {
2203
+ await storeFn({
2204
+ key: `trajectory-pending-${trajectoryId}`,
2205
+ value: JSON.stringify(trajectory),
2206
+ namespace: 'trajectories',
2207
+ tags: [agent, 'pending', 'sona-trajectory'],
2208
+ });
2209
+ }
2210
+ catch {
2211
+ // Best-effort persistence — trajectory still lives in-memory
2212
+ }
2213
+ }
2199
2214
  return {
2200
2215
  trajectoryId,
2201
2216
  task,
@@ -2607,8 +2622,19 @@ export const hooksIntelligenceStats = {
2607
2622
  const moe = await getMoERouter();
2608
2623
  const flash = await getFlashAttention();
2609
2624
  const lora = await getLoRAAdapter();
2610
- // Fallback to memory store for legacy data
2611
- const memoryStats = getIntelligenceStatsFromMemory();
2625
+ // Fallback to memory store for legacy data (may not exist yet)
2626
+ let memoryStats;
2627
+ try {
2628
+ memoryStats = getIntelligenceStatsFromMemory();
2629
+ }
2630
+ catch {
2631
+ memoryStats = {
2632
+ trajectories: { total: 0, successful: 0 },
2633
+ patterns: { learned: 0, categories: {} },
2634
+ memory: { indexSize: 0, totalAccessCount: 0, memorySizeBytes: 0 },
2635
+ routing: { decisions: 0, avgConfidence: 0 },
2636
+ };
2637
+ }
2612
2638
  // SONA stats from real implementation
2613
2639
  let sonaStats = {
2614
2640
  trajectoriesTotal: memoryStats.trajectories.total,
@@ -3304,26 +3330,7 @@ export const hooksWorkerDispatch = {
3304
3330
  startedAt: new Date(),
3305
3331
  };
3306
3332
  activeWorkers.set(workerId, worker);
3307
- // Update worker progress in background
3308
- if (background) {
3309
- setTimeout(() => {
3310
- const w = activeWorkers.get(workerId);
3311
- if (w) {
3312
- w.progress = 50;
3313
- w.phase = 'processing';
3314
- }
3315
- }, 500);
3316
- setTimeout(() => {
3317
- const w = activeWorkers.get(workerId);
3318
- if (w) {
3319
- w.progress = 100;
3320
- w.phase = 'completed';
3321
- w.status = 'completed';
3322
- w.completedAt = new Date();
3323
- }
3324
- }, 1500);
3325
- }
3326
- else {
3333
+ if (!background) {
3327
3334
  worker.progress = 100;
3328
3335
  worker.phase = 'completed';
3329
3336
  worker.status = 'completed';
@@ -3340,8 +3347,9 @@ export const hooksWorkerDispatch = {
3340
3347
  estimatedDuration: config.estimatedDuration,
3341
3348
  capabilities: config.capabilities,
3342
3349
  },
3343
- status: background ? 'dispatched' : 'completed',
3350
+ status: background ? 'scheduled' : 'completed',
3344
3351
  background,
3352
+ note: background ? 'Worker scheduled. Use hooks_worker-status to check progress. Start the daemon (daemon start) for real background execution.' : undefined,
3345
3353
  timestamp: new Date().toISOString(),
3346
3354
  };
3347
3355
  },