@pcircle/claude-code-buddy-mcp 2.3.1

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 (709) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +599 -0
  3. package/README.zh-TW.md +577 -0
  4. package/dist/__benchmarks__/performance-fixes.bench.d.ts +8 -0
  5. package/dist/__benchmarks__/performance-fixes.bench.d.ts.map +1 -0
  6. package/dist/__benchmarks__/performance-fixes.bench.js +213 -0
  7. package/dist/__benchmarks__/performance-fixes.bench.js.map +1 -0
  8. package/dist/agents/DevelopmentButler.d.ts +80 -0
  9. package/dist/agents/DevelopmentButler.d.ts.map +1 -0
  10. package/dist/agents/DevelopmentButler.js +328 -0
  11. package/dist/agents/DevelopmentButler.js.map +1 -0
  12. package/dist/agents/E2EHealingAgent.d.ts +30 -0
  13. package/dist/agents/E2EHealingAgent.d.ts.map +1 -0
  14. package/dist/agents/E2EHealingAgent.js +162 -0
  15. package/dist/agents/E2EHealingAgent.js.map +1 -0
  16. package/dist/agents/TestWriterAgent.d.ts +26 -0
  17. package/dist/agents/TestWriterAgent.d.ts.map +1 -0
  18. package/dist/agents/TestWriterAgent.js +139 -0
  19. package/dist/agents/TestWriterAgent.js.map +1 -0
  20. package/dist/agents/base/AgentExecutor.d.ts +7 -0
  21. package/dist/agents/base/AgentExecutor.d.ts.map +1 -0
  22. package/dist/agents/base/AgentExecutor.js +13 -0
  23. package/dist/agents/base/AgentExecutor.js.map +1 -0
  24. package/dist/agents/base/index.d.ts +2 -0
  25. package/dist/agents/base/index.d.ts.map +1 -0
  26. package/dist/agents/base/index.js +2 -0
  27. package/dist/agents/base/index.js.map +1 -0
  28. package/dist/agents/e2e-healing/analyzers/EvidenceCollector.d.ts +24 -0
  29. package/dist/agents/e2e-healing/analyzers/EvidenceCollector.d.ts.map +1 -0
  30. package/dist/agents/e2e-healing/analyzers/EvidenceCollector.js +55 -0
  31. package/dist/agents/e2e-healing/analyzers/EvidenceCollector.js.map +1 -0
  32. package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.d.ts +22 -0
  33. package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.d.ts.map +1 -0
  34. package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.js +36 -0
  35. package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.js.map +1 -0
  36. package/dist/agents/e2e-healing/config.d.ts +4 -0
  37. package/dist/agents/e2e-healing/config.d.ts.map +1 -0
  38. package/dist/agents/e2e-healing/config.js +28 -0
  39. package/dist/agents/e2e-healing/config.js.map +1 -0
  40. package/dist/agents/e2e-healing/generators/FixGenerator.d.ts +21 -0
  41. package/dist/agents/e2e-healing/generators/FixGenerator.d.ts.map +1 -0
  42. package/dist/agents/e2e-healing/generators/FixGenerator.js +33 -0
  43. package/dist/agents/e2e-healing/generators/FixGenerator.js.map +1 -0
  44. package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.d.ts +29 -0
  45. package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.d.ts.map +1 -0
  46. package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.js +70 -0
  47. package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.js.map +1 -0
  48. package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.d.ts +30 -0
  49. package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.d.ts.map +1 -0
  50. package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.js +115 -0
  51. package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.js.map +1 -0
  52. package/dist/agents/e2e-healing/runners/PlaywrightRunner.d.ts +19 -0
  53. package/dist/agents/e2e-healing/runners/PlaywrightRunner.d.ts.map +1 -0
  54. package/dist/agents/e2e-healing/runners/PlaywrightRunner.js +79 -0
  55. package/dist/agents/e2e-healing/runners/PlaywrightRunner.js.map +1 -0
  56. package/dist/agents/e2e-healing/safety/CircuitBreaker.d.ts +26 -0
  57. package/dist/agents/e2e-healing/safety/CircuitBreaker.d.ts.map +1 -0
  58. package/dist/agents/e2e-healing/safety/CircuitBreaker.js +75 -0
  59. package/dist/agents/e2e-healing/safety/CircuitBreaker.js.map +1 -0
  60. package/dist/agents/e2e-healing/safety/RollbackManager.d.ts +31 -0
  61. package/dist/agents/e2e-healing/safety/RollbackManager.d.ts.map +1 -0
  62. package/dist/agents/e2e-healing/safety/RollbackManager.js +130 -0
  63. package/dist/agents/e2e-healing/safety/RollbackManager.js.map +1 -0
  64. package/dist/agents/e2e-healing/safety/SafetyGate.d.ts +21 -0
  65. package/dist/agents/e2e-healing/safety/SafetyGate.d.ts.map +1 -0
  66. package/dist/agents/e2e-healing/safety/SafetyGate.js +62 -0
  67. package/dist/agents/e2e-healing/safety/SafetyGate.js.map +1 -0
  68. package/dist/agents/e2e-healing/safety/ScopeLimiter.d.ts +14 -0
  69. package/dist/agents/e2e-healing/safety/ScopeLimiter.d.ts.map +1 -0
  70. package/dist/agents/e2e-healing/safety/ScopeLimiter.js +36 -0
  71. package/dist/agents/e2e-healing/safety/ScopeLimiter.js.map +1 -0
  72. package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.d.ts +29 -0
  73. package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.d.ts.map +1 -0
  74. package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.js +86 -0
  75. package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.js.map +1 -0
  76. package/dist/agents/e2e-healing/types.d.ts +46 -0
  77. package/dist/agents/e2e-healing/types.d.ts.map +1 -0
  78. package/dist/agents/e2e-healing/types.js +2 -0
  79. package/dist/agents/e2e-healing/types.js.map +1 -0
  80. package/dist/agents/knowledge/KnowledgeGraph.d.ts +26 -0
  81. package/dist/agents/knowledge/KnowledgeGraph.d.ts.map +1 -0
  82. package/dist/agents/knowledge/KnowledgeGraph.js +106 -0
  83. package/dist/agents/knowledge/KnowledgeGraph.js.map +1 -0
  84. package/dist/agents/knowledge/KnowledgeGraphSQLite.d.ts +42 -0
  85. package/dist/agents/knowledge/KnowledgeGraphSQLite.d.ts.map +1 -0
  86. package/dist/agents/knowledge/KnowledgeGraphSQLite.js +349 -0
  87. package/dist/agents/knowledge/KnowledgeGraphSQLite.js.map +1 -0
  88. package/dist/agents/knowledge/index.d.ts +94 -0
  89. package/dist/agents/knowledge/index.d.ts.map +1 -0
  90. package/dist/agents/knowledge/index.js +296 -0
  91. package/dist/agents/knowledge/index.js.map +1 -0
  92. package/dist/agents/knowledge/storage/KnowledgeGraphStore.d.ts +25 -0
  93. package/dist/agents/knowledge/storage/KnowledgeGraphStore.d.ts.map +1 -0
  94. package/dist/agents/knowledge/storage/KnowledgeGraphStore.js +342 -0
  95. package/dist/agents/knowledge/storage/KnowledgeGraphStore.js.map +1 -0
  96. package/dist/agents/knowledge/types.d.ts +21 -0
  97. package/dist/agents/knowledge/types.d.ts.map +1 -0
  98. package/dist/agents/knowledge/types.js +2 -0
  99. package/dist/agents/knowledge/types.js.map +1 -0
  100. package/dist/agents/templates/ci-templates.d.ts +8 -0
  101. package/dist/agents/templates/ci-templates.d.ts.map +1 -0
  102. package/dist/agents/templates/ci-templates.js +119 -0
  103. package/dist/agents/templates/ci-templates.js.map +1 -0
  104. package/dist/agents/templates/test-templates.d.ts +18 -0
  105. package/dist/agents/templates/test-templates.d.ts.map +1 -0
  106. package/dist/agents/templates/test-templates.js +22 -0
  107. package/dist/agents/templates/test-templates.js.map +1 -0
  108. package/dist/config/index.d.ts +51 -0
  109. package/dist/config/index.d.ts.map +1 -0
  110. package/dist/config/index.js +96 -0
  111. package/dist/config/index.js.map +1 -0
  112. package/dist/config/models.d.ts +47 -0
  113. package/dist/config/models.d.ts.map +1 -0
  114. package/dist/config/models.js +57 -0
  115. package/dist/config/models.js.map +1 -0
  116. package/dist/config/simple-config.d.ts +32 -0
  117. package/dist/config/simple-config.d.ts.map +1 -0
  118. package/dist/config/simple-config.js +225 -0
  119. package/dist/config/simple-config.js.map +1 -0
  120. package/dist/core/AgentRegistry.d.ts +32 -0
  121. package/dist/core/AgentRegistry.d.ts.map +1 -0
  122. package/dist/core/AgentRegistry.js +281 -0
  123. package/dist/core/AgentRegistry.js.map +1 -0
  124. package/dist/core/BackgroundExecutor.d.ts +56 -0
  125. package/dist/core/BackgroundExecutor.d.ts.map +1 -0
  126. package/dist/core/BackgroundExecutor.js +492 -0
  127. package/dist/core/BackgroundExecutor.js.map +1 -0
  128. package/dist/core/BackgroundExecutorConstants.d.ts +8 -0
  129. package/dist/core/BackgroundExecutorConstants.d.ts.map +1 -0
  130. package/dist/core/BackgroundExecutorConstants.js +8 -0
  131. package/dist/core/BackgroundExecutorConstants.js.map +1 -0
  132. package/dist/core/CheckpointDetector.d.ts +25 -0
  133. package/dist/core/CheckpointDetector.d.ts.map +1 -0
  134. package/dist/core/CheckpointDetector.js +67 -0
  135. package/dist/core/CheckpointDetector.js.map +1 -0
  136. package/dist/core/ExecutionMonitor.d.ts +29 -0
  137. package/dist/core/ExecutionMonitor.d.ts.map +1 -0
  138. package/dist/core/ExecutionMonitor.js +124 -0
  139. package/dist/core/ExecutionMonitor.js.map +1 -0
  140. package/dist/core/ExecutionQueue.d.ts +21 -0
  141. package/dist/core/ExecutionQueue.d.ts.map +1 -0
  142. package/dist/core/ExecutionQueue.js +104 -0
  143. package/dist/core/ExecutionQueue.js.map +1 -0
  144. package/dist/core/HealthCheck.d.ts +39 -0
  145. package/dist/core/HealthCheck.d.ts.map +1 -0
  146. package/dist/core/HealthCheck.js +219 -0
  147. package/dist/core/HealthCheck.js.map +1 -0
  148. package/dist/core/HookIntegration.d.ts +45 -0
  149. package/dist/core/HookIntegration.d.ts.map +1 -0
  150. package/dist/core/HookIntegration.js +241 -0
  151. package/dist/core/HookIntegration.js.map +1 -0
  152. package/dist/core/MCPToolInterface.d.ts +120 -0
  153. package/dist/core/MCPToolInterface.d.ts.map +1 -0
  154. package/dist/core/MCPToolInterface.js +376 -0
  155. package/dist/core/MCPToolInterface.js.map +1 -0
  156. package/dist/core/PromptEnhancer.d.ts +13 -0
  157. package/dist/core/PromptEnhancer.d.ts.map +1 -0
  158. package/dist/core/PromptEnhancer.js +112 -0
  159. package/dist/core/PromptEnhancer.js.map +1 -0
  160. package/dist/core/ResourceMonitor.d.ts +32 -0
  161. package/dist/core/ResourceMonitor.d.ts.map +1 -0
  162. package/dist/core/ResourceMonitor.js +181 -0
  163. package/dist/core/ResourceMonitor.js.map +1 -0
  164. package/dist/core/ResultHandler.d.ts +9 -0
  165. package/dist/core/ResultHandler.d.ts.map +1 -0
  166. package/dist/core/ResultHandler.js +60 -0
  167. package/dist/core/ResultHandler.js.map +1 -0
  168. package/dist/core/ServiceLocator.d.ts +10 -0
  169. package/dist/core/ServiceLocator.d.ts.map +1 -0
  170. package/dist/core/ServiceLocator.js +29 -0
  171. package/dist/core/ServiceLocator.js.map +1 -0
  172. package/dist/core/SessionContextMonitor.d.ts +41 -0
  173. package/dist/core/SessionContextMonitor.d.ts.map +1 -0
  174. package/dist/core/SessionContextMonitor.js +156 -0
  175. package/dist/core/SessionContextMonitor.js.map +1 -0
  176. package/dist/core/SessionTokenTracker.d.ts +43 -0
  177. package/dist/core/SessionTokenTracker.d.ts.map +1 -0
  178. package/dist/core/SessionTokenTracker.js +76 -0
  179. package/dist/core/SessionTokenTracker.js.map +1 -0
  180. package/dist/core/TaskScheduler.d.ts +19 -0
  181. package/dist/core/TaskScheduler.d.ts.map +1 -0
  182. package/dist/core/TaskScheduler.js +59 -0
  183. package/dist/core/TaskScheduler.js.map +1 -0
  184. package/dist/core/WorkflowGuidanceEngine.d.ts +35 -0
  185. package/dist/core/WorkflowGuidanceEngine.d.ts.map +1 -0
  186. package/dist/core/WorkflowGuidanceEngine.js +104 -0
  187. package/dist/core/WorkflowGuidanceEngine.js.map +1 -0
  188. package/dist/core/types.d.ts +66 -0
  189. package/dist/core/types.d.ts.map +1 -0
  190. package/dist/core/types.js +11 -0
  191. package/dist/core/types.js.map +1 -0
  192. package/dist/db/ConnectionPool.d.ts +47 -0
  193. package/dist/db/ConnectionPool.d.ts.map +1 -0
  194. package/dist/db/ConnectionPool.js +432 -0
  195. package/dist/db/ConnectionPool.js.map +1 -0
  196. package/dist/db/QueryCache.d.ts +46 -0
  197. package/dist/db/QueryCache.d.ts.map +1 -0
  198. package/dist/db/QueryCache.js +229 -0
  199. package/dist/db/QueryCache.js.map +1 -0
  200. package/dist/errors/index.d.ts +62 -0
  201. package/dist/errors/index.d.ts.map +1 -0
  202. package/dist/errors/index.js +124 -0
  203. package/dist/errors/index.js.map +1 -0
  204. package/dist/evolution/ABTestManager.d.ts +21 -0
  205. package/dist/evolution/ABTestManager.d.ts.map +1 -0
  206. package/dist/evolution/ABTestManager.js +183 -0
  207. package/dist/evolution/ABTestManager.js.map +1 -0
  208. package/dist/evolution/AdaptationEngine.d.ts +60 -0
  209. package/dist/evolution/AdaptationEngine.d.ts.map +1 -0
  210. package/dist/evolution/AdaptationEngine.js +313 -0
  211. package/dist/evolution/AdaptationEngine.js.map +1 -0
  212. package/dist/evolution/AgentEvolutionConfig.d.ts +32 -0
  213. package/dist/evolution/AgentEvolutionConfig.d.ts.map +1 -0
  214. package/dist/evolution/AgentEvolutionConfig.js +329 -0
  215. package/dist/evolution/AgentEvolutionConfig.js.map +1 -0
  216. package/dist/evolution/ContextMatcher.d.ts +24 -0
  217. package/dist/evolution/ContextMatcher.d.ts.map +1 -0
  218. package/dist/evolution/ContextMatcher.js +85 -0
  219. package/dist/evolution/ContextMatcher.js.map +1 -0
  220. package/dist/evolution/EvolutionBootstrap.d.ts +69 -0
  221. package/dist/evolution/EvolutionBootstrap.d.ts.map +1 -0
  222. package/dist/evolution/EvolutionBootstrap.js +332 -0
  223. package/dist/evolution/EvolutionBootstrap.js.map +1 -0
  224. package/dist/evolution/EvolutionMonitor.d.ts +111 -0
  225. package/dist/evolution/EvolutionMonitor.d.ts.map +1 -0
  226. package/dist/evolution/EvolutionMonitor.js +540 -0
  227. package/dist/evolution/EvolutionMonitor.js.map +1 -0
  228. package/dist/evolution/FeedbackCollector.d.ts +26 -0
  229. package/dist/evolution/FeedbackCollector.d.ts.map +1 -0
  230. package/dist/evolution/FeedbackCollector.js +93 -0
  231. package/dist/evolution/FeedbackCollector.js.map +1 -0
  232. package/dist/evolution/KnowledgeTransferManager.d.ts +16 -0
  233. package/dist/evolution/KnowledgeTransferManager.d.ts.map +1 -0
  234. package/dist/evolution/KnowledgeTransferManager.js +34 -0
  235. package/dist/evolution/KnowledgeTransferManager.js.map +1 -0
  236. package/dist/evolution/LearningManager.d.ts +79 -0
  237. package/dist/evolution/LearningManager.d.ts.map +1 -0
  238. package/dist/evolution/LearningManager.js +582 -0
  239. package/dist/evolution/LearningManager.js.map +1 -0
  240. package/dist/evolution/LearningManagerConstants.d.ts +55 -0
  241. package/dist/evolution/LearningManagerConstants.d.ts.map +1 -0
  242. package/dist/evolution/LearningManagerConstants.js +55 -0
  243. package/dist/evolution/LearningManagerConstants.js.map +1 -0
  244. package/dist/evolution/MultiObjectiveOptimizer.d.ts +9 -0
  245. package/dist/evolution/MultiObjectiveOptimizer.d.ts.map +1 -0
  246. package/dist/evolution/MultiObjectiveOptimizer.js +92 -0
  247. package/dist/evolution/MultiObjectiveOptimizer.js.map +1 -0
  248. package/dist/evolution/PatternExplainer.d.ts +14 -0
  249. package/dist/evolution/PatternExplainer.d.ts.map +1 -0
  250. package/dist/evolution/PatternExplainer.js +113 -0
  251. package/dist/evolution/PatternExplainer.js.map +1 -0
  252. package/dist/evolution/PerformanceTracker.d.ts +43 -0
  253. package/dist/evolution/PerformanceTracker.d.ts.map +1 -0
  254. package/dist/evolution/PerformanceTracker.js +453 -0
  255. package/dist/evolution/PerformanceTracker.js.map +1 -0
  256. package/dist/evolution/PerformanceTrackerConstants.d.ts +5 -0
  257. package/dist/evolution/PerformanceTrackerConstants.d.ts.map +1 -0
  258. package/dist/evolution/PerformanceTrackerConstants.js +5 -0
  259. package/dist/evolution/PerformanceTrackerConstants.js.map +1 -0
  260. package/dist/evolution/StatisticalAnalyzer.d.ts +20 -0
  261. package/dist/evolution/StatisticalAnalyzer.d.ts.map +1 -0
  262. package/dist/evolution/StatisticalAnalyzer.js +154 -0
  263. package/dist/evolution/StatisticalAnalyzer.js.map +1 -0
  264. package/dist/evolution/TransferabilityChecker.d.ts +11 -0
  265. package/dist/evolution/TransferabilityChecker.d.ts.map +1 -0
  266. package/dist/evolution/TransferabilityChecker.js +78 -0
  267. package/dist/evolution/TransferabilityChecker.js.map +1 -0
  268. package/dist/evolution/index.d.ts +11 -0
  269. package/dist/evolution/index.d.ts.map +1 -0
  270. package/dist/evolution/index.js +9 -0
  271. package/dist/evolution/index.js.map +1 -0
  272. package/dist/evolution/instrumentation/SpanTracker.d.ts +64 -0
  273. package/dist/evolution/instrumentation/SpanTracker.d.ts.map +1 -0
  274. package/dist/evolution/instrumentation/SpanTracker.js +229 -0
  275. package/dist/evolution/instrumentation/SpanTracker.js.map +1 -0
  276. package/dist/evolution/instrumentation/withEvolutionTracking.d.ts +19 -0
  277. package/dist/evolution/instrumentation/withEvolutionTracking.d.ts.map +1 -0
  278. package/dist/evolution/instrumentation/withEvolutionTracking.js +256 -0
  279. package/dist/evolution/instrumentation/withEvolutionTracking.js.map +1 -0
  280. package/dist/evolution/integration-test-scenarios.d.ts +56 -0
  281. package/dist/evolution/integration-test-scenarios.d.ts.map +1 -0
  282. package/dist/evolution/integration-test-scenarios.js +131 -0
  283. package/dist/evolution/integration-test-scenarios.js.map +1 -0
  284. package/dist/evolution/links/LinkManager.d.ts +17 -0
  285. package/dist/evolution/links/LinkManager.d.ts.map +1 -0
  286. package/dist/evolution/links/LinkManager.js +41 -0
  287. package/dist/evolution/links/LinkManager.js.map +1 -0
  288. package/dist/evolution/storage/EvolutionStore.d.ts +87 -0
  289. package/dist/evolution/storage/EvolutionStore.d.ts.map +1 -0
  290. package/dist/evolution/storage/EvolutionStore.js +2 -0
  291. package/dist/evolution/storage/EvolutionStore.js.map +1 -0
  292. package/dist/evolution/storage/IEvolutionStore.d.ts +87 -0
  293. package/dist/evolution/storage/IEvolutionStore.d.ts.map +1 -0
  294. package/dist/evolution/storage/IEvolutionStore.js +2 -0
  295. package/dist/evolution/storage/IEvolutionStore.js.map +1 -0
  296. package/dist/evolution/storage/SQLiteStore.d.ts +115 -0
  297. package/dist/evolution/storage/SQLiteStore.d.ts.map +1 -0
  298. package/dist/evolution/storage/SQLiteStore.enhanced.d.ts +35 -0
  299. package/dist/evolution/storage/SQLiteStore.enhanced.d.ts.map +1 -0
  300. package/dist/evolution/storage/SQLiteStore.enhanced.js +514 -0
  301. package/dist/evolution/storage/SQLiteStore.enhanced.js.map +1 -0
  302. package/dist/evolution/storage/SQLiteStore.js +915 -0
  303. package/dist/evolution/storage/SQLiteStore.js.map +1 -0
  304. package/dist/evolution/storage/deprecated/SQLiteStore.basic.d.ts +109 -0
  305. package/dist/evolution/storage/deprecated/SQLiteStore.basic.d.ts.map +1 -0
  306. package/dist/evolution/storage/deprecated/SQLiteStore.basic.js +1033 -0
  307. package/dist/evolution/storage/deprecated/SQLiteStore.basic.js.map +1 -0
  308. package/dist/evolution/storage/index.d.ts +6 -0
  309. package/dist/evolution/storage/index.d.ts.map +1 -0
  310. package/dist/evolution/storage/index.js +3 -0
  311. package/dist/evolution/storage/index.js.map +1 -0
  312. package/dist/evolution/storage/migrations/MigrationManager.d.ts +17 -0
  313. package/dist/evolution/storage/migrations/MigrationManager.d.ts.map +1 -0
  314. package/dist/evolution/storage/migrations/MigrationManager.js +242 -0
  315. package/dist/evolution/storage/migrations/MigrationManager.js.map +1 -0
  316. package/dist/evolution/storage/repositories/AdaptationRepository.d.ts +17 -0
  317. package/dist/evolution/storage/repositories/AdaptationRepository.d.ts.map +1 -0
  318. package/dist/evolution/storage/repositories/AdaptationRepository.js +82 -0
  319. package/dist/evolution/storage/repositories/AdaptationRepository.js.map +1 -0
  320. package/dist/evolution/storage/repositories/CostRecordsRepository.d.ts +43 -0
  321. package/dist/evolution/storage/repositories/CostRecordsRepository.d.ts.map +1 -0
  322. package/dist/evolution/storage/repositories/CostRecordsRepository.js +157 -0
  323. package/dist/evolution/storage/repositories/CostRecordsRepository.js.map +1 -0
  324. package/dist/evolution/storage/repositories/ExecutionRepository.d.ts +12 -0
  325. package/dist/evolution/storage/repositories/ExecutionRepository.d.ts.map +1 -0
  326. package/dist/evolution/storage/repositories/ExecutionRepository.js +87 -0
  327. package/dist/evolution/storage/repositories/ExecutionRepository.js.map +1 -0
  328. package/dist/evolution/storage/repositories/PatternRepository.d.ts +12 -0
  329. package/dist/evolution/storage/repositories/PatternRepository.d.ts.map +1 -0
  330. package/dist/evolution/storage/repositories/PatternRepository.js +150 -0
  331. package/dist/evolution/storage/repositories/PatternRepository.js.map +1 -0
  332. package/dist/evolution/storage/repositories/PerformanceMetricsRepository.d.ts +39 -0
  333. package/dist/evolution/storage/repositories/PerformanceMetricsRepository.d.ts.map +1 -0
  334. package/dist/evolution/storage/repositories/PerformanceMetricsRepository.js +130 -0
  335. package/dist/evolution/storage/repositories/PerformanceMetricsRepository.js.map +1 -0
  336. package/dist/evolution/storage/repositories/RewardRepository.d.ts +17 -0
  337. package/dist/evolution/storage/repositories/RewardRepository.d.ts.map +1 -0
  338. package/dist/evolution/storage/repositories/RewardRepository.js +82 -0
  339. package/dist/evolution/storage/repositories/RewardRepository.js.map +1 -0
  340. package/dist/evolution/storage/repositories/SpanRepository.d.ts +14 -0
  341. package/dist/evolution/storage/repositories/SpanRepository.d.ts.map +1 -0
  342. package/dist/evolution/storage/repositories/SpanRepository.js +191 -0
  343. package/dist/evolution/storage/repositories/SpanRepository.js.map +1 -0
  344. package/dist/evolution/storage/repositories/StatsRepository.d.ts +16 -0
  345. package/dist/evolution/storage/repositories/StatsRepository.d.ts.map +1 -0
  346. package/dist/evolution/storage/repositories/StatsRepository.js +271 -0
  347. package/dist/evolution/storage/repositories/StatsRepository.js.map +1 -0
  348. package/dist/evolution/storage/repositories/TaskRepository.d.ts +16 -0
  349. package/dist/evolution/storage/repositories/TaskRepository.d.ts.map +1 -0
  350. package/dist/evolution/storage/repositories/TaskRepository.js +93 -0
  351. package/dist/evolution/storage/repositories/TaskRepository.js.map +1 -0
  352. package/dist/evolution/storage/schema.d.ts +81 -0
  353. package/dist/evolution/storage/schema.d.ts.map +1 -0
  354. package/dist/evolution/storage/schema.js +241 -0
  355. package/dist/evolution/storage/schema.js.map +1 -0
  356. package/dist/evolution/storage/types.d.ts +402 -0
  357. package/dist/evolution/storage/types.d.ts.map +1 -0
  358. package/dist/evolution/storage/types.js +2 -0
  359. package/dist/evolution/storage/types.js.map +1 -0
  360. package/dist/evolution/storage/validation.d.ts +12 -0
  361. package/dist/evolution/storage/validation.d.ts.map +1 -0
  362. package/dist/evolution/storage/validation.js +88 -0
  363. package/dist/evolution/storage/validation.js.map +1 -0
  364. package/dist/evolution/types.d.ts +214 -0
  365. package/dist/evolution/types.d.ts.map +1 -0
  366. package/dist/evolution/types.js +2 -0
  367. package/dist/evolution/types.js.map +1 -0
  368. package/dist/index.d.ts +11 -0
  369. package/dist/index.d.ts.map +1 -0
  370. package/dist/index.js +32 -0
  371. package/dist/index.js.map +1 -0
  372. package/dist/knowledge-graph/index.d.ts +27 -0
  373. package/dist/knowledge-graph/index.d.ts.map +1 -0
  374. package/dist/knowledge-graph/index.js +353 -0
  375. package/dist/knowledge-graph/index.js.map +1 -0
  376. package/dist/knowledge-graph/types.d.ts +37 -0
  377. package/dist/knowledge-graph/types.d.ts.map +1 -0
  378. package/dist/knowledge-graph/types.js +2 -0
  379. package/dist/knowledge-graph/types.js.map +1 -0
  380. package/dist/management/UninstallManager.d.ts +23 -0
  381. package/dist/management/UninstallManager.d.ts.map +1 -0
  382. package/dist/management/UninstallManager.js +186 -0
  383. package/dist/management/UninstallManager.js.map +1 -0
  384. package/dist/management/index.d.ts +3 -0
  385. package/dist/management/index.d.ts.map +1 -0
  386. package/dist/management/index.js +2 -0
  387. package/dist/management/index.js.map +1 -0
  388. package/dist/mcp/BuddyCommands.d.ts +13 -0
  389. package/dist/mcp/BuddyCommands.d.ts.map +1 -0
  390. package/dist/mcp/BuddyCommands.js +110 -0
  391. package/dist/mcp/BuddyCommands.js.map +1 -0
  392. package/dist/mcp/ClaudeMdReloader.d.ts +37 -0
  393. package/dist/mcp/ClaudeMdReloader.d.ts.map +1 -0
  394. package/dist/mcp/ClaudeMdReloader.js +92 -0
  395. package/dist/mcp/ClaudeMdReloader.js.map +1 -0
  396. package/dist/mcp/HumanInLoopUI.d.ts +23 -0
  397. package/dist/mcp/HumanInLoopUI.d.ts.map +1 -0
  398. package/dist/mcp/HumanInLoopUI.js +92 -0
  399. package/dist/mcp/HumanInLoopUI.js.map +1 -0
  400. package/dist/mcp/ServerInitializer.d.ts +47 -0
  401. package/dist/mcp/ServerInitializer.d.ts.map +1 -0
  402. package/dist/mcp/ServerInitializer.js +89 -0
  403. package/dist/mcp/ServerInitializer.js.map +1 -0
  404. package/dist/mcp/SessionBootstrapper.d.ts +11 -0
  405. package/dist/mcp/SessionBootstrapper.d.ts.map +1 -0
  406. package/dist/mcp/SessionBootstrapper.js +67 -0
  407. package/dist/mcp/SessionBootstrapper.js.map +1 -0
  408. package/dist/mcp/ToolDefinitions.d.ts +42 -0
  409. package/dist/mcp/ToolDefinitions.d.ts.map +1 -0
  410. package/dist/mcp/ToolDefinitions.js +234 -0
  411. package/dist/mcp/ToolDefinitions.js.map +1 -0
  412. package/dist/mcp/ToolRouter.d.ts +22 -0
  413. package/dist/mcp/ToolRouter.d.ts.map +1 -0
  414. package/dist/mcp/ToolRouter.js +102 -0
  415. package/dist/mcp/ToolRouter.js.map +1 -0
  416. package/dist/mcp/handlers/BuddyHandlers.d.ts +14 -0
  417. package/dist/mcp/handlers/BuddyHandlers.d.ts.map +1 -0
  418. package/dist/mcp/handlers/BuddyHandlers.js +152 -0
  419. package/dist/mcp/handlers/BuddyHandlers.js.map +1 -0
  420. package/dist/mcp/handlers/ResourceHandlers.d.ts +3 -0
  421. package/dist/mcp/handlers/ResourceHandlers.d.ts.map +1 -0
  422. package/dist/mcp/handlers/ResourceHandlers.js +86 -0
  423. package/dist/mcp/handlers/ResourceHandlers.js.map +1 -0
  424. package/dist/mcp/handlers/ToolHandlers.d.ts +52 -0
  425. package/dist/mcp/handlers/ToolHandlers.d.ts.map +1 -0
  426. package/dist/mcp/handlers/ToolHandlers.js +914 -0
  427. package/dist/mcp/handlers/ToolHandlers.js.map +1 -0
  428. package/dist/mcp/handlers/index.d.ts +4 -0
  429. package/dist/mcp/handlers/index.d.ts.map +1 -0
  430. package/dist/mcp/handlers/index.js +4 -0
  431. package/dist/mcp/handlers/index.js.map +1 -0
  432. package/dist/mcp/index.d.ts +5 -0
  433. package/dist/mcp/index.d.ts.map +1 -0
  434. package/dist/mcp/index.js +3 -0
  435. package/dist/mcp/index.js.map +1 -0
  436. package/dist/mcp/schemas/OutputSchemas.d.ts +368 -0
  437. package/dist/mcp/schemas/OutputSchemas.d.ts.map +1 -0
  438. package/dist/mcp/schemas/OutputSchemas.js +191 -0
  439. package/dist/mcp/schemas/OutputSchemas.js.map +1 -0
  440. package/dist/mcp/server.d.ts +17 -0
  441. package/dist/mcp/server.d.ts.map +1 -0
  442. package/dist/mcp/server.js +184 -0
  443. package/dist/mcp/server.js.map +1 -0
  444. package/dist/mcp/tools/add-observations.d.ts +48 -0
  445. package/dist/mcp/tools/add-observations.d.ts.map +1 -0
  446. package/dist/mcp/tools/add-observations.js +64 -0
  447. package/dist/mcp/tools/add-observations.js.map +1 -0
  448. package/dist/mcp/tools/buddy-do.d.ts +14 -0
  449. package/dist/mcp/tools/buddy-do.d.ts.map +1 -0
  450. package/dist/mcp/tools/buddy-do.js +77 -0
  451. package/dist/mcp/tools/buddy-do.js.map +1 -0
  452. package/dist/mcp/tools/buddy-help.d.ts +13 -0
  453. package/dist/mcp/tools/buddy-help.d.ts.map +1 -0
  454. package/dist/mcp/tools/buddy-help.js +52 -0
  455. package/dist/mcp/tools/buddy-help.js.map +1 -0
  456. package/dist/mcp/tools/buddy-remember.d.ts +15 -0
  457. package/dist/mcp/tools/buddy-remember.d.ts.map +1 -0
  458. package/dist/mcp/tools/buddy-remember.js +77 -0
  459. package/dist/mcp/tools/buddy-remember.js.map +1 -0
  460. package/dist/mcp/tools/create-entities.d.ts +57 -0
  461. package/dist/mcp/tools/create-entities.d.ts.map +1 -0
  462. package/dist/mcp/tools/create-entities.js +64 -0
  463. package/dist/mcp/tools/create-entities.js.map +1 -0
  464. package/dist/mcp/tools/create-relations.d.ts +60 -0
  465. package/dist/mcp/tools/create-relations.d.ts.map +1 -0
  466. package/dist/mcp/tools/create-relations.js +84 -0
  467. package/dist/mcp/tools/create-relations.js.map +1 -0
  468. package/dist/mcp/tools/health-check.d.ts +10 -0
  469. package/dist/mcp/tools/health-check.d.ts.map +1 -0
  470. package/dist/mcp/tools/health-check.js +37 -0
  471. package/dist/mcp/tools/health-check.js.map +1 -0
  472. package/dist/mcp/tools/recall-memory.d.ts +31 -0
  473. package/dist/mcp/tools/recall-memory.d.ts.map +1 -0
  474. package/dist/mcp/tools/recall-memory.js +31 -0
  475. package/dist/mcp/tools/recall-memory.js.map +1 -0
  476. package/dist/mcp/validation.d.ts +88 -0
  477. package/dist/mcp/validation.d.ts.map +1 -0
  478. package/dist/mcp/validation.js +119 -0
  479. package/dist/mcp/validation.js.map +1 -0
  480. package/dist/memory/ProjectAutoTracker.d.ts +36 -0
  481. package/dist/memory/ProjectAutoTracker.d.ts.map +1 -0
  482. package/dist/memory/ProjectAutoTracker.js +200 -0
  483. package/dist/memory/ProjectAutoTracker.js.map +1 -0
  484. package/dist/memory/ProjectMemoryCleanup.d.ts +17 -0
  485. package/dist/memory/ProjectMemoryCleanup.d.ts.map +1 -0
  486. package/dist/memory/ProjectMemoryCleanup.js +57 -0
  487. package/dist/memory/ProjectMemoryCleanup.js.map +1 -0
  488. package/dist/memory/ProjectMemoryManager.d.ts +15 -0
  489. package/dist/memory/ProjectMemoryManager.d.ts.map +1 -0
  490. package/dist/memory/ProjectMemoryManager.js +36 -0
  491. package/dist/memory/ProjectMemoryManager.js.map +1 -0
  492. package/dist/orchestrator/AgentRouter.d.ts +20 -0
  493. package/dist/orchestrator/AgentRouter.d.ts.map +1 -0
  494. package/dist/orchestrator/AgentRouter.js +274 -0
  495. package/dist/orchestrator/AgentRouter.js.map +1 -0
  496. package/dist/orchestrator/CostTracker.d.ts +25 -0
  497. package/dist/orchestrator/CostTracker.d.ts.map +1 -0
  498. package/dist/orchestrator/CostTracker.js +199 -0
  499. package/dist/orchestrator/CostTracker.js.map +1 -0
  500. package/dist/orchestrator/GlobalResourcePool.d.ts +59 -0
  501. package/dist/orchestrator/GlobalResourcePool.d.ts.map +1 -0
  502. package/dist/orchestrator/GlobalResourcePool.js +224 -0
  503. package/dist/orchestrator/GlobalResourcePool.js.map +1 -0
  504. package/dist/orchestrator/GlobalResourcePoolConstants.d.ts +22 -0
  505. package/dist/orchestrator/GlobalResourcePoolConstants.d.ts.map +1 -0
  506. package/dist/orchestrator/GlobalResourcePoolConstants.js +22 -0
  507. package/dist/orchestrator/GlobalResourcePoolConstants.js.map +1 -0
  508. package/dist/orchestrator/TaskAnalyzer.d.ts +15 -0
  509. package/dist/orchestrator/TaskAnalyzer.d.ts.map +1 -0
  510. package/dist/orchestrator/TaskAnalyzer.js +234 -0
  511. package/dist/orchestrator/TaskAnalyzer.js.map +1 -0
  512. package/dist/orchestrator/TaskAnalyzerConstants.d.ts +16 -0
  513. package/dist/orchestrator/TaskAnalyzerConstants.d.ts.map +1 -0
  514. package/dist/orchestrator/TaskAnalyzerConstants.js +16 -0
  515. package/dist/orchestrator/TaskAnalyzerConstants.js.map +1 -0
  516. package/dist/orchestrator/example.d.ts +2 -0
  517. package/dist/orchestrator/example.d.ts.map +1 -0
  518. package/dist/orchestrator/example.js +118 -0
  519. package/dist/orchestrator/example.js.map +1 -0
  520. package/dist/orchestrator/index.d.ts +82 -0
  521. package/dist/orchestrator/index.d.ts.map +1 -0
  522. package/dist/orchestrator/index.js +364 -0
  523. package/dist/orchestrator/index.js.map +1 -0
  524. package/dist/orchestrator/router.d.ts +48 -0
  525. package/dist/orchestrator/router.d.ts.map +1 -0
  526. package/dist/orchestrator/router.js +126 -0
  527. package/dist/orchestrator/router.js.map +1 -0
  528. package/dist/orchestrator/types.d.ts +60 -0
  529. package/dist/orchestrator/types.d.ts.map +1 -0
  530. package/dist/orchestrator/types.js +2 -0
  531. package/dist/orchestrator/types.js.map +1 -0
  532. package/dist/planning/PlanningEngine.d.ts +52 -0
  533. package/dist/planning/PlanningEngine.d.ts.map +1 -0
  534. package/dist/planning/PlanningEngine.js +271 -0
  535. package/dist/planning/PlanningEngine.js.map +1 -0
  536. package/dist/planning/TaskDecomposer.d.ts +32 -0
  537. package/dist/planning/TaskDecomposer.d.ts.map +1 -0
  538. package/dist/planning/TaskDecomposer.js +152 -0
  539. package/dist/planning/TaskDecomposer.js.map +1 -0
  540. package/dist/prompts/templates/PromptTemplates.d.ts +11 -0
  541. package/dist/prompts/templates/PromptTemplates.d.ts.map +1 -0
  542. package/dist/prompts/templates/PromptTemplates.js +942 -0
  543. package/dist/prompts/templates/PromptTemplates.js.map +1 -0
  544. package/dist/prompts/templates/index.d.ts +2 -0
  545. package/dist/prompts/templates/index.d.ts.map +1 -0
  546. package/dist/prompts/templates/index.js +2 -0
  547. package/dist/prompts/templates/index.js.map +1 -0
  548. package/dist/skills/SkillManager.d.ts +33 -0
  549. package/dist/skills/SkillManager.d.ts.map +1 -0
  550. package/dist/skills/SkillManager.js +153 -0
  551. package/dist/skills/SkillManager.js.map +1 -0
  552. package/dist/skills/index.d.ts +3 -0
  553. package/dist/skills/index.d.ts.map +1 -0
  554. package/dist/skills/index.js +2 -0
  555. package/dist/skills/index.js.map +1 -0
  556. package/dist/telemetry/TelemetryCollector.d.ts +19 -0
  557. package/dist/telemetry/TelemetryCollector.d.ts.map +1 -0
  558. package/dist/telemetry/TelemetryCollector.js +62 -0
  559. package/dist/telemetry/TelemetryCollector.js.map +1 -0
  560. package/dist/telemetry/TelemetryStore.d.ts +20 -0
  561. package/dist/telemetry/TelemetryStore.d.ts.map +1 -0
  562. package/dist/telemetry/TelemetryStore.js +126 -0
  563. package/dist/telemetry/TelemetryStore.js.map +1 -0
  564. package/dist/telemetry/index.d.ts +8 -0
  565. package/dist/telemetry/index.d.ts.map +1 -0
  566. package/dist/telemetry/index.js +33 -0
  567. package/dist/telemetry/index.js.map +1 -0
  568. package/dist/telemetry/sanitization.d.ts +6 -0
  569. package/dist/telemetry/sanitization.d.ts.map +1 -0
  570. package/dist/telemetry/sanitization.js +180 -0
  571. package/dist/telemetry/sanitization.js.map +1 -0
  572. package/dist/telemetry/types.d.ts +73 -0
  573. package/dist/telemetry/types.d.ts.map +1 -0
  574. package/dist/telemetry/types.js +16 -0
  575. package/dist/telemetry/types.js.map +1 -0
  576. package/dist/templates/git-education-templates.d.ts +26 -0
  577. package/dist/templates/git-education-templates.d.ts.map +1 -0
  578. package/dist/templates/git-education-templates.js +455 -0
  579. package/dist/templates/git-education-templates.js.map +1 -0
  580. package/dist/types/AgentClassification.d.ts +6 -0
  581. package/dist/types/AgentClassification.d.ts.map +1 -0
  582. package/dist/types/AgentClassification.js +7 -0
  583. package/dist/types/AgentClassification.js.map +1 -0
  584. package/dist/types/Checkpoint.d.ts +12 -0
  585. package/dist/types/Checkpoint.d.ts.map +1 -0
  586. package/dist/types/Checkpoint.js +13 -0
  587. package/dist/types/Checkpoint.js.map +1 -0
  588. package/dist/types/toonify.d.ts +91 -0
  589. package/dist/types/toonify.d.ts.map +1 -0
  590. package/dist/types/toonify.js +18 -0
  591. package/dist/types/toonify.js.map +1 -0
  592. package/dist/ui/AsciiProgressBar.d.ts +29 -0
  593. package/dist/ui/AsciiProgressBar.d.ts.map +1 -0
  594. package/dist/ui/AsciiProgressBar.js +131 -0
  595. package/dist/ui/AsciiProgressBar.js.map +1 -0
  596. package/dist/ui/AttributionManager.d.ts +19 -0
  597. package/dist/ui/AttributionManager.d.ts.map +1 -0
  598. package/dist/ui/AttributionManager.js +107 -0
  599. package/dist/ui/AttributionManager.js.map +1 -0
  600. package/dist/ui/Dashboard.d.ts +24 -0
  601. package/dist/ui/Dashboard.d.ts.map +1 -0
  602. package/dist/ui/Dashboard.js +135 -0
  603. package/dist/ui/Dashboard.js.map +1 -0
  604. package/dist/ui/LoadingIndicator.d.ts +53 -0
  605. package/dist/ui/LoadingIndicator.d.ts.map +1 -0
  606. package/dist/ui/LoadingIndicator.js +174 -0
  607. package/dist/ui/LoadingIndicator.js.map +1 -0
  608. package/dist/ui/MetricsStore.d.ts +15 -0
  609. package/dist/ui/MetricsStore.d.ts.map +1 -0
  610. package/dist/ui/MetricsStore.js +111 -0
  611. package/dist/ui/MetricsStore.js.map +1 -0
  612. package/dist/ui/ProgressRenderer.d.ts +24 -0
  613. package/dist/ui/ProgressRenderer.d.ts.map +1 -0
  614. package/dist/ui/ProgressRenderer.js +121 -0
  615. package/dist/ui/ProgressRenderer.js.map +1 -0
  616. package/dist/ui/ResponseFormatter.d.ts +42 -0
  617. package/dist/ui/ResponseFormatter.d.ts.map +1 -0
  618. package/dist/ui/ResponseFormatter.js +243 -0
  619. package/dist/ui/ResponseFormatter.js.map +1 -0
  620. package/dist/ui/UIEventBus.d.ts +38 -0
  621. package/dist/ui/UIEventBus.d.ts.map +1 -0
  622. package/dist/ui/UIEventBus.js +173 -0
  623. package/dist/ui/UIEventBus.js.map +1 -0
  624. package/dist/ui/index.d.ts +8 -0
  625. package/dist/ui/index.d.ts.map +1 -0
  626. package/dist/ui/index.js +6 -0
  627. package/dist/ui/index.js.map +1 -0
  628. package/dist/ui/theme.d.ts +292 -0
  629. package/dist/ui/theme.d.ts.map +1 -0
  630. package/dist/ui/theme.js +153 -0
  631. package/dist/ui/theme.js.map +1 -0
  632. package/dist/ui/types.d.ts +146 -0
  633. package/dist/ui/types.d.ts.map +1 -0
  634. package/dist/ui/types.js +16 -0
  635. package/dist/ui/types.js.map +1 -0
  636. package/dist/utils/ILogger.d.ts +7 -0
  637. package/dist/utils/ILogger.d.ts.map +1 -0
  638. package/dist/utils/ILogger.js +2 -0
  639. package/dist/utils/ILogger.js.map +1 -0
  640. package/dist/utils/MinHeap.d.ts +15 -0
  641. package/dist/utils/MinHeap.d.ts.map +1 -0
  642. package/dist/utils/MinHeap.js +69 -0
  643. package/dist/utils/MinHeap.js.map +1 -0
  644. package/dist/utils/RateLimiter.d.ts +28 -0
  645. package/dist/utils/RateLimiter.d.ts.map +1 -0
  646. package/dist/utils/RateLimiter.js +115 -0
  647. package/dist/utils/RateLimiter.js.map +1 -0
  648. package/dist/utils/SecureKeyStore.d.ts +10 -0
  649. package/dist/utils/SecureKeyStore.d.ts.map +1 -0
  650. package/dist/utils/SecureKeyStore.js +32 -0
  651. package/dist/utils/SecureKeyStore.js.map +1 -0
  652. package/dist/utils/SystemResources.d.ts +40 -0
  653. package/dist/utils/SystemResources.d.ts.map +1 -0
  654. package/dist/utils/SystemResources.js +221 -0
  655. package/dist/utils/SystemResources.js.map +1 -0
  656. package/dist/utils/cost-tracker.d.ts +34 -0
  657. package/dist/utils/cost-tracker.d.ts.map +1 -0
  658. package/dist/utils/cost-tracker.js +92 -0
  659. package/dist/utils/cost-tracker.js.map +1 -0
  660. package/dist/utils/errorHandler.d.ts +28 -0
  661. package/dist/utils/errorHandler.d.ts.map +1 -0
  662. package/dist/utils/errorHandler.js +206 -0
  663. package/dist/utils/errorHandler.js.map +1 -0
  664. package/dist/utils/json.d.ts +13 -0
  665. package/dist/utils/json.d.ts.map +1 -0
  666. package/dist/utils/json.js +85 -0
  667. package/dist/utils/json.js.map +1 -0
  668. package/dist/utils/logger.d.ts +16 -0
  669. package/dist/utils/logger.d.ts.map +1 -0
  670. package/dist/utils/logger.js +57 -0
  671. package/dist/utils/logger.js.map +1 -0
  672. package/dist/utils/lru-cache.d.ts +40 -0
  673. package/dist/utils/lru-cache.d.ts.map +1 -0
  674. package/dist/utils/lru-cache.js +209 -0
  675. package/dist/utils/lru-cache.js.map +1 -0
  676. package/dist/utils/memory.d.ts +20 -0
  677. package/dist/utils/memory.d.ts.map +1 -0
  678. package/dist/utils/memory.js +53 -0
  679. package/dist/utils/memory.js.map +1 -0
  680. package/dist/utils/money.d.ts +10 -0
  681. package/dist/utils/money.d.ts.map +1 -0
  682. package/dist/utils/money.js +25 -0
  683. package/dist/utils/money.js.map +1 -0
  684. package/dist/utils/pathValidation.d.ts +2 -0
  685. package/dist/utils/pathValidation.d.ts.map +1 -0
  686. package/dist/utils/pathValidation.js +62 -0
  687. package/dist/utils/pathValidation.js.map +1 -0
  688. package/dist/utils/paths.d.ts +4 -0
  689. package/dist/utils/paths.d.ts.map +1 -0
  690. package/dist/utils/paths.js +28 -0
  691. package/dist/utils/paths.js.map +1 -0
  692. package/dist/utils/requestId.d.ts +4 -0
  693. package/dist/utils/requestId.d.ts.map +1 -0
  694. package/dist/utils/requestId.js +17 -0
  695. package/dist/utils/requestId.js.map +1 -0
  696. package/dist/utils/retry.d.ts +20 -0
  697. package/dist/utils/retry.d.ts.map +1 -0
  698. package/dist/utils/retry.js +226 -0
  699. package/dist/utils/retry.js.map +1 -0
  700. package/dist/utils/toonify-adapter.d.ts +77 -0
  701. package/dist/utils/toonify-adapter.d.ts.map +1 -0
  702. package/dist/utils/toonify-adapter.js +283 -0
  703. package/dist/utils/toonify-adapter.js.map +1 -0
  704. package/dist/utils/validation.d.ts +7 -0
  705. package/dist/utils/validation.d.ts.map +1 -0
  706. package/dist/utils/validation.js +62 -0
  707. package/dist/utils/validation.js.map +1 -0
  708. package/package.json +116 -0
  709. package/plugin.json +21 -0
@@ -0,0 +1,914 @@
1
+ import { z } from 'zod';
2
+ import { ValidationError, OperationError } from '../../errors/index.js';
3
+ import { RateLimiter } from '../../utils/RateLimiter.js';
4
+ import { SimpleConfig } from '../../config/simple-config.js';
5
+ import { recallMemoryTool } from '../tools/recall-memory.js';
6
+ import { createEntitiesTool } from '../tools/create-entities.js';
7
+ import { addObservationsTool } from '../tools/add-observations.js';
8
+ import { createRelationsTool } from '../tools/create-relations.js';
9
+ import { handleError, logError } from '../../utils/errorHandler.js';
10
+ import { ListSkillsInputSchema, UninstallInputSchema, WorkflowGuidanceInputSchema, RecordTokenUsageInputSchema, HookToolUseInputSchema, GenerateSmartPlanInputSchema, RecallMemoryInputSchema, CreateEntitiesInputSchema, AddObservationsInputSchema, CreateRelationsInputSchema, formatValidationError, } from '../validation.js';
11
+ export class ToolHandlers {
12
+ router;
13
+ agentRegistry;
14
+ feedbackCollector;
15
+ performanceTracker;
16
+ learningManager;
17
+ evolutionMonitor;
18
+ skillManager;
19
+ uninstallManager;
20
+ developmentButler;
21
+ checkpointDetector;
22
+ hookIntegration;
23
+ planningEngine;
24
+ projectMemoryManager;
25
+ knowledgeGraph;
26
+ ui;
27
+ memoryRateLimiter;
28
+ constructor(router, agentRegistry, feedbackCollector, performanceTracker, learningManager, evolutionMonitor, skillManager, uninstallManager, developmentButler, checkpointDetector, hookIntegration, planningEngine, projectMemoryManager, knowledgeGraph, ui) {
29
+ this.router = router;
30
+ this.agentRegistry = agentRegistry;
31
+ this.feedbackCollector = feedbackCollector;
32
+ this.performanceTracker = performanceTracker;
33
+ this.learningManager = learningManager;
34
+ this.evolutionMonitor = evolutionMonitor;
35
+ this.skillManager = skillManager;
36
+ this.uninstallManager = uninstallManager;
37
+ this.developmentButler = developmentButler;
38
+ this.checkpointDetector = checkpointDetector;
39
+ this.hookIntegration = hookIntegration;
40
+ this.planningEngine = planningEngine;
41
+ this.projectMemoryManager = projectMemoryManager;
42
+ this.knowledgeGraph = knowledgeGraph;
43
+ this.ui = ui;
44
+ this.memoryRateLimiter = new RateLimiter({ requestsPerMinute: 10 });
45
+ }
46
+ async handleListSkills(args) {
47
+ try {
48
+ let validatedInput;
49
+ try {
50
+ validatedInput = ListSkillsInputSchema.parse(args);
51
+ }
52
+ catch (error) {
53
+ if (error instanceof z.ZodError) {
54
+ throw new ValidationError(formatValidationError(error), {
55
+ component: 'ToolHandlers',
56
+ method: 'handleListSkills',
57
+ schema: 'ListSkillsInputSchema',
58
+ providedArgs: args,
59
+ });
60
+ }
61
+ throw error;
62
+ }
63
+ const filter = validatedInput.filter || 'all';
64
+ let skills;
65
+ let title;
66
+ switch (filter) {
67
+ case 'claude-code-buddy':
68
+ skills = await this.skillManager.listSmartAgentsSkills();
69
+ title = 'šŸŽ“ Claude Code Buddy Skills (sa: prefix)';
70
+ break;
71
+ case 'user':
72
+ skills = await this.skillManager.listUserSkills();
73
+ title = 'šŸ‘¤ User Skills';
74
+ break;
75
+ case 'all':
76
+ default:
77
+ const allSkillsMetadata = await this.skillManager.listAllSkills();
78
+ skills = allSkillsMetadata.map(s => s.name);
79
+ title = 'šŸŽ“ All Skills';
80
+ break;
81
+ }
82
+ let output = `${title}\n`;
83
+ output += '━'.repeat(60) + '\n\n';
84
+ if (skills.length === 0) {
85
+ output += ' No skills found.\n\n';
86
+ if (filter === 'claude-code-buddy') {
87
+ output += 'šŸ’” Claude Code Buddy can generate skills automatically.\n';
88
+ output += ' Skills will appear here once generated.\n';
89
+ }
90
+ }
91
+ else {
92
+ output += `Total: ${skills.length} skill${skills.length === 1 ? '' : 's'}\n\n`;
93
+ const saSkills = skills.filter(s => s.startsWith('sa:'));
94
+ const userSkills = skills.filter(s => !s.startsWith('sa:'));
95
+ if (filter === 'all') {
96
+ if (saSkills.length > 0) {
97
+ output += 'šŸŽ“ Claude Code Buddy Skills:\n';
98
+ output += '─'.repeat(60) + '\n';
99
+ saSkills.forEach(skill => {
100
+ output += ` • ${skill}\n`;
101
+ });
102
+ output += '\n';
103
+ }
104
+ if (userSkills.length > 0) {
105
+ output += 'šŸ‘¤ User Skills:\n';
106
+ output += '─'.repeat(60) + '\n';
107
+ userSkills.forEach(skill => {
108
+ output += ` • ${skill}\n`;
109
+ });
110
+ output += '\n';
111
+ }
112
+ }
113
+ else {
114
+ skills.forEach(skill => {
115
+ output += ` • ${skill}\n`;
116
+ });
117
+ output += '\n';
118
+ }
119
+ }
120
+ output += '━'.repeat(60) + '\n';
121
+ output += '\nšŸ’” Usage:\n';
122
+ output += ' • buddy_skills - List all skills\n';
123
+ output += ' • buddy_skills --filter claude-code-buddy - List only sa: skills\n';
124
+ output += ' • buddy_skills --filter user - List only user skills\n';
125
+ output += '\nšŸ“š Skill Naming Convention:\n';
126
+ output += ' • sa:<name> - Claude Code Buddy generated skills\n';
127
+ output += ' • <name> - User-installed skills\n';
128
+ return {
129
+ content: [
130
+ {
131
+ type: 'text',
132
+ text: output,
133
+ },
134
+ ],
135
+ };
136
+ }
137
+ catch (error) {
138
+ logError(error, {
139
+ component: 'ToolHandlers',
140
+ method: 'handleListSkills',
141
+ operation: 'listing skills',
142
+ data: { filter: args?.filter },
143
+ });
144
+ const handled = handleError(error, {
145
+ component: 'ToolHandlers',
146
+ method: 'handleListSkills',
147
+ });
148
+ return {
149
+ content: [
150
+ {
151
+ type: 'text',
152
+ text: `āŒ List skills failed: ${handled.message}`,
153
+ },
154
+ ],
155
+ };
156
+ }
157
+ }
158
+ async handleUninstall(args) {
159
+ try {
160
+ let validatedInput;
161
+ try {
162
+ validatedInput = UninstallInputSchema.parse(args);
163
+ }
164
+ catch (error) {
165
+ if (error instanceof z.ZodError) {
166
+ throw new ValidationError(formatValidationError(error), {
167
+ component: 'ToolHandlers',
168
+ method: 'handleUninstall',
169
+ schema: 'UninstallInputSchema',
170
+ providedArgs: args,
171
+ });
172
+ }
173
+ throw error;
174
+ }
175
+ const report = await this.uninstallManager.uninstall(validatedInput);
176
+ const formattedReport = this.uninstallManager.formatReport(report);
177
+ return {
178
+ content: [
179
+ {
180
+ type: 'text',
181
+ text: formattedReport,
182
+ },
183
+ ],
184
+ };
185
+ }
186
+ catch (error) {
187
+ logError(error, {
188
+ component: 'ToolHandlers',
189
+ method: 'handleUninstall',
190
+ operation: 'uninstalling Claude Code Buddy',
191
+ data: { options: args },
192
+ });
193
+ const handled = handleError(error, {
194
+ component: 'ToolHandlers',
195
+ method: 'handleUninstall',
196
+ });
197
+ return {
198
+ content: [
199
+ {
200
+ type: 'text',
201
+ text: `āŒ Uninstall failed: ${handled.message}`,
202
+ },
203
+ ],
204
+ };
205
+ }
206
+ }
207
+ async handleGetWorkflowGuidance(args) {
208
+ try {
209
+ let validatedInput;
210
+ try {
211
+ validatedInput = WorkflowGuidanceInputSchema.parse(args);
212
+ }
213
+ catch (error) {
214
+ if (error instanceof z.ZodError) {
215
+ throw new ValidationError(formatValidationError(error), {
216
+ component: 'ToolHandlers',
217
+ method: 'handleGetWorkflowGuidance',
218
+ schema: 'WorkflowGuidanceInputSchema',
219
+ providedArgs: args,
220
+ });
221
+ }
222
+ throw error;
223
+ }
224
+ const normalizedPhase = this.normalizeWorkflowPhase(validatedInput.phase);
225
+ if (!normalizedPhase) {
226
+ throw new ValidationError(`Invalid workflow phase: ${validatedInput.phase}`, {
227
+ component: 'ToolHandlers',
228
+ method: 'handleGetWorkflowGuidance',
229
+ validPhases: ['idle', 'code-written', 'test-complete', 'commit-ready', 'committed'],
230
+ providedPhase: validatedInput.phase,
231
+ });
232
+ }
233
+ const result = await this.developmentButler.processCheckpoint(normalizedPhase, {
234
+ ...validatedInput,
235
+ phase: normalizedPhase,
236
+ });
237
+ return {
238
+ content: [
239
+ {
240
+ type: 'text',
241
+ text: result.formattedRequest,
242
+ },
243
+ ],
244
+ };
245
+ }
246
+ catch (error) {
247
+ logError(error, {
248
+ component: 'ToolHandlers',
249
+ method: 'handleGetWorkflowGuidance',
250
+ operation: 'processing workflow checkpoint',
251
+ data: { phase: args?.phase },
252
+ });
253
+ const handled = handleError(error, {
254
+ component: 'ToolHandlers',
255
+ method: 'handleGetWorkflowGuidance',
256
+ });
257
+ return {
258
+ content: [
259
+ {
260
+ type: 'text',
261
+ text: `āŒ Workflow guidance failed: ${handled.message}`,
262
+ },
263
+ ],
264
+ };
265
+ }
266
+ }
267
+ async handleGetSessionHealth() {
268
+ try {
269
+ const health = this.developmentButler.getContextMonitor().checkSessionHealth();
270
+ return {
271
+ content: [
272
+ {
273
+ type: 'text',
274
+ text: JSON.stringify(health, null, 2),
275
+ },
276
+ ],
277
+ };
278
+ }
279
+ catch (error) {
280
+ logError(error, {
281
+ component: 'ToolHandlers',
282
+ method: 'handleGetSessionHealth',
283
+ operation: 'checking session health',
284
+ });
285
+ const handled = handleError(error, {
286
+ component: 'ToolHandlers',
287
+ method: 'handleGetSessionHealth',
288
+ });
289
+ return {
290
+ content: [
291
+ {
292
+ type: 'text',
293
+ text: `āŒ Session health check failed: ${handled.message}`,
294
+ },
295
+ ],
296
+ };
297
+ }
298
+ }
299
+ async handleReloadContext(input) {
300
+ try {
301
+ const requestId = `manual_${Date.now()}`;
302
+ const result = await this.developmentButler.executeContextReload(requestId);
303
+ return {
304
+ content: [
305
+ {
306
+ type: 'text',
307
+ text: JSON.stringify(result, null, 2),
308
+ },
309
+ ],
310
+ };
311
+ }
312
+ catch (error) {
313
+ logError(error, {
314
+ component: 'ToolHandlers',
315
+ method: 'handleReloadContext',
316
+ operation: 'reloading context',
317
+ data: { reason: input.reason },
318
+ });
319
+ const handled = handleError(error, {
320
+ component: 'ToolHandlers',
321
+ method: 'handleReloadContext',
322
+ });
323
+ return {
324
+ content: [
325
+ {
326
+ type: 'text',
327
+ text: `āŒ Context reload failed: ${handled.message}`,
328
+ },
329
+ ],
330
+ };
331
+ }
332
+ }
333
+ async handleRecordTokenUsage(args) {
334
+ try {
335
+ let validatedInput;
336
+ try {
337
+ validatedInput = RecordTokenUsageInputSchema.parse(args);
338
+ }
339
+ catch (error) {
340
+ if (error instanceof z.ZodError) {
341
+ throw new ValidationError(formatValidationError(error), {
342
+ component: 'ToolHandlers',
343
+ method: 'handleRecordTokenUsage',
344
+ schema: 'RecordTokenUsageInputSchema',
345
+ providedArgs: args,
346
+ });
347
+ }
348
+ throw error;
349
+ }
350
+ this.developmentButler.getTokenTracker().recordUsage({
351
+ inputTokens: validatedInput.inputTokens,
352
+ outputTokens: validatedInput.outputTokens,
353
+ });
354
+ return {
355
+ content: [
356
+ {
357
+ type: 'text',
358
+ text: JSON.stringify({ success: true }, null, 2),
359
+ },
360
+ ],
361
+ };
362
+ }
363
+ catch (error) {
364
+ logError(error, {
365
+ component: 'ToolHandlers',
366
+ method: 'handleRecordTokenUsage',
367
+ operation: 'recording token usage',
368
+ data: { inputTokens: args?.inputTokens, outputTokens: args?.outputTokens },
369
+ });
370
+ const handled = handleError(error, {
371
+ component: 'ToolHandlers',
372
+ method: 'handleRecordTokenUsage',
373
+ });
374
+ return {
375
+ content: [
376
+ {
377
+ type: 'text',
378
+ text: `āŒ Token usage recording failed: ${handled.message}`,
379
+ },
380
+ ],
381
+ };
382
+ }
383
+ }
384
+ async handleHookToolUse(args) {
385
+ try {
386
+ let validatedInput;
387
+ try {
388
+ validatedInput = HookToolUseInputSchema.parse(args);
389
+ }
390
+ catch (error) {
391
+ if (error instanceof z.ZodError) {
392
+ throw new ValidationError(formatValidationError(error), {
393
+ component: 'ToolHandlers',
394
+ method: 'handleHookToolUse',
395
+ schema: 'HookToolUseInputSchema',
396
+ providedArgs: args,
397
+ });
398
+ }
399
+ throw error;
400
+ }
401
+ await this.hookIntegration.processToolUse({
402
+ toolName: validatedInput.toolName,
403
+ arguments: validatedInput.arguments,
404
+ success: validatedInput.success,
405
+ duration: validatedInput.duration,
406
+ tokensUsed: validatedInput.tokensUsed,
407
+ output: validatedInput.output,
408
+ });
409
+ return {
410
+ content: [
411
+ {
412
+ type: 'text',
413
+ text: JSON.stringify({ success: true }, null, 2),
414
+ },
415
+ ],
416
+ };
417
+ }
418
+ catch (error) {
419
+ logError(error, {
420
+ component: 'ToolHandlers',
421
+ method: 'handleHookToolUse',
422
+ operation: 'processing hook tool use',
423
+ data: { toolName: args?.toolName },
424
+ });
425
+ const handled = handleError(error, {
426
+ component: 'ToolHandlers',
427
+ method: 'handleHookToolUse',
428
+ });
429
+ return {
430
+ content: [
431
+ {
432
+ type: 'text',
433
+ text: `āŒ Hook processing failed: ${handled.message}`,
434
+ },
435
+ ],
436
+ };
437
+ }
438
+ }
439
+ async handleGenerateSmartPlan(args) {
440
+ try {
441
+ let validatedInput;
442
+ try {
443
+ validatedInput = GenerateSmartPlanInputSchema.parse(args);
444
+ }
445
+ catch (error) {
446
+ if (error instanceof z.ZodError) {
447
+ throw new ValidationError(formatValidationError(error), {
448
+ component: 'ToolHandlers',
449
+ method: 'handleGenerateSmartPlan',
450
+ schema: 'GenerateSmartPlanInputSchema',
451
+ providedArgs: args,
452
+ });
453
+ }
454
+ throw error;
455
+ }
456
+ const plan = await this.planningEngine.generatePlan({
457
+ featureDescription: validatedInput.featureDescription,
458
+ requirements: validatedInput.requirements,
459
+ constraints: validatedInput.constraints,
460
+ });
461
+ let planText = `# ${plan.title}\n\n`;
462
+ planText += `**Goal**: ${plan.goal}\n\n`;
463
+ planText += `**Architecture**: ${plan.architecture}\n\n`;
464
+ planText += `**Tech Stack**: ${plan.techStack.join(', ')}\n\n`;
465
+ planText += `**Total Estimated Time**: ${plan.totalEstimatedTime}\n\n`;
466
+ planText += `---\n\n`;
467
+ planText += `## Tasks\n\n`;
468
+ for (const task of plan.tasks) {
469
+ planText += `### ${task.id}: ${task.description}\n\n`;
470
+ planText += `- **Priority**: ${task.priority}\n`;
471
+ planText += `- **Estimated Duration**: ${task.estimatedDuration}\n`;
472
+ if (task.suggestedAgent) {
473
+ const capabilityHint = this.describeCapabilities(task.suggestedAgent);
474
+ if (capabilityHint) {
475
+ planText += `- **Suggested Capability**: ${capabilityHint}\n`;
476
+ }
477
+ }
478
+ if (task.dependencies.length > 0) {
479
+ planText += `- **Dependencies**: ${task.dependencies.join(', ')}\n`;
480
+ }
481
+ planText += `\n**Steps**:\n`;
482
+ task.steps.forEach((step, index) => {
483
+ planText += `${index + 1}. ${step}\n`;
484
+ });
485
+ if (task.files.create && task.files.create.length > 0) {
486
+ planText += `\n**Files to Create**: ${task.files.create.join(', ')}\n`;
487
+ }
488
+ if (task.files.modify && task.files.modify.length > 0) {
489
+ planText += `**Files to Modify**: ${task.files.modify.join(', ')}\n`;
490
+ }
491
+ if (task.files.test && task.files.test.length > 0) {
492
+ planText += `**Test Files**: ${task.files.test.join(', ')}\n`;
493
+ }
494
+ planText += `\n---\n\n`;
495
+ }
496
+ if (SimpleConfig.EVIDENCE_MODE || SimpleConfig.BEGINNER_MODE) {
497
+ planText += `## Quality Gates (Best Practices)\n\n`;
498
+ planText += `- **Code Review**: Group findings by severity and cite file paths/symbols for each issue.\n`;
499
+ planText += `- **Issue Fixes**: Provide reproduction steps, root cause evidence, minimal fix, and verification steps.\n`;
500
+ planText += `- **E2E Tests**: Run targeted tests and attach logs/screenshots; if not run, state "Not run".\n`;
501
+ planText += `- **Evidence Guard**: Separate facts vs assumptions and request missing inputs explicitly.\n`;
502
+ planText += `- **Release Hygiene**: Run lint/typecheck, update docs if APIs change, and note tests executed.\n\n`;
503
+ }
504
+ return {
505
+ content: [
506
+ {
507
+ type: 'text',
508
+ text: planText,
509
+ },
510
+ ],
511
+ };
512
+ }
513
+ catch (error) {
514
+ logError(error, {
515
+ component: 'ToolHandlers',
516
+ method: 'handleGenerateSmartPlan',
517
+ operation: 'generating smart plan',
518
+ data: { featureDescription: args?.featureDescription },
519
+ });
520
+ const handled = handleError(error, {
521
+ component: 'ToolHandlers',
522
+ method: 'handleGenerateSmartPlan',
523
+ });
524
+ return {
525
+ content: [
526
+ {
527
+ type: 'text',
528
+ text: `āŒ Smart plan generation failed: ${handled.message}`,
529
+ },
530
+ ],
531
+ };
532
+ }
533
+ }
534
+ async handleRecallMemory(args) {
535
+ if (!this.memoryRateLimiter.consume()) {
536
+ throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
537
+ component: 'ToolHandlers',
538
+ method: 'handleRecallMemory',
539
+ rateLimitStatus: this.memoryRateLimiter.getStatus(),
540
+ });
541
+ }
542
+ try {
543
+ let validatedInput;
544
+ try {
545
+ validatedInput = RecallMemoryInputSchema.parse(args);
546
+ }
547
+ catch (error) {
548
+ if (error instanceof z.ZodError) {
549
+ throw new ValidationError(formatValidationError(error), {
550
+ component: 'ToolHandlers',
551
+ method: 'handleRecallMemory',
552
+ schema: 'RecallMemoryInputSchema',
553
+ providedArgs: args,
554
+ });
555
+ }
556
+ throw error;
557
+ }
558
+ const result = await recallMemoryTool.handler(validatedInput, this.projectMemoryManager);
559
+ let text = 'šŸ“š Project Memory Recall\n';
560
+ text += '━'.repeat(60) + '\n\n';
561
+ if (result.memories.length === 0) {
562
+ text += 'No memories found.\n\n';
563
+ text += 'šŸ’” Memories will be created as you work on the project.\n';
564
+ }
565
+ else {
566
+ text += `Found ${result.memories.length} recent memories:\n\n`;
567
+ result.memories.forEach((memory, index) => {
568
+ text += `${index + 1}. ${memory.type}\n`;
569
+ if (memory.timestamp) {
570
+ text += ` Timestamp: ${memory.timestamp}\n`;
571
+ }
572
+ if (memory.observations && memory.observations.length > 0) {
573
+ text += ' Observations:\n';
574
+ memory.observations.forEach(obs => {
575
+ text += ` - ${obs}\n`;
576
+ });
577
+ }
578
+ text += '\n';
579
+ });
580
+ }
581
+ text += '━'.repeat(60) + '\n';
582
+ return {
583
+ content: [
584
+ {
585
+ type: 'text',
586
+ text,
587
+ },
588
+ ],
589
+ };
590
+ }
591
+ catch (error) {
592
+ logError(error, {
593
+ component: 'ToolHandlers',
594
+ method: 'handleRecallMemory',
595
+ operation: 'recalling project memory',
596
+ data: { query: args?.query, limit: args?.limit },
597
+ });
598
+ const handled = handleError(error, {
599
+ component: 'ToolHandlers',
600
+ method: 'handleRecallMemory',
601
+ });
602
+ return {
603
+ content: [
604
+ {
605
+ type: 'text',
606
+ text: `āŒ Failed to recall memory: ${handled.message}`,
607
+ },
608
+ ],
609
+ };
610
+ }
611
+ }
612
+ describeCapabilities(agentName) {
613
+ const agent = this.agentRegistry.getAgent(agentName);
614
+ if (!agent || !agent.capabilities || agent.capabilities.length === 0) {
615
+ return undefined;
616
+ }
617
+ return agent.capabilities.slice(0, 3).join(', ');
618
+ }
619
+ async handleCreateEntities(args) {
620
+ if (!this.memoryRateLimiter.consume()) {
621
+ throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
622
+ component: 'ToolHandlers',
623
+ method: 'handleCreateEntities',
624
+ rateLimitStatus: this.memoryRateLimiter.getStatus(),
625
+ });
626
+ }
627
+ try {
628
+ let validatedInput;
629
+ try {
630
+ validatedInput = CreateEntitiesInputSchema.parse(args);
631
+ }
632
+ catch (error) {
633
+ if (error instanceof z.ZodError) {
634
+ throw new ValidationError(formatValidationError(error), {
635
+ component: 'ToolHandlers',
636
+ method: 'handleCreateEntities',
637
+ schema: 'CreateEntitiesInputSchema',
638
+ providedArgs: args,
639
+ });
640
+ }
641
+ throw error;
642
+ }
643
+ const result = await createEntitiesTool.handler(validatedInput, this.knowledgeGraph);
644
+ let text = '✨ Knowledge Graph Entity Creation\n';
645
+ text += '━'.repeat(60) + '\n\n';
646
+ if (result.count === 0) {
647
+ text += 'āš ļø No entities were created.\n\n';
648
+ if (result.errors && result.errors.length > 0) {
649
+ text += 'Errors encountered:\n';
650
+ result.errors.forEach(error => {
651
+ text += ` āŒ ${error.name}: ${error.error}\n`;
652
+ });
653
+ }
654
+ }
655
+ else {
656
+ text += `āœ… Successfully created ${result.count} ${result.count === 1 ? 'entity' : 'entities'}:\n\n`;
657
+ result.created.forEach((name, index) => {
658
+ text += `${index + 1}. ${name}\n`;
659
+ });
660
+ if (result.errors && result.errors.length > 0) {
661
+ text += '\nāš ļø Some entities failed:\n';
662
+ result.errors.forEach(error => {
663
+ text += ` āŒ ${error.name}: ${error.error}\n`;
664
+ });
665
+ }
666
+ }
667
+ text += '\n' + '━'.repeat(60) + '\n';
668
+ return {
669
+ content: [
670
+ {
671
+ type: 'text',
672
+ text,
673
+ },
674
+ ],
675
+ };
676
+ }
677
+ catch (error) {
678
+ logError(error, {
679
+ component: 'ToolHandlers',
680
+ method: 'handleCreateEntities',
681
+ operation: 'creating knowledge graph entities',
682
+ data: { entityCount: args?.entities?.length ?? 0 },
683
+ });
684
+ const handled = handleError(error, {
685
+ component: 'ToolHandlers',
686
+ method: 'handleCreateEntities',
687
+ });
688
+ return {
689
+ content: [
690
+ {
691
+ type: 'text',
692
+ text: `āŒ Failed to create entities: ${handled.message}`,
693
+ },
694
+ ],
695
+ };
696
+ }
697
+ }
698
+ async handleAddObservations(args) {
699
+ if (!this.memoryRateLimiter.consume()) {
700
+ throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
701
+ component: 'ToolHandlers',
702
+ method: 'handleAddObservations',
703
+ rateLimitStatus: this.memoryRateLimiter.getStatus(),
704
+ });
705
+ }
706
+ try {
707
+ let validatedInput;
708
+ try {
709
+ validatedInput = AddObservationsInputSchema.parse(args);
710
+ }
711
+ catch (error) {
712
+ if (error instanceof z.ZodError) {
713
+ throw new ValidationError(formatValidationError(error), {
714
+ component: 'ToolHandlers',
715
+ method: 'handleAddObservations',
716
+ schema: 'AddObservationsInputSchema',
717
+ providedArgs: args,
718
+ });
719
+ }
720
+ throw error;
721
+ }
722
+ const result = await addObservationsTool.handler(validatedInput, this.knowledgeGraph);
723
+ let text = 'šŸ“ Knowledge Graph Observation Update\n';
724
+ text += '━'.repeat(60) + '\n\n';
725
+ if (result.count === 0) {
726
+ text += 'āš ļø No observations were added.\n\n';
727
+ if (result.notFound && result.notFound.length > 0) {
728
+ text += 'Entities not found:\n';
729
+ result.notFound.forEach(name => {
730
+ text += ` āŒ ${name}\n`;
731
+ });
732
+ }
733
+ if (result.errors && result.errors.length > 0) {
734
+ text += '\nErrors encountered:\n';
735
+ result.errors.forEach(error => {
736
+ text += ` āŒ ${error.entityName}: ${error.error}\n`;
737
+ });
738
+ }
739
+ }
740
+ else {
741
+ text += `āœ… Successfully updated ${result.count} ${result.count === 1 ? 'entity' : 'entities'}:\n\n`;
742
+ result.updated.forEach((name, index) => {
743
+ text += `${index + 1}. ${name}\n`;
744
+ });
745
+ if (result.notFound && result.notFound.length > 0) {
746
+ text += '\nāš ļø Some entities were not found:\n';
747
+ result.notFound.forEach(name => {
748
+ text += ` āŒ ${name}\n`;
749
+ });
750
+ }
751
+ if (result.errors && result.errors.length > 0) {
752
+ text += '\nāš ļø Some updates failed:\n';
753
+ result.errors.forEach(error => {
754
+ text += ` āŒ ${error.entityName}: ${error.error}\n`;
755
+ });
756
+ }
757
+ }
758
+ text += '\n' + '━'.repeat(60) + '\n';
759
+ return {
760
+ content: [
761
+ {
762
+ type: 'text',
763
+ text,
764
+ },
765
+ ],
766
+ };
767
+ }
768
+ catch (error) {
769
+ logError(error, {
770
+ component: 'ToolHandlers',
771
+ method: 'handleAddObservations',
772
+ operation: 'adding observations to entities',
773
+ data: { observationCount: args?.observations?.length ?? 0 },
774
+ });
775
+ const handled = handleError(error, {
776
+ component: 'ToolHandlers',
777
+ method: 'handleAddObservations',
778
+ });
779
+ return {
780
+ content: [
781
+ {
782
+ type: 'text',
783
+ text: `āŒ Failed to add observations: ${handled.message}`,
784
+ },
785
+ ],
786
+ };
787
+ }
788
+ }
789
+ async handleCreateRelations(args) {
790
+ if (!this.memoryRateLimiter.consume()) {
791
+ throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
792
+ component: 'ToolHandlers',
793
+ method: 'handleCreateRelations',
794
+ rateLimitStatus: this.memoryRateLimiter.getStatus(),
795
+ });
796
+ }
797
+ try {
798
+ let validatedInput;
799
+ try {
800
+ validatedInput = CreateRelationsInputSchema.parse(args);
801
+ }
802
+ catch (error) {
803
+ if (error instanceof z.ZodError) {
804
+ throw new ValidationError(formatValidationError(error), {
805
+ component: 'ToolHandlers',
806
+ method: 'handleCreateRelations',
807
+ schema: 'CreateRelationsInputSchema',
808
+ providedArgs: args,
809
+ });
810
+ }
811
+ throw error;
812
+ }
813
+ const result = await createRelationsTool.handler(validatedInput, this.knowledgeGraph);
814
+ let text = 'šŸ”— Knowledge Graph Relation Creation\n';
815
+ text += '━'.repeat(60) + '\n\n';
816
+ if (result.count === 0) {
817
+ text += 'āš ļø No relations were created.\n\n';
818
+ if (result.missingEntities && result.missingEntities.length > 0) {
819
+ text += 'Entities not found:\n';
820
+ result.missingEntities.forEach(name => {
821
+ text += ` āŒ ${name}\n`;
822
+ });
823
+ }
824
+ if (result.errors && result.errors.length > 0) {
825
+ text += '\nErrors encountered:\n';
826
+ result.errors.forEach(error => {
827
+ text += ` āŒ ${error.from} → ${error.to}: ${error.error}\n`;
828
+ });
829
+ }
830
+ }
831
+ else {
832
+ text += `āœ… Successfully created ${result.count} ${result.count === 1 ? 'relation' : 'relations'}:\n\n`;
833
+ result.created.forEach((rel, index) => {
834
+ text += `${index + 1}. ${rel.from} --[${rel.type}]--> ${rel.to}\n`;
835
+ });
836
+ if (result.missingEntities && result.missingEntities.length > 0) {
837
+ text += '\nāš ļø Some entities were not found:\n';
838
+ result.missingEntities.forEach(name => {
839
+ text += ` āŒ ${name}\n`;
840
+ });
841
+ }
842
+ if (result.errors && result.errors.length > 0) {
843
+ text += '\nāš ļø Some relations failed:\n';
844
+ result.errors.forEach(error => {
845
+ text += ` āŒ ${error.from} → ${error.to}: ${error.error}\n`;
846
+ });
847
+ }
848
+ }
849
+ text += '\n' + '━'.repeat(60) + '\n';
850
+ return {
851
+ content: [
852
+ {
853
+ type: 'text',
854
+ text,
855
+ },
856
+ ],
857
+ };
858
+ }
859
+ catch (error) {
860
+ logError(error, {
861
+ component: 'ToolHandlers',
862
+ method: 'handleCreateRelations',
863
+ operation: 'creating entity relations',
864
+ data: { relationCount: args?.relations?.length ?? 0 },
865
+ });
866
+ const handled = handleError(error, {
867
+ component: 'ToolHandlers',
868
+ method: 'handleCreateRelations',
869
+ });
870
+ return {
871
+ content: [
872
+ {
873
+ type: 'text',
874
+ text: `āŒ Failed to create relations: ${handled.message}`,
875
+ },
876
+ ],
877
+ };
878
+ }
879
+ }
880
+ normalizeWorkflowPhase(phase) {
881
+ const normalized = phase.trim().toLowerCase();
882
+ if (!normalized) {
883
+ return null;
884
+ }
885
+ const cleaned = normalized.replace(/[_\s]+/g, '-');
886
+ const direct = new Set(['idle', 'code-written', 'test-complete', 'commit-ready', 'committed']);
887
+ if (direct.has(cleaned)) {
888
+ return cleaned;
889
+ }
890
+ const aliases = {
891
+ planning: 'idle',
892
+ analysis: 'idle',
893
+ start: 'idle',
894
+ 'code-analysis': 'code-written',
895
+ implementation: 'code-written',
896
+ coding: 'code-written',
897
+ code: 'code-written',
898
+ 'test-analysis': 'test-complete',
899
+ testing: 'test-complete',
900
+ tests: 'test-complete',
901
+ test: 'test-complete',
902
+ 'tests-complete': 'test-complete',
903
+ 'ready-to-commit': 'commit-ready',
904
+ commit: 'commit-ready',
905
+ 'pre-commit': 'commit-ready',
906
+ done: 'committed',
907
+ merged: 'committed',
908
+ shipped: 'committed',
909
+ released: 'committed',
910
+ };
911
+ return aliases[cleaned] || null;
912
+ }
913
+ }
914
+ //# sourceMappingURL=ToolHandlers.js.map