@claude-flow/cli 3.10.15 → 3.10.17

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.
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/hooks-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,YAAY,CAAC;AAiBzD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASzD;AAwqBD,eAAO,MAAM,YAAY,EAAE,OAwC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OA+C3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OA6C7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAuD9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAgLxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAoE1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OA8CvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OA2F1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAuK3B,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,OA4E1B,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,OA4K3B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,OAoE9B,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,OA+E3B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAuI/B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,OAuF7B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,OAyCjC,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,OA+BzB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,OAsCvB,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAkI/B,CAAC;AA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O,MAAM,sBAAsB,EAAE,OAgNpC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,OAiGpC,CAAC;AAGF,eAAO,MAAM,0BAA0B,EAAE,OA8MxC,CAAC;AAgQF,eAAO,MAAM,eAAe,EAAE,OA8C7B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,OAwIjC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAuD/B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAkE/B,CAAC;AAiBF,eAAO,MAAM,eAAe,EAAE,OA4C7B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAgC/B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,OAuB7B,CAAC;AAeF,eAAO,MAAM,YAAY,EAAE,OAmI1B,CAAC;AAqBF,eAAO,MAAM,iBAAiB,EAAE,OA0C/B,CAAC;AAOF,eAAO,MAAM,iBAAiB,EAAE,OAwB/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAoFhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,OAc3C,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAAO,EA6C/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -673,17 +673,41 @@ export const hooksPostEdit = {
673
673
  catch {
674
674
  // Bridge not available — continue with basic response
675
675
  }
676
+ // #2245 Round B — also feed the trajectory pipeline so globalStats
677
+ // (and the unified-stats aggregator in ADR-075) reflects the activity.
678
+ // Synthesises a one-step trajectory from the edit outcome.
679
+ let learningPath = 'recorded-only';
680
+ let trajectoriesDelta = 0;
681
+ try {
682
+ const intel = await import('../memory/intelligence.js');
683
+ const before = intel.getIntelligenceStats().trajectoriesRecorded;
684
+ await intel.recordTrajectory([{
685
+ type: 'action',
686
+ content: `Edit ${filePath}${agent ? ` by ${agent}` : ''}: ${success ? 'success' : 'failure'}`,
687
+ metadata: { hook: 'post-edit', filePath, agent, success },
688
+ timestamp: Date.now(),
689
+ }], success ? 'success' : 'failure');
690
+ trajectoriesDelta = intel.getIntelligenceStats().trajectoriesRecorded - before;
691
+ if (trajectoriesDelta > 0)
692
+ learningPath = 'trajectory-pipeline';
693
+ }
694
+ catch { /* intelligence module not yet initialised — keep recorded-only */ }
676
695
  return {
677
696
  recorded: true,
678
697
  filePath,
679
698
  success,
680
699
  timestamp: new Date().toISOString(),
681
700
  learningUpdate: success ? 'pattern_reinforced' : 'pattern_adjusted',
701
+ learningPath, // ADR-074 / ADR-075 — honest path naming
702
+ trajectoriesDelta,
682
703
  feedback: feedbackResult ? {
683
704
  recorded: feedbackResult.success,
684
705
  controller: feedbackResult.controller,
685
706
  updates: feedbackResult.updated,
686
707
  } : { recorded: false, controller: 'unavailable', updates: 0 },
708
+ note: learningPath === 'trajectory-pipeline'
709
+ ? `Edit outcome fed to the SONA + EWC++ trajectory pipeline (trajectoriesRecorded +${trajectoriesDelta}).`
710
+ : 'Edit outcome stored via memory-bridge only; the trajectory pipeline was not reachable in this process.',
687
711
  };
688
712
  },
689
713
  };
@@ -782,6 +806,24 @@ export const hooksPostCommand = {
782
806
  }
783
807
  catch { /* non-critical */ }
784
808
  }
