aiyou-dev 3.5.15

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 (853) hide show
  1. package/.claude/agents/analysis/analyze-code-quality.md +179 -0
  2. package/.claude/agents/analysis/code-analyzer.md +210 -0
  3. package/.claude/agents/analysis/code-review/analyze-code-quality.md +179 -0
  4. package/.claude/agents/architecture/arch-system-design.md +157 -0
  5. package/.claude/agents/architecture/system-design/arch-system-design.md +155 -0
  6. package/.claude/agents/browser/browser-agent.yaml +182 -0
  7. package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
  8. package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
  9. package/.claude/agents/consensus/gossip-coordinator.md +63 -0
  10. package/.claude/agents/consensus/performance-benchmarker.md +851 -0
  11. package/.claude/agents/consensus/quorum-manager.md +823 -0
  12. package/.claude/agents/consensus/raft-manager.md +63 -0
  13. package/.claude/agents/consensus/security-manager.md +622 -0
  14. package/.claude/agents/core/coder.md +453 -0
  15. package/.claude/agents/core/planner.md +375 -0
  16. package/.claude/agents/core/researcher.md +369 -0
  17. package/.claude/agents/core/reviewer.md +520 -0
  18. package/.claude/agents/core/tester.md +512 -0
  19. package/.claude/agents/custom/test-long-runner.md +44 -0
  20. package/.claude/agents/data/data-ml-model.md +445 -0
  21. package/.claude/agents/data/ml/data-ml-model.md +193 -0
  22. package/.claude/agents/development/backend/dev-backend-api.md +142 -0
  23. package/.claude/agents/development/dev-backend-api.md +345 -0
  24. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
  25. package/.claude/agents/devops/ops-cicd-github.md +165 -0
  26. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
  27. package/.claude/agents/documentation/docs-api-openapi.md +355 -0
  28. package/.claude/agents/flow-nexus/app-store.md +88 -0
  29. package/.claude/agents/flow-nexus/authentication.md +69 -0
  30. package/.claude/agents/flow-nexus/challenges.md +81 -0
  31. package/.claude/agents/flow-nexus/neural-network.md +88 -0
  32. package/.claude/agents/flow-nexus/payments.md +83 -0
  33. package/.claude/agents/flow-nexus/sandbox.md +76 -0
  34. package/.claude/agents/flow-nexus/swarm.md +76 -0
  35. package/.claude/agents/flow-nexus/user-tools.md +96 -0
  36. package/.claude/agents/flow-nexus/workflow.md +84 -0
  37. package/.claude/agents/github/code-review-swarm.md +377 -0
  38. package/.claude/agents/github/github-modes.md +173 -0
  39. package/.claude/agents/github/issue-tracker.md +576 -0
  40. package/.claude/agents/github/multi-repo-swarm.md +553 -0
  41. package/.claude/agents/github/pr-manager.md +438 -0
  42. package/.claude/agents/github/project-board-sync.md +509 -0
  43. package/.claude/agents/github/release-manager.md +605 -0
  44. package/.claude/agents/github/release-swarm.md +583 -0
  45. package/.claude/agents/github/repo-architect.md +398 -0
  46. package/.claude/agents/github/swarm-issue.md +573 -0
  47. package/.claude/agents/github/swarm-pr.md +428 -0
  48. package/.claude/agents/github/sync-coordinator.md +452 -0
  49. package/.claude/agents/github/workflow-automation.md +903 -0
  50. package/.claude/agents/goal/agent.md +816 -0
  51. package/.claude/agents/goal/goal-planner.md +73 -0
  52. package/.claude/agents/optimization/benchmark-suite.md +665 -0
  53. package/.claude/agents/optimization/load-balancer.md +431 -0
  54. package/.claude/agents/optimization/performance-monitor.md +672 -0
  55. package/.claude/agents/optimization/resource-allocator.md +674 -0
  56. package/.claude/agents/optimization/topology-optimizer.md +808 -0
  57. package/.claude/agents/payments/agentic-payments.md +126 -0
  58. package/.claude/agents/sona/sona-learning-optimizer.md +74 -0
  59. package/.claude/agents/sparc/architecture.md +699 -0
  60. package/.claude/agents/sparc/pseudocode.md +520 -0
  61. package/.claude/agents/sparc/refinement.md +802 -0
  62. package/.claude/agents/sparc/specification.md +478 -0
  63. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +225 -0
  64. package/.claude/agents/specialized/spec-mobile-react-native.md +227 -0
  65. package/.claude/agents/sublinear/consensus-coordinator.md +338 -0
  66. package/.claude/agents/sublinear/matrix-optimizer.md +185 -0
  67. package/.claude/agents/sublinear/pagerank-analyzer.md +299 -0
  68. package/.claude/agents/sublinear/performance-optimizer.md +368 -0
  69. package/.claude/agents/sublinear/trading-predictor.md +246 -0
  70. package/.claude/agents/swarm/adaptive-coordinator.md +1127 -0
  71. package/.claude/agents/swarm/hierarchical-coordinator.md +710 -0
  72. package/.claude/agents/swarm/mesh-coordinator.md +963 -0
  73. package/.claude/agents/templates/automation-smart-agent.md +205 -0
  74. package/.claude/agents/templates/base-template-generator.md +268 -0
  75. package/.claude/agents/templates/coordinator-swarm-init.md +90 -0
  76. package/.claude/agents/templates/github-pr-manager.md +177 -0
  77. package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
  78. package/.claude/agents/templates/memory-coordinator.md +187 -0
  79. package/.claude/agents/templates/orchestrator-task.md +139 -0
  80. package/.claude/agents/templates/performance-analyzer.md +199 -0
  81. package/.claude/agents/templates/sparc-coordinator.md +514 -0
  82. package/.claude/agents/testing/production-validator.md +395 -0
  83. package/.claude/agents/testing/tdd-london-swarm.md +244 -0
  84. package/.claude/agents/v3/adr-architect.md +184 -0
  85. package/.claude/agents/v3/aidefence-guardian.md +282 -0
  86. package/.claude/agents/v3/claims-authorizer.md +208 -0
  87. package/.claude/agents/v3/collective-intelligence-coordinator.md +993 -0
  88. package/.claude/agents/v3/ddd-domain-expert.md +220 -0
  89. package/.claude/agents/v3/injection-analyst.md +236 -0
  90. package/.claude/agents/v3/memory-specialist.md +995 -0
  91. package/.claude/agents/v3/performance-engineer.md +1233 -0
  92. package/.claude/agents/v3/pii-detector.md +151 -0
  93. package/.claude/agents/v3/reasoningbank-learner.md +213 -0
  94. package/.claude/agents/v3/security-architect-aidefence.md +410 -0
  95. package/.claude/agents/v3/security-architect.md +867 -0
  96. package/.claude/agents/v3/security-auditor.md +771 -0
  97. package/.claude/agents/v3/sparc-orchestrator.md +182 -0
  98. package/.claude/agents/v3/swarm-memory-manager.md +157 -0
  99. package/.claude/agents/v3/v3-integration-architect.md +205 -0
  100. package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
  101. package/.claude/commands/analysis/README.md +9 -0
  102. package/.claude/commands/analysis/bottleneck-detect.md +162 -0
  103. package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
  104. package/.claude/commands/analysis/performance-report.md +25 -0
  105. package/.claude/commands/analysis/token-efficiency.md +45 -0
  106. package/.claude/commands/analysis/token-usage.md +25 -0
  107. package/.claude/commands/automation/README.md +9 -0
  108. package/.claude/commands/automation/auto-agent.md +122 -0
  109. package/.claude/commands/automation/self-healing.md +106 -0
  110. package/.claude/commands/automation/session-memory.md +90 -0
  111. package/.claude/commands/automation/smart-agents.md +73 -0
  112. package/.claude/commands/automation/smart-spawn.md +25 -0
  113. package/.claude/commands/automation/workflow-select.md +25 -0
  114. package/.claude/commands/claude-flow-help.md +103 -0
  115. package/.claude/commands/claude-flow-memory.md +107 -0
  116. package/.claude/commands/claude-flow-swarm.md +205 -0
  117. package/.claude/commands/github/README.md +11 -0
  118. package/.claude/commands/github/code-review-swarm.md +514 -0
  119. package/.claude/commands/github/code-review.md +25 -0
  120. package/.claude/commands/github/github-modes.md +147 -0
  121. package/.claude/commands/github/github-swarm.md +121 -0
  122. package/.claude/commands/github/issue-tracker.md +292 -0
  123. package/.claude/commands/github/issue-triage.md +25 -0
  124. package/.claude/commands/github/multi-repo-swarm.md +519 -0
  125. package/.claude/commands/github/pr-enhance.md +26 -0
  126. package/.claude/commands/github/pr-manager.md +170 -0
  127. package/.claude/commands/github/project-board-sync.md +471 -0
  128. package/.claude/commands/github/release-manager.md +338 -0
  129. package/.claude/commands/github/release-swarm.md +544 -0
  130. package/.claude/commands/github/repo-analyze.md +25 -0
  131. package/.claude/commands/github/repo-architect.md +367 -0
  132. package/.claude/commands/github/swarm-issue.md +482 -0
  133. package/.claude/commands/github/swarm-pr.md +285 -0
  134. package/.claude/commands/github/sync-coordinator.md +301 -0
  135. package/.claude/commands/github/workflow-automation.md +442 -0
  136. package/.claude/commands/hooks/README.md +11 -0
  137. package/.claude/commands/hooks/overview.md +58 -0
  138. package/.claude/commands/hooks/post-edit.md +117 -0
  139. package/.claude/commands/hooks/post-task.md +112 -0
  140. package/.claude/commands/hooks/pre-edit.md +113 -0
  141. package/.claude/commands/hooks/pre-task.md +111 -0
  142. package/.claude/commands/hooks/session-end.md +118 -0
  143. package/.claude/commands/hooks/setup.md +103 -0
  144. package/.claude/commands/monitoring/README.md +9 -0
  145. package/.claude/commands/monitoring/agent-metrics.md +25 -0
  146. package/.claude/commands/monitoring/agents.md +44 -0
  147. package/.claude/commands/monitoring/real-time-view.md +25 -0
  148. package/.claude/commands/monitoring/status.md +46 -0
  149. package/.claude/commands/monitoring/swarm-monitor.md +25 -0
  150. package/.claude/commands/optimization/README.md +9 -0
  151. package/.claude/commands/optimization/auto-topology.md +62 -0
  152. package/.claude/commands/optimization/cache-manage.md +25 -0
  153. package/.claude/commands/optimization/parallel-execute.md +25 -0
  154. package/.claude/commands/optimization/parallel-execution.md +50 -0
  155. package/.claude/commands/optimization/topology-optimize.md +25 -0
  156. package/.claude/commands/sparc/analyzer.md +52 -0
  157. package/.claude/commands/sparc/architect.md +53 -0
  158. package/.claude/commands/sparc/ask.md +97 -0
  159. package/.claude/commands/sparc/batch-executor.md +54 -0
  160. package/.claude/commands/sparc/code.md +89 -0
  161. package/.claude/commands/sparc/coder.md +54 -0
  162. package/.claude/commands/sparc/debug.md +83 -0
  163. package/.claude/commands/sparc/debugger.md +54 -0
  164. package/.claude/commands/sparc/designer.md +53 -0
  165. package/.claude/commands/sparc/devops.md +109 -0
  166. package/.claude/commands/sparc/docs-writer.md +80 -0
  167. package/.claude/commands/sparc/documenter.md +54 -0
  168. package/.claude/commands/sparc/innovator.md +54 -0
  169. package/.claude/commands/sparc/integration.md +83 -0
  170. package/.claude/commands/sparc/mcp.md +117 -0
  171. package/.claude/commands/sparc/memory-manager.md +54 -0
  172. package/.claude/commands/sparc/optimizer.md +54 -0
  173. package/.claude/commands/sparc/orchestrator.md +132 -0
  174. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +83 -0
  175. package/.claude/commands/sparc/refinement-optimization-mode.md +83 -0
  176. package/.claude/commands/sparc/researcher.md +54 -0
  177. package/.claude/commands/sparc/reviewer.md +54 -0
  178. package/.claude/commands/sparc/security-review.md +80 -0
  179. package/.claude/commands/sparc/sparc-modes.md +174 -0
  180. package/.claude/commands/sparc/sparc.md +111 -0
  181. package/.claude/commands/sparc/spec-pseudocode.md +80 -0
  182. package/.claude/commands/sparc/supabase-admin.md +348 -0
  183. package/.claude/commands/sparc/swarm-coordinator.md +54 -0
  184. package/.claude/commands/sparc/tdd.md +54 -0
  185. package/.claude/commands/sparc/tester.md +54 -0
  186. package/.claude/commands/sparc/tutorial.md +79 -0
  187. package/.claude/commands/sparc/workflow-manager.md +54 -0
  188. package/.claude/helpers/README.md +97 -0
  189. package/.claude/helpers/adr-compliance.sh +186 -0
  190. package/.claude/helpers/auto-commit.sh +178 -0
  191. package/.claude/helpers/auto-memory-hook.mjs +365 -0
  192. package/.claude/helpers/checkpoint-manager.sh +251 -0
  193. package/.claude/helpers/daemon-manager.sh +252 -0
  194. package/.claude/helpers/ddd-tracker.sh +144 -0
  195. package/.claude/helpers/github-safe.js +106 -0
  196. package/.claude/helpers/github-setup.sh +28 -0
  197. package/.claude/helpers/guidance-hook.sh +13 -0
  198. package/.claude/helpers/guidance-hooks.sh +102 -0
  199. package/.claude/helpers/health-monitor.sh +108 -0
  200. package/.claude/helpers/hook-handler.cjs +271 -0
  201. package/.claude/helpers/intelligence.cjs +916 -0
  202. package/.claude/helpers/learning-hooks.sh +329 -0
  203. package/.claude/helpers/learning-optimizer.sh +127 -0
  204. package/.claude/helpers/learning-service.mjs +1144 -0
  205. package/.claude/helpers/memory.js +83 -0
  206. package/.claude/helpers/metrics-db.mjs +488 -0
  207. package/.claude/helpers/pattern-consolidator.sh +86 -0
  208. package/.claude/helpers/perf-worker.sh +160 -0
  209. package/.claude/helpers/post-commit +16 -0
  210. package/.claude/helpers/pre-commit +26 -0
  211. package/.claude/helpers/quick-start.sh +19 -0
  212. package/.claude/helpers/router.js +66 -0
  213. package/.claude/helpers/security-scanner.sh +127 -0
  214. package/.claude/helpers/session.js +135 -0
  215. package/.claude/helpers/setup-mcp.sh +18 -0
  216. package/.claude/helpers/standard-checkpoint-hooks.sh +189 -0
  217. package/.claude/helpers/statusline-hook.sh +21 -0
  218. package/.claude/helpers/statusline.cjs +758 -0
  219. package/.claude/helpers/statusline.js +316 -0
  220. package/.claude/helpers/swarm-comms.sh +353 -0
  221. package/.claude/helpers/swarm-hooks.sh +761 -0
  222. package/.claude/helpers/swarm-monitor.sh +211 -0
  223. package/.claude/helpers/sync-v3-metrics.sh +245 -0
  224. package/.claude/helpers/update-v3-progress.sh +166 -0
  225. package/.claude/helpers/v3-quick-status.sh +58 -0
  226. package/.claude/helpers/v3.sh +111 -0
  227. package/.claude/helpers/validate-v3-config.sh +216 -0
  228. package/.claude/helpers/worker-manager.sh +170 -0
  229. package/.claude/settings.json +319 -0
  230. package/.claude/settings.local.json +18 -0
  231. package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
  232. package/.claude/skills/agentdb-learning/SKILL.md +545 -0
  233. package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
  234. package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
  235. package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
  236. package/.claude/skills/browser/SKILL.md +204 -0
  237. package/.claude/skills/github-code-review/SKILL.md +1140 -0
  238. package/.claude/skills/github-multi-repo/SKILL.md +874 -0
  239. package/.claude/skills/github-project-management/SKILL.md +1277 -0
  240. package/.claude/skills/github-release-management/SKILL.md +1081 -0
  241. package/.claude/skills/github-workflow-automation/SKILL.md +1065 -0
  242. package/.claude/skills/hooks-automation/SKILL.md +1201 -0
  243. package/.claude/skills/pair-programming/SKILL.md +1202 -0
  244. package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
  245. package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
  246. package/.claude/skills/skill-builder/SKILL.md +910 -0
  247. package/.claude/skills/sparc-methodology/SKILL.md +1115 -0
  248. package/.claude/skills/stream-chain/SKILL.md +563 -0
  249. package/.claude/skills/swarm-advanced/SKILL.md +973 -0
  250. package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
  251. package/.claude/skills/v3-cli-modernization/SKILL.md +872 -0
  252. package/.claude/skills/v3-core-implementation/SKILL.md +797 -0
  253. package/.claude/skills/v3-ddd-architecture/SKILL.md +442 -0
  254. package/.claude/skills/v3-integration-deep/SKILL.md +241 -0
  255. package/.claude/skills/v3-mcp-optimization/SKILL.md +777 -0
  256. package/.claude/skills/v3-memory-unification/SKILL.md +174 -0
  257. package/.claude/skills/v3-performance-optimization/SKILL.md +390 -0
  258. package/.claude/skills/v3-security-overhaul/SKILL.md +82 -0
  259. package/.claude/skills/v3-swarm-coordination/SKILL.md +340 -0
  260. package/.claude/skills/verification-quality/SKILL.md +649 -0
  261. package/.claude-plugin/README.md +720 -0
  262. package/.claude-plugin/docs/INSTALLATION.md +261 -0
  263. package/.claude-plugin/docs/PLUGIN_SUMMARY.md +361 -0
  264. package/.claude-plugin/docs/QUICKSTART.md +361 -0
  265. package/.claude-plugin/docs/STRUCTURE.md +128 -0
  266. package/.claude-plugin/hooks/hooks.json +74 -0
  267. package/.claude-plugin/marketplace.json +96 -0
  268. package/.claude-plugin/plugin.json +71 -0
  269. package/.claude-plugin/scripts/install.sh +234 -0
  270. package/.claude-plugin/scripts/uninstall.sh +36 -0
  271. package/.claude-plugin/scripts/verify.sh +108 -0
  272. package/LICENSE +24 -0
  273. package/README.md +99 -0
  274. package/bin/cli.js +11 -0
  275. package/bin/npx-repair.js +7 -0
  276. package/bin/npx-safe-launch.js +9 -0
  277. package/package.json +131 -0
  278. package/v3/@aiyou-dev/cli/bin/cli.js +156 -0
  279. package/v3/@aiyou-dev/cli/bin/mcp-server.js +189 -0
  280. package/v3/@aiyou-dev/cli/bin/preinstall.cjs +2 -0
  281. package/v3/@aiyou-dev/cli/dist/src/appliance/gguf-engine.d.ts +91 -0
  282. package/v3/@aiyou-dev/cli/dist/src/appliance/gguf-engine.js +425 -0
  283. package/v3/@aiyou-dev/cli/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
  284. package/v3/@aiyou-dev/cli/dist/src/appliance/ruvllm-bridge.js +292 -0
  285. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-builder.d.ts +44 -0
  286. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-builder.js +329 -0
  287. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-distribution.d.ts +97 -0
  288. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-distribution.js +370 -0
  289. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-format.d.ts +111 -0
  290. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-format.js +393 -0
  291. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-runner.d.ts +69 -0
  292. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-runner.js +237 -0
  293. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-signing.d.ts +123 -0
  294. package/v3/@aiyou-dev/cli/dist/src/appliance/rvfa-signing.js +347 -0
  295. package/v3/@aiyou-dev/cli/dist/src/benchmarks/pretrain/index.d.ts +58 -0
  296. package/v3/@aiyou-dev/cli/dist/src/benchmarks/pretrain/index.js +404 -0
  297. package/v3/@aiyou-dev/cli/dist/src/commands/agent.d.ts +8 -0
  298. package/v3/@aiyou-dev/cli/dist/src/commands/agent.js +819 -0
  299. package/v3/@aiyou-dev/cli/dist/src/commands/analyze.d.ts +19 -0
  300. package/v3/@aiyou-dev/cli/dist/src/commands/analyze.js +1823 -0
  301. package/v3/@aiyou-dev/cli/dist/src/commands/appliance-advanced.d.ts +9 -0
  302. package/v3/@aiyou-dev/cli/dist/src/commands/appliance-advanced.js +215 -0
  303. package/v3/@aiyou-dev/cli/dist/src/commands/appliance.d.ts +8 -0
  304. package/v3/@aiyou-dev/cli/dist/src/commands/appliance.js +406 -0
  305. package/v3/@aiyou-dev/cli/dist/src/commands/benchmark.d.ts +10 -0
  306. package/v3/@aiyou-dev/cli/dist/src/commands/benchmark.js +459 -0
  307. package/v3/@aiyou-dev/cli/dist/src/commands/claims.d.ts +10 -0
  308. package/v3/@aiyou-dev/cli/dist/src/commands/claims.js +373 -0
  309. package/v3/@aiyou-dev/cli/dist/src/commands/completions.d.ts +10 -0
  310. package/v3/@aiyou-dev/cli/dist/src/commands/completions.js +539 -0
  311. package/v3/@aiyou-dev/cli/dist/src/commands/config.d.ts +8 -0
  312. package/v3/@aiyou-dev/cli/dist/src/commands/config.js +406 -0
  313. package/v3/@aiyou-dev/cli/dist/src/commands/daemon.d.ts +8 -0
  314. package/v3/@aiyou-dev/cli/dist/src/commands/daemon.js +609 -0
  315. package/v3/@aiyou-dev/cli/dist/src/commands/deployment.d.ts +10 -0
  316. package/v3/@aiyou-dev/cli/dist/src/commands/deployment.js +289 -0
  317. package/v3/@aiyou-dev/cli/dist/src/commands/doctor.d.ts +10 -0
  318. package/v3/@aiyou-dev/cli/dist/src/commands/doctor.js +602 -0
  319. package/v3/@aiyou-dev/cli/dist/src/commands/embeddings.d.ts +18 -0
  320. package/v3/@aiyou-dev/cli/dist/src/commands/embeddings.js +1576 -0
  321. package/v3/@aiyou-dev/cli/dist/src/commands/gcc.d.ts +10 -0
  322. package/v3/@aiyou-dev/cli/dist/src/commands/gcc.js +197 -0
  323. package/v3/@aiyou-dev/cli/dist/src/commands/guidance.d.ts +8 -0
  324. package/v3/@aiyou-dev/cli/dist/src/commands/guidance.js +560 -0
  325. package/v3/@aiyou-dev/cli/dist/src/commands/hive-mind.d.ts +11 -0
  326. package/v3/@aiyou-dev/cli/dist/src/commands/hive-mind.js +1230 -0
  327. package/v3/@aiyou-dev/cli/dist/src/commands/hooks.d.ts +8 -0
  328. package/v3/@aiyou-dev/cli/dist/src/commands/hooks.js +3759 -0
  329. package/v3/@aiyou-dev/cli/dist/src/commands/index.d.ts +114 -0
  330. package/v3/@aiyou-dev/cli/dist/src/commands/index.js +375 -0
  331. package/v3/@aiyou-dev/cli/dist/src/commands/init.d.ts +8 -0
  332. package/v3/@aiyou-dev/cli/dist/src/commands/init.js +976 -0
  333. package/v3/@aiyou-dev/cli/dist/src/commands/issues.d.ts +21 -0
  334. package/v3/@aiyou-dev/cli/dist/src/commands/issues.js +567 -0
  335. package/v3/@aiyou-dev/cli/dist/src/commands/mcp.d.ts +11 -0
  336. package/v3/@aiyou-dev/cli/dist/src/commands/mcp.js +715 -0
  337. package/v3/@aiyou-dev/cli/dist/src/commands/memory.d.ts +8 -0
  338. package/v3/@aiyou-dev/cli/dist/src/commands/memory.js +1292 -0
  339. package/v3/@aiyou-dev/cli/dist/src/commands/migrate.d.ts +8 -0
  340. package/v3/@aiyou-dev/cli/dist/src/commands/migrate.js +410 -0
  341. package/v3/@aiyou-dev/cli/dist/src/commands/neural.d.ts +10 -0
  342. package/v3/@aiyou-dev/cli/dist/src/commands/neural.js +1448 -0
  343. package/v3/@aiyou-dev/cli/dist/src/commands/performance.d.ts +10 -0
  344. package/v3/@aiyou-dev/cli/dist/src/commands/performance.js +579 -0
  345. package/v3/@aiyou-dev/cli/dist/src/commands/plugins.d.ts +11 -0
  346. package/v3/@aiyou-dev/cli/dist/src/commands/plugins.js +820 -0
  347. package/v3/@aiyou-dev/cli/dist/src/commands/process.d.ts +10 -0
  348. package/v3/@aiyou-dev/cli/dist/src/commands/process.js +641 -0
  349. package/v3/@aiyou-dev/cli/dist/src/commands/progress.d.ts +11 -0
  350. package/v3/@aiyou-dev/cli/dist/src/commands/progress.js +259 -0
  351. package/v3/@aiyou-dev/cli/dist/src/commands/providers.d.ts +10 -0
  352. package/v3/@aiyou-dev/cli/dist/src/commands/providers.js +232 -0
  353. package/v3/@aiyou-dev/cli/dist/src/commands/route.d.ts +16 -0
  354. package/v3/@aiyou-dev/cli/dist/src/commands/route.js +813 -0
  355. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/backup.d.ts +11 -0
  356. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/backup.js +746 -0
  357. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/benchmark.d.ts +11 -0
  358. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/benchmark.js +480 -0
  359. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/import.d.ts +18 -0
  360. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/import.js +349 -0
  361. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/index.d.ts +29 -0
  362. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/index.js +129 -0
  363. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/init.d.ts +11 -0
  364. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/init.js +431 -0
  365. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/migrate.d.ts +11 -0
  366. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/migrate.js +481 -0
  367. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/optimize.d.ts +11 -0
  368. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/optimize.js +503 -0
  369. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/setup.d.ts +18 -0
  370. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/setup.js +765 -0
  371. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/status.d.ts +11 -0
  372. package/v3/@aiyou-dev/cli/dist/src/commands/ruvector/status.js +456 -0
  373. package/v3/@aiyou-dev/cli/dist/src/commands/security.d.ts +10 -0
  374. package/v3/@aiyou-dev/cli/dist/src/commands/security.js +575 -0
  375. package/v3/@aiyou-dev/cli/dist/src/commands/session.d.ts +8 -0
  376. package/v3/@aiyou-dev/cli/dist/src/commands/session.js +750 -0
  377. package/v3/@aiyou-dev/cli/dist/src/commands/start.d.ts +8 -0
  378. package/v3/@aiyou-dev/cli/dist/src/commands/start.js +418 -0
  379. package/v3/@aiyou-dev/cli/dist/src/commands/status.d.ts +8 -0
  380. package/v3/@aiyou-dev/cli/dist/src/commands/status.js +591 -0
  381. package/v3/@aiyou-dev/cli/dist/src/commands/swarm.d.ts +8 -0
  382. package/v3/@aiyou-dev/cli/dist/src/commands/swarm.js +748 -0
  383. package/v3/@aiyou-dev/cli/dist/src/commands/task.d.ts +8 -0
  384. package/v3/@aiyou-dev/cli/dist/src/commands/task.js +671 -0
  385. package/v3/@aiyou-dev/cli/dist/src/commands/transfer-store.d.ts +13 -0
  386. package/v3/@aiyou-dev/cli/dist/src/commands/transfer-store.js +428 -0
  387. package/v3/@aiyou-dev/cli/dist/src/commands/update.d.ts +8 -0
  388. package/v3/@aiyou-dev/cli/dist/src/commands/update.js +276 -0
  389. package/v3/@aiyou-dev/cli/dist/src/commands/workflow.d.ts +8 -0
  390. package/v3/@aiyou-dev/cli/dist/src/commands/workflow.js +617 -0
  391. package/v3/@aiyou-dev/cli/dist/src/config-adapter.d.ts +15 -0
  392. package/v3/@aiyou-dev/cli/dist/src/config-adapter.js +186 -0
  393. package/v3/@aiyou-dev/cli/dist/src/gcc/core.d.ts +98 -0
  394. package/v3/@aiyou-dev/cli/dist/src/gcc/core.js +504 -0
  395. package/v3/@aiyou-dev/cli/dist/src/gcc/index.d.ts +10 -0
  396. package/v3/@aiyou-dev/cli/dist/src/gcc/index.js +9 -0
  397. package/v3/@aiyou-dev/cli/dist/src/gcc/toon-bridge.d.ts +19 -0
  398. package/v3/@aiyou-dev/cli/dist/src/gcc/toon-bridge.js +51 -0
  399. package/v3/@aiyou-dev/cli/dist/src/index.d.ts +76 -0
  400. package/v3/@aiyou-dev/cli/dist/src/index.js +470 -0
  401. package/v3/@aiyou-dev/cli/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
  402. package/v3/@aiyou-dev/cli/dist/src/infrastructure/in-memory-repositories.js +264 -0
  403. package/v3/@aiyou-dev/cli/dist/src/init/claudemd-generator.d.ts +25 -0
  404. package/v3/@aiyou-dev/cli/dist/src/init/claudemd-generator.js +525 -0
  405. package/v3/@aiyou-dev/cli/dist/src/init/executor.d.ts +41 -0
  406. package/v3/@aiyou-dev/cli/dist/src/init/executor.js +1767 -0
  407. package/v3/@aiyou-dev/cli/dist/src/init/gemini-config-generator.d.ts +24 -0
  408. package/v3/@aiyou-dev/cli/dist/src/init/gemini-config-generator.js +89 -0
  409. package/v3/@aiyou-dev/cli/dist/src/init/geminimd-generator.d.ts +15 -0
  410. package/v3/@aiyou-dev/cli/dist/src/init/geminimd-generator.js +222 -0
  411. package/v3/@aiyou-dev/cli/dist/src/init/helpers-generator.d.ts +60 -0
  412. package/v3/@aiyou-dev/cli/dist/src/init/helpers-generator.js +1166 -0
  413. package/v3/@aiyou-dev/cli/dist/src/init/index.d.ts +13 -0
  414. package/v3/@aiyou-dev/cli/dist/src/init/index.js +15 -0
  415. package/v3/@aiyou-dev/cli/dist/src/init/mcp-generator.d.ts +26 -0
  416. package/v3/@aiyou-dev/cli/dist/src/init/mcp-generator.js +116 -0
  417. package/v3/@aiyou-dev/cli/dist/src/init/settings-generator.d.ts +14 -0
  418. package/v3/@aiyou-dev/cli/dist/src/init/settings-generator.js +437 -0
  419. package/v3/@aiyou-dev/cli/dist/src/init/statusline-generator.d.ts +28 -0
  420. package/v3/@aiyou-dev/cli/dist/src/init/statusline-generator.js +817 -0
  421. package/v3/@aiyou-dev/cli/dist/src/init/types.d.ts +291 -0
  422. package/v3/@aiyou-dev/cli/dist/src/init/types.js +260 -0
  423. package/v3/@aiyou-dev/cli/dist/src/mcp-client.d.ts +92 -0
  424. package/v3/@aiyou-dev/cli/dist/src/mcp-client.js +241 -0
  425. package/v3/@aiyou-dev/cli/dist/src/mcp-server.d.ts +161 -0
  426. package/v3/@aiyou-dev/cli/dist/src/mcp-server.js +627 -0
  427. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/agent-tools.d.ts +9 -0
  428. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/agent-tools.js +549 -0
  429. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
  430. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/agentdb-tools.js +557 -0
  431. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
  432. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/analyze-tools.js +317 -0
  433. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/auto-install.d.ts +83 -0
  434. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/auto-install.js +131 -0
  435. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/browser-tools.d.ts +13 -0
  436. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/browser-tools.js +550 -0
  437. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/claims-tools.d.ts +12 -0
  438. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/claims-tools.js +732 -0
  439. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/config-tools.d.ts +8 -0
  440. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/config-tools.js +343 -0
  441. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/coordination-tools.d.ts +13 -0
  442. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/coordination-tools.js +486 -0
  443. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/daa-tools.d.ts +13 -0
  444. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/daa-tools.js +426 -0
  445. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/embeddings-tools.d.ts +9 -0
  446. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/embeddings-tools.js +782 -0
  447. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/gcc-tools.d.ts +9 -0
  448. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/gcc-tools.js +152 -0
  449. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/github-tools.d.ts +13 -0
  450. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/github-tools.js +373 -0
  451. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
  452. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/hive-mind-tools.js +583 -0
  453. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/hooks-tools.d.ts +44 -0
  454. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/hooks-tools.js +2969 -0
  455. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/index.d.ts +24 -0
  456. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/index.js +23 -0
  457. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/memory-tools.d.ts +14 -0
  458. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/memory-tools.js +499 -0
  459. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/neural-tools.d.ts +16 -0
  460. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/neural-tools.js +461 -0
  461. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/performance-tools.d.ts +16 -0
  462. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/performance-tools.js +534 -0
  463. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/progress-tools.d.ts +14 -0
  464. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/progress-tools.js +348 -0
  465. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/security-tools.d.ts +18 -0
  466. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/security-tools.js +434 -0
  467. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/session-tools.d.ts +8 -0
  468. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/session-tools.js +315 -0
  469. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/swarm-tools.d.ts +8 -0
  470. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/swarm-tools.js +102 -0
  471. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/system-tools.d.ts +13 -0
  472. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/system-tools.js +417 -0
  473. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/task-tools.d.ts +8 -0
  474. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/task-tools.js +338 -0
  475. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/terminal-tools.d.ts +13 -0
  476. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/terminal-tools.js +246 -0
  477. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/transfer-tools.d.ts +14 -0
  478. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/transfer-tools.js +396 -0
  479. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/types.d.ts +31 -0
  480. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/types.js +7 -0
  481. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
  482. package/v3/@aiyou-dev/cli/dist/src/mcp-tools/workflow-tools.js +572 -0
  483. package/v3/@aiyou-dev/cli/dist/src/memory/ewc-consolidation.d.ts +271 -0
  484. package/v3/@aiyou-dev/cli/dist/src/memory/ewc-consolidation.js +542 -0
  485. package/v3/@aiyou-dev/cli/dist/src/memory/intelligence.d.ts +285 -0
  486. package/v3/@aiyou-dev/cli/dist/src/memory/intelligence.js +794 -0
  487. package/v3/@aiyou-dev/cli/dist/src/memory/memory-bridge.d.ts +407 -0
  488. package/v3/@aiyou-dev/cli/dist/src/memory/memory-bridge.js +1494 -0
  489. package/v3/@aiyou-dev/cli/dist/src/memory/memory-initializer.d.ts +405 -0
  490. package/v3/@aiyou-dev/cli/dist/src/memory/memory-initializer.js +2105 -0
  491. package/v3/@aiyou-dev/cli/dist/src/memory/sona-optimizer.d.ts +227 -0
  492. package/v3/@aiyou-dev/cli/dist/src/memory/sona-optimizer.js +633 -0
  493. package/v3/@aiyou-dev/cli/dist/src/output.d.ts +133 -0
  494. package/v3/@aiyou-dev/cli/dist/src/output.js +514 -0
  495. package/v3/@aiyou-dev/cli/dist/src/parser.d.ts +41 -0
  496. package/v3/@aiyou-dev/cli/dist/src/parser.js +377 -0
  497. package/v3/@aiyou-dev/cli/dist/src/plugins/manager.d.ts +133 -0
  498. package/v3/@aiyou-dev/cli/dist/src/plugins/manager.js +400 -0
  499. package/v3/@aiyou-dev/cli/dist/src/plugins/store/discovery.d.ts +88 -0
  500. package/v3/@aiyou-dev/cli/dist/src/plugins/store/discovery.js +1147 -0
  501. package/v3/@aiyou-dev/cli/dist/src/plugins/store/index.d.ts +76 -0
  502. package/v3/@aiyou-dev/cli/dist/src/plugins/store/index.js +141 -0
  503. package/v3/@aiyou-dev/cli/dist/src/plugins/store/search.d.ts +46 -0
  504. package/v3/@aiyou-dev/cli/dist/src/plugins/store/search.js +230 -0
  505. package/v3/@aiyou-dev/cli/dist/src/plugins/store/types.d.ts +274 -0
  506. package/v3/@aiyou-dev/cli/dist/src/plugins/store/types.js +7 -0
  507. package/v3/@aiyou-dev/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
  508. package/v3/@aiyou-dev/cli/dist/src/plugins/tests/demo-plugin-store.js +126 -0
  509. package/v3/@aiyou-dev/cli/dist/src/plugins/tests/standalone-test.d.ts +12 -0
  510. package/v3/@aiyou-dev/cli/dist/src/plugins/tests/standalone-test.js +188 -0
  511. package/v3/@aiyou-dev/cli/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
  512. package/v3/@aiyou-dev/cli/dist/src/plugins/tests/test-plugin-store.js +206 -0
  513. package/v3/@aiyou-dev/cli/dist/src/production/circuit-breaker.d.ts +101 -0
  514. package/v3/@aiyou-dev/cli/dist/src/production/circuit-breaker.js +241 -0
  515. package/v3/@aiyou-dev/cli/dist/src/production/error-handler.d.ts +92 -0
  516. package/v3/@aiyou-dev/cli/dist/src/production/error-handler.js +299 -0
  517. package/v3/@aiyou-dev/cli/dist/src/production/index.d.ts +23 -0
  518. package/v3/@aiyou-dev/cli/dist/src/production/index.js +18 -0
  519. package/v3/@aiyou-dev/cli/dist/src/production/monitoring.d.ts +161 -0
  520. package/v3/@aiyou-dev/cli/dist/src/production/monitoring.js +356 -0
  521. package/v3/@aiyou-dev/cli/dist/src/production/rate-limiter.d.ts +80 -0
  522. package/v3/@aiyou-dev/cli/dist/src/production/rate-limiter.js +201 -0
  523. package/v3/@aiyou-dev/cli/dist/src/production/retry.d.ts +48 -0
  524. package/v3/@aiyou-dev/cli/dist/src/production/retry.js +179 -0
  525. package/v3/@aiyou-dev/cli/dist/src/prompt.d.ts +44 -0
  526. package/v3/@aiyou-dev/cli/dist/src/prompt.js +501 -0
  527. package/v3/@aiyou-dev/cli/dist/src/runtime/headless.d.ts +60 -0
  528. package/v3/@aiyou-dev/cli/dist/src/runtime/headless.js +284 -0
  529. package/v3/@aiyou-dev/cli/dist/src/ruvector/ast-analyzer.d.ts +67 -0
  530. package/v3/@aiyou-dev/cli/dist/src/ruvector/ast-analyzer.js +277 -0
  531. package/v3/@aiyou-dev/cli/dist/src/ruvector/coverage-router.d.ts +160 -0
  532. package/v3/@aiyou-dev/cli/dist/src/ruvector/coverage-router.js +529 -0
  533. package/v3/@aiyou-dev/cli/dist/src/ruvector/coverage-tools.d.ts +33 -0
  534. package/v3/@aiyou-dev/cli/dist/src/ruvector/coverage-tools.js +157 -0
  535. package/v3/@aiyou-dev/cli/dist/src/ruvector/diff-classifier.d.ts +175 -0
  536. package/v3/@aiyou-dev/cli/dist/src/ruvector/diff-classifier.js +698 -0
  537. package/v3/@aiyou-dev/cli/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
  538. package/v3/@aiyou-dev/cli/dist/src/ruvector/enhanced-model-router.js +529 -0
  539. package/v3/@aiyou-dev/cli/dist/src/ruvector/flash-attention.d.ts +195 -0
  540. package/v3/@aiyou-dev/cli/dist/src/ruvector/flash-attention.js +643 -0
  541. package/v3/@aiyou-dev/cli/dist/src/ruvector/graph-analyzer.d.ts +187 -0
  542. package/v3/@aiyou-dev/cli/dist/src/ruvector/graph-analyzer.js +929 -0
  543. package/v3/@aiyou-dev/cli/dist/src/ruvector/index.d.ts +34 -0
  544. package/v3/@aiyou-dev/cli/dist/src/ruvector/index.js +60 -0
  545. package/v3/@aiyou-dev/cli/dist/src/ruvector/lora-adapter.d.ts +218 -0
  546. package/v3/@aiyou-dev/cli/dist/src/ruvector/lora-adapter.js +455 -0
  547. package/v3/@aiyou-dev/cli/dist/src/ruvector/model-router.d.ts +220 -0
  548. package/v3/@aiyou-dev/cli/dist/src/ruvector/model-router.js +488 -0
  549. package/v3/@aiyou-dev/cli/dist/src/ruvector/moe-router.d.ts +206 -0
  550. package/v3/@aiyou-dev/cli/dist/src/ruvector/moe-router.js +626 -0
  551. package/v3/@aiyou-dev/cli/dist/src/ruvector/q-learning-router.d.ts +211 -0
  552. package/v3/@aiyou-dev/cli/dist/src/ruvector/q-learning-router.js +681 -0
  553. package/v3/@aiyou-dev/cli/dist/src/ruvector/semantic-router.d.ts +77 -0
  554. package/v3/@aiyou-dev/cli/dist/src/ruvector/semantic-router.js +178 -0
  555. package/v3/@aiyou-dev/cli/dist/src/ruvector/vector-db.d.ts +69 -0
  556. package/v3/@aiyou-dev/cli/dist/src/ruvector/vector-db.js +243 -0
  557. package/v3/@aiyou-dev/cli/dist/src/services/agentic-flow-bridge.d.ts +50 -0
  558. package/v3/@aiyou-dev/cli/dist/src/services/agentic-flow-bridge.js +95 -0
  559. package/v3/@aiyou-dev/cli/dist/src/services/claim-service.d.ts +204 -0
  560. package/v3/@aiyou-dev/cli/dist/src/services/claim-service.js +818 -0
  561. package/v3/@aiyou-dev/cli/dist/src/services/container-worker-pool.d.ts +197 -0
  562. package/v3/@aiyou-dev/cli/dist/src/services/container-worker-pool.js +583 -0
  563. package/v3/@aiyou-dev/cli/dist/src/services/headless-worker-executor.d.ts +304 -0
  564. package/v3/@aiyou-dev/cli/dist/src/services/headless-worker-executor.js +999 -0
  565. package/v3/@aiyou-dev/cli/dist/src/services/index.d.ts +13 -0
  566. package/v3/@aiyou-dev/cli/dist/src/services/index.js +11 -0
  567. package/v3/@aiyou-dev/cli/dist/src/services/registry-api.d.ts +58 -0
  568. package/v3/@aiyou-dev/cli/dist/src/services/registry-api.js +146 -0
  569. package/v3/@aiyou-dev/cli/dist/src/services/ruvector-training.d.ts +214 -0
  570. package/v3/@aiyou-dev/cli/dist/src/services/ruvector-training.js +497 -0
  571. package/v3/@aiyou-dev/cli/dist/src/services/worker-daemon.d.ts +203 -0
  572. package/v3/@aiyou-dev/cli/dist/src/services/worker-daemon.js +756 -0
  573. package/v3/@aiyou-dev/cli/dist/src/services/worker-queue.d.ts +194 -0
  574. package/v3/@aiyou-dev/cli/dist/src/services/worker-queue.js +513 -0
  575. package/v3/@aiyou-dev/cli/dist/src/suggest.d.ts +53 -0
  576. package/v3/@aiyou-dev/cli/dist/src/suggest.js +200 -0
  577. package/v3/@aiyou-dev/cli/dist/src/transfer/anonymization/index.d.ts +25 -0
  578. package/v3/@aiyou-dev/cli/dist/src/transfer/anonymization/index.js +175 -0
  579. package/v3/@aiyou-dev/cli/dist/src/transfer/deploy-seraphine.d.ts +13 -0
  580. package/v3/@aiyou-dev/cli/dist/src/transfer/deploy-seraphine.js +205 -0
  581. package/v3/@aiyou-dev/cli/dist/src/transfer/export.d.ts +25 -0
  582. package/v3/@aiyou-dev/cli/dist/src/transfer/export.js +113 -0
  583. package/v3/@aiyou-dev/cli/dist/src/transfer/index.d.ts +12 -0
  584. package/v3/@aiyou-dev/cli/dist/src/transfer/index.js +31 -0
  585. package/v3/@aiyou-dev/cli/dist/src/transfer/ipfs/client.d.ts +109 -0
  586. package/v3/@aiyou-dev/cli/dist/src/transfer/ipfs/client.js +307 -0
  587. package/v3/@aiyou-dev/cli/dist/src/transfer/ipfs/upload.d.ts +95 -0
  588. package/v3/@aiyou-dev/cli/dist/src/transfer/ipfs/upload.js +411 -0
  589. package/v3/@aiyou-dev/cli/dist/src/transfer/models/seraphine.d.ts +72 -0
  590. package/v3/@aiyou-dev/cli/dist/src/transfer/models/seraphine.js +373 -0
  591. package/v3/@aiyou-dev/cli/dist/src/transfer/serialization/cfp.d.ts +49 -0
  592. package/v3/@aiyou-dev/cli/dist/src/transfer/serialization/cfp.js +183 -0
  593. package/v3/@aiyou-dev/cli/dist/src/transfer/storage/gcs.d.ts +82 -0
  594. package/v3/@aiyou-dev/cli/dist/src/transfer/storage/gcs.js +256 -0
  595. package/v3/@aiyou-dev/cli/dist/src/transfer/storage/index.d.ts +6 -0
  596. package/v3/@aiyou-dev/cli/dist/src/transfer/storage/index.js +6 -0
  597. package/v3/@aiyou-dev/cli/dist/src/transfer/store/discovery.d.ts +84 -0
  598. package/v3/@aiyou-dev/cli/dist/src/transfer/store/discovery.js +382 -0
  599. package/v3/@aiyou-dev/cli/dist/src/transfer/store/download.d.ts +70 -0
  600. package/v3/@aiyou-dev/cli/dist/src/transfer/store/download.js +334 -0
  601. package/v3/@aiyou-dev/cli/dist/src/transfer/store/index.d.ts +84 -0
  602. package/v3/@aiyou-dev/cli/dist/src/transfer/store/index.js +153 -0
  603. package/v3/@aiyou-dev/cli/dist/src/transfer/store/publish.d.ts +76 -0
  604. package/v3/@aiyou-dev/cli/dist/src/transfer/store/publish.js +294 -0
  605. package/v3/@aiyou-dev/cli/dist/src/transfer/store/registry.d.ts +58 -0
  606. package/v3/@aiyou-dev/cli/dist/src/transfer/store/registry.js +285 -0
  607. package/v3/@aiyou-dev/cli/dist/src/transfer/store/search.d.ts +54 -0
  608. package/v3/@aiyou-dev/cli/dist/src/transfer/store/search.js +232 -0
  609. package/v3/@aiyou-dev/cli/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
  610. package/v3/@aiyou-dev/cli/dist/src/transfer/store/tests/standalone-test.js +190 -0
  611. package/v3/@aiyou-dev/cli/dist/src/transfer/store/types.d.ts +193 -0
  612. package/v3/@aiyou-dev/cli/dist/src/transfer/store/types.js +6 -0
  613. package/v3/@aiyou-dev/cli/dist/src/transfer/test-seraphine.d.ts +6 -0
  614. package/v3/@aiyou-dev/cli/dist/src/transfer/test-seraphine.js +105 -0
  615. package/v3/@aiyou-dev/cli/dist/src/transfer/tests/test-store.d.ts +7 -0
  616. package/v3/@aiyou-dev/cli/dist/src/transfer/tests/test-store.js +214 -0
  617. package/v3/@aiyou-dev/cli/dist/src/transfer/types.d.ts +245 -0
  618. package/v3/@aiyou-dev/cli/dist/src/transfer/types.js +6 -0
  619. package/v3/@aiyou-dev/cli/dist/src/types.d.ts +198 -0
  620. package/v3/@aiyou-dev/cli/dist/src/types.js +38 -0
  621. package/v3/@aiyou-dev/cli/dist/src/update/checker.d.ts +34 -0
  622. package/v3/@aiyou-dev/cli/dist/src/update/checker.js +190 -0
  623. package/v3/@aiyou-dev/cli/dist/src/update/executor.d.ts +32 -0
  624. package/v3/@aiyou-dev/cli/dist/src/update/executor.js +181 -0
  625. package/v3/@aiyou-dev/cli/dist/src/update/index.d.ts +33 -0
  626. package/v3/@aiyou-dev/cli/dist/src/update/index.js +64 -0
  627. package/v3/@aiyou-dev/cli/dist/src/update/rate-limiter.d.ts +20 -0
  628. package/v3/@aiyou-dev/cli/dist/src/update/rate-limiter.js +96 -0
  629. package/v3/@aiyou-dev/cli/dist/src/update/validator.d.ts +17 -0
  630. package/v3/@aiyou-dev/cli/dist/src/update/validator.js +123 -0
  631. package/v3/@aiyou-dev/cli/package.json +111 -0
  632. package/v3/@aiyou-dev/guidance/dist/adversarial.d.ts +284 -0
  633. package/v3/@aiyou-dev/guidance/dist/adversarial.js +572 -0
  634. package/v3/@aiyou-dev/guidance/dist/analyzer.d.ts +530 -0
  635. package/v3/@aiyou-dev/guidance/dist/analyzer.js +2518 -0
  636. package/v3/@aiyou-dev/guidance/dist/artifacts.d.ts +283 -0
  637. package/v3/@aiyou-dev/guidance/dist/artifacts.js +356 -0
  638. package/v3/@aiyou-dev/guidance/dist/authority.d.ts +290 -0
  639. package/v3/@aiyou-dev/guidance/dist/authority.js +558 -0
  640. package/v3/@aiyou-dev/guidance/dist/capabilities.d.ts +209 -0
  641. package/v3/@aiyou-dev/guidance/dist/capabilities.js +485 -0
  642. package/v3/@aiyou-dev/guidance/dist/coherence.d.ts +233 -0
  643. package/v3/@aiyou-dev/guidance/dist/coherence.js +372 -0
  644. package/v3/@aiyou-dev/guidance/dist/compiler.d.ts +87 -0
  645. package/v3/@aiyou-dev/guidance/dist/compiler.js +419 -0
  646. package/v3/@aiyou-dev/guidance/dist/conformance-kit.d.ts +225 -0
  647. package/v3/@aiyou-dev/guidance/dist/conformance-kit.js +629 -0
  648. package/v3/@aiyou-dev/guidance/dist/continue-gate.d.ts +214 -0
  649. package/v3/@aiyou-dev/guidance/dist/continue-gate.js +353 -0
  650. package/v3/@aiyou-dev/guidance/dist/crypto-utils.d.ts +17 -0
  651. package/v3/@aiyou-dev/guidance/dist/crypto-utils.js +24 -0
  652. package/v3/@aiyou-dev/guidance/dist/evolution.d.ts +282 -0
  653. package/v3/@aiyou-dev/guidance/dist/evolution.js +500 -0
  654. package/v3/@aiyou-dev/guidance/dist/gates.d.ts +79 -0
  655. package/v3/@aiyou-dev/guidance/dist/gates.js +302 -0
  656. package/v3/@aiyou-dev/guidance/dist/gateway.d.ts +206 -0
  657. package/v3/@aiyou-dev/guidance/dist/gateway.js +452 -0
  658. package/v3/@aiyou-dev/guidance/dist/generators.d.ts +153 -0
  659. package/v3/@aiyou-dev/guidance/dist/generators.js +682 -0
  660. package/v3/@aiyou-dev/guidance/dist/headless.d.ts +177 -0
  661. package/v3/@aiyou-dev/guidance/dist/headless.js +342 -0
  662. package/v3/@aiyou-dev/guidance/dist/hooks.d.ts +154 -0
  663. package/v3/@aiyou-dev/guidance/dist/hooks.js +361 -0
  664. package/v3/@aiyou-dev/guidance/dist/index.d.ts +205 -0
  665. package/v3/@aiyou-dev/guidance/dist/index.js +321 -0
  666. package/v3/@aiyou-dev/guidance/dist/ledger.d.ts +162 -0
  667. package/v3/@aiyou-dev/guidance/dist/ledger.js +375 -0
  668. package/v3/@aiyou-dev/guidance/dist/manifest-validator.d.ts +289 -0
  669. package/v3/@aiyou-dev/guidance/dist/manifest-validator.js +838 -0
  670. package/v3/@aiyou-dev/guidance/dist/memory-gate.d.ts +222 -0
  671. package/v3/@aiyou-dev/guidance/dist/memory-gate.js +382 -0
  672. package/v3/@aiyou-dev/guidance/dist/meta-governance.d.ts +265 -0
  673. package/v3/@aiyou-dev/guidance/dist/meta-governance.js +348 -0
  674. package/v3/@aiyou-dev/guidance/dist/optimizer.d.ts +104 -0
  675. package/v3/@aiyou-dev/guidance/dist/optimizer.js +329 -0
  676. package/v3/@aiyou-dev/guidance/dist/persistence.d.ts +189 -0
  677. package/v3/@aiyou-dev/guidance/dist/persistence.js +464 -0
  678. package/v3/@aiyou-dev/guidance/dist/proof.d.ts +185 -0
  679. package/v3/@aiyou-dev/guidance/dist/proof.js +238 -0
  680. package/v3/@aiyou-dev/guidance/dist/retriever.d.ts +116 -0
  681. package/v3/@aiyou-dev/guidance/dist/retriever.js +394 -0
  682. package/v3/@aiyou-dev/guidance/dist/ruvbot-integration.d.ts +370 -0
  683. package/v3/@aiyou-dev/guidance/dist/ruvbot-integration.js +738 -0
  684. package/v3/@aiyou-dev/guidance/dist/temporal.d.ts +426 -0
  685. package/v3/@aiyou-dev/guidance/dist/temporal.js +658 -0
  686. package/v3/@aiyou-dev/guidance/dist/trust.d.ts +283 -0
  687. package/v3/@aiyou-dev/guidance/dist/trust.js +473 -0
  688. package/v3/@aiyou-dev/guidance/dist/truth-anchors.d.ts +276 -0
  689. package/v3/@aiyou-dev/guidance/dist/truth-anchors.js +488 -0
  690. package/v3/@aiyou-dev/guidance/dist/types.d.ts +378 -0
  691. package/v3/@aiyou-dev/guidance/dist/types.js +10 -0
  692. package/v3/@aiyou-dev/guidance/dist/uncertainty.d.ts +372 -0
  693. package/v3/@aiyou-dev/guidance/dist/uncertainty.js +619 -0
  694. package/v3/@aiyou-dev/guidance/dist/wasm-kernel.d.ts +48 -0
  695. package/v3/@aiyou-dev/guidance/dist/wasm-kernel.js +158 -0
  696. package/v3/@aiyou-dev/guidance/package.json +198 -0
  697. package/v3/@aiyou-dev/shared/dist/core/config/defaults.d.ts +41 -0
  698. package/v3/@aiyou-dev/shared/dist/core/config/defaults.js +186 -0
  699. package/v3/@aiyou-dev/shared/dist/core/config/index.d.ts +8 -0
  700. package/v3/@aiyou-dev/shared/dist/core/config/index.js +12 -0
  701. package/v3/@aiyou-dev/shared/dist/core/config/loader.d.ts +45 -0
  702. package/v3/@aiyou-dev/shared/dist/core/config/loader.js +222 -0
  703. package/v3/@aiyou-dev/shared/dist/core/config/schema.d.ts +1134 -0
  704. package/v3/@aiyou-dev/shared/dist/core/config/schema.js +158 -0
  705. package/v3/@aiyou-dev/shared/dist/core/config/validator.d.ts +92 -0
  706. package/v3/@aiyou-dev/shared/dist/core/config/validator.js +147 -0
  707. package/v3/@aiyou-dev/shared/dist/core/event-bus.d.ts +31 -0
  708. package/v3/@aiyou-dev/shared/dist/core/event-bus.js +197 -0
  709. package/v3/@aiyou-dev/shared/dist/core/index.d.ts +15 -0
  710. package/v3/@aiyou-dev/shared/dist/core/index.js +19 -0
  711. package/v3/@aiyou-dev/shared/dist/core/interfaces/agent.interface.d.ts +200 -0
  712. package/v3/@aiyou-dev/shared/dist/core/interfaces/agent.interface.js +6 -0
  713. package/v3/@aiyou-dev/shared/dist/core/interfaces/coordinator.interface.d.ts +310 -0
  714. package/v3/@aiyou-dev/shared/dist/core/interfaces/coordinator.interface.js +7 -0
  715. package/v3/@aiyou-dev/shared/dist/core/interfaces/event.interface.d.ts +224 -0
  716. package/v3/@aiyou-dev/shared/dist/core/interfaces/event.interface.js +46 -0
  717. package/v3/@aiyou-dev/shared/dist/core/interfaces/index.d.ts +10 -0
  718. package/v3/@aiyou-dev/shared/dist/core/interfaces/index.js +15 -0
  719. package/v3/@aiyou-dev/shared/dist/core/interfaces/memory.interface.d.ts +298 -0
  720. package/v3/@aiyou-dev/shared/dist/core/interfaces/memory.interface.js +7 -0
  721. package/v3/@aiyou-dev/shared/dist/core/interfaces/task.interface.d.ts +185 -0
  722. package/v3/@aiyou-dev/shared/dist/core/interfaces/task.interface.js +6 -0
  723. package/v3/@aiyou-dev/shared/dist/core/orchestrator/event-coordinator.d.ts +35 -0
  724. package/v3/@aiyou-dev/shared/dist/core/orchestrator/event-coordinator.js +101 -0
  725. package/v3/@aiyou-dev/shared/dist/core/orchestrator/health-monitor.d.ts +60 -0
  726. package/v3/@aiyou-dev/shared/dist/core/orchestrator/health-monitor.js +166 -0
  727. package/v3/@aiyou-dev/shared/dist/core/orchestrator/index.d.ts +46 -0
  728. package/v3/@aiyou-dev/shared/dist/core/orchestrator/index.js +64 -0
  729. package/v3/@aiyou-dev/shared/dist/core/orchestrator/lifecycle-manager.d.ts +56 -0
  730. package/v3/@aiyou-dev/shared/dist/core/orchestrator/lifecycle-manager.js +195 -0
  731. package/v3/@aiyou-dev/shared/dist/core/orchestrator/session-manager.d.ts +83 -0
  732. package/v3/@aiyou-dev/shared/dist/core/orchestrator/session-manager.js +193 -0
  733. package/v3/@aiyou-dev/shared/dist/core/orchestrator/task-manager.d.ts +49 -0
  734. package/v3/@aiyou-dev/shared/dist/core/orchestrator/task-manager.js +253 -0
  735. package/v3/@aiyou-dev/shared/dist/events/domain-events.d.ts +282 -0
  736. package/v3/@aiyou-dev/shared/dist/events/domain-events.js +165 -0
  737. package/v3/@aiyou-dev/shared/dist/events/event-store.d.ts +126 -0
  738. package/v3/@aiyou-dev/shared/dist/events/event-store.js +416 -0
  739. package/v3/@aiyou-dev/shared/dist/events/event-store.test.d.ts +8 -0
  740. package/v3/@aiyou-dev/shared/dist/events/event-store.test.js +293 -0
  741. package/v3/@aiyou-dev/shared/dist/events/example-usage.d.ts +10 -0
  742. package/v3/@aiyou-dev/shared/dist/events/example-usage.js +193 -0
  743. package/v3/@aiyou-dev/shared/dist/events/index.d.ts +21 -0
  744. package/v3/@aiyou-dev/shared/dist/events/index.js +22 -0
  745. package/v3/@aiyou-dev/shared/dist/events/projections.d.ts +177 -0
  746. package/v3/@aiyou-dev/shared/dist/events/projections.js +421 -0
  747. package/v3/@aiyou-dev/shared/dist/events/rvf-event-log.d.ts +82 -0
  748. package/v3/@aiyou-dev/shared/dist/events/rvf-event-log.js +340 -0
  749. package/v3/@aiyou-dev/shared/dist/events/state-reconstructor.d.ts +101 -0
  750. package/v3/@aiyou-dev/shared/dist/events/state-reconstructor.js +263 -0
  751. package/v3/@aiyou-dev/shared/dist/events.d.ts +80 -0
  752. package/v3/@aiyou-dev/shared/dist/events.js +249 -0
  753. package/v3/@aiyou-dev/shared/dist/hooks/example-usage.d.ts +42 -0
  754. package/v3/@aiyou-dev/shared/dist/hooks/example-usage.js +351 -0
  755. package/v3/@aiyou-dev/shared/dist/hooks/executor.d.ts +100 -0
  756. package/v3/@aiyou-dev/shared/dist/hooks/executor.js +264 -0
  757. package/v3/@aiyou-dev/shared/dist/hooks/hooks.test.d.ts +9 -0
  758. package/v3/@aiyou-dev/shared/dist/hooks/hooks.test.js +322 -0
  759. package/v3/@aiyou-dev/shared/dist/hooks/index.d.ts +52 -0
  760. package/v3/@aiyou-dev/shared/dist/hooks/index.js +51 -0
  761. package/v3/@aiyou-dev/shared/dist/hooks/registry.d.ts +133 -0
  762. package/v3/@aiyou-dev/shared/dist/hooks/registry.js +277 -0
  763. package/v3/@aiyou-dev/shared/dist/hooks/safety/bash-safety.d.ts +105 -0
  764. package/v3/@aiyou-dev/shared/dist/hooks/safety/bash-safety.js +481 -0
  765. package/v3/@aiyou-dev/shared/dist/hooks/safety/file-organization.d.ts +144 -0
  766. package/v3/@aiyou-dev/shared/dist/hooks/safety/file-organization.js +328 -0
  767. package/v3/@aiyou-dev/shared/dist/hooks/safety/git-commit.d.ts +158 -0
  768. package/v3/@aiyou-dev/shared/dist/hooks/safety/git-commit.js +450 -0
  769. package/v3/@aiyou-dev/shared/dist/hooks/safety/index.d.ts +17 -0
  770. package/v3/@aiyou-dev/shared/dist/hooks/safety/index.js +17 -0
  771. package/v3/@aiyou-dev/shared/dist/hooks/session-hooks.d.ts +234 -0
  772. package/v3/@aiyou-dev/shared/dist/hooks/session-hooks.js +334 -0
  773. package/v3/@aiyou-dev/shared/dist/hooks/task-hooks.d.ts +163 -0
  774. package/v3/@aiyou-dev/shared/dist/hooks/task-hooks.js +326 -0
  775. package/v3/@aiyou-dev/shared/dist/hooks/types.d.ts +267 -0
  776. package/v3/@aiyou-dev/shared/dist/hooks/types.js +62 -0
  777. package/v3/@aiyou-dev/shared/dist/hooks/verify-exports.test.d.ts +9 -0
  778. package/v3/@aiyou-dev/shared/dist/hooks/verify-exports.test.js +93 -0
  779. package/v3/@aiyou-dev/shared/dist/index.d.ts +20 -0
  780. package/v3/@aiyou-dev/shared/dist/index.js +50 -0
  781. package/v3/@aiyou-dev/shared/dist/mcp/connection-pool.d.ts +98 -0
  782. package/v3/@aiyou-dev/shared/dist/mcp/connection-pool.js +364 -0
  783. package/v3/@aiyou-dev/shared/dist/mcp/index.d.ts +69 -0
  784. package/v3/@aiyou-dev/shared/dist/mcp/index.js +84 -0
  785. package/v3/@aiyou-dev/shared/dist/mcp/server.d.ts +166 -0
  786. package/v3/@aiyou-dev/shared/dist/mcp/server.js +593 -0
  787. package/v3/@aiyou-dev/shared/dist/mcp/session-manager.d.ts +136 -0
  788. package/v3/@aiyou-dev/shared/dist/mcp/session-manager.js +335 -0
  789. package/v3/@aiyou-dev/shared/dist/mcp/tool-registry.d.ts +178 -0
  790. package/v3/@aiyou-dev/shared/dist/mcp/tool-registry.js +439 -0
  791. package/v3/@aiyou-dev/shared/dist/mcp/transport/http.d.ts +104 -0
  792. package/v3/@aiyou-dev/shared/dist/mcp/transport/http.js +476 -0
  793. package/v3/@aiyou-dev/shared/dist/mcp/transport/index.d.ts +102 -0
  794. package/v3/@aiyou-dev/shared/dist/mcp/transport/index.js +238 -0
  795. package/v3/@aiyou-dev/shared/dist/mcp/transport/stdio.d.ts +104 -0
  796. package/v3/@aiyou-dev/shared/dist/mcp/transport/stdio.js +263 -0
  797. package/v3/@aiyou-dev/shared/dist/mcp/transport/websocket.d.ts +133 -0
  798. package/v3/@aiyou-dev/shared/dist/mcp/transport/websocket.js +396 -0
  799. package/v3/@aiyou-dev/shared/dist/mcp/types.d.ts +438 -0
  800. package/v3/@aiyou-dev/shared/dist/mcp/types.js +54 -0
  801. package/v3/@aiyou-dev/shared/dist/plugin-interface.d.ts +544 -0
  802. package/v3/@aiyou-dev/shared/dist/plugin-interface.js +23 -0
  803. package/v3/@aiyou-dev/shared/dist/plugin-loader.d.ts +139 -0
  804. package/v3/@aiyou-dev/shared/dist/plugin-loader.js +434 -0
  805. package/v3/@aiyou-dev/shared/dist/plugin-registry.d.ts +183 -0
  806. package/v3/@aiyou-dev/shared/dist/plugin-registry.js +457 -0
  807. package/v3/@aiyou-dev/shared/dist/plugins/index.d.ts +10 -0
  808. package/v3/@aiyou-dev/shared/dist/plugins/index.js +10 -0
  809. package/v3/@aiyou-dev/shared/dist/plugins/official/hive-mind-plugin.d.ts +106 -0
  810. package/v3/@aiyou-dev/shared/dist/plugins/official/hive-mind-plugin.js +241 -0
  811. package/v3/@aiyou-dev/shared/dist/plugins/official/index.d.ts +10 -0
  812. package/v3/@aiyou-dev/shared/dist/plugins/official/index.js +10 -0
  813. package/v3/@aiyou-dev/shared/dist/plugins/official/maestro-plugin.d.ts +121 -0
  814. package/v3/@aiyou-dev/shared/dist/plugins/official/maestro-plugin.js +355 -0
  815. package/v3/@aiyou-dev/shared/dist/plugins/types.d.ts +93 -0
  816. package/v3/@aiyou-dev/shared/dist/plugins/types.js +9 -0
  817. package/v3/@aiyou-dev/shared/dist/resilience/bulkhead.d.ts +105 -0
  818. package/v3/@aiyou-dev/shared/dist/resilience/bulkhead.js +206 -0
  819. package/v3/@aiyou-dev/shared/dist/resilience/circuit-breaker.d.ts +132 -0
  820. package/v3/@aiyou-dev/shared/dist/resilience/circuit-breaker.js +233 -0
  821. package/v3/@aiyou-dev/shared/dist/resilience/index.d.ts +19 -0
  822. package/v3/@aiyou-dev/shared/dist/resilience/index.js +19 -0
  823. package/v3/@aiyou-dev/shared/dist/resilience/rate-limiter.d.ts +168 -0
  824. package/v3/@aiyou-dev/shared/dist/resilience/rate-limiter.js +314 -0
  825. package/v3/@aiyou-dev/shared/dist/resilience/retry.d.ts +91 -0
  826. package/v3/@aiyou-dev/shared/dist/resilience/retry.js +159 -0
  827. package/v3/@aiyou-dev/shared/dist/security/index.d.ts +10 -0
  828. package/v3/@aiyou-dev/shared/dist/security/index.js +12 -0
  829. package/v3/@aiyou-dev/shared/dist/security/input-validation.d.ts +73 -0
  830. package/v3/@aiyou-dev/shared/dist/security/input-validation.js +201 -0
  831. package/v3/@aiyou-dev/shared/dist/security/secure-random.d.ts +92 -0
  832. package/v3/@aiyou-dev/shared/dist/security/secure-random.js +142 -0
  833. package/v3/@aiyou-dev/shared/dist/services/index.d.ts +7 -0
  834. package/v3/@aiyou-dev/shared/dist/services/index.js +7 -0
  835. package/v3/@aiyou-dev/shared/dist/services/v3-progress.service.d.ts +124 -0
  836. package/v3/@aiyou-dev/shared/dist/services/v3-progress.service.js +402 -0
  837. package/v3/@aiyou-dev/shared/dist/types/agent.types.d.ts +137 -0
  838. package/v3/@aiyou-dev/shared/dist/types/agent.types.js +6 -0
  839. package/v3/@aiyou-dev/shared/dist/types/index.d.ts +11 -0
  840. package/v3/@aiyou-dev/shared/dist/types/index.js +17 -0
  841. package/v3/@aiyou-dev/shared/dist/types/mcp.types.d.ts +266 -0
  842. package/v3/@aiyou-dev/shared/dist/types/mcp.types.js +7 -0
  843. package/v3/@aiyou-dev/shared/dist/types/memory.types.d.ts +236 -0
  844. package/v3/@aiyou-dev/shared/dist/types/memory.types.js +7 -0
  845. package/v3/@aiyou-dev/shared/dist/types/swarm.types.d.ts +186 -0
  846. package/v3/@aiyou-dev/shared/dist/types/swarm.types.js +65 -0
  847. package/v3/@aiyou-dev/shared/dist/types/task.types.d.ts +178 -0
  848. package/v3/@aiyou-dev/shared/dist/types/task.types.js +32 -0
  849. package/v3/@aiyou-dev/shared/dist/types.d.ts +197 -0
  850. package/v3/@aiyou-dev/shared/dist/types.js +21 -0
  851. package/v3/@aiyou-dev/shared/dist/utils/secure-logger.d.ts +69 -0
  852. package/v3/@aiyou-dev/shared/dist/utils/secure-logger.js +208 -0
  853. package/v3/@aiyou-dev/shared/package.json +42 -0
@@ -0,0 +1,1292 @@
1
+ /**
2
+ * V3 CLI Memory Command
3
+ * Memory operations for AgentDB integration
4
+ */
5
+ import { output } from '../output.js';
6
+ import { select, confirm, input } from '../prompt.js';
7
+ import { callMCPTool, MCPClientError } from '../mcp-client.js';
8
+ // Memory backends
9
+ const BACKENDS = [
10
+ { value: 'agentdb', label: 'AgentDB', hint: 'Vector database with HNSW indexing (150x-12,500x faster)' },
11
+ { value: 'sqlite', label: 'SQLite', hint: 'Lightweight local storage' },
12
+ { value: 'hybrid', label: 'Hybrid', hint: 'SQLite + AgentDB (recommended)' },
13
+ { value: 'memory', label: 'In-Memory', hint: 'Fast but non-persistent' }
14
+ ];
15
+ // Store command
16
+ const storeCommand = {
17
+ name: 'store',
18
+ description: 'Store data in memory',
19
+ options: [
20
+ {
21
+ name: 'key',
22
+ short: 'k',
23
+ description: 'Storage key/namespace',
24
+ type: 'string',
25
+ required: true
26
+ },
27
+ {
28
+ name: 'value',
29
+ // Note: No short flag - global -v is reserved for verbose
30
+ description: 'Value to store (use --value)',
31
+ type: 'string'
32
+ },
33
+ {
34
+ name: 'namespace',
35
+ short: 'n',
36
+ description: 'Memory namespace',
37
+ type: 'string',
38
+ default: 'default'
39
+ },
40
+ {
41
+ name: 'ttl',
42
+ description: 'Time to live in seconds',
43
+ type: 'number'
44
+ },
45
+ {
46
+ name: 'tags',
47
+ description: 'Comma-separated tags',
48
+ type: 'string'
49
+ },
50
+ {
51
+ name: 'vector',
52
+ description: 'Store as vector embedding',
53
+ type: 'boolean',
54
+ default: false
55
+ },
56
+ {
57
+ name: 'upsert',
58
+ short: 'u',
59
+ description: 'Update if key exists (insert or replace)',
60
+ type: 'boolean',
61
+ default: false
62
+ }
63
+ ],
64
+ examples: [
65
+ { command: 'aiyou-dev memory store -k "api/auth" -v "JWT implementation"', description: 'Store text' },
66
+ { command: 'aiyou-dev memory store -k "pattern/singleton" --vector', description: 'Store vector' },
67
+ { command: 'aiyou-dev memory store -k "pattern" -v "updated" --upsert', description: 'Update existing' }
68
+ ],
69
+ action: async (ctx) => {
70
+ const key = ctx.flags.key;
71
+ let value = ctx.flags.value || ctx.args[0];
72
+ const namespace = ctx.flags.namespace;
73
+ const ttl = ctx.flags.ttl;
74
+ const tags = ctx.flags.tags ? ctx.flags.tags.split(',') : [];
75
+ const asVector = ctx.flags.vector;
76
+ const upsert = ctx.flags.upsert;
77
+ if (!key) {
78
+ output.printError('Key is required. Use --key or -k');
79
+ return { success: false, exitCode: 1 };
80
+ }
81
+ if (!value && ctx.interactive) {
82
+ value = await input({
83
+ message: 'Enter value to store:',
84
+ validate: (v) => v.length > 0 || 'Value is required'
85
+ });
86
+ }
87
+ if (!value) {
88
+ output.printError('Value is required. Use --value');
89
+ return { success: false, exitCode: 1 };
90
+ }
91
+ const storeData = {
92
+ key,
93
+ namespace,
94
+ value,
95
+ ttl,
96
+ tags,
97
+ asVector,
98
+ storedAt: new Date().toISOString(),
99
+ size: Buffer.byteLength(value, 'utf8')
100
+ };
101
+ output.printInfo(`Storing in ${namespace}/${key}...`);
102
+ // Use direct sql.js storage with automatic embedding generation
103
+ try {
104
+ const { storeEntry } = await import('../memory/memory-initializer.js');
105
+ if (asVector) {
106
+ output.writeln(output.dim(' Generating embedding vector...'));
107
+ }
108
+ const result = await storeEntry({
109
+ key,
110
+ value,
111
+ namespace,
112
+ generateEmbeddingFlag: true, // Always generate embeddings for semantic search
113
+ tags,
114
+ ttl,
115
+ upsert
116
+ });
117
+ if (!result.success) {
118
+ output.printError(result.error || 'Failed to store');
119
+ return { success: false, exitCode: 1 };
120
+ }
121
+ output.writeln();
122
+ output.printTable({
123
+ columns: [
124
+ { key: 'property', header: 'Property', width: 15 },
125
+ { key: 'val', header: 'Value', width: 40 }
126
+ ],
127
+ data: [
128
+ { property: 'Key', val: key },
129
+ { property: 'Namespace', val: namespace },
130
+ { property: 'Size', val: `${storeData.size} bytes` },
131
+ { property: 'TTL', val: ttl ? `${ttl}s` : 'None' },
132
+ { property: 'Tags', val: tags.length > 0 ? tags.join(', ') : 'None' },
133
+ { property: 'Vector', val: result.embedding ? `Yes (${result.embedding.dimensions}-dim)` : 'No' },
134
+ { property: 'ID', val: result.id.substring(0, 20) }
135
+ ]
136
+ });
137
+ output.writeln();
138
+ output.printSuccess('Data stored successfully');
139
+ return { success: true, data: { ...storeData, id: result.id, embedding: result.embedding } };
140
+ }
141
+ catch (error) {
142
+ output.printError(`Failed to store: ${error instanceof Error ? error.message : 'Unknown error'}`);
143
+ return { success: false, exitCode: 1 };
144
+ }
145
+ }
146
+ };
147
+ // Retrieve command
148
+ const retrieveCommand = {
149
+ name: 'retrieve',
150
+ aliases: ['get'],
151
+ description: 'Retrieve data from memory',
152
+ options: [
153
+ {
154
+ name: 'key',
155
+ short: 'k',
156
+ description: 'Storage key',
157
+ type: 'string'
158
+ },
159
+ {
160
+ name: 'namespace',
161
+ short: 'n',
162
+ description: 'Memory namespace',
163
+ type: 'string',
164
+ default: 'default'
165
+ }
166
+ ],
167
+ action: async (ctx) => {
168
+ const key = ctx.flags.key || ctx.args[0];
169
+ const namespace = ctx.flags.namespace;
170
+ if (!key) {
171
+ output.printError('Key is required');
172
+ return { success: false, exitCode: 1 };
173
+ }
174
+ // Use sql.js directly for consistent data access
175
+ try {
176
+ const { getEntry } = await import('../memory/memory-initializer.js');
177
+ const result = await getEntry({ key, namespace });
178
+ if (!result.success) {
179
+ output.printError(`Failed to retrieve: ${result.error}`);
180
+ return { success: false, exitCode: 1 };
181
+ }
182
+ if (!result.found || !result.entry) {
183
+ output.printWarning(`Key not found: ${key}`);
184
+ return { success: false, exitCode: 1, data: { key, found: false } };
185
+ }
186
+ const entry = result.entry;
187
+ if (ctx.flags.format === 'json') {
188
+ output.printJson(entry);
189
+ return { success: true, data: entry };
190
+ }
191
+ output.writeln();
192
+ output.printBox([
193
+ `Namespace: ${entry.namespace}`,
194
+ `Key: ${entry.key}`,
195
+ `Size: ${entry.content.length} bytes`,
196
+ `Access Count: ${entry.accessCount}`,
197
+ `Tags: ${entry.tags.length > 0 ? entry.tags.join(', ') : 'None'}`,
198
+ `Vector: ${entry.hasEmbedding ? 'Yes' : 'No'}`,
199
+ '',
200
+ output.bold('Value:'),
201
+ entry.content
202
+ ].join('\n'), 'Memory Entry');
203
+ return { success: true, data: entry };
204
+ }
205
+ catch (error) {
206
+ output.printError(`Failed to retrieve: ${error instanceof Error ? error.message : 'Unknown error'}`);
207
+ return { success: false, exitCode: 1 };
208
+ }
209
+ }
210
+ };
211
+ // Search command
212
+ const searchCommand = {
213
+ name: 'search',
214
+ description: 'Search memory with semantic/vector search',
215
+ options: [
216
+ {
217
+ name: 'query',
218
+ short: 'q',
219
+ description: 'Search query',
220
+ type: 'string',
221
+ required: true
222
+ },
223
+ {
224
+ name: 'namespace',
225
+ short: 'n',
226
+ description: 'Memory namespace',
227
+ type: 'string'
228
+ },
229
+ {
230
+ name: 'limit',
231
+ short: 'l',
232
+ description: 'Maximum results',
233
+ type: 'number',
234
+ default: 10
235
+ },
236
+ {
237
+ name: 'threshold',
238
+ description: 'Similarity threshold (0-1)',
239
+ type: 'number',
240
+ default: 0.7
241
+ },
242
+ {
243
+ name: 'type',
244
+ short: 't',
245
+ description: 'Search type (semantic, keyword, hybrid)',
246
+ type: 'string',
247
+ default: 'semantic',
248
+ choices: ['semantic', 'keyword', 'hybrid']
249
+ },
250
+ {
251
+ name: 'build-hnsw',
252
+ description: 'Build/rebuild HNSW index before searching (enables 150x-12,500x speedup)',
253
+ type: 'boolean',
254
+ default: false
255
+ }
256
+ ],
257
+ examples: [
258
+ { command: 'aiyou-dev memory search -q "authentication patterns"', description: 'Semantic search' },
259
+ { command: 'aiyou-dev memory search -q "JWT" -t keyword', description: 'Keyword search' },
260
+ { command: 'aiyou-dev memory search -q "test" --build-hnsw', description: 'Build HNSW index and search' }
261
+ ],
262
+ action: async (ctx) => {
263
+ const query = ctx.flags.query || ctx.args[0];
264
+ const namespace = ctx.flags.namespace || 'all';
265
+ const limit = ctx.flags.limit || 10;
266
+ const threshold = ctx.flags.threshold || 0.3;
267
+ const searchType = ctx.flags.type || 'semantic';
268
+ const buildHnsw = (ctx.flags['build-hnsw'] || ctx.flags.buildHnsw);
269
+ if (!query) {
270
+ output.printError('Query is required. Use --query or -q');
271
+ return { success: false, exitCode: 1 };
272
+ }
273
+ // Build/rebuild HNSW index if requested
274
+ if (buildHnsw) {
275
+ output.printInfo('Building HNSW index...');
276
+ try {
277
+ const { getHNSWIndex, getHNSWStatus } = await import('../memory/memory-initializer.js');
278
+ const startTime = Date.now();
279
+ const index = await getHNSWIndex({ forceRebuild: true });
280
+ const buildTime = Date.now() - startTime;
281
+ if (index) {
282
+ const status = getHNSWStatus();
283
+ output.printSuccess(`HNSW index built (${status.entryCount} vectors, ${buildTime}ms)`);
284
+ output.writeln(output.dim(` Dimensions: ${status.dimensions}, Metric: cosine`));
285
+ output.writeln(output.dim(` Search speedup: ${status.entryCount > 10000 ? '12,500x' : status.entryCount > 1000 ? '150x' : '10x'}`));
286
+ }
287
+ else {
288
+ output.printWarning('HNSW index not available (install @ruvector/core for acceleration)');
289
+ }
290
+ output.writeln();
291
+ }
292
+ catch (error) {
293
+ output.printWarning(`HNSW build failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
294
+ output.writeln(output.dim(' Falling back to brute-force search'));
295
+ output.writeln();
296
+ }
297
+ }
298
+ output.printInfo(`Searching: "${query}" (${searchType})`);
299
+ output.writeln();
300
+ // Use direct sql.js search with vector similarity
301
+ try {
302
+ const { searchEntries } = await import('../memory/memory-initializer.js');
303
+ const searchResult = await searchEntries({
304
+ query,
305
+ namespace,
306
+ limit,
307
+ threshold
308
+ });
309
+ if (!searchResult.success) {
310
+ output.printError(searchResult.error || 'Search failed');
311
+ return { success: false, exitCode: 1 };
312
+ }
313
+ const results = searchResult.results.map(r => ({
314
+ key: r.key,
315
+ score: r.score,
316
+ namespace: r.namespace,
317
+ preview: r.content
318
+ }));
319
+ if (ctx.flags.format === 'json') {
320
+ output.printJson({ query, searchType, results, searchTime: `${searchResult.searchTime}ms` });
321
+ return { success: true, data: results };
322
+ }
323
+ // Performance stats
324
+ output.writeln(output.dim(` Search time: ${searchResult.searchTime}ms`));
325
+ output.writeln();
326
+ if (results.length === 0) {
327
+ output.printWarning('No results found');
328
+ output.writeln(output.dim('Try: aiyou-dev memory store -k "key" --value "data"'));
329
+ return { success: true, data: [] };
330
+ }
331
+ output.printTable({
332
+ columns: [
333
+ { key: 'key', header: 'Key', width: 20 },
334
+ { key: 'score', header: 'Score', width: 8, align: 'right', format: (v) => Number(v).toFixed(2) },
335
+ { key: 'namespace', header: 'Namespace', width: 12 },
336
+ { key: 'preview', header: 'Preview', width: 35 }
337
+ ],
338
+ data: results
339
+ });
340
+ output.writeln();
341
+ output.printInfo(`Found ${results.length} results`);
342
+ return { success: true, data: results };
343
+ }
344
+ catch (error) {
345
+ output.printError(`Search failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
346
+ return { success: false, exitCode: 1 };
347
+ }
348
+ }
349
+ };
350
+ // List command
351
+ const listCommand = {
352
+ name: 'list',
353
+ aliases: ['ls'],
354
+ description: 'List memory entries',
355
+ options: [
356
+ {
357
+ name: 'namespace',
358
+ short: 'n',
359
+ description: 'Filter by namespace',
360
+ type: 'string'
361
+ },
362
+ {
363
+ name: 'tags',
364
+ short: 't',
365
+ description: 'Filter by tags (comma-separated)',
366
+ type: 'string'
367
+ },
368
+ {
369
+ name: 'limit',
370
+ short: 'l',
371
+ description: 'Maximum entries',
372
+ type: 'number',
373
+ default: 20
374
+ }
375
+ ],
376
+ action: async (ctx) => {
377
+ const namespace = ctx.flags.namespace;
378
+ const limit = ctx.flags.limit;
379
+ // Use sql.js directly for consistent data access
380
+ try {
381
+ const { listEntries } = await import('../memory/memory-initializer.js');
382
+ const listResult = await listEntries({ namespace, limit, offset: 0 });
383
+ if (!listResult.success) {
384
+ output.printError(`Failed to list: ${listResult.error}`);
385
+ return { success: false, exitCode: 1 };
386
+ }
387
+ // Format entries for display
388
+ const entries = listResult.entries.map(e => ({
389
+ key: e.key,
390
+ namespace: e.namespace,
391
+ size: e.size + ' B',
392
+ vector: e.hasEmbedding ? '✓' : '-',
393
+ accessCount: e.accessCount,
394
+ updated: formatRelativeTime(e.updatedAt)
395
+ }));
396
+ if (ctx.flags.format === 'json') {
397
+ output.printJson(listResult.entries);
398
+ return { success: true, data: listResult.entries };
399
+ }
400
+ output.writeln();
401
+ output.writeln(output.bold('Memory Entries'));
402
+ output.writeln();
403
+ if (entries.length === 0) {
404
+ output.printWarning('No entries found');
405
+ output.printInfo('Store data: aiyou-dev memory store -k "key" --value "data"');
406
+ return { success: true, data: [] };
407
+ }
408
+ output.printTable({
409
+ columns: [
410
+ { key: 'key', header: 'Key', width: 25 },
411
+ { key: 'namespace', header: 'Namespace', width: 12 },
412
+ { key: 'size', header: 'Size', width: 10, align: 'right' },
413
+ { key: 'vector', header: 'Vector', width: 8, align: 'center' },
414
+ { key: 'accessCount', header: 'Accessed', width: 10, align: 'right' },
415
+ { key: 'updated', header: 'Updated', width: 12 }
416
+ ],
417
+ data: entries
418
+ });
419
+ output.writeln();
420
+ output.printInfo(`Showing ${entries.length} of ${listResult.total} entries`);
421
+ return { success: true, data: listResult.entries };
422
+ }
423
+ catch (error) {
424
+ output.printError(`Failed to list: ${error instanceof Error ? error.message : 'Unknown error'}`);
425
+ return { success: false, exitCode: 1 };
426
+ }
427
+ }
428
+ };
429
+ // Helper function to format relative time
430
+ function formatRelativeTime(isoDate) {
431
+ const now = Date.now();
432
+ const date = new Date(isoDate).getTime();
433
+ const diff = now - date;
434
+ const seconds = Math.floor(diff / 1000);
435
+ const minutes = Math.floor(seconds / 60);
436
+ const hours = Math.floor(minutes / 60);
437
+ const days = Math.floor(hours / 24);
438
+ if (days > 0)
439
+ return `${days}d ago`;
440
+ if (hours > 0)
441
+ return `${hours}h ago`;
442
+ if (minutes > 0)
443
+ return `${minutes}m ago`;
444
+ return 'just now';
445
+ }
446
+ // Delete command
447
+ const deleteCommand = {
448
+ name: 'delete',
449
+ aliases: ['rm'],
450
+ description: 'Delete memory entry',
451
+ options: [
452
+ {
453
+ name: 'key',
454
+ short: 'k',
455
+ description: 'Storage key',
456
+ type: 'string'
457
+ },
458
+ {
459
+ name: 'namespace',
460
+ short: 'n',
461
+ description: 'Memory namespace',
462
+ type: 'string',
463
+ default: 'default'
464
+ },
465
+ {
466
+ name: 'force',
467
+ short: 'f',
468
+ description: 'Skip confirmation',
469
+ type: 'boolean',
470
+ default: false
471
+ }
472
+ ],
473
+ examples: [
474
+ { command: 'aiyou-dev memory delete -k "mykey"', description: 'Delete entry with default namespace' },
475
+ { command: 'aiyou-dev memory delete -k "lesson" -n "lessons"', description: 'Delete entry from specific namespace' },
476
+ { command: 'aiyou-dev memory delete mykey -f', description: 'Delete without confirmation' }
477
+ ],
478
+ action: async (ctx) => {
479
+ // Support both --key flag and positional argument
480
+ const key = ctx.flags.key || ctx.args[0];
481
+ const namespace = ctx.flags.namespace || 'default';
482
+ const force = ctx.flags.force;
483
+ if (!key) {
484
+ output.printError('Key is required. Use: memory delete -k "key" [-n "namespace"]');
485
+ return { success: false, exitCode: 1 };
486
+ }
487
+ if (!force && ctx.interactive) {
488
+ const confirmed = await confirm({
489
+ message: `Delete memory entry "${key}" from namespace "${namespace}"?`,
490
+ default: false
491
+ });
492
+ if (!confirmed) {
493
+ output.printInfo('Operation cancelled');
494
+ return { success: true };
495
+ }
496
+ }
497
+ // Use sql.js directly for consistent data access (Issue #980)
498
+ try {
499
+ const { deleteEntry } = await import('../memory/memory-initializer.js');
500
+ const result = await deleteEntry({ key, namespace });
501
+ if (!result.success) {
502
+ output.printError(result.error || 'Failed to delete');
503
+ return { success: false, exitCode: 1 };
504
+ }
505
+ if (result.deleted) {
506
+ output.printSuccess(`Deleted "${key}" from namespace "${namespace}"`);
507
+ output.printInfo(`Remaining entries: ${result.remainingEntries}`);
508
+ }
509
+ else {
510
+ output.printWarning(`Key not found: "${key}" in namespace "${namespace}"`);
511
+ }
512
+ return { success: result.deleted, data: result };
513
+ }
514
+ catch (error) {
515
+ output.printError(`Failed to delete: ${error instanceof Error ? error.message : 'Unknown error'}`);
516
+ return { success: false, exitCode: 1 };
517
+ }
518
+ }
519
+ };
520
+ // Stats command
521
+ const statsCommand = {
522
+ name: 'stats',
523
+ description: 'Show memory statistics',
524
+ action: async (ctx) => {
525
+ // Call MCP memory/stats tool for real statistics
526
+ try {
527
+ const statsResult = await callMCPTool('memory_stats', {});
528
+ const stats = {
529
+ backend: statsResult.backend,
530
+ entries: {
531
+ total: statsResult.totalEntries,
532
+ vectors: 0, // Would need vector backend support
533
+ text: statsResult.totalEntries
534
+ },
535
+ storage: {
536
+ total: statsResult.totalSize,
537
+ location: statsResult.location
538
+ },
539
+ version: statsResult.version,
540
+ oldestEntry: statsResult.oldestEntry,
541
+ newestEntry: statsResult.newestEntry
542
+ };
543
+ if (ctx.flags.format === 'json') {
544
+ output.printJson(stats);
545
+ return { success: true, data: stats };
546
+ }
547
+ output.writeln();
548
+ output.writeln(output.bold('Memory Statistics'));
549
+ output.writeln();
550
+ output.writeln(output.bold('Overview'));
551
+ output.printTable({
552
+ columns: [
553
+ { key: 'metric', header: 'Metric', width: 20 },
554
+ { key: 'value', header: 'Value', width: 30, align: 'right' }
555
+ ],
556
+ data: [
557
+ { metric: 'Backend', value: stats.backend },
558
+ { metric: 'Version', value: stats.version },
559
+ { metric: 'Total Entries', value: stats.entries.total.toLocaleString() },
560
+ { metric: 'Total Storage', value: stats.storage.total },
561
+ { metric: 'Location', value: stats.storage.location }
562
+ ]
563
+ });
564
+ output.writeln();
565
+ output.writeln(output.bold('Timeline'));
566
+ output.printTable({
567
+ columns: [
568
+ { key: 'metric', header: 'Metric', width: 20 },
569
+ { key: 'value', header: 'Value', width: 30, align: 'right' }
570
+ ],
571
+ data: [
572
+ { metric: 'Oldest Entry', value: stats.oldestEntry || 'N/A' },
573
+ { metric: 'Newest Entry', value: stats.newestEntry || 'N/A' }
574
+ ]
575
+ });
576
+ output.writeln();
577
+ output.printInfo('V3 Performance: 150x-12,500x faster search with HNSW indexing');
578
+ return { success: true, data: stats };
579
+ }
580
+ catch (error) {
581
+ output.printError(`Failed to get stats: ${error instanceof Error ? error.message : 'Unknown error'}`);
582
+ return { success: false, exitCode: 1 };
583
+ }
584
+ }
585
+ };
586
+ // Configure command
587
+ const configureCommand = {
588
+ name: 'configure',
589
+ aliases: ['config'],
590
+ description: 'Configure memory backend',
591
+ options: [
592
+ {
593
+ name: 'backend',
594
+ short: 'b',
595
+ description: 'Memory backend',
596
+ type: 'string',
597
+ choices: BACKENDS.map(b => b.value)
598
+ },
599
+ {
600
+ name: 'path',
601
+ description: 'Storage path',
602
+ type: 'string'
603
+ },
604
+ {
605
+ name: 'cache-size',
606
+ description: 'Cache size in MB',
607
+ type: 'number'
608
+ },
609
+ {
610
+ name: 'hnsw-m',
611
+ description: 'HNSW M parameter',
612
+ type: 'number',
613
+ default: 16
614
+ },
615
+ {
616
+ name: 'hnsw-ef',
617
+ description: 'HNSW ef parameter',
618
+ type: 'number',
619
+ default: 200
620
+ }
621
+ ],
622
+ action: async (ctx) => {
623
+ let backend = ctx.flags.backend;
624
+ if (!backend && ctx.interactive) {
625
+ backend = await select({
626
+ message: 'Select memory backend:',
627
+ options: BACKENDS,
628
+ default: 'hybrid'
629
+ });
630
+ }
631
+ const config = {
632
+ backend: backend || 'hybrid',
633
+ path: ctx.flags.path || './data/memory',
634
+ cacheSize: ctx.flags.cacheSize || 256,
635
+ hnsw: {
636
+ m: ctx.flags.hnswM || 16,
637
+ ef: ctx.flags.hnswEf || 200
638
+ }
639
+ };
640
+ output.writeln();
641
+ output.printInfo('Memory Configuration');
642
+ output.writeln();
643
+ output.printTable({
644
+ columns: [
645
+ { key: 'setting', header: 'Setting', width: 20 },
646
+ { key: 'value', header: 'Value', width: 25 }
647
+ ],
648
+ data: [
649
+ { setting: 'Backend', value: config.backend },
650
+ { setting: 'Storage Path', value: config.path },
651
+ { setting: 'Cache Size', value: `${config.cacheSize} MB` },
652
+ { setting: 'HNSW M', value: config.hnsw.m },
653
+ { setting: 'HNSW ef', value: config.hnsw.ef }
654
+ ]
655
+ });
656
+ output.writeln();
657
+ output.printSuccess('Memory configuration updated');
658
+ return { success: true, data: config };
659
+ }
660
+ };
661
+ // Cleanup command
662
+ const cleanupCommand = {
663
+ name: 'cleanup',
664
+ description: 'Clean up stale and expired memory entries',
665
+ options: [
666
+ {
667
+ name: 'dry-run',
668
+ short: 'd',
669
+ description: 'Show what would be deleted',
670
+ type: 'boolean',
671
+ default: false
672
+ },
673
+ {
674
+ name: 'older-than',
675
+ short: 'o',
676
+ description: 'Delete entries older than (e.g., "7d", "30d")',
677
+ type: 'string'
678
+ },
679
+ {
680
+ name: 'expired-only',
681
+ short: 'e',
682
+ description: 'Only delete expired TTL entries',
683
+ type: 'boolean',
684
+ default: false
685
+ },
686
+ {
687
+ name: 'low-quality',
688
+ short: 'l',
689
+ description: 'Delete low quality patterns (threshold)',
690
+ type: 'number'
691
+ },
692
+ {
693
+ name: 'namespace',
694
+ short: 'n',
695
+ description: 'Clean specific namespace only',
696
+ type: 'string'
697
+ },
698
+ {
699
+ name: 'force',
700
+ short: 'f',
701
+ description: 'Skip confirmation',
702
+ type: 'boolean',
703
+ default: false
704
+ }
705
+ ],
706
+ examples: [
707
+ { command: 'aiyou-dev memory cleanup --dry-run', description: 'Preview cleanup' },
708
+ { command: 'aiyou-dev memory cleanup --older-than 30d', description: 'Delete entries older than 30 days' },
709
+ { command: 'aiyou-dev memory cleanup --expired-only', description: 'Clean expired entries' }
710
+ ],
711
+ action: async (ctx) => {
712
+ const dryRun = ctx.flags.dryRun;
713
+ const force = ctx.flags.force;
714
+ if (dryRun) {
715
+ output.writeln(output.warning('DRY RUN - No changes will be made'));
716
+ }
717
+ output.printInfo('Analyzing memory for cleanup...');
718
+ try {
719
+ const result = await callMCPTool('memory_cleanup', {
720
+ dryRun,
721
+ olderThan: ctx.flags.olderThan,
722
+ expiredOnly: ctx.flags.expiredOnly,
723
+ lowQualityThreshold: ctx.flags.lowQuality,
724
+ namespace: ctx.flags.namespace,
725
+ });
726
+ if (ctx.flags.format === 'json') {
727
+ output.printJson(result);
728
+ return { success: true, data: result };
729
+ }
730
+ output.writeln();
731
+ output.writeln(output.bold('Cleanup Analysis'));
732
+ output.printTable({
733
+ columns: [
734
+ { key: 'category', header: 'Category', width: 20 },
735
+ { key: 'count', header: 'Count', width: 15, align: 'right' }
736
+ ],
737
+ data: [
738
+ { category: 'Expired (TTL)', count: result.candidates.expired },
739
+ { category: 'Stale (unused)', count: result.candidates.stale },
740
+ { category: 'Low Quality', count: result.candidates.lowQuality },
741
+ { category: output.bold('Total'), count: output.bold(String(result.candidates.total)) }
742
+ ]
743
+ });
744
+ if (!dryRun && result.candidates.total > 0 && !force) {
745
+ const confirmed = await confirm({
746
+ message: `Delete ${result.candidates.total} entries (${result.freed.formatted})?`,
747
+ default: false
748
+ });
749
+ if (!confirmed) {
750
+ output.printInfo('Cleanup cancelled');
751
+ return { success: true, data: result };
752
+ }
753
+ }
754
+ if (!dryRun) {
755
+ output.writeln();
756
+ output.printSuccess(`Cleaned ${result.deleted.entries} entries`);
757
+ output.printList([
758
+ `Vectors removed: ${result.deleted.vectors}`,
759
+ `Patterns removed: ${result.deleted.patterns}`,
760
+ `Space freed: ${result.freed.formatted}`,
761
+ `Duration: ${result.duration}ms`
762
+ ]);
763
+ }
764
+ return { success: true, data: result };
765
+ }
766
+ catch (error) {
767
+ if (error instanceof MCPClientError) {
768
+ output.printError(`Cleanup error: ${error.message}`);
769
+ }
770
+ else {
771
+ output.printError(`Unexpected error: ${String(error)}`);
772
+ }
773
+ return { success: false, exitCode: 1 };
774
+ }
775
+ }
776
+ };
777
+ // Compress command
778
+ const compressCommand = {
779
+ name: 'compress',
780
+ description: 'Compress and optimize memory storage',
781
+ options: [
782
+ {
783
+ name: 'level',
784
+ short: 'l',
785
+ description: 'Compression level (fast, balanced, max)',
786
+ type: 'string',
787
+ choices: ['fast', 'balanced', 'max'],
788
+ default: 'balanced'
789
+ },
790
+ {
791
+ name: 'target',
792
+ short: 't',
793
+ description: 'Target (vectors, text, patterns, all)',
794
+ type: 'string',
795
+ choices: ['vectors', 'text', 'patterns', 'all'],
796
+ default: 'all'
797
+ },
798
+ {
799
+ name: 'quantize',
800
+ short: 'z',
801
+ description: 'Enable vector quantization (reduces memory 4-32x)',
802
+ type: 'boolean',
803
+ default: false
804
+ },
805
+ {
806
+ name: 'bits',
807
+ description: 'Quantization bits (4, 8, 16)',
808
+ type: 'number',
809
+ default: 8
810
+ },
811
+ {
812
+ name: 'rebuild-index',
813
+ short: 'r',
814
+ description: 'Rebuild HNSW index after compression',
815
+ type: 'boolean',
816
+ default: true
817
+ }
818
+ ],
819
+ examples: [
820
+ { command: 'aiyou-dev memory compress', description: 'Balanced compression' },
821
+ { command: 'aiyou-dev memory compress --quantize --bits 4', description: '4-bit quantization (32x reduction)' },
822
+ { command: 'aiyou-dev memory compress -l max -t vectors', description: 'Max compression on vectors' }
823
+ ],
824
+ action: async (ctx) => {
825
+ const level = ctx.flags.level || 'balanced';
826
+ const target = ctx.flags.target || 'all';
827
+ const quantize = ctx.flags.quantize;
828
+ const bits = ctx.flags.bits || 8;
829
+ const rebuildIndex = ctx.flags.rebuildIndex ?? true;
830
+ output.writeln();
831
+ output.writeln(output.bold('Memory Compression'));
832
+ output.writeln(output.dim(`Level: ${level}, Target: ${target}, Quantize: ${quantize ? `${bits}-bit` : 'no'}`));
833
+ output.writeln();
834
+ const spinner = output.createSpinner({ text: 'Analyzing current storage...', spinner: 'dots' });
835
+ spinner.start();
836
+ try {
837
+ const result = await callMCPTool('memory_compress', {
838
+ level,
839
+ target,
840
+ quantize,
841
+ bits,
842
+ rebuildIndex,
843
+ });
844
+ spinner.succeed('Compression complete');
845
+ if (ctx.flags.format === 'json') {
846
+ output.printJson(result);
847
+ return { success: true, data: result };
848
+ }
849
+ output.writeln();
850
+ output.writeln(output.bold('Storage Comparison'));
851
+ output.printTable({
852
+ columns: [
853
+ { key: 'category', header: 'Category', width: 15 },
854
+ { key: 'before', header: 'Before', width: 12, align: 'right' },
855
+ { key: 'after', header: 'After', width: 12, align: 'right' },
856
+ { key: 'saved', header: 'Saved', width: 12, align: 'right' }
857
+ ],
858
+ data: [
859
+ { category: 'Vectors', before: result.before.vectorsSize, after: result.after.vectorsSize, saved: '-' },
860
+ { category: 'Text', before: result.before.textSize, after: result.after.textSize, saved: '-' },
861
+ { category: 'Patterns', before: result.before.patternsSize, after: result.after.patternsSize, saved: '-' },
862
+ { category: 'Index', before: result.before.indexSize, after: result.after.indexSize, saved: '-' },
863
+ { category: output.bold('Total'), before: result.before.totalSize, after: result.after.totalSize, saved: output.success(result.compression.formattedSaved) }
864
+ ]
865
+ });
866
+ output.writeln();
867
+ output.printBox([
868
+ `Compression Ratio: ${result.compression.ratio.toFixed(2)}x`,
869
+ `Space Saved: ${result.compression.formattedSaved}`,
870
+ `Quantization: ${result.compression.quantizationApplied ? `Yes (${bits}-bit)` : 'No'}`,
871
+ `Index Rebuilt: ${result.compression.indexRebuilt ? 'Yes' : 'No'}`,
872
+ `Duration: ${(result.duration / 1000).toFixed(1)}s`
873
+ ].join('\n'), 'Results');
874
+ if (result.performance) {
875
+ output.writeln();
876
+ output.writeln(output.bold('Performance Impact'));
877
+ output.printList([
878
+ `Search latency: ${result.performance.searchLatencyBefore.toFixed(2)}ms → ${result.performance.searchLatencyAfter.toFixed(2)}ms`,
879
+ `Speedup: ${output.success(result.performance.searchSpeedup)}`
880
+ ]);
881
+ }
882
+ return { success: true, data: result };
883
+ }
884
+ catch (error) {
885
+ spinner.fail('Compression failed');
886
+ if (error instanceof MCPClientError) {
887
+ output.printError(`Compression error: ${error.message}`);
888
+ }
889
+ else {
890
+ output.printError(`Unexpected error: ${String(error)}`);
891
+ }
892
+ return { success: false, exitCode: 1 };
893
+ }
894
+ }
895
+ };
896
+ // Export command
897
+ const exportCommand = {
898
+ name: 'export',
899
+ description: 'Export memory to file',
900
+ options: [
901
+ {
902
+ name: 'output',
903
+ short: 'o',
904
+ description: 'Output file path',
905
+ type: 'string',
906
+ required: true
907
+ },
908
+ {
909
+ name: 'format',
910
+ short: 'f',
911
+ description: 'Export format (json, csv, binary)',
912
+ type: 'string',
913
+ choices: ['json', 'csv', 'binary'],
914
+ default: 'json'
915
+ },
916
+ {
917
+ name: 'namespace',
918
+ short: 'n',
919
+ description: 'Export specific namespace',
920
+ type: 'string'
921
+ },
922
+ {
923
+ name: 'include-vectors',
924
+ description: 'Include vector embeddings',
925
+ type: 'boolean',
926
+ default: true
927
+ }
928
+ ],
929
+ examples: [
930
+ { command: 'aiyou-dev memory export -o ./backup.json', description: 'Export all to JSON' },
931
+ { command: 'aiyou-dev memory export -o ./data.csv -f csv', description: 'Export to CSV' }
932
+ ],
933
+ action: async (ctx) => {
934
+ const outputPath = ctx.flags.output;
935
+ const format = ctx.flags.format || 'json';
936
+ if (!outputPath) {
937
+ output.printError('Output path is required. Use --output or -o');
938
+ return { success: false, exitCode: 1 };
939
+ }
940
+ output.printInfo(`Exporting memory to ${outputPath}...`);
941
+ try {
942
+ const result = await callMCPTool('memory_export', {
943
+ outputPath,
944
+ format,
945
+ namespace: ctx.flags.namespace,
946
+ includeVectors: ctx.flags.includeVectors ?? true,
947
+ });
948
+ output.printSuccess(`Exported to ${result.outputPath}`);
949
+ output.printList([
950
+ `Entries: ${result.exported.entries}`,
951
+ `Vectors: ${result.exported.vectors}`,
952
+ `Patterns: ${result.exported.patterns}`,
953
+ `File size: ${result.fileSize}`
954
+ ]);
955
+ return { success: true, data: result };
956
+ }
957
+ catch (error) {
958
+ if (error instanceof MCPClientError) {
959
+ output.printError(`Export error: ${error.message}`);
960
+ }
961
+ else {
962
+ output.printError(`Unexpected error: ${String(error)}`);
963
+ }
964
+ return { success: false, exitCode: 1 };
965
+ }
966
+ }
967
+ };
968
+ // Import command
969
+ const importCommand = {
970
+ name: 'import',
971
+ description: 'Import memory from file',
972
+ options: [
973
+ {
974
+ name: 'input',
975
+ short: 'i',
976
+ description: 'Input file path',
977
+ type: 'string',
978
+ required: true
979
+ },
980
+ {
981
+ name: 'merge',
982
+ short: 'm',
983
+ description: 'Merge with existing (skip duplicates)',
984
+ type: 'boolean',
985
+ default: true
986
+ },
987
+ {
988
+ name: 'namespace',
989
+ short: 'n',
990
+ description: 'Import into specific namespace',
991
+ type: 'string'
992
+ }
993
+ ],
994
+ examples: [
995
+ { command: 'aiyou-dev memory import -i ./backup.json', description: 'Import from file' },
996
+ { command: 'aiyou-dev memory import -i ./data.json -n archive', description: 'Import to namespace' }
997
+ ],
998
+ action: async (ctx) => {
999
+ const inputPath = ctx.flags.input || ctx.args[0];
1000
+ if (!inputPath) {
1001
+ output.printError('Input path is required. Use --input or -i');
1002
+ return { success: false, exitCode: 1 };
1003
+ }
1004
+ output.printInfo(`Importing memory from ${inputPath}...`);
1005
+ try {
1006
+ const result = await callMCPTool('memory_import', {
1007
+ inputPath,
1008
+ merge: ctx.flags.merge ?? true,
1009
+ namespace: ctx.flags.namespace,
1010
+ });
1011
+ output.printSuccess(`Imported from ${result.inputPath}`);
1012
+ output.printList([
1013
+ `Entries: ${result.imported.entries}`,
1014
+ `Vectors: ${result.imported.vectors}`,
1015
+ `Patterns: ${result.imported.patterns}`,
1016
+ `Skipped (duplicates): ${result.skipped}`,
1017
+ `Duration: ${result.duration}ms`
1018
+ ]);
1019
+ return { success: true, data: result };
1020
+ }
1021
+ catch (error) {
1022
+ if (error instanceof MCPClientError) {
1023
+ output.printError(`Import error: ${error.message}`);
1024
+ }
1025
+ else {
1026
+ output.printError(`Unexpected error: ${String(error)}`);
1027
+ }
1028
+ return { success: false, exitCode: 1 };
1029
+ }
1030
+ }
1031
+ };
1032
+ // Init subcommand - initialize memory database using sql.js
1033
+ const initMemoryCommand = {
1034
+ name: 'init',
1035
+ description: 'Initialize memory database with sql.js (WASM SQLite) - includes vector embeddings, pattern learning, temporal decay',
1036
+ options: [
1037
+ {
1038
+ name: 'backend',
1039
+ short: 'b',
1040
+ description: 'Backend type: hybrid (default), sqlite, or agentdb',
1041
+ type: 'string',
1042
+ default: 'hybrid'
1043
+ },
1044
+ {
1045
+ name: 'path',
1046
+ short: 'p',
1047
+ description: 'Database path',
1048
+ type: 'string'
1049
+ },
1050
+ {
1051
+ name: 'force',
1052
+ short: 'f',
1053
+ description: 'Overwrite existing database',
1054
+ type: 'boolean',
1055
+ default: false
1056
+ },
1057
+ {
1058
+ name: 'verbose',
1059
+ description: 'Show detailed initialization output',
1060
+ type: 'boolean',
1061
+ default: false
1062
+ },
1063
+ {
1064
+ name: 'verify',
1065
+ description: 'Run verification tests after initialization',
1066
+ type: 'boolean',
1067
+ default: true
1068
+ },
1069
+ {
1070
+ name: 'load-embeddings',
1071
+ description: 'Pre-load ONNX embedding model (lazy by default)',
1072
+ type: 'boolean',
1073
+ default: false
1074
+ }
1075
+ ],
1076
+ examples: [
1077
+ { command: 'aiyou-dev memory init', description: 'Initialize hybrid backend with all features' },
1078
+ { command: 'aiyou-dev memory init -b agentdb', description: 'Initialize AgentDB backend' },
1079
+ { command: 'aiyou-dev memory init -p ./data/memory.db --force', description: 'Reinitialize at custom path' },
1080
+ { command: 'aiyou-dev memory init --verbose --verify', description: 'Initialize with full verification' }
1081
+ ],
1082
+ action: async (ctx) => {
1083
+ const backend = ctx.flags.backend || 'hybrid';
1084
+ const customPath = ctx.flags.path;
1085
+ const force = ctx.flags.force;
1086
+ const verbose = ctx.flags.verbose;
1087
+ const verify = ctx.flags.verify !== false; // Default true
1088
+ const loadEmbeddings = ctx.flags.loadEmbeddings;
1089
+ output.writeln();
1090
+ output.writeln(output.bold('Initializing Memory Database'));
1091
+ output.writeln(output.dim('─'.repeat(50)));
1092
+ const spinner = output.createSpinner({ text: 'Initializing schema...', spinner: 'dots' });
1093
+ spinner.start();
1094
+ try {
1095
+ // Import the memory initializer
1096
+ const { initializeMemoryDatabase, loadEmbeddingModel, verifyMemoryInit } = await import('../memory/memory-initializer.js');
1097
+ const result = await initializeMemoryDatabase({
1098
+ backend,
1099
+ dbPath: customPath,
1100
+ force,
1101
+ verbose
1102
+ });
1103
+ if (!result.success) {
1104
+ spinner.fail('Initialization failed');
1105
+ output.printError(result.error || 'Unknown error');
1106
+ return { success: false, exitCode: 1 };
1107
+ }
1108
+ spinner.succeed('Schema initialized');
1109
+ // Lazy load or pre-load embedding model
1110
+ if (loadEmbeddings) {
1111
+ const embeddingSpinner = output.createSpinner({ text: 'Loading embedding model...', spinner: 'dots' });
1112
+ embeddingSpinner.start();
1113
+ const embeddingResult = await loadEmbeddingModel({ verbose });
1114
+ if (embeddingResult.success) {
1115
+ embeddingSpinner.succeed(`Embedding model loaded: ${embeddingResult.modelName} (${embeddingResult.dimensions}-dim, ${embeddingResult.loadTime}ms)`);
1116
+ }
1117
+ else {
1118
+ embeddingSpinner.stop(output.warning(`Embedding model: ${embeddingResult.error || 'Using fallback'}`));
1119
+ }
1120
+ }
1121
+ output.writeln();
1122
+ // Show features enabled with detailed capabilities
1123
+ const featureLines = [
1124
+ `Backend: ${result.backend}`,
1125
+ `Schema Version: ${result.schemaVersion}`,
1126
+ `Database Path: ${result.dbPath}`,
1127
+ '',
1128
+ output.bold('Features:'),
1129
+ ` Vector Embeddings: ${result.features.vectorEmbeddings ? output.success('✓ Enabled') : output.dim('✗ Disabled')}`,
1130
+ ` Pattern Learning: ${result.features.patternLearning ? output.success('✓ Enabled') : output.dim('✗ Disabled')}`,
1131
+ ` Temporal Decay: ${result.features.temporalDecay ? output.success('✓ Enabled') : output.dim('✗ Disabled')}`,
1132
+ ` HNSW Indexing: ${result.features.hnswIndexing ? output.success('✓ Enabled') : output.dim('✗ Disabled')}`,
1133
+ ` Migration Tracking: ${result.features.migrationTracking ? output.success('✓ Enabled') : output.dim('✗ Disabled')}`
1134
+ ];
1135
+ if (verbose) {
1136
+ featureLines.push('', output.bold('HNSW Configuration:'), ` M (connections): 16`, ` ef (construction): 200`, ` ef (search): 100`, ` Metric: cosine`, '', output.bold('Pattern Learning:'), ` Confidence scoring: 0.0 - 1.0`, ` Temporal decay: Half-life 30 days`, ` Pattern versioning: Enabled`, ` Types: task-routing, error-recovery, optimization, coordination, prediction`);
1137
+ }
1138
+ output.printBox(featureLines.join('\n'), 'Configuration');
1139
+ output.writeln();
1140
+ // ADR-053: Show ControllerRegistry activation results
1141
+ if (result.controllers) {
1142
+ const { activated, failed, initTimeMs } = result.controllers;
1143
+ if (activated.length > 0 || failed.length > 0) {
1144
+ const controllerLines = [
1145
+ output.bold('AgentDB Controllers:'),
1146
+ ` Activated: ${activated.length} Failed: ${failed.length} Init: ${Math.round(initTimeMs)}ms`,
1147
+ ];
1148
+ if (verbose && activated.length > 0) {
1149
+ controllerLines.push('');
1150
+ for (const name of activated) {
1151
+ controllerLines.push(` ${output.success('✓')} ${name}`);
1152
+ }
1153
+ }
1154
+ if (failed.length > 0 && verbose) {
1155
+ controllerLines.push('');
1156
+ for (const name of failed) {
1157
+ controllerLines.push(` ${output.dim('✗')} ${name}`);
1158
+ }
1159
+ }
1160
+ output.printBox(controllerLines.join('\n'), 'Controller Registry (ADR-053)');
1161
+ output.writeln();
1162
+ }
1163
+ }
1164
+ // Show tables created
1165
+ if (verbose && result.tablesCreated.length > 0) {
1166
+ output.writeln(output.bold('Tables Created:'));
1167
+ output.printTable({
1168
+ columns: [
1169
+ { key: 'table', header: 'Table', width: 22 },
1170
+ { key: 'purpose', header: 'Purpose', width: 38 }
1171
+ ],
1172
+ data: [
1173
+ { table: 'memory_entries', purpose: 'Core memory storage with embeddings' },
1174
+ { table: 'patterns', purpose: 'Learned patterns with confidence scores' },
1175
+ { table: 'pattern_history', purpose: 'Pattern versioning and evolution' },
1176
+ { table: 'trajectories', purpose: 'SONA learning trajectories' },
1177
+ { table: 'trajectory_steps', purpose: 'Individual trajectory steps' },
1178
+ { table: 'migration_state', purpose: 'Migration progress tracking' },
1179
+ { table: 'sessions', purpose: 'Context persistence' },
1180
+ { table: 'vector_indexes', purpose: 'HNSW index configuration' },
1181
+ { table: 'metadata', purpose: 'System metadata' }
1182
+ ]
1183
+ });
1184
+ output.writeln();
1185
+ output.writeln(output.bold('Indexes Created:'));
1186
+ output.printList(result.indexesCreated.slice(0, 8).map(idx => output.dim(idx)));
1187
+ if (result.indexesCreated.length > 8) {
1188
+ output.writeln(output.dim(` ... and ${result.indexesCreated.length - 8} more`));
1189
+ }
1190
+ output.writeln();
1191
+ }
1192
+ // Run verification if enabled
1193
+ if (verify) {
1194
+ const verifySpinner = output.createSpinner({ text: 'Verifying initialization...', spinner: 'dots' });
1195
+ verifySpinner.start();
1196
+ const verification = await verifyMemoryInit(result.dbPath, { verbose });
1197
+ if (verification.success) {
1198
+ verifySpinner.succeed(`Verification passed (${verification.summary.passed}/${verification.summary.total} tests)`);
1199
+ }
1200
+ else {
1201
+ verifySpinner.fail(`Verification failed (${verification.summary.failed}/${verification.summary.total} tests failed)`);
1202
+ }
1203
+ if (verbose || !verification.success) {
1204
+ output.writeln();
1205
+ output.writeln(output.bold('Verification Results:'));
1206
+ output.printTable({
1207
+ columns: [
1208
+ { key: 'status', header: '', width: 3 },
1209
+ { key: 'name', header: 'Test', width: 22 },
1210
+ { key: 'details', header: 'Details', width: 30 },
1211
+ { key: 'duration', header: 'Time', width: 8, align: 'right' }
1212
+ ],
1213
+ data: verification.tests.map(t => ({
1214
+ status: t.passed ? output.success('✓') : output.error('✗'),
1215
+ name: t.name,
1216
+ details: t.details || '',
1217
+ duration: t.duration ? `${t.duration}ms` : '-'
1218
+ }))
1219
+ });
1220
+ }
1221
+ output.writeln();
1222
+ }
1223
+ // Show next steps
1224
+ output.writeln(output.bold('Next Steps:'));
1225
+ output.printList([
1226
+ `Store data: ${output.highlight('aiyou-dev memory store -k "key" --value "data"')}`,
1227
+ `Search: ${output.highlight('aiyou-dev memory search -q "query"')}`,
1228
+ `Train patterns: ${output.highlight('aiyou-dev neural train -p coordination')}`,
1229
+ `View stats: ${output.highlight('aiyou-dev memory stats')}`
1230
+ ]);
1231
+ // Also sync to .claude directory
1232
+ const fs = await import('fs');
1233
+ const path = await import('path');
1234
+ const claudeDir = path.join(process.cwd(), '.claude');
1235
+ const claudeDbPath = path.join(claudeDir, 'memory.db');
1236
+ if (!fs.existsSync(claudeDir)) {
1237
+ fs.mkdirSync(claudeDir, { recursive: true });
1238
+ }
1239
+ if (fs.existsSync(result.dbPath) && (!fs.existsSync(claudeDbPath) || force)) {
1240
+ fs.copyFileSync(result.dbPath, claudeDbPath);
1241
+ output.writeln();
1242
+ output.writeln(output.dim(`Synced to: ${claudeDbPath}`));
1243
+ }
1244
+ return {
1245
+ success: true,
1246
+ data: result
1247
+ };
1248
+ }
1249
+ catch (error) {
1250
+ spinner.fail('Initialization failed');
1251
+ output.printError(`Failed to initialize memory: ${error instanceof Error ? error.message : String(error)}`);
1252
+ return { success: false, exitCode: 1 };
1253
+ }
1254
+ }
1255
+ };
1256
+ // Main memory command
1257
+ export const memoryCommand = {
1258
+ name: 'memory',
1259
+ description: 'Memory management commands',
1260
+ subcommands: [initMemoryCommand, storeCommand, retrieveCommand, searchCommand, listCommand, deleteCommand, statsCommand, configureCommand, cleanupCommand, compressCommand, exportCommand, importCommand],
1261
+ options: [],
1262
+ examples: [
1263
+ { command: 'aiyou-dev memory store -k "key" -v "value"', description: 'Store data' },
1264
+ { command: 'aiyou-dev memory search -q "auth patterns"', description: 'Search memory' },
1265
+ { command: 'aiyou-dev memory stats', description: 'Show statistics' }
1266
+ ],
1267
+ action: async (ctx) => {
1268
+ output.writeln();
1269
+ output.writeln(output.bold('Memory Management Commands'));
1270
+ output.writeln();
1271
+ output.writeln('Usage: aiyou-dev memory <subcommand> [options]');
1272
+ output.writeln();
1273
+ output.writeln('Subcommands:');
1274
+ output.printList([
1275
+ `${output.highlight('init')} - Initialize memory database (sql.js)`,
1276
+ `${output.highlight('store')} - Store data in memory`,
1277
+ `${output.highlight('retrieve')} - Retrieve data from memory`,
1278
+ `${output.highlight('search')} - Semantic/vector search`,
1279
+ `${output.highlight('list')} - List memory entries`,
1280
+ `${output.highlight('delete')} - Delete memory entry`,
1281
+ `${output.highlight('stats')} - Show statistics`,
1282
+ `${output.highlight('configure')} - Configure backend`,
1283
+ `${output.highlight('cleanup')} - Clean expired entries`,
1284
+ `${output.highlight('compress')} - Compress database`,
1285
+ `${output.highlight('export')} - Export memory to file`,
1286
+ `${output.highlight('import')} - Import from file`
1287
+ ]);
1288
+ return { success: true };
1289
+ }
1290
+ };
1291
+ export default memoryCommand;
1292
+ //# sourceMappingURL=memory.js.map