@pcircle/memesh 2.6.6 → 2.7.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 (430) hide show
  1. package/README.md +116 -54
  2. package/README.zh-TW.md +198 -33
  3. package/dist/a2a/client/A2AClient.d.ts +7 -1
  4. package/dist/a2a/client/A2AClient.d.ts.map +1 -1
  5. package/dist/a2a/client/A2AClient.js +197 -61
  6. package/dist/a2a/client/A2AClient.js.map +1 -1
  7. package/dist/a2a/constants.d.ts +34 -0
  8. package/dist/a2a/constants.d.ts.map +1 -0
  9. package/dist/a2a/constants.js +34 -0
  10. package/dist/a2a/constants.js.map +1 -0
  11. package/dist/a2a/delegator/MCPTaskDelegator.d.ts +19 -0
  12. package/dist/a2a/delegator/MCPTaskDelegator.d.ts.map +1 -0
  13. package/dist/a2a/delegator/MCPTaskDelegator.js +184 -0
  14. package/dist/a2a/delegator/MCPTaskDelegator.js.map +1 -0
  15. package/dist/a2a/delegator/index.d.ts +3 -0
  16. package/dist/a2a/delegator/index.d.ts.map +1 -0
  17. package/dist/a2a/delegator/index.js +2 -0
  18. package/dist/a2a/delegator/index.js.map +1 -0
  19. package/dist/a2a/delegator/types.d.ts +9 -0
  20. package/dist/a2a/delegator/types.d.ts.map +1 -0
  21. package/dist/a2a/delegator/types.js +2 -0
  22. package/dist/a2a/delegator/types.js.map +1 -0
  23. package/dist/a2a/errors/ErrorCodes.d.ts +26 -0
  24. package/dist/a2a/errors/ErrorCodes.d.ts.map +1 -0
  25. package/dist/a2a/errors/ErrorCodes.js +25 -0
  26. package/dist/a2a/errors/ErrorCodes.js.map +1 -0
  27. package/dist/a2a/errors/ErrorMessages.d.ts +28 -0
  28. package/dist/a2a/errors/ErrorMessages.d.ts.map +1 -0
  29. package/dist/a2a/errors/ErrorMessages.js +51 -0
  30. package/dist/a2a/errors/ErrorMessages.js.map +1 -0
  31. package/dist/a2a/errors/index.d.ts +3 -0
  32. package/dist/a2a/errors/index.d.ts.map +1 -0
  33. package/dist/a2a/errors/index.js +3 -0
  34. package/dist/a2a/errors/index.js.map +1 -0
  35. package/dist/a2a/executor/TaskExecutor.d.ts +6 -4
  36. package/dist/a2a/executor/TaskExecutor.d.ts.map +1 -1
  37. package/dist/a2a/executor/TaskExecutor.js +8 -47
  38. package/dist/a2a/executor/TaskExecutor.js.map +1 -1
  39. package/dist/a2a/jobs/TimeoutChecker.d.ts +49 -0
  40. package/dist/a2a/jobs/TimeoutChecker.d.ts.map +1 -0
  41. package/dist/a2a/jobs/TimeoutChecker.js +176 -0
  42. package/dist/a2a/jobs/TimeoutChecker.js.map +1 -0
  43. package/dist/a2a/metrics/A2AMetrics.d.ts +38 -0
  44. package/dist/a2a/metrics/A2AMetrics.d.ts.map +1 -0
  45. package/dist/a2a/metrics/A2AMetrics.js +142 -0
  46. package/dist/a2a/metrics/A2AMetrics.js.map +1 -0
  47. package/dist/a2a/metrics/index.d.ts +3 -0
  48. package/dist/a2a/metrics/index.d.ts.map +1 -0
  49. package/dist/a2a/metrics/index.js +2 -0
  50. package/dist/a2a/metrics/index.js.map +1 -0
  51. package/dist/a2a/server/A2AServer.d.ts +2 -0
  52. package/dist/a2a/server/A2AServer.d.ts.map +1 -1
  53. package/dist/a2a/server/A2AServer.js +48 -8
  54. package/dist/a2a/server/A2AServer.js.map +1 -1
  55. package/dist/a2a/server/middleware/auth.d.ts +6 -0
  56. package/dist/a2a/server/middleware/auth.d.ts.map +1 -0
  57. package/dist/a2a/server/middleware/auth.js +64 -0
  58. package/dist/a2a/server/middleware/auth.js.map +1 -0
  59. package/dist/a2a/server/middleware/csrf.d.ts +7 -0
  60. package/dist/a2a/server/middleware/csrf.d.ts.map +1 -0
  61. package/dist/a2a/server/middleware/csrf.js +169 -0
  62. package/dist/a2a/server/middleware/csrf.js.map +1 -0
  63. package/dist/a2a/server/middleware/rateLimit.d.ts +9 -0
  64. package/dist/a2a/server/middleware/rateLimit.d.ts.map +1 -0
  65. package/dist/a2a/server/middleware/rateLimit.js +192 -0
  66. package/dist/a2a/server/middleware/rateLimit.js.map +1 -0
  67. package/dist/a2a/server/middleware/resourceProtection.d.ts +17 -0
  68. package/dist/a2a/server/middleware/resourceProtection.d.ts.map +1 -0
  69. package/dist/a2a/server/middleware/resourceProtection.js +258 -0
  70. package/dist/a2a/server/middleware/resourceProtection.js.map +1 -0
  71. package/dist/a2a/server/middleware/timeout.d.ts +4 -0
  72. package/dist/a2a/server/middleware/timeout.d.ts.map +1 -0
  73. package/dist/a2a/server/middleware/timeout.js +56 -0
  74. package/dist/a2a/server/middleware/timeout.js.map +1 -0
  75. package/dist/a2a/server/middleware.d.ts.map +1 -1
  76. package/dist/a2a/server/middleware.js +9 -6
  77. package/dist/a2a/server/middleware.js.map +1 -1
  78. package/dist/a2a/server/routes.d.ts +3 -0
  79. package/dist/a2a/server/routes.d.ts.map +1 -1
  80. package/dist/a2a/server/routes.js +24 -7
  81. package/dist/a2a/server/routes.js.map +1 -1
  82. package/dist/a2a/server/validation/index.d.ts +2 -0
  83. package/dist/a2a/server/validation/index.d.ts.map +1 -0
  84. package/dist/a2a/server/validation/index.js +2 -0
  85. package/dist/a2a/server/validation/index.js.map +1 -0
  86. package/dist/a2a/server/validation/sendMessageSchema.d.ts +112 -0
  87. package/dist/a2a/server/validation/sendMessageSchema.d.ts.map +1 -0
  88. package/dist/a2a/server/validation/sendMessageSchema.js +143 -0
  89. package/dist/a2a/server/validation/sendMessageSchema.js.map +1 -0
  90. package/dist/a2a/storage/AgentRegistry.d.ts +7 -0
  91. package/dist/a2a/storage/AgentRegistry.d.ts.map +1 -1
  92. package/dist/a2a/storage/AgentRegistry.js +95 -38
  93. package/dist/a2a/storage/AgentRegistry.js.map +1 -1
  94. package/dist/a2a/storage/TaskQueue.d.ts +3 -0
  95. package/dist/a2a/storage/TaskQueue.d.ts.map +1 -1
  96. package/dist/a2a/storage/TaskQueue.js +80 -18
  97. package/dist/a2a/storage/TaskQueue.js.map +1 -1
  98. package/dist/a2a/storage/inputValidation.d.ts +18 -0
  99. package/dist/a2a/storage/inputValidation.d.ts.map +1 -0
  100. package/dist/a2a/storage/inputValidation.js +101 -0
  101. package/dist/a2a/storage/inputValidation.js.map +1 -0
  102. package/dist/a2a/storage/schemas.sql +11 -1
  103. package/dist/a2a/types/index.d.ts +1 -0
  104. package/dist/a2a/types/index.d.ts.map +1 -1
  105. package/dist/a2a/types/rateLimit.d.ts +26 -0
  106. package/dist/a2a/types/rateLimit.d.ts.map +1 -0
  107. package/dist/a2a/types/rateLimit.js +2 -0
  108. package/dist/a2a/types/rateLimit.js.map +1 -0
  109. package/dist/a2a/types/task.d.ts +1 -1
  110. package/dist/a2a/types/task.d.ts.map +1 -1
  111. package/dist/agents/E2EHealingAgent.js +1 -1
  112. package/dist/agents/E2EHealingAgent.js.map +1 -1
  113. package/dist/agents/knowledge/storage/KnowledgeGraphStore.d.ts.map +1 -1
  114. package/dist/agents/knowledge/storage/KnowledgeGraphStore.js +5 -3
  115. package/dist/agents/knowledge/storage/KnowledgeGraphStore.js.map +1 -1
  116. package/dist/cli/config.d.ts +36 -0
  117. package/dist/cli/config.d.ts.map +1 -0
  118. package/dist/cli/config.js +398 -0
  119. package/dist/cli/config.js.map +1 -0
  120. package/dist/cli/daemon.d.ts +3 -0
  121. package/dist/cli/daemon.d.ts.map +1 -0
  122. package/dist/cli/daemon.js +413 -0
  123. package/dist/cli/daemon.js.map +1 -0
  124. package/dist/cli/dashboard.d.ts +2 -0
  125. package/dist/cli/dashboard.d.ts.map +1 -0
  126. package/dist/cli/dashboard.js +300 -0
  127. package/dist/cli/dashboard.js.map +1 -0
  128. package/dist/cli/index.d.ts +3 -0
  129. package/dist/cli/index.d.ts.map +1 -0
  130. package/dist/cli/index.js +182 -0
  131. package/dist/cli/index.js.map +1 -0
  132. package/dist/cli/setup-wizard.d.ts +18 -0
  133. package/dist/cli/setup-wizard.d.ts.map +1 -0
  134. package/dist/cli/setup-wizard.js +308 -0
  135. package/dist/cli/setup-wizard.js.map +1 -0
  136. package/dist/cli/stats.d.ts +34 -0
  137. package/dist/cli/stats.d.ts.map +1 -0
  138. package/dist/cli/stats.js +479 -0
  139. package/dist/cli/stats.js.map +1 -0
  140. package/dist/cli/tutorial.d.ts +27 -0
  141. package/dist/cli/tutorial.d.ts.map +1 -0
  142. package/dist/cli/tutorial.js +430 -0
  143. package/dist/cli/tutorial.js.map +1 -0
  144. package/dist/config/index.d.ts.map +1 -1
  145. package/dist/config/index.js +8 -7
  146. package/dist/config/index.js.map +1 -1
  147. package/dist/config/simple-config.js.map +1 -1
  148. package/dist/core/BackgroundExecutor.d.ts +6 -0
  149. package/dist/core/BackgroundExecutor.d.ts.map +1 -1
  150. package/dist/core/BackgroundExecutor.js +152 -44
  151. package/dist/core/BackgroundExecutor.js.map +1 -1
  152. package/dist/core/ClaudeMdRuleExtractor.d.ts.map +1 -1
  153. package/dist/core/ClaudeMdRuleExtractor.js +9 -14
  154. package/dist/core/ClaudeMdRuleExtractor.js.map +1 -1
  155. package/dist/core/MistakePatternManager.d.ts.map +1 -1
  156. package/dist/core/MistakePatternManager.js +29 -3
  157. package/dist/core/MistakePatternManager.js.map +1 -1
  158. package/dist/core/ResourceMonitor.d.ts.map +1 -1
  159. package/dist/core/ResourceMonitor.js +64 -2
  160. package/dist/core/ResourceMonitor.js.map +1 -1
  161. package/dist/core/ResultHandler.d.ts.map +1 -1
  162. package/dist/core/ResultHandler.js +12 -0
  163. package/dist/core/ResultHandler.js.map +1 -1
  164. package/dist/core/SessionContextMonitor.d.ts.map +1 -1
  165. package/dist/core/SessionContextMonitor.js +4 -1
  166. package/dist/core/SessionContextMonitor.js.map +1 -1
  167. package/dist/core/SessionTokenTracker.d.ts.map +1 -1
  168. package/dist/core/SessionTokenTracker.js +58 -2
  169. package/dist/core/SessionTokenTracker.js.map +1 -1
  170. package/dist/db/ConnectionPool.d.ts.map +1 -1
  171. package/dist/db/ConnectionPool.js +111 -37
  172. package/dist/db/ConnectionPool.js.map +1 -1
  173. package/dist/db/QueryCache.d.ts.map +1 -1
  174. package/dist/db/QueryCache.js +8 -5
  175. package/dist/db/QueryCache.js.map +1 -1
  176. package/dist/errors/ErrorClassifier.d.ts +60 -0
  177. package/dist/errors/ErrorClassifier.d.ts.map +1 -0
  178. package/dist/errors/ErrorClassifier.js +443 -0
  179. package/dist/errors/ErrorClassifier.js.map +1 -0
  180. package/dist/errors/index.d.ts +1 -0
  181. package/dist/errors/index.d.ts.map +1 -1
  182. package/dist/errors/index.js +3 -0
  183. package/dist/errors/index.js.map +1 -1
  184. package/dist/evolution/ABTestManager.d.ts.map +1 -1
  185. package/dist/evolution/ABTestManager.js +80 -1
  186. package/dist/evolution/ABTestManager.js.map +1 -1
  187. package/dist/evolution/EvolutionBootstrap.d.ts.map +1 -1
  188. package/dist/evolution/EvolutionBootstrap.js +4 -4
  189. package/dist/evolution/EvolutionBootstrap.js.map +1 -1
  190. package/dist/evolution/FeedbackCollector.d.ts.map +1 -1
  191. package/dist/evolution/FeedbackCollector.js +6 -0
  192. package/dist/evolution/FeedbackCollector.js.map +1 -1
  193. package/dist/evolution/LearningManager.d.ts.map +1 -1
  194. package/dist/evolution/LearningManager.js +16 -0
  195. package/dist/evolution/LearningManager.js.map +1 -1
  196. package/dist/evolution/MultiObjectiveOptimizer.d.ts.map +1 -1
  197. package/dist/evolution/MultiObjectiveOptimizer.js +18 -3
  198. package/dist/evolution/MultiObjectiveOptimizer.js.map +1 -1
  199. package/dist/evolution/PerformanceTracker.d.ts.map +1 -1
  200. package/dist/evolution/PerformanceTracker.js +83 -13
  201. package/dist/evolution/PerformanceTracker.js.map +1 -1
  202. package/dist/evolution/StatisticalAnalyzer.d.ts +1 -0
  203. package/dist/evolution/StatisticalAnalyzer.d.ts.map +1 -1
  204. package/dist/evolution/StatisticalAnalyzer.js +126 -9
  205. package/dist/evolution/StatisticalAnalyzer.js.map +1 -1
  206. package/dist/evolution/instrumentation/withEvolutionTracking.d.ts.map +1 -1
  207. package/dist/evolution/instrumentation/withEvolutionTracking.js +0 -2
  208. package/dist/evolution/instrumentation/withEvolutionTracking.js.map +1 -1
  209. package/dist/evolution/storage/SQLiteStore.d.ts +1 -0
  210. package/dist/evolution/storage/SQLiteStore.d.ts.map +1 -1
  211. package/dist/evolution/storage/SQLiteStore.js +59 -12
  212. package/dist/evolution/storage/SQLiteStore.js.map +1 -1
  213. package/dist/evolution/storage/validation.d.ts +2 -3
  214. package/dist/evolution/storage/validation.d.ts.map +1 -1
  215. package/dist/evolution/storage/validation.js +2 -6
  216. package/dist/evolution/storage/validation.js.map +1 -1
  217. package/dist/hooks/a2a-collaboration.d.ts +30 -0
  218. package/dist/hooks/a2a-collaboration.d.ts.map +1 -0
  219. package/dist/hooks/a2a-collaboration.js +400 -0
  220. package/dist/hooks/a2a-collaboration.js.map +1 -0
  221. package/dist/knowledge-graph/index.d.ts +7 -1
  222. package/dist/knowledge-graph/index.d.ts.map +1 -1
  223. package/dist/knowledge-graph/index.js +335 -52
  224. package/dist/knowledge-graph/index.js.map +1 -1
  225. package/dist/knowledge-graph/types.d.ts +1 -0
  226. package/dist/knowledge-graph/types.d.ts.map +1 -1
  227. package/dist/management/UninstallManager.d.ts.map +1 -1
  228. package/dist/management/UninstallManager.js.map +1 -1
  229. package/dist/mcp/BuddyCommands.d.ts +15 -2
  230. package/dist/mcp/BuddyCommands.d.ts.map +1 -1
  231. package/dist/mcp/BuddyCommands.js +635 -52
  232. package/dist/mcp/BuddyCommands.js.map +1 -1
  233. package/dist/mcp/ServerInitializer.d.ts +7 -1
  234. package/dist/mcp/ServerInitializer.d.ts.map +1 -1
  235. package/dist/mcp/ServerInitializer.js +121 -69
  236. package/dist/mcp/ServerInitializer.js.map +1 -1
  237. package/dist/mcp/ToolDefinitions.d.ts.map +1 -1
  238. package/dist/mcp/ToolDefinitions.js +109 -18
  239. package/dist/mcp/ToolDefinitions.js.map +1 -1
  240. package/dist/mcp/ToolRouter.d.ts +6 -0
  241. package/dist/mcp/ToolRouter.d.ts.map +1 -1
  242. package/dist/mcp/ToolRouter.js +90 -2
  243. package/dist/mcp/ToolRouter.js.map +1 -1
  244. package/dist/mcp/daemon/DaemonBootstrap.d.ts +33 -0
  245. package/dist/mcp/daemon/DaemonBootstrap.d.ts.map +1 -0
  246. package/dist/mcp/daemon/DaemonBootstrap.js +155 -0
  247. package/dist/mcp/daemon/DaemonBootstrap.js.map +1 -0
  248. package/dist/mcp/daemon/DaemonLockManager.d.ts +47 -0
  249. package/dist/mcp/daemon/DaemonLockManager.d.ts.map +1 -0
  250. package/dist/mcp/daemon/DaemonLockManager.js +417 -0
  251. package/dist/mcp/daemon/DaemonLockManager.js.map +1 -0
  252. package/dist/mcp/daemon/DaemonProtocol.d.ts +127 -0
  253. package/dist/mcp/daemon/DaemonProtocol.d.ts.map +1 -0
  254. package/dist/mcp/daemon/DaemonProtocol.js +452 -0
  255. package/dist/mcp/daemon/DaemonProtocol.js.map +1 -0
  256. package/dist/mcp/daemon/DaemonSocketServer.d.ts +71 -0
  257. package/dist/mcp/daemon/DaemonSocketServer.d.ts.map +1 -0
  258. package/dist/mcp/daemon/DaemonSocketServer.js +384 -0
  259. package/dist/mcp/daemon/DaemonSocketServer.js.map +1 -0
  260. package/dist/mcp/daemon/GracefulShutdownCoordinator.d.ts +67 -0
  261. package/dist/mcp/daemon/GracefulShutdownCoordinator.d.ts.map +1 -0
  262. package/dist/mcp/daemon/GracefulShutdownCoordinator.js +206 -0
  263. package/dist/mcp/daemon/GracefulShutdownCoordinator.js.map +1 -0
  264. package/dist/mcp/daemon/IpcTransport.d.ts +42 -0
  265. package/dist/mcp/daemon/IpcTransport.d.ts.map +1 -0
  266. package/dist/mcp/daemon/IpcTransport.js +231 -0
  267. package/dist/mcp/daemon/IpcTransport.js.map +1 -0
  268. package/dist/mcp/daemon/StdioProxyClient.d.ts +84 -0
  269. package/dist/mcp/daemon/StdioProxyClient.d.ts.map +1 -0
  270. package/dist/mcp/daemon/StdioProxyClient.js +560 -0
  271. package/dist/mcp/daemon/StdioProxyClient.js.map +1 -0
  272. package/dist/mcp/daemon/VersionManager.d.ts +35 -0
  273. package/dist/mcp/daemon/VersionManager.d.ts.map +1 -0
  274. package/dist/mcp/daemon/VersionManager.js +169 -0
  275. package/dist/mcp/daemon/VersionManager.js.map +1 -0
  276. package/dist/mcp/daemon/index.d.ts +9 -0
  277. package/dist/mcp/daemon/index.d.ts.map +1 -0
  278. package/dist/mcp/daemon/index.js +9 -0
  279. package/dist/mcp/daemon/index.js.map +1 -0
  280. package/dist/mcp/handlers/A2AToolHandlers.d.ts.map +1 -1
  281. package/dist/mcp/handlers/A2AToolHandlers.js +24 -4
  282. package/dist/mcp/handlers/A2AToolHandlers.js.map +1 -1
  283. package/dist/mcp/handlers/ToolHandlers.d.ts.map +1 -1
  284. package/dist/mcp/handlers/ToolHandlers.js.map +1 -1
  285. package/dist/mcp/resources/best-practices.md +1 -1
  286. package/dist/mcp/resources/buddy-do-skill.md +1 -1
  287. package/dist/mcp/resources/examples.md +1 -1
  288. package/dist/mcp/resources/quick-reference.md +1 -1
  289. package/dist/mcp/resources/usage-guide.md +2 -2
  290. package/dist/mcp/schemas/OutputSchemas.d.ts +16 -0
  291. package/dist/mcp/schemas/OutputSchemas.d.ts.map +1 -1
  292. package/dist/mcp/schemas/OutputSchemas.js +12 -0
  293. package/dist/mcp/schemas/OutputSchemas.js.map +1 -1
  294. package/dist/mcp/server-bootstrap.js +245 -29
  295. package/dist/mcp/server-bootstrap.js.map +1 -1
  296. package/dist/mcp/server.d.ts +11 -1
  297. package/dist/mcp/server.d.ts.map +1 -1
  298. package/dist/mcp/server.js +196 -9
  299. package/dist/mcp/server.js.map +1 -1
  300. package/dist/mcp/tools/a2a-list-tasks.d.ts +13 -0
  301. package/dist/mcp/tools/a2a-list-tasks.d.ts.map +1 -0
  302. package/dist/mcp/tools/a2a-list-tasks.js +24 -0
  303. package/dist/mcp/tools/a2a-list-tasks.js.map +1 -0
  304. package/dist/mcp/tools/a2a-report-result.d.ts +35 -0
  305. package/dist/mcp/tools/a2a-report-result.d.ts.map +1 -0
  306. package/dist/mcp/tools/a2a-report-result.js +73 -0
  307. package/dist/mcp/tools/a2a-report-result.js.map +1 -0
  308. package/dist/mcp/tools/buddy-do.d.ts.map +1 -1
  309. package/dist/mcp/tools/buddy-do.js +10 -2
  310. package/dist/mcp/tools/buddy-do.js.map +1 -1
  311. package/dist/mcp/tools/buddy-help.d.ts.map +1 -1
  312. package/dist/mcp/tools/buddy-help.js +6 -14
  313. package/dist/mcp/tools/buddy-help.js.map +1 -1
  314. package/dist/mcp/validation.d.ts +1 -1
  315. package/dist/memory/AutoMemoryRecorder.d.ts +35 -0
  316. package/dist/memory/AutoMemoryRecorder.d.ts.map +1 -0
  317. package/dist/memory/AutoMemoryRecorder.js +164 -0
  318. package/dist/memory/AutoMemoryRecorder.js.map +1 -0
  319. package/dist/memory/AutoTagger.d.ts +9 -0
  320. package/dist/memory/AutoTagger.d.ts.map +1 -0
  321. package/dist/memory/AutoTagger.js +149 -0
  322. package/dist/memory/AutoTagger.js.map +1 -0
  323. package/dist/memory/MistakePatternEngine.d.ts.map +1 -1
  324. package/dist/memory/MistakePatternEngine.js.map +1 -1
  325. package/dist/memory/ProjectMemoryCleanup.js +1 -1
  326. package/dist/memory/SecretManager.d.ts.map +1 -1
  327. package/dist/memory/SecretManager.js +48 -15
  328. package/dist/memory/SecretManager.js.map +1 -1
  329. package/dist/memory/SmartMemoryQuery.d.ts +9 -0
  330. package/dist/memory/SmartMemoryQuery.d.ts.map +1 -0
  331. package/dist/memory/SmartMemoryQuery.js +65 -0
  332. package/dist/memory/SmartMemoryQuery.js.map +1 -0
  333. package/dist/memory/UnifiedMemoryStore.d.ts +1 -0
  334. package/dist/memory/UnifiedMemoryStore.d.ts.map +1 -1
  335. package/dist/memory/UnifiedMemoryStore.js +211 -38
  336. package/dist/memory/UnifiedMemoryStore.js.map +1 -1
  337. package/dist/memory/UserPreferenceEngine.d.ts.map +1 -1
  338. package/dist/memory/UserPreferenceEngine.js +6 -5
  339. package/dist/memory/UserPreferenceEngine.js.map +1 -1
  340. package/dist/memory/types/unified-memory.d.ts +2 -0
  341. package/dist/memory/types/unified-memory.d.ts.map +1 -1
  342. package/dist/memory/types/unified-memory.js +2 -0
  343. package/dist/memory/types/unified-memory.js.map +1 -1
  344. package/dist/orchestrator/AgentRouter.d.ts.map +1 -1
  345. package/dist/orchestrator/AgentRouter.js +5 -4
  346. package/dist/orchestrator/AgentRouter.js.map +1 -1
  347. package/dist/orchestrator/CostTracker.d.ts.map +1 -1
  348. package/dist/orchestrator/CostTracker.js.map +1 -1
  349. package/dist/orchestrator/GlobalResourcePool.d.ts.map +1 -1
  350. package/dist/orchestrator/GlobalResourcePool.js +70 -3
  351. package/dist/orchestrator/GlobalResourcePool.js.map +1 -1
  352. package/dist/ui/AsciiProgressBar.d.ts.map +1 -1
  353. package/dist/ui/AsciiProgressBar.js +0 -1
  354. package/dist/ui/AsciiProgressBar.js.map +1 -1
  355. package/dist/ui/AttributionManager.js +2 -2
  356. package/dist/ui/AttributionManager.js.map +1 -1
  357. package/dist/ui/Dashboard.d.ts.map +1 -1
  358. package/dist/ui/Dashboard.js +2 -2
  359. package/dist/ui/Dashboard.js.map +1 -1
  360. package/dist/ui/MetricsStore.d.ts.map +1 -1
  361. package/dist/ui/MetricsStore.js +2 -2
  362. package/dist/ui/MetricsStore.js.map +1 -1
  363. package/dist/ui/ProgressIndicator.d.ts +35 -0
  364. package/dist/ui/ProgressIndicator.d.ts.map +1 -0
  365. package/dist/ui/ProgressIndicator.js +177 -0
  366. package/dist/ui/ProgressIndicator.js.map +1 -0
  367. package/dist/ui/ResponseFormatter.d.ts +8 -0
  368. package/dist/ui/ResponseFormatter.d.ts.map +1 -1
  369. package/dist/ui/ResponseFormatter.js +220 -35
  370. package/dist/ui/ResponseFormatter.js.map +1 -1
  371. package/dist/ui/design-tokens.d.ts +37 -0
  372. package/dist/ui/design-tokens.d.ts.map +1 -0
  373. package/dist/ui/design-tokens.js +105 -0
  374. package/dist/ui/design-tokens.js.map +1 -0
  375. package/dist/ui/theme.d.ts +14 -4
  376. package/dist/ui/theme.d.ts.map +1 -1
  377. package/dist/ui/theme.js +7 -2
  378. package/dist/ui/theme.js.map +1 -1
  379. package/dist/utils/PathResolver.d.ts.map +1 -1
  380. package/dist/utils/PathResolver.js +3 -2
  381. package/dist/utils/PathResolver.js.map +1 -1
  382. package/dist/utils/SystemResources.d.ts.map +1 -1
  383. package/dist/utils/SystemResources.js +9 -14
  384. package/dist/utils/SystemResources.js.map +1 -1
  385. package/dist/utils/errorHandler.d.ts +6 -0
  386. package/dist/utils/errorHandler.d.ts.map +1 -1
  387. package/dist/utils/errorHandler.js +50 -1
  388. package/dist/utils/errorHandler.js.map +1 -1
  389. package/dist/utils/index.d.ts +19 -0
  390. package/dist/utils/index.d.ts.map +1 -0
  391. package/dist/utils/index.js +17 -0
  392. package/dist/utils/index.js.map +1 -0
  393. package/dist/utils/json.d.ts.map +1 -1
  394. package/dist/utils/json.js +11 -1
  395. package/dist/utils/json.js.map +1 -1
  396. package/dist/utils/logger.d.ts.map +1 -1
  397. package/dist/utils/logger.js +65 -3
  398. package/dist/utils/logger.js.map +1 -1
  399. package/dist/utils/lru-cache.d.ts +7 -0
  400. package/dist/utils/lru-cache.d.ts.map +1 -1
  401. package/dist/utils/lru-cache.js +37 -7
  402. package/dist/utils/lru-cache.js.map +1 -1
  403. package/dist/utils/safeMath.d.ts +11 -0
  404. package/dist/utils/safeMath.d.ts.map +1 -0
  405. package/dist/utils/safeMath.js +92 -0
  406. package/dist/utils/safeMath.js.map +1 -0
  407. package/dist/utils/toonify-adapter.d.ts.map +1 -1
  408. package/dist/utils/toonify-adapter.js.map +1 -1
  409. package/dist/utils/tracing/TraceContext.d.ts +23 -0
  410. package/dist/utils/tracing/TraceContext.d.ts.map +1 -0
  411. package/dist/utils/tracing/TraceContext.js +127 -0
  412. package/dist/utils/tracing/TraceContext.js.map +1 -0
  413. package/dist/utils/tracing/index.d.ts +3 -0
  414. package/dist/utils/tracing/index.d.ts.map +1 -0
  415. package/dist/utils/tracing/index.js +3 -0
  416. package/dist/utils/tracing/index.js.map +1 -0
  417. package/dist/utils/tracing/middleware.d.ts +15 -0
  418. package/dist/utils/tracing/middleware.d.ts.map +1 -0
  419. package/dist/utils/tracing/middleware.js +49 -0
  420. package/dist/utils/tracing/middleware.js.map +1 -0
  421. package/dist/utils/validation.d.ts +12 -0
  422. package/dist/utils/validation.d.ts.map +1 -0
  423. package/dist/utils/validation.js +87 -0
  424. package/dist/utils/validation.js.map +1 -0
  425. package/mcp.json +10 -0
  426. package/package.json +10 -2
  427. package/plugin.json +2 -12
  428. package/scripts/postinstall.js +192 -21
  429. package/README.md.backup +0 -536
  430. package/README.zh-TW.md.backup +0 -446
@@ -1,3 +1,5 @@
1
+ import chalk from 'chalk';
2
+ import boxen from 'boxen';
1
3
  export class BuddyCommands {
2
4
  static ALIASES = new Map([
3
5
  ['help-with', 'do'],
@@ -44,67 +46,648 @@ export class BuddyCommands {
44
46
  originalInput,
45
47
  };
46
48
  }
47
- static getHelp(command) {
49
+ static getHelp(command, options = {}) {
48
50
  if (!command) {
49
- return this.getGeneralHelp();
51
+ return options.full ? this.getFullHelp() : this.getQuickStartHelp();
50
52
  }
51
- const helpTexts = {
52
- do: `
53
- buddy do <task>
54
-
55
- Execute tasks with smart routing. MeMesh analyzes complexity and applies
56
- capability-focused prompt enhancement.
57
-
58
- Examples:
59
- buddy do setup authentication
60
- buddy do refactor user service
61
- buddy do fix login bug
62
- `,
63
- remember: `
64
- buddy remember <query>
65
-
66
- Recall project memory and decisions. MeMesh searches your:
67
- - Knowledge graph (entities, relations)
68
- - Project history
69
- - Past decisions
70
-
71
- Examples:
72
- buddy remember api design decisions
73
- buddy remember authentication approach
74
- buddy recall database schema
75
- `,
76
- help: `
77
- buddy help [command]
78
-
79
- Show help for all commands or a specific command.
80
-
81
- Examples:
82
- buddy help
83
- buddy help do
84
- buddy help remember
85
- `,
86
- };
87
- return helpTexts[command] || this.getGeneralHelp();
53
+ return this.getCommandHelp(command);
54
+ }
55
+ static getQuickStartHelp() {
56
+ const content = `
57
+ ${chalk.bold.cyan('🤖 MeMesh Quick Start')}
58
+
59
+ ${chalk.bold('Essential Commands')}
60
+
61
+ ${chalk.cyan('┌────────────────────────────────────────────┐')}
62
+ ${chalk.cyan('│')} ${chalk.bold('buddy-do "<task>"')} ${chalk.cyan('│')}
63
+ ${chalk.cyan('│')} Execute any development task ${chalk.cyan('│')}
64
+ ${chalk.cyan('└────────────────────────────────────────────┘')}
65
+ ${chalk.green('❯')} buddy-do "add user authentication"
66
+ ${chalk.dim('→')} Routes to backend-developer, creates auth system
67
+
68
+ ${chalk.cyan('┌────────────────────────────────────────────┐')}
69
+ ${chalk.cyan('│')} ${chalk.bold('buddy-remember "<query>"')} ${chalk.cyan('│')}
70
+ ${chalk.cyan('│')} Recall project decisions and patterns ${chalk.cyan('│')}
71
+ ${chalk.cyan('└────────────────────────────────────────────┘')}
72
+ ${chalk.green('❯')} buddy-remember "api design approach"
73
+ ${chalk.dim('→')} Searches knowledge graph, shows past decisions
74
+
75
+ ${chalk.bold('Additional Features')}
76
+
77
+ ${chalk.dim('A2A (Agent-to-Agent):')} a2a-list-agents, a2a-send-task
78
+ ${chalk.dim('Secrets:')} buddy-secret-store, buddy-secret-get
79
+ ${chalk.dim('Knowledge:')} create-entities
80
+ ${chalk.dim('Health:')} get-session-health
81
+
82
+ ${chalk.yellow('💡 New to MeMesh?')}
83
+ Run: ${chalk.cyan('memesh tutorial')} (5 min guided intro)
84
+
85
+ ${chalk.dim('📖 Full reference:')} buddy-help --all
86
+ ${chalk.dim(' Specific command:')} buddy-help do
87
+ ${chalk.dim(' Category help:')} buddy-help a2a
88
+ `;
89
+ return boxen(content, {
90
+ padding: 1,
91
+ borderColor: 'cyan',
92
+ borderStyle: 'round',
93
+ });
88
94
  }
89
- static getGeneralHelp() {
95
+ static getFullHelp() {
90
96
  return `
91
- MeMesh (MeMesh) v2.2 - Your friendly AI companion
97
+ ${chalk.bold.cyan('MeMesh Complete Command Reference')}
98
+ ${chalk.dim('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━')}
99
+
100
+ ${chalk.bold.yellow('📋 Core Commands')}
101
+ ${chalk.cyan('buddy-do')} <task> Execute tasks with smart routing
102
+ ${chalk.cyan('buddy-remember')} <query> Recall project memory & decisions
103
+ ${chalk.cyan('buddy-help')} [command] Show this help or command-specific help
104
+ ${chalk.cyan('buddy-record-mistake')} Record AI mistakes for learning
105
+
106
+ ${chalk.dim('Aliases:')}
107
+ ${chalk.dim('do:')} help-with, execute, run, task
108
+ ${chalk.dim('remember:')} recall, retrieve, search, find
109
+
110
+ ${chalk.bold.yellow('🤝 A2A (Agent-to-Agent) Collaboration')}
111
+ ${chalk.cyan('a2a-list-agents')} List all available A2A agents
112
+ ${chalk.cyan('a2a-send-task')} Send task to another agent
113
+ ${chalk.cyan('a2a-get-task')} Get task status and details
114
+ ${chalk.cyan('a2a-list-tasks')} List tasks assigned to you
115
+ ${chalk.cyan('a2a-report-result')} Report task execution result
116
+
117
+ ${chalk.dim('Note:')} Your agent ID format: ${chalk.dim('${hostname}-${timestamp}')}
118
+ ${chalk.dim('Find your ID:')} curl -s http://localhost:3000/a2a/agent-card | grep id
119
+
120
+ ${chalk.bold.yellow('🔐 Secrets Management')}
121
+ ${chalk.cyan('buddy-secret-store')} Securely store API keys/tokens
122
+ ${chalk.cyan('buddy-secret-get')} Retrieve stored secret
123
+ ${chalk.cyan('buddy-secret-list')} List all stored secrets (names only)
124
+ ${chalk.cyan('buddy-secret-delete')} Delete a stored secret
125
+
126
+ ${chalk.dim('Encryption:')} AES-256-GCM, stored locally only
127
+ ${chalk.dim('Auto-expiry:')} Default 30 days, configurable
128
+
129
+ ${chalk.bold.yellow('🧠 Knowledge Graph')}
130
+ ${chalk.cyan('create-entities')} Record decisions, features, lessons learned
131
+
132
+ ${chalk.dim('Entity types:')} decision, feature, bug_fix, lesson_learned
133
+ ${chalk.dim('Auto-tags:')} scope:project:*, tech:* added automatically
134
+
135
+ ${chalk.bold.yellow('💊 Workflow & Health')}
136
+ ${chalk.cyan('get-session-health')} Check token usage & quality metrics
137
+ ${chalk.cyan('get-workflow-guidance')} Get context-aware workflow suggestions
138
+
139
+ ${chalk.bold.yellow('📖 Examples')}
140
+ ${chalk.green('# Task Execution')}
141
+ ${chalk.green('❯')} buddy-do "setup authentication"
142
+ ${chalk.green('❯')} buddy-remember "why JWT over sessions"
143
+
144
+ ${chalk.green('# A2A Collaboration')}
145
+ ${chalk.green('❯')} a2a-list-agents
146
+ ${chalk.green('❯')} a2a-send-task targetAgentId="kts-macbook-abc123" task="analyze logs"
147
+
148
+ ${chalk.green('# Secrets')}
149
+ ${chalk.green('❯')} buddy-secret-store name="openai_key" value="sk-..." type="api_key"
150
+ ${chalk.green('❯')} buddy-secret-get name="openai_key"
151
+
152
+ ${chalk.green('# Knowledge')}
153
+ ${chalk.green('❯')} create-entities entities=[{name:"JWT Auth",type:"decision",...}]
154
+
155
+ ${chalk.bold.yellow('🛠️ Configuration')}
156
+ ${chalk.cyan('memesh setup')} Interactive configuration wizard
157
+ ${chalk.cyan('memesh config show')} View current configuration
158
+ ${chalk.cyan('memesh config validate')} Test MCP connection
159
+
160
+ ${chalk.bold.yellow('📚 Learning Resources')}
161
+ ${chalk.cyan('memesh tutorial')} Interactive 5-minute tutorial
162
+ ${chalk.cyan('memesh dashboard')} Session health dashboard
163
+ ${chalk.cyan('memesh stats')} Usage statistics
164
+ ${chalk.cyan('buddy-help')} <command> Detailed command help
165
+
166
+ ${chalk.dim('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━')}
167
+ ${chalk.dim('🔗 Links:')} https://github.com/PCIRCLE-AI/claude-code-buddy
168
+ ${chalk.dim('📖 Docs:')} https://memesh.pcircle.ai
169
+ `;
170
+ }
171
+ static getCommandHelp(command) {
172
+ const commandHelpers = {
173
+ do: () => this.getDoCommandHelp(),
174
+ remember: () => this.getRememberCommandHelp(),
175
+ help: () => this.getHelpCommandHelp(),
176
+ a2a: () => this.getA2AHelp(),
177
+ secrets: () => this.getSecretsHelp(),
178
+ secret: () => this.getSecretsHelp(),
179
+ knowledge: () => this.getKnowledgeHelp(),
180
+ health: () => this.getHealthHelp(),
181
+ };
182
+ const helper = commandHelpers[command];
183
+ return helper ? helper() : this.getQuickStartHelp();
184
+ }
185
+ static getDoCommandHelp() {
186
+ const content = `
187
+ ${chalk.bold.cyan('buddy-do')} - Execute Development Tasks
188
+
189
+ ${chalk.dim('Description:')}
190
+ Execute any development task with intelligent routing.
191
+ MeMesh analyzes complexity and routes to the best capability.
192
+
193
+ ${chalk.bold('Usage:')}
194
+ buddy-do "<task description>"
195
+
196
+ ${chalk.bold('📝 Examples:')}
197
+
198
+ ${chalk.green('❯')} ${chalk.cyan('buddy-do "add user authentication"')}
199
+ ${chalk.dim('→')} Creates JWT auth system with tests
200
+ ${chalk.dim(' Files:')} src/auth/jwt.ts, tests/auth/jwt.test.ts
201
+ ${chalk.dim(' Agent:')} backend-developer
202
+
203
+ ${chalk.green('❯')} ${chalk.cyan('buddy-do "refactor user service"')}
204
+ ${chalk.dim('→')} Analyzes code, suggests improvements
205
+ ${chalk.dim(' Agent:')} refactoring-specialist
206
+
207
+ ${chalk.green('❯')} ${chalk.cyan('buddy-do "fix login bug"')}
208
+ ${chalk.dim('→')} Debugs issue, provides fix
209
+ ${chalk.dim(' Agent:')} debugger
210
+
211
+ ${chalk.bold('💡 Pro Tips:')}
212
+ • Be specific: "add JWT authentication" > "add auth"
213
+ • Include context: "refactor user service for better testability"
214
+ • Ask follow-ups: Use buddy-remember to recall decisions
215
+
216
+ ${chalk.bold('Common Tasks:')}
217
+ Setup: "setup project structure"
218
+ Features: "add dark mode toggle"
219
+ Refactoring: "extract auth logic to service"
220
+ Debugging: "fix memory leak in socket handler"
221
+ Testing: "add unit tests for auth service"
222
+ `;
223
+ return boxen(content, {
224
+ padding: 1,
225
+ borderColor: 'cyan',
226
+ borderStyle: 'round',
227
+ });
228
+ }
229
+ static getRememberCommandHelp() {
230
+ const content = `
231
+ ${chalk.bold.cyan('buddy-remember')} - Recall Project Memory
232
+
233
+ ${chalk.dim('Description:')}
234
+ Search your project's knowledge graph for past decisions,
235
+ patterns, and context. MeMesh remembers everything.
236
+
237
+ ${chalk.bold('Usage:')}
238
+ buddy-remember "<query>"
239
+
240
+ ${chalk.bold('📝 Examples:')}
241
+
242
+ ${chalk.green('❯')} ${chalk.cyan('buddy-remember "api design decisions"')}
243
+ ${chalk.dim('→')} Shows: REST vs GraphQL choice, auth approach
244
+ ${chalk.dim(' Found:')} 3 decisions from last 2 weeks
245
+
246
+ ${chalk.green('❯')} ${chalk.cyan('buddy-remember "database schema"')}
247
+ ${chalk.dim('→')} Recalls: Table structure, relations, migrations
248
+ ${chalk.dim(' Context:')} User, Post, Comment entities
249
+
250
+ ${chalk.green('❯')} ${chalk.cyan('buddy-remember "why JWT"')}
251
+ ${chalk.dim('→')} Explains: Reasoning behind authentication choice
252
+ ${chalk.dim(' Decision date:')} 2026-01-15
253
+
254
+ ${chalk.bold('💡 Pro Tips:')}
255
+ • Use natural language: "why did we choose X?"
256
+ • Search by topic: "authentication", "database"
257
+ • Time-based queries: "recent api changes"
258
+ • Combine with do: Remember first, then implement
259
+
260
+ ${chalk.bold('What Gets Remembered:')}
261
+ ✓ Technical decisions and rationale
262
+ ✓ Architecture patterns and approaches
263
+ ✓ Code structure and organization
264
+ ✓ Library/framework choices
265
+ ✓ Problem solutions and workarounds
266
+
267
+ ${chalk.dim('Aliases:')} recall, retrieve, search, find
268
+ `;
269
+ return boxen(content, {
270
+ padding: 1,
271
+ borderColor: 'cyan',
272
+ borderStyle: 'round',
273
+ });
274
+ }
275
+ static getHelpCommandHelp() {
276
+ const content = `
277
+ ${chalk.bold.cyan('buddy-help')} - Get Help and Documentation
278
+
279
+ ${chalk.dim('Description:')}
280
+ Show help for all commands or specific command details.
281
+
282
+ ${chalk.bold('Usage:')}
283
+ buddy-help Show quick start guide
284
+ buddy-help --all Show complete reference
285
+ buddy-help <command> Show command-specific help
286
+
287
+ ${chalk.bold('📝 Examples:')}
288
+
289
+ ${chalk.green('❯')} ${chalk.cyan('buddy-help')}
290
+ ${chalk.dim('→')} Shows essential commands (quick start)
291
+
292
+ ${chalk.green('❯')} ${chalk.cyan('buddy-help --all')}
293
+ ${chalk.dim('→')} Complete command reference
294
+
295
+ ${chalk.green('❯')} ${chalk.cyan('buddy-help do')}
296
+ ${chalk.dim('→')} Detailed help for buddy-do command
297
+
298
+ ${chalk.bold('💡 Learning Resources:')}
299
+
300
+ ${chalk.cyan('memesh tutorial')} Interactive 5-minute intro
301
+ ${chalk.cyan('memesh dashboard')} View session health
302
+ ${chalk.cyan('memesh stats')} Your usage statistics
303
+
304
+ ${chalk.bold('Documentation:')}
305
+ 📖 User Guide: https://memesh.pcircle.ai/guide
306
+ 🚀 Quick Start: https://memesh.pcircle.ai/quick-start
307
+ 💬 Discussions: github.com/PCIRCLE-AI/claude-code-buddy
308
+ `;
309
+ return boxen(content, {
310
+ padding: 1,
311
+ borderColor: 'cyan',
312
+ borderStyle: 'round',
313
+ });
314
+ }
315
+ static getA2AHelp() {
316
+ const content = `
317
+ ${chalk.bold.cyan('A2A (Agent-to-Agent)')} - Multi-Agent Collaboration
318
+
319
+ ${chalk.dim('Description:')}
320
+ Enable multiple Claude Code sessions to collaborate and delegate
321
+ tasks to each other. Each session runs an independent A2A agent.
322
+
323
+ ${chalk.bold('🔑 Key Concepts:')}
324
+
325
+ ${chalk.yellow('Agent ID Format:')} ${chalk.dim('\${hostname}-\${timestamp}')}
326
+ Example: kts-macbook-ml8cy34o
327
+
328
+ ${chalk.yellow('Check-in Name:')} Display name (e.g., "Lambda")
329
+ ${chalk.dim('Note:')} This is NOT your agent ID!
330
+
331
+ ${chalk.yellow('Find Your Agent ID:')}
332
+ ${chalk.cyan('curl -s http://localhost:3000/a2a/agent-card | grep id')}
333
+
334
+ ${chalk.bold('📋 Available Tools:')}
335
+
336
+ ${chalk.cyan('a2a-list-agents')} [status]
337
+ List all A2A agents in the registry
338
+ ${chalk.dim('Status:')} active | inactive | all
339
+
340
+ ${chalk.cyan('a2a-send-task')} targetAgentId taskDescription [priority]
341
+ Send a task to another agent
342
+ ${chalk.dim('Priority:')} low | normal | high | urgent
343
+
344
+ ${chalk.cyan('a2a-get-task')} targetAgentId taskId
345
+ Get status and details of a specific task
346
+
347
+ ${chalk.cyan('a2a-list-tasks')} [state] [limit]
348
+ List tasks assigned to you
349
+ ${chalk.dim('State:')} SUBMITTED | WORKING | COMPLETED | FAILED
350
+
351
+ ${chalk.cyan('a2a-report-result')} taskId result success
352
+ Report task execution result
353
+
354
+ ${chalk.bold('📝 Examples:')}
355
+
356
+ ${chalk.green('# Discover agents')}
357
+ ${chalk.green('❯')} a2a-list-agents status="active"
358
+ ${chalk.dim('→')} Shows all active agents with IDs, ports, heartbeat
359
+
360
+ ${chalk.green('# Send task')}
361
+ ${chalk.green('❯')} a2a-send-task \\
362
+ targetAgentId="kts-macbook-xyz789" \\
363
+ taskDescription="analyze error logs" \\
364
+ priority="high"
365
+ ${chalk.dim('→')} Returns task ID for tracking
366
+
367
+ ${chalk.green('# Check task')}
368
+ ${chalk.green('❯')} a2a-get-task \\
369
+ targetAgentId="kts-macbook-xyz789" \\
370
+ taskId="task_123abc"
371
+ ${chalk.dim('→')} Shows: WORKING, 60% complete
372
+
373
+ ${chalk.green('# List your tasks')}
374
+ ${chalk.green('❯')} a2a-list-tasks state="WORKING" limit=10
375
+ ${chalk.dim('→')} Shows all tasks assigned to you
376
+
377
+ ${chalk.bold('💡 Best Practices:')}
378
+ • Always check agent list before sending tasks
379
+ • Use meaningful task descriptions
380
+ • Set appropriate priority levels
381
+ • Monitor task progress with a2a-get-task
382
+ • Report results when completed
383
+
384
+ ${chalk.bold('🔧 Troubleshooting:')}
385
+
386
+ ${chalk.yellow('Q:')} Why don't I see my agent in the list?
387
+ ${chalk.green('A:')} Your agent ID is different from check-in name.
388
+ Run: curl -s http://localhost:3000/a2a/agent-card
389
+
390
+ ${chalk.yellow('Q:')} How do I test A2A locally?
391
+ ${chalk.green('A:')} Open multiple Claude Code sessions. Each creates
392
+ an independent agent that can collaborate.
393
+
394
+ ${chalk.yellow('Q:')} Agent shows "stale" status?
395
+ ${chalk.green('A:')} No heartbeat for 5+ minutes. Restart the session.
396
+ `;
397
+ return boxen(content, {
398
+ padding: 1,
399
+ borderColor: 'cyan',
400
+ borderStyle: 'round',
401
+ });
402
+ }
403
+ static getSecretsHelp() {
404
+ const content = `
405
+ ${chalk.bold.cyan('Secrets Management')} - Secure Credential Storage
406
+
407
+ ${chalk.dim('Description:')}
408
+ Securely store and retrieve API keys, tokens, and passwords.
409
+ Uses AES-256-GCM encryption, stored locally only (never transmitted).
410
+
411
+ ${chalk.bold('📋 Available Tools:')}
412
+
413
+ ${chalk.cyan('buddy-secret-store')} name value type [description] [expiresIn]
414
+ Store a secret securely
415
+ ${chalk.dim('Types:')} api_key | token | password | other
416
+ ${chalk.dim('ExpiresIn:')} "30d" (days), "24h" (hours), "60m" (minutes)
417
+
418
+ ${chalk.cyan('buddy-secret-get')} name
419
+ Retrieve a stored secret (returns decrypted value)
420
+
421
+ ${chalk.cyan('buddy-secret-list')}
422
+ List all secrets (names, types, expiry - NOT values)
423
+
424
+ ${chalk.cyan('buddy-secret-delete')} name
425
+ Permanently delete a secret
426
+
427
+ ${chalk.bold('📝 Examples:')}
428
+
429
+ ${chalk.green('# Store API key')}
430
+ ${chalk.green('❯')} buddy-secret-store \\
431
+ name="openai_api_key" \\
432
+ value="sk-proj-..." \\
433
+ type="api_key" \\
434
+ description="Production OpenAI key for GPT-4"
435
+ ${chalk.dim('→')} ✅ Secret stored securely (expires in 30 days)
436
+
437
+ ${chalk.green('# Retrieve secret')}
438
+ ${chalk.green('❯')} buddy-secret-get name="openai_api_key"
439
+ ${chalk.dim('→')} sk-proj-xxx... (decrypted value)
440
+
441
+ ${chalk.green('# List all secrets')}
442
+ ${chalk.green('❯')} buddy-secret-list
443
+ ${chalk.dim('→')} Shows:
444
+ openai_api_key | api_key | Expires: 2026-03-05
445
+ github_token | token | Expires: 2026-02-20
446
+ db_password | password | Expires: 2026-03-01
447
+
448
+ ${chalk.green('# Delete secret')}
449
+ ${chalk.green('❯')} buddy-secret-delete name="old_api_key"
450
+ ${chalk.dim('→')} ✅ Secret deleted permanently
451
+
452
+ ${chalk.green('# Store with custom expiry')}
453
+ ${chalk.green('❯')} buddy-secret-store \\
454
+ name="temp_token" \\
455
+ value="token_abc123" \\
456
+ type="token" \\
457
+ expiresIn="24h"
458
+ ${chalk.dim('→')} Auto-deletes after 24 hours
459
+
460
+ ${chalk.bold('💡 Best Practices:')}
461
+ • Use descriptive names (e.g., "prod_openai_key" not "key1")
462
+ • Set appropriate expiry times for temporary credentials
463
+ • Rotate keys regularly (delete old, store new)
464
+ • Never hardcode secrets in code - always use this system
465
+ • Check buddy-secret-list before storing to avoid duplicates
466
+
467
+ ${chalk.bold('🔒 Security:')}
468
+ • Encryption: AES-256-GCM (industry standard)
469
+ • Storage: Local filesystem only (${chalk.dim('~/.memesh/secrets/')})
470
+ • Never transmitted: Secrets stay on your machine
471
+ • Auto-cleanup: Expired secrets are automatically deleted
472
+
473
+ ${chalk.bold('🔧 Common Workflows:')}
474
+
475
+ ${chalk.yellow('Key Rotation:')}
476
+ ${chalk.cyan('1.')} buddy-secret-store name="openai_key_new" value="sk-..."
477
+ ${chalk.cyan('2.')} Test with new key
478
+ ${chalk.cyan('3.')} buddy-secret-delete name="openai_key_old"
479
+
480
+ ${chalk.yellow('First-time Setup:')}
481
+ ${chalk.cyan('1.')} buddy-secret-store name="openai_key" value="sk-..." type="api_key"
482
+ ${chalk.cyan('2.')} buddy-secret-store name="github_token" value="ghp_..." type="token"
483
+ ${chalk.cyan('3.')} buddy-secret-list ${chalk.dim('# Verify stored')}
484
+ `;
485
+ return boxen(content, {
486
+ padding: 1,
487
+ borderColor: 'cyan',
488
+ borderStyle: 'round',
489
+ });
490
+ }
491
+ static getKnowledgeHelp() {
492
+ const content = `
493
+ ${chalk.bold.cyan('Knowledge Graph')} - Project Memory System
494
+
495
+ ${chalk.dim('Description:')}
496
+ Record decisions, features, lessons, and bugs in a structured
497
+ knowledge graph. MeMesh automatically tracks relationships and
498
+ provides powerful search capabilities.
499
+
500
+ ${chalk.bold('📋 Available Tools:')}
501
+
502
+ ${chalk.cyan('create-entities')} entities
503
+ Create one or more entities in the knowledge graph
504
+
505
+ ${chalk.cyan('buddy-remember')} query [limit]
506
+ Search and recall stored knowledge
507
+
508
+ ${chalk.bold('🏗️ Entity Structure:')}
509
+
510
+ ${chalk.yellow('name:')} Unique identifier (searchable)
511
+ ${chalk.dim('Format:')} Use imperative or declarative
512
+ ${chalk.dim('Examples:')} "Use Redis for caching", "JWT auth implementation"
513
+
514
+ ${chalk.yellow('entityType:')} Category of entity
515
+ ${chalk.dim('Types:')} decision, feature, bug_fix, lesson_learned, pattern
516
+
517
+ ${chalk.yellow('observations:')} Array of facts/notes
518
+ ${chalk.dim('Format:')} One fact per observation
519
+ ${chalk.dim('Include:')} WHY (rationale), WHAT (impl), HOW (approach)
520
+
521
+ ${chalk.yellow('tags:')} Array of tags (3-7 recommended)
522
+ ${chalk.dim('Format:')} lowercase, hyphens for multi-word
523
+ ${chalk.dim('Examples:')} "tech:postgresql", "domain:auth", "pattern:repository"
524
+
525
+ ${chalk.bold('📝 Examples:')}
526
+
527
+ ${chalk.green('# Record a technical decision')}
528
+ ${chalk.green('❯')} create-entities entities='[{
529
+ "name": "Use JWT for API authentication",
530
+ "entityType": "decision",
531
+ "observations": [
532
+ "Rationale: Stateless auth enables horizontal scaling",
533
+ "Implementation: jsonwebtoken library with RS256",
534
+ "Security: Tokens expire 1hr, refresh tokens 7 days",
535
+ "Files: src/auth/jwt.ts, middleware/authenticate.ts"
536
+ ],
537
+ "tags": ["tech:jwt", "domain:authentication", "security"]
538
+ }]'
539
+
540
+ ${chalk.green('# Record a lesson learned')}
541
+ ${chalk.green('❯')} create-entities entities='[{
542
+ "name": "Always validate user input before DB queries",
543
+ "entityType": "lesson_learned",
544
+ "observations": [
545
+ "Problem: SQL injection vulnerability in search endpoint",
546
+ "Root cause: Direct string concatenation in query",
547
+ "Solution: Use parameterized queries with prepared statements",
548
+ "Prevention: Added input validation middleware"
549
+ ],
550
+ "tags": ["security", "database", "best-practice"]
551
+ }]'
552
+
553
+ ${chalk.green('# Record a feature implementation')}
554
+ ${chalk.green('❯')} create-entities entities='[{
555
+ "name": "Dark mode implementation",
556
+ "entityType": "feature",
557
+ "observations": [
558
+ "Approach: CSS variables + localStorage persistence",
559
+ "Components: ThemeProvider, useTheme hook",
560
+ "Colors: 16 semantic color tokens",
561
+ "Files: src/theme/, components/ThemeToggle.tsx"
562
+ ],
563
+ "tags": ["tech:react", "frontend", "ux", "theme"]
564
+ }]'
565
+
566
+ ${chalk.green('# Recall stored knowledge')}
567
+ ${chalk.green('❯')} buddy-remember "authentication decisions" limit=5
568
+ ${chalk.dim('→')} Found 3 relevant memories:
569
+ 1. Use JWT for API authentication
570
+ 2. OAuth2 for third-party login
571
+ 3. Session management with Redis
572
+
573
+ ${chalk.bold('💡 Best Practices:')}
574
+ • Name entities clearly and searchably
575
+ • Include rationale (WHY) in observations
576
+ • Add relevant tags for discoverability
577
+ • Record decisions when made, not later
578
+ • Link related entities with shared tags
579
+ • Update entities when context changes
580
+
581
+ ${chalk.bold('🏷️ Recommended Tag Patterns:')}
582
+
583
+ ${chalk.yellow('Technology:')} tech:postgresql, tech:react, tech:nodejs
584
+ ${chalk.yellow('Domain:')} domain:auth, domain:api, domain:frontend
585
+ ${chalk.yellow('Pattern:')} pattern:repository, pattern:factory
586
+ ${chalk.yellow('Concern:')} security, performance, scalability
587
+ ${chalk.yellow('Status:')} deprecated, experimental, stable
588
+
589
+ ${chalk.bold('🔍 Search Tips:')}
590
+ • Natural language: "why did we choose PostgreSQL"
591
+ • By tag: "tech:react AND domain:frontend"
592
+ • Recent changes: "recent authentication updates"
593
+ • Problem-solution: "how we fixed login bug"
594
+ `;
595
+ return boxen(content, {
596
+ padding: 1,
597
+ borderColor: 'cyan',
598
+ borderStyle: 'round',
599
+ });
600
+ }
601
+ static getHealthHelp() {
602
+ const content = `
603
+ ${chalk.bold.cyan('Workflow & Health')} - Session Monitoring
604
+
605
+ ${chalk.dim('Description:')}
606
+ Monitor session health, track quality metrics, and get
607
+ workflow guidance for optimal development practices.
608
+
609
+ ${chalk.bold('📋 Available Tools:')}
610
+
611
+ ${chalk.cyan('get-session-health')}
612
+ Check current session health and metrics
613
+
614
+ ${chalk.cyan('get-workflow-guidance')}
615
+ Get context-aware workflow suggestions
616
+
617
+ ${chalk.bold('📝 Examples:')}
618
+
619
+ ${chalk.green('# Check session health')}
620
+ ${chalk.green('❯')} get-session-health
621
+ ${chalk.dim('→')} Session Health Report:
622
+
623
+ Token Usage: 45,231 / 200,000 (23%)
624
+ Quality Score: 87 / 100 (Good)
625
+ Tool Calls: 142
626
+ Errors: 3 (2.1% error rate)
627
+
628
+ Recommendations:
629
+ • Continue current approach
630
+ • Consider saving checkpoint at 50% tokens
631
+
632
+ ${chalk.green('# Get workflow guidance')}
633
+ ${chalk.green('❯')} get-workflow-guidance
634
+ ${chalk.dim('→')} Workflow Guidance:
635
+
636
+ Current Phase: Implementation
637
+ Suggested Next: Code Review
638
+
639
+ Best Practices:
640
+ ✓ Read files before editing
641
+ ✓ Test after implementation
642
+ ✓ Record decisions in knowledge graph
643
+
644
+ ${chalk.bold('📊 Health Metrics:')}
645
+
646
+ ${chalk.yellow('Token Usage:')} Track API usage and budget
647
+ ${chalk.green('Green:')} < 50% - Plenty of room
648
+ ${chalk.yellow('Yellow:')} 50-80% - Monitor usage
649
+ ${chalk.red('Red:')} > 80% - Consider checkpoint
650
+
651
+ ${chalk.yellow('Quality Score:')} Code quality indicators
652
+ ${chalk.dim('Factors:')} Test coverage, error handling, documentation
653
+ ${chalk.green('Good:')} 80-100
654
+ ${chalk.yellow('Fair:')} 60-79
655
+ ${chalk.red('Poor:')} < 60
656
+
657
+ ${chalk.yellow('Error Rate:')} Tool call success rate
658
+ ${chalk.green('Excellent:')} < 5%
659
+ ${chalk.yellow('Normal:')} 5-15%
660
+ ${chalk.red('High:')} > 15% (investigate)
661
+
662
+ ${chalk.bold('💡 Best Practices:')}
663
+ • Check health every 30-60 minutes
664
+ • Save checkpoint before major changes
665
+ • Address quality issues proactively
666
+ • Use workflow guidance for complex tasks
667
+ • Monitor error trends
92
668
 
93
- Commands:
94
- buddy do <task> Execute tasks with smart routing
95
- buddy remember <query> Recall project memory
96
- buddy help [command] Show this help or command-specific help
669
+ ${chalk.bold('🔧 Common Workflows:')}
97
670
 
98
- Aliases:
99
- do: help-with, execute, run, task
100
- remember: recall, retrieve, search, find
671
+ ${chalk.yellow('Before Major Refactoring:')}
672
+ ${chalk.cyan('1.')} get-session-health ${chalk.dim('# Check token budget')}
673
+ ${chalk.cyan('2.')} Save checkpoint if > 50% used
674
+ ${chalk.cyan('3.')} Proceed with refactoring
101
675
 
102
- Examples:
103
- buddy do setup authentication
104
- buddy remember api design decisions
676
+ ${chalk.yellow('Quality Check:')}
677
+ ${chalk.cyan('1.')} get-session-health ${chalk.dim('# Check quality score')}
678
+ ${chalk.cyan('2.')} If < 70, review recent changes
679
+ ${chalk.cyan('3.')} Address flagged issues
105
680
 
106
- For more info: https://github.com/PCIRCLE-AI/claude-code-buddy
681
+ ${chalk.yellow('Error Troubleshooting:')}
682
+ ${chalk.cyan('1.')} get-session-health ${chalk.dim('# Check error rate')}
683
+ ${chalk.cyan('2.')} If > 15%, review error types
684
+ ${chalk.cyan('3.')} Adjust approach based on errors
107
685
  `;
686
+ return boxen(content, {
687
+ padding: 1,
688
+ borderColor: 'cyan',
689
+ borderStyle: 'round',
690
+ });
108
691
  }
109
692
  }
110
693
  //# sourceMappingURL=BuddyCommands.js.map