809
+ // #2245 Round B — feed the trajectory pipeline so globalStats reflects
810
+ // command outcomes alongside the AgentDB entry that already gets written.
811
+ let learningPath = 'recorded-only';
812
+ let trajectoriesDelta = 0;
813
+ try {
814
+ const intel = await import('../memory/intelligence.js');
815
+ const before = intel.getIntelligenceStats().trajectoriesRecorded;
816
+ await intel.recordTrajectory([{
817
+ type: 'action',
818
+ content: `Command \`${command.slice(0, 200)}\` exited ${exitCode} (${success ? 'success' : 'failure'})`,
819
+ metadata: { hook: 'post-command', command: command.slice(0, 500), exitCode, success },
820
+ timestamp: Date.now(),
821
+ }], success ? 'success' : 'failure');
822
+ trajectoriesDelta = intel.getIntelligenceStats().trajectoriesRecorded - before;
823
+ if (trajectoriesDelta > 0)
824
+ learningPath = 'trajectory-pipeline';
825
+ }
826
+ catch { /* intelligence module not yet initialised — keep recorded-only */ }
785
827
  return {
786
828
  recorded: _storedIn !== 'none',
787
829
  command,
@@ -789,6 +831,11 @@ export const hooksPostCommand = {
789
831
  success,
790
832
  timestamp: new Date().toISOString(),
791
833
  _storedIn,
834
+ learningPath, // 'trajectory-pipeline' | 'recorded-only'
835
+ trajectoriesDelta,
836
+ note: learningPath === 'trajectory-pipeline'
837
+ ? `Command outcome fed to the SONA + EWC++ trajectory pipeline (trajectoriesRecorded +${trajectoriesDelta}).`
838
+ : `Command outcome stored via ${_storedIn}; the trajectory pipeline was not reachable in this process.`,
792
839
  };
793
840
  },
794
841
  };
@@ -2575,6 +2622,27 @@ export const hooksTrajectoryEnd = {
2575
2622
  }
2576
2623
  }
2577
2624
  }
2625
+ // #2245 Round B — also bump globalStats so the trajectory-end MCP path
2626
+ // shows up in `hooks_intelligence_unified-stats.global.*` (was only
2627
+ // touching sonaCoordinator before — the "MCP trajectory tools feed sona,
2628
+ // not globalStats" gap from ADR-075). Maps the recorded steps to the
2629
+ // intelligence-module TrajectoryStep shape and runs them through the
2630
+ // canonical recordTrajectory() entry point.
2631
+ let globalStatsDelta = 0;
2632
+ if (trajectory && trajectory.steps && trajectory.steps.length > 0) {
2633
+ try {
2634
+ const intel = await import('../memory/intelligence.js');
2635
+ const before = intel.getIntelligenceStats();
2636
+ await intel.recordTrajectory(trajectory.steps.map((s) => ({
2637
+ type: s.type ?? 'action',
2638
+ content: String(s.content ?? `${s.action ?? ''} → ${s.result ?? ''}`).slice(0, 4096),
2639
+ timestamp: Date.now(),
2640
+ })), success ? 'success' : 'failure');
2641
+ const after = intel.getIntelligenceStats();
2642
+ globalStatsDelta = after.trajectoriesRecorded - before.trajectoriesRecorded;
2643
+ }
2644
+ catch { /* intelligence module not loadable — keep sona-only behaviour */ }
2645
+ }
2578
2646
  const learningTimeMs = Date.now() - startTime;
2579
2647
  return {
2580
2648
  trajectoryId,
@@ -2590,6 +2658,7 @@ export const hooksTrajectoryEnd = {
2590
2658
  ewcPenalty: ewcResult.penalty || undefined,
2591
2659
  patternsExtracted: trajectory?.steps.length || 0,
2592
2660
  learningTimeMs,
2661
+ globalStatsTrajectoriesDelta: globalStatsDelta, // Round B: was 0, now reflects
2593
2662
  },
2594
2663
  trajectory: trajectory ? {
2595
2664
  task: trajectory.task,