@monoes/monomindcli 2.8.4 → 2.9.2

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 (1795) hide show
  1. package/.claude/agents/architecture/system-design/arch-system-design.md +0 -0
  2. package/.claude/agents/consensus/crdt-synchronizer.md +0 -0
  3. package/.claude/agents/consensus/quorum-manager.md +0 -0
  4. package/.claude/agents/consensus/security-manager.md +0 -0
  5. package/.claude/agents/core/coder.md +0 -0
  6. package/.claude/agents/core/coordinator.md +0 -0
  7. package/.claude/agents/core/planner.md +0 -0
  8. package/.claude/agents/core/researcher.md +0 -0
  9. package/.claude/agents/core/reviewer.md +0 -0
  10. package/.claude/agents/core/tester.md +0 -0
  11. package/.claude/agents/design/design-monodesign.md +0 -0
  12. package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +0 -0
  13. package/.claude/agents/engineering/engineering-ai-engineer.md +0 -0
  14. package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -0
  15. package/.claude/agents/engineering/engineering-backend-architect.md +0 -0
  16. package/.claude/agents/engineering/engineering-code-reviewer.md +0 -0
  17. package/.claude/agents/engineering/engineering-data-engineer.md +0 -0
  18. package/.claude/agents/engineering/engineering-database-optimizer.md +0 -0
  19. package/.claude/agents/engineering/engineering-devops-automator.md +0 -0
  20. package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +0 -0
  21. package/.claude/agents/engineering/engineering-feishu-integration-developer.md +0 -0
  22. package/.claude/agents/engineering/engineering-frontend-developer.md +0 -0
  23. package/.claude/agents/engineering/engineering-git-workflow-master.md +0 -0
  24. package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -0
  25. package/.claude/agents/engineering/engineering-mobile-app-builder.md +0 -0
  26. package/.claude/agents/engineering/engineering-rapid-prototyper.md +0 -0
  27. package/.claude/agents/engineering/engineering-security-engineer.md +0 -0
  28. package/.claude/agents/engineering/engineering-senior-developer.md +0 -0
  29. package/.claude/agents/engineering/engineering-software-architect.md +0 -0
  30. package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +0 -0
  31. package/.claude/agents/engineering/engineering-sre.md +0 -0
  32. package/.claude/agents/engineering/engineering-technical-writer.md +0 -0
  33. package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -0
  34. package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +0 -0
  35. package/.claude/agents/github/code-review-swarm.md +0 -0
  36. package/.claude/agents/github/github-modes.md +0 -0
  37. package/.claude/agents/github/issue-tracker.md +0 -0
  38. package/.claude/agents/github/multi-repo-swarm.md +0 -0
  39. package/.claude/agents/github/pr-manager.md +0 -0
  40. package/.claude/agents/github/project-board-sync.md +0 -0
  41. package/.claude/agents/github/release-manager.md +0 -0
  42. package/.claude/agents/github/repo-architect.md +0 -0
  43. package/.claude/agents/github/swarm-issue.md +0 -0
  44. package/.claude/agents/github/swarm-pr.md +0 -0
  45. package/.claude/agents/github/sync-coordinator.md +0 -0
  46. package/.claude/agents/github/workflow-automation.md +0 -0
  47. package/.claude/agents/goal/goal-planner.md +0 -0
  48. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -0
  49. package/.claude/agents/hive-mind/scout-explorer.md +0 -0
  50. package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -0
  51. package/.claude/agents/hive-mind/worker-specialist.md +0 -0
  52. package/.claude/agents/marketing/marketing-competitive-content.md +0 -0
  53. package/.claude/agents/marketing/marketing-cro-specialist.md +0 -0
  54. package/.claude/agents/marketing/marketing-email-specialist.md +0 -0
  55. package/.claude/agents/marketing/marketing-launch-strategist.md +0 -0
  56. package/.claude/agents/marketing/marketing-pricing-strategist.md +0 -0
  57. package/.claude/agents/optimization/benchmark-suite.md +0 -0
  58. package/.claude/agents/optimization/load-balancer.md +0 -0
  59. package/.claude/agents/optimization/performance-monitor.md +0 -0
  60. package/.claude/agents/optimization/resource-allocator.md +0 -0
  61. package/.claude/agents/optimization/topology-optimizer.md +0 -0
  62. package/.claude/agents/schemas/architecture-output.json +0 -0
  63. package/.claude/agents/schemas/code-review-output.json +0 -0
  64. package/.claude/agents/schemas/generic-task-input.json +0 -0
  65. package/.claude/agents/schemas/implementation-output.json +0 -0
  66. package/.claude/agents/schemas/research-output.json +0 -0
  67. package/.claude/agents/schemas/security-audit-output.json +0 -0
  68. package/.claude/agents/schemas/test-report-output.json +0 -0
  69. package/.claude/agents/specialists/integration-architect.md +0 -0
  70. package/.claude/agents/specialized/agentic-identity-trust.md +0 -0
  71. package/.claude/agents/specialized/agents-orchestrator.md +0 -0
  72. package/.claude/agents/specialized/automation-governance-architect.md +0 -0
  73. package/.claude/agents/specialized/blockchain-security-auditor.md +0 -0
  74. package/.claude/agents/specialized/compliance-auditor.md +0 -0
  75. package/.claude/agents/specialized/identity-graph-operator.md +0 -0
  76. package/.claude/agents/specialized/lsp-index-engineer.md +0 -0
  77. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -0
  78. package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -0
  79. package/.claude/agents/specialized/specialized-developer-advocate.md +0 -0
  80. package/.claude/agents/specialized/specialized-document-generator.md +0 -0
  81. package/.claude/agents/specialized/specialized-mcp-builder.md +0 -0
  82. package/.claude/agents/specialized/specialized-model-qa.md +0 -0
  83. package/.claude/agents/specialized/specialized-workflow-architect.md +0 -0
  84. package/.claude/agents/specialized/zk-steward.md +0 -0
  85. package/.claude/agents/swarm/mesh-coordinator.md +0 -0
  86. package/.claude/agents/templates/automation-smart-agent.md +0 -0
  87. package/.claude/agents/templates/coordinator-swarm-init.md +0 -0
  88. package/.claude/agents/testing/production-validator.md +0 -0
  89. package/.claude/agents/testing/tdd-london-swarm.md +0 -0
  90. package/.claude/agents/testing/testing-accessibility-auditor.md +0 -0
  91. package/.claude/agents/testing/testing-api-tester.md +0 -0
  92. package/.claude/agents/testing/testing-evidence-collector.md +0 -0
  93. package/.claude/agents/testing/testing-performance-benchmarker.md +0 -0
  94. package/.claude/agents/testing/testing-test-results-analyzer.md +0 -0
  95. package/.claude/agents/testing/testing-tool-evaluator.md +0 -0
  96. package/.claude/agents/testing/testing-workflow-optimizer.md +0 -0
  97. package/.claude/commands/agents/README.md +0 -0
  98. package/.claude/commands/agents/agent-capabilities.md +0 -0
  99. package/.claude/commands/agents/agent-coordination.md +0 -0
  100. package/.claude/commands/agents/agent-spawning.md +0 -0
  101. package/.claude/commands/agents/agent-types.md +0 -0
  102. package/.claude/commands/analysis/README.md +0 -0
  103. package/.claude/commands/analysis/bottleneck-detect.md +0 -0
  104. package/.claude/commands/analysis/performance-bottlenecks.md +0 -0
  105. package/.claude/commands/analysis/performance-report.md +0 -0
  106. package/.claude/commands/analysis/token-usage.md +0 -0
  107. package/.claude/commands/automation/README.md +0 -0
  108. package/.claude/commands/automation/auto-agent.md +0 -0
  109. package/.claude/commands/automation/self-healing.md +0 -0
  110. package/.claude/commands/automation/session-memory.md +0 -0
  111. package/.claude/commands/automation/smart-agents.md +0 -0
  112. package/.claude/commands/automation/smart-spawn.md +0 -0
  113. package/.claude/commands/automation/workflow-select.md +0 -0
  114. package/.claude/commands/coordination/README.md +0 -0
  115. package/.claude/commands/coordination/agent-spawn.md +0 -0
  116. package/.claude/commands/coordination/swarm-init.md +0 -0
  117. package/.claude/commands/coordination/task-orchestrate.md +0 -0
  118. package/.claude/commands/github/README.md +0 -0
  119. package/.claude/commands/github/github-modes.md +0 -0
  120. package/.claude/commands/github/issue-tracker.md +0 -0
  121. package/.claude/commands/github/pr-manager.md +0 -0
  122. package/.claude/commands/github/release-manager.md +0 -0
  123. package/.claude/commands/github/repo-architect.md +0 -0
  124. package/.claude/commands/github/sync-coordinator.md +0 -0
  125. package/.claude/commands/hive-mind/README.md +0 -0
  126. package/.claude/commands/hive-mind/hive-mind-consensus.md +0 -0
  127. package/.claude/commands/hive-mind/hive-mind-init.md +0 -0
  128. package/.claude/commands/hive-mind/hive-mind-memory.md +0 -0
  129. package/.claude/commands/hive-mind/hive-mind-spawn.md +0 -0
  130. package/.claude/commands/hive-mind/hive-mind-status.md +0 -0
  131. package/.claude/commands/hive-mind/hive-mind-stop.md +0 -0
  132. package/.claude/commands/hive-mind/hive-mind.md +0 -0
  133. package/.claude/commands/hooks/README.md +0 -0
  134. package/.claude/commands/hooks/overview.md +0 -0
  135. package/.claude/commands/hooks/post-edit.md +0 -0
  136. package/.claude/commands/hooks/post-task.md +0 -0
  137. package/.claude/commands/hooks/pre-edit.md +0 -0
  138. package/.claude/commands/hooks/pre-task.md +0 -0
  139. package/.claude/commands/hooks/session-end.md +0 -0
  140. package/.claude/commands/hooks/setup.md +0 -0
  141. package/.claude/commands/mastermind/_repeat.md +0 -0
  142. package/.claude/commands/mastermind/_taskfile.md +0 -0
  143. package/.claude/commands/mastermind/adr.md +0 -0
  144. package/.claude/commands/mastermind/approvev1.md +0 -0
  145. package/.claude/commands/mastermind/architect.md +0 -0
  146. package/.claude/commands/mastermind/autodev.md +0 -0
  147. package/.claude/commands/mastermind/brain.md +0 -0
  148. package/.claude/commands/mastermind/budget.md +0 -0
  149. package/.claude/commands/mastermind/build.md +0 -0
  150. package/.claude/commands/mastermind/code-review.md +0 -0
  151. package/.claude/commands/mastermind/content.md +0 -0
  152. package/.claude/commands/mastermind/createorg.md +0 -0
  153. package/.claude/commands/mastermind/createtask.md +0 -0
  154. package/.claude/commands/mastermind/debug.md +0 -0
  155. package/.claude/commands/mastermind/design.md +0 -0
  156. package/.claude/commands/mastermind/do.md +0 -0
  157. package/.claude/commands/mastermind/execute.md +0 -0
  158. package/.claude/commands/mastermind/finance.md +0 -0
  159. package/.claude/commands/mastermind/finish.md +0 -0
  160. package/.claude/commands/mastermind/graph-status.md +0 -0
  161. package/.claude/commands/mastermind/help.md +0 -0
  162. package/.claude/commands/mastermind/idea.md +0 -0
  163. package/.claude/commands/mastermind/ideate.md +0 -0
  164. package/.claude/commands/mastermind/improve.md +0 -0
  165. package/.claude/commands/mastermind/loops.md +0 -0
  166. package/.claude/commands/mastermind/marketing.md +0 -0
  167. package/.claude/commands/mastermind/master.md +0 -0
  168. package/.claude/commands/mastermind/memory.md +0 -0
  169. package/.claude/commands/mastermind/okf-export.md +0 -0
  170. package/.claude/commands/mastermind/okf-import.md +0 -0
  171. package/.claude/commands/mastermind/ops.md +0 -0
  172. package/.claude/commands/mastermind/orgs.md +0 -0
  173. package/.claude/commands/mastermind/orgstatus.md +0 -0
  174. package/.claude/commands/mastermind/plan.md +0 -0
  175. package/.claude/commands/mastermind/receive-review.md +0 -0
  176. package/.claude/commands/mastermind/references/antigravity-tools.md +0 -0
  177. package/.claude/commands/mastermind/references/claude-code-tools.md +0 -0
  178. package/.claude/commands/mastermind/references/codex-tools.md +0 -0
  179. package/.claude/commands/mastermind/references/copilot-tools.md +0 -0
  180. package/.claude/commands/mastermind/references/gemini-tools.md +0 -0
  181. package/.claude/commands/mastermind/references/pi-tools.md +0 -0
  182. package/.claude/commands/mastermind/release.md +0 -0
  183. package/.claude/commands/mastermind/repeat.md +0 -0
  184. package/.claude/commands/mastermind/research.md +0 -0
  185. package/.claude/commands/mastermind/review.md +0 -0
  186. package/.claude/commands/mastermind/runorg.md +0 -0
  187. package/.claude/commands/mastermind/runorgv1.md +0 -0
  188. package/.claude/commands/mastermind/sales.md +0 -0
  189. package/.claude/commands/mastermind/skill-builder.md +0 -0
  190. package/.claude/commands/mastermind/specialagents.md +0 -0
  191. package/.claude/commands/mastermind/stoporg.md +0 -0
  192. package/.claude/commands/mastermind/swarm.md +0 -0
  193. package/.claude/commands/mastermind/taskdev.md +0 -0
  194. package/.claude/commands/mastermind/tdd.md +0 -0
  195. package/.claude/commands/mastermind/techport.md +0 -0
  196. package/.claude/commands/mastermind/topology.md +0 -0
  197. package/.claude/commands/mastermind/understand.md +0 -0
  198. package/.claude/commands/mastermind/verify.md +0 -0
  199. package/.claude/commands/mastermind/worktree.md +0 -0
  200. package/.claude/commands/mastermind.md +0 -0
  201. package/.claude/commands/memory/README.md +0 -0
  202. package/.claude/commands/memory/memory-search.md +0 -0
  203. package/.claude/commands/monitoring/README.md +0 -0
  204. package/.claude/commands/monitoring/agent-metrics.md +0 -0
  205. package/.claude/commands/monitoring/agents.md +0 -0
  206. package/.claude/commands/monitoring/status.md +0 -0
  207. package/.claude/commands/monobrowse.md +0 -0
  208. package/.claude/commands/monoes/README.md +0 -0
  209. package/.claude/commands/monoes/install.md +0 -0
  210. package/.claude/commands/monoes/monoagent.md +0 -0
  211. package/.claude/commands/monoes/monoclip.md +0 -0
  212. package/.claude/commands/monoes/monotask.md +0 -0
  213. package/.claude/commands/monograph/README.md +0 -0
  214. package/.claude/commands/monograph/monograph-build.md +0 -0
  215. package/.claude/commands/monograph/monograph-search.md +0 -0
  216. package/.claude/commands/monograph/monograph-stats.md +0 -0
  217. package/.claude/commands/monograph/monograph-watch.md +0 -0
  218. package/.claude/commands/monograph/monograph-wiki.md +0 -0
  219. package/.claude/commands/optimization/auto-topology.md +0 -0
  220. package/.claude/commands/optimization/performance-optimize.md +0 -0
  221. package/.claude/commands/pair/README.md +0 -0
  222. package/.claude/commands/pair/examples.md +0 -0
  223. package/.claude/commands/pair/modes.md +0 -0
  224. package/.claude/commands/pair/session.md +0 -0
  225. package/.claude/commands/stream-chain/pipeline.md +0 -0
  226. package/.claude/commands/stream-chain/run.md +0 -0
  227. package/.claude/commands/swarm/README.md +0 -0
  228. package/.claude/commands/swarm/analysis.md +0 -0
  229. package/.claude/commands/swarm/development.md +0 -0
  230. package/.claude/commands/swarm/examples.md +0 -0
  231. package/.claude/commands/swarm/maintenance.md +0 -0
  232. package/.claude/commands/swarm/optimization.md +0 -0
  233. package/.claude/commands/swarm/research.md +0 -0
  234. package/.claude/commands/swarm/swarm.md +0 -0
  235. package/.claude/commands/swarm/testing.md +0 -0
  236. package/.claude/commands/tokens.md +0 -0
  237. package/.claude/commands/truth/start.md +0 -0
  238. package/.claude/commands/ts.md +0 -0
  239. package/.claude/commands/workflows/README.md +0 -0
  240. package/.claude/commands/workflows/development.md +0 -0
  241. package/.claude/commands/workflows/research.md +0 -0
  242. package/.claude/commands/workflows/workflow-create.md +0 -0
  243. package/.claude/commands/workflows/workflow-execute.md +0 -0
  244. package/.claude/commands/workflows/workflow-export.md +0 -0
  245. package/.claude/helpers/build-skill-registry.cjs +0 -0
  246. package/.claude/helpers/control-start.cjs +0 -0
  247. package/.claude/helpers/control-stop.cjs +0 -0
  248. package/.claude/helpers/event-logger.cjs +0 -0
  249. package/.claude/helpers/graphify-freshen.cjs +0 -0
  250. package/.claude/helpers/handlers/adr-draft-handler.cjs +0 -0
  251. package/.claude/helpers/handlers/agent-start-handler.cjs +0 -0
  252. package/.claude/helpers/handlers/budget-status-handler.cjs +0 -0
  253. package/.claude/helpers/handlers/capture-handler.cjs +0 -0
  254. package/.claude/helpers/handlers/compact-handler.cjs +0 -0
  255. package/.claude/helpers/handlers/edit-handler.cjs +0 -0
  256. package/.claude/helpers/handlers/gates-handler.cjs +0 -0
  257. package/.claude/helpers/handlers/graph-status-handler.cjs +0 -0
  258. package/.claude/helpers/handlers/loops-status-handler.cjs +0 -0
  259. package/.claude/helpers/handlers/route-handler.cjs +12 -0
  260. package/.claude/helpers/handlers/session-handler.cjs +0 -0
  261. package/.claude/helpers/handlers/session-restore-handler.cjs +28 -7
  262. package/.claude/helpers/handlers/stats-handler.cjs +0 -0
  263. package/.claude/helpers/handlers/task-handler.cjs +0 -0
  264. package/.claude/helpers/intelligence.cjs +0 -0
  265. package/.claude/helpers/learning-service.mjs +0 -0
  266. package/.claude/helpers/loop-tracker.cjs +0 -0
  267. package/.claude/helpers/mastermind-activate.cjs +0 -0
  268. package/.claude/helpers/memory-palace.cjs +0 -0
  269. package/.claude/helpers/memory.cjs +0 -0
  270. package/.claude/helpers/metrics-db.mjs +0 -0
  271. package/.claude/helpers/monolean-activate.cjs +0 -0
  272. package/.claude/helpers/monolean-config.cjs +0 -0
  273. package/.claude/helpers/monolean-instructions.cjs +0 -0
  274. package/.claude/helpers/monolean-propagate.cjs +0 -0
  275. package/.claude/helpers/monolean-tracker.cjs +0 -0
  276. package/.claude/helpers/router.cjs +0 -0
  277. package/.claude/helpers/session.cjs +0 -0
  278. package/.claude/helpers/skill-registry.json +0 -0
  279. package/.claude/helpers/statusline.cjs +0 -0
  280. package/.claude/helpers/toggle-statusline.cjs +0 -0
  281. package/.claude/helpers/token-tracker.cjs +0 -0
  282. package/.claude/helpers/utils/agent-registrations.cjs +0 -0
  283. package/.claude/helpers/utils/fs-helpers.cjs +0 -0
  284. package/.claude/helpers/utils/micro-agents.cjs +22 -0
  285. package/.claude/helpers/utils/monograph.cjs +0 -0
  286. package/.claude/helpers/utils/system-pressure.cjs +0 -0
  287. package/.claude/helpers/utils/telemetry.cjs +0 -0
  288. package/.claude/settings.json +0 -0
  289. package/.claude/skills/agent-browser-testing/SKILL.md +0 -0
  290. package/.claude/skills/agentic-jujutsu/SKILL.md +0 -0
  291. package/.claude/skills/github-issue-triage/SKILL.md +0 -0
  292. package/.claude/skills/github-repo-recap/SKILL.md +0 -0
  293. package/.claude/skills/github-toolkit/SKILL.md +60 -0
  294. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -0
  295. package/.claude/skills/hooks-automation/SKILL.md +0 -0
  296. package/.claude/skills/mastermind-access/SKILL.md +0 -0
  297. package/.claude/skills/mastermind-activity/SKILL.md +0 -0
  298. package/.claude/skills/mastermind-adapter-manager/SKILL.md +0 -0
  299. package/.claude/skills/mastermind-adapters/SKILL.md +0 -0
  300. package/.claude/skills/mastermind-agent-detail/SKILL.md +0 -0
  301. package/.claude/skills/mastermind-agent-select/SKILL.md +0 -0
  302. package/.claude/skills/mastermind-agents/SKILL.md +0 -0
  303. package/.claude/skills/mastermind-approval-detail/SKILL.md +0 -0
  304. package/.claude/skills/mastermind-approvev1/SKILL.md +0 -0
  305. package/.claude/skills/mastermind-architect/SKILL.md +0 -0
  306. package/.claude/skills/mastermind-autodev/SKILL.md +0 -0
  307. package/.claude/skills/mastermind-backup/SKILL.md +0 -0
  308. package/.claude/skills/mastermind-bootstrap/SKILL.md +0 -0
  309. package/.claude/skills/mastermind-budgets/SKILL.md +0 -0
  310. package/.claude/skills/mastermind-build/SKILL.md +0 -0
  311. package/.claude/skills/mastermind-companies/SKILL.md +0 -0
  312. package/.claude/skills/mastermind-content/SKILL.md +0 -0
  313. package/.claude/skills/mastermind-costs/SKILL.md +0 -0
  314. package/.claude/skills/mastermind-createorg/SKILL.md +0 -0
  315. package/.claude/skills/mastermind-debug/SKILL.md +0 -0
  316. package/.claude/skills/mastermind-delegation/SKILL.md +0 -0
  317. package/.claude/skills/mastermind-design/SKILL.md +0 -0
  318. package/.claude/skills/mastermind-diagnose/SKILL.md +0 -0
  319. package/.claude/skills/mastermind-env/SKILL.md +0 -0
  320. package/.claude/skills/mastermind-environments/SKILL.md +0 -0
  321. package/.claude/skills/mastermind-execute/SKILL.md +0 -0
  322. package/.claude/skills/mastermind-export/SKILL.md +0 -0
  323. package/.claude/skills/mastermind-finance/SKILL.md +0 -0
  324. package/.claude/skills/mastermind-finish/SKILL.md +0 -0
  325. package/.claude/skills/mastermind-goal-detail/SKILL.md +0 -0
  326. package/.claude/skills/mastermind-goals/SKILL.md +0 -0
  327. package/.claude/skills/mastermind-heartbeatv1/SKILL.md +0 -0
  328. package/.claude/skills/mastermind-idea/SKILL.md +0 -0
  329. package/.claude/skills/mastermind-import/SKILL.md +0 -0
  330. package/.claude/skills/mastermind-inbox/SKILL.md +0 -0
  331. package/.claude/skills/mastermind-instance/SKILL.md +0 -0
  332. package/.claude/skills/mastermind-instance-settings/SKILL.md +0 -0
  333. package/.claude/skills/mastermind-intake/SKILL.md +0 -0
  334. package/.claude/skills/mastermind-invite-landing/SKILL.md +0 -0
  335. package/.claude/skills/mastermind-invites/SKILL.md +0 -0
  336. package/.claude/skills/mastermind-issue-detail/SKILL.md +0 -0
  337. package/.claude/skills/mastermind-issues/SKILL.md +0 -0
  338. package/.claude/skills/mastermind-join-queue/SKILL.md +0 -0
  339. package/.claude/skills/mastermind-liveness/SKILL.md +0 -0
  340. package/.claude/skills/mastermind-marketing/SKILL.md +0 -0
  341. package/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +0 -0
  342. package/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +0 -0
  343. package/.claude/skills/mastermind-memory/SKILL.md +0 -0
  344. package/.claude/skills/mastermind-monitor/SKILL.md +0 -0
  345. package/.claude/skills/mastermind-monotask/SKILL.md +0 -0
  346. package/.claude/skills/mastermind-my-issues/SKILL.md +0 -0
  347. package/.claude/skills/mastermind-new-agent/SKILL.md +0 -0
  348. package/.claude/skills/mastermind-ops/SKILL.md +0 -0
  349. package/.claude/skills/mastermind-org-chart/SKILL.md +0 -0
  350. package/.claude/skills/mastermind-org-settings/SKILL.md +0 -0
  351. package/.claude/skills/mastermind-orgs/SKILL.md +0 -0
  352. package/.claude/skills/mastermind-orgstatus/SKILL.md +0 -0
  353. package/.claude/skills/mastermind-plan/SKILL.md +0 -0
  354. package/.claude/skills/mastermind-plan-to-tasks/SKILL.md +0 -0
  355. package/.claude/skills/mastermind-plugin-manager/SKILL.md +0 -0
  356. package/.claude/skills/mastermind-plugin-settings/SKILL.md +0 -0
  357. package/.claude/skills/mastermind-plugins/SKILL.md +0 -0
  358. package/.claude/skills/mastermind-profile/SKILL.md +0 -0
  359. package/.claude/skills/mastermind-project-detail/SKILL.md +0 -0
  360. package/.claude/skills/mastermind-project-workspace/SKILL.md +0 -0
  361. package/.claude/skills/mastermind-projects/SKILL.md +0 -0
  362. package/.claude/skills/mastermind-protocol/SKILL.md +0 -0
  363. package/.claude/skills/mastermind-receive-review/SKILL.md +0 -0
  364. package/.claude/skills/mastermind-release/SKILL.md +0 -0
  365. package/.claude/skills/mastermind-repeat/SKILL.md +0 -0
  366. package/.claude/skills/mastermind-research/SKILL.md +0 -0
  367. package/.claude/skills/mastermind-review/SKILL.md +0 -0
  368. package/.claude/skills/mastermind-routine-detail/SKILL.md +0 -0
  369. package/.claude/skills/mastermind-routines/SKILL.md +0 -0
  370. package/.claude/skills/mastermind-runorg/SKILL.md +0 -0
  371. package/.claude/skills/mastermind-runorgv1/SKILL.md +0 -0
  372. package/.claude/skills/mastermind-sales/SKILL.md +0 -0
  373. package/.claude/skills/mastermind-search/SKILL.md +0 -0
  374. package/.claude/skills/mastermind-secrets/SKILL.md +0 -0
  375. package/.claude/skills/mastermind-skill-builder/SKILL.md +0 -0
  376. package/.claude/skills/mastermind-skills/SKILL.md +0 -0
  377. package/.claude/skills/mastermind-stoporg/SKILL.md +0 -0
  378. package/.claude/skills/mastermind-taskdev/SKILL.md +0 -0
  379. package/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +0 -0
  380. package/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +0 -0
  381. package/.claude/skills/mastermind-taskdev/implementer-prompt.md +0 -0
  382. package/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +0 -0
  383. package/.claude/skills/mastermind-tasks/SKILL.md +0 -0
  384. package/.claude/skills/mastermind-tdd/SKILL.md +0 -0
  385. package/.claude/skills/mastermind-techport/SKILL.md +0 -0
  386. package/.claude/skills/mastermind-threads/SKILL.md +0 -0
  387. package/.claude/skills/mastermind-tree-control/SKILL.md +0 -0
  388. package/.claude/skills/mastermind-verify/SKILL.md +0 -0
  389. package/.claude/skills/mastermind-wiki/SKILL.md +0 -0
  390. package/.claude/skills/mastermind-workspace-detail/SKILL.md +0 -0
  391. package/.claude/skills/mastermind-workspaces/SKILL.md +0 -0
  392. package/.claude/skills/mastermind-worktree/SKILL.md +0 -0
  393. package/.claude/skills/memory-toolkit/SKILL.md +75 -0
  394. package/.claude/skills/monodesign/SKILL.md +0 -0
  395. package/.claude/skills/monodesign/adapt.md +0 -0
  396. package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +0 -0
  397. package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +0 -0
  398. package/.claude/skills/monodesign/animate.md +0 -0
  399. package/.claude/skills/monodesign/audit.md +0 -0
  400. package/.claude/skills/monodesign/bolder.md +0 -0
  401. package/.claude/skills/monodesign/clarify.md +0 -0
  402. package/.claude/skills/monodesign/colorize.md +0 -0
  403. package/.claude/skills/monodesign/craft.md +0 -0
  404. package/.claude/skills/monodesign/critique.md +0 -0
  405. package/.claude/skills/monodesign/delight.md +0 -0
  406. package/.claude/skills/monodesign/distill.md +0 -0
  407. package/.claude/skills/monodesign/document.md +0 -0
  408. package/.claude/skills/monodesign/extract.md +0 -0
  409. package/.claude/skills/monodesign/harden.md +0 -0
  410. package/.claude/skills/monodesign/init.md +0 -0
  411. package/.claude/skills/monodesign/layout.md +0 -0
  412. package/.claude/skills/monodesign/live.md +0 -0
  413. package/.claude/skills/monodesign/onboard.md +0 -0
  414. package/.claude/skills/monodesign/optimize.md +0 -0
  415. package/.claude/skills/monodesign/overdrive.md +0 -0
  416. package/.claude/skills/monodesign/polish.md +0 -0
  417. package/.claude/skills/monodesign/quieter.md +0 -0
  418. package/.claude/skills/monodesign/reference/adapt.md +0 -0
  419. package/.claude/skills/monodesign/reference/adapt.native.md +0 -0
  420. package/.claude/skills/monodesign/reference/android.md +0 -0
  421. package/.claude/skills/monodesign/reference/animate.md +0 -0
  422. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +0 -0
  423. package/.claude/skills/monodesign/reference/audit.md +0 -0
  424. package/.claude/skills/monodesign/reference/audit.native.md +0 -0
  425. package/.claude/skills/monodesign/reference/bolder.md +0 -0
  426. package/.claude/skills/monodesign/reference/brand-workflow.md +0 -0
  427. package/.claude/skills/monodesign/reference/brand.md +0 -0
  428. package/.claude/skills/monodesign/reference/clarify.md +0 -0
  429. package/.claude/skills/monodesign/reference/codex.md +0 -0
  430. package/.claude/skills/monodesign/reference/cognitive-load.md +0 -0
  431. package/.claude/skills/monodesign/reference/color-and-contrast.md +0 -0
  432. package/.claude/skills/monodesign/reference/colorize.md +0 -0
  433. package/.claude/skills/monodesign/reference/component-specs.md +0 -0
  434. package/.claude/skills/monodesign/reference/component-states.md +0 -0
  435. package/.claude/skills/monodesign/reference/component-system.md +0 -0
  436. package/.claude/skills/monodesign/reference/copy-formulas.md +0 -0
  437. package/.claude/skills/monodesign/reference/craft.md +0 -0
  438. package/.claude/skills/monodesign/reference/critique.md +0 -0
  439. package/.claude/skills/monodesign/reference/delight.md +0 -0
  440. package/.claude/skills/monodesign/reference/design-principles.md +0 -0
  441. package/.claude/skills/monodesign/reference/distill.md +0 -0
  442. package/.claude/skills/monodesign/reference/document.md +0 -0
  443. package/.claude/skills/monodesign/reference/extract.md +0 -0
  444. package/.claude/skills/monodesign/reference/harden.md +0 -0
  445. package/.claude/skills/monodesign/reference/heuristics-scoring.md +0 -0
  446. package/.claude/skills/monodesign/reference/hooks.md +0 -0
  447. package/.claude/skills/monodesign/reference/image-prompts.md +0 -0
  448. package/.claude/skills/monodesign/reference/init.md +0 -0
  449. package/.claude/skills/monodesign/reference/interaction-design.md +0 -0
  450. package/.claude/skills/monodesign/reference/ios.md +0 -0
  451. package/.claude/skills/monodesign/reference/layout.md +0 -0
  452. package/.claude/skills/monodesign/reference/live.md +0 -0
  453. package/.claude/skills/monodesign/reference/motion-design.md +0 -0
  454. package/.claude/skills/monodesign/reference/onboard.md +0 -0
  455. package/.claude/skills/monodesign/reference/optimize.md +0 -0
  456. package/.claude/skills/monodesign/reference/overdrive.md +0 -0
  457. package/.claude/skills/monodesign/reference/personas.md +0 -0
  458. package/.claude/skills/monodesign/reference/polish.md +0 -0
  459. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +0 -0
  460. package/.claude/skills/monodesign/reference/product.md +0 -0
  461. package/.claude/skills/monodesign/reference/quieter.md +0 -0
  462. package/.claude/skills/monodesign/reference/responsive-design.md +0 -0
  463. package/.claude/skills/monodesign/reference/shape.md +0 -0
  464. package/.claude/skills/monodesign/reference/spatial-design.md +0 -0
  465. package/.claude/skills/monodesign/reference/teach.md +0 -0
  466. package/.claude/skills/monodesign/reference/token-architecture.md +0 -0
  467. package/.claude/skills/monodesign/reference/typeset.md +0 -0
  468. package/.claude/skills/monodesign/reference/typography.md +0 -0
  469. package/.claude/skills/monodesign/reference/ux-research.md +0 -0
  470. package/.claude/skills/monodesign/reference/ux-rules.md +0 -0
  471. package/.claude/skills/monodesign/reference/ux-writing.md +0 -0
  472. package/.claude/skills/monodesign/scripts/command-metadata.json +0 -0
  473. package/.claude/skills/monodesign/scripts/context-signals.mjs +0 -0
  474. package/.claude/skills/monodesign/scripts/context.mjs +0 -0
  475. package/.claude/skills/monodesign/scripts/critique-storage.mjs +0 -0
  476. package/.claude/skills/monodesign/scripts/detect-csp.mjs +0 -0
  477. package/.claude/skills/monodesign/scripts/detect.mjs +0 -0
  478. package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +0 -0
  479. package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +0 -0
  480. package/.claude/skills/monodesign/scripts/detector/design-system.mjs +0 -0
  481. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +0 -0
  482. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +0 -0
  483. package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +0 -0
  484. package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +0 -0
  485. package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +0 -0
  486. package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +0 -0
  487. package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +0 -0
  488. package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -0
  489. package/.claude/skills/monodesign/scripts/detector/findings.mjs +0 -0
  490. package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +0 -0
  491. package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +0 -0
  492. package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +0 -0
  493. package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +0 -0
  494. package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +0 -0
  495. package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +0 -0
  496. package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +0 -0
  497. package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +0 -0
  498. package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +0 -0
  499. package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +0 -0
  500. package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +0 -0
  501. package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +0 -0
  502. package/.claude/skills/monodesign/scripts/hook-admin.mjs +0 -0
  503. package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +0 -0
  504. package/.claude/skills/monodesign/scripts/hook-lib.mjs +0 -0
  505. package/.claude/skills/monodesign/scripts/hook.mjs +0 -0
  506. package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +0 -0
  507. package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +0 -0
  508. package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +0 -0
  509. package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +0 -0
  510. package/.claude/skills/monodesign/scripts/lib/provider.mjs +0 -0
  511. package/.claude/skills/monodesign/scripts/lib/target-args.mjs +0 -0
  512. package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +0 -0
  513. package/.claude/skills/monodesign/scripts/live/completion.mjs +0 -0
  514. package/.claude/skills/monodesign/scripts/live/event-validation.mjs +0 -0
  515. package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +0 -0
  516. package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +0 -0
  517. package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +0 -0
  518. package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +0 -0
  519. package/.claude/skills/monodesign/scripts/live/session-store.mjs +0 -0
  520. package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +0 -0
  521. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +11 -6
  522. package/.claude/skills/monodesign/scripts/live/ui-core.mjs +0 -0
  523. package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +0 -0
  524. package/.claude/skills/monodesign/scripts/live-accept.mjs +0 -0
  525. package/.claude/skills/monodesign/scripts/live-browser-dom.js +0 -0
  526. package/.claude/skills/monodesign/scripts/live-browser-session.js +0 -0
  527. package/.claude/skills/monodesign/scripts/live-browser.js +0 -0
  528. package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +0 -0
  529. package/.claude/skills/monodesign/scripts/live-complete.mjs +0 -0
  530. package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +0 -0
  531. package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +0 -0
  532. package/.claude/skills/monodesign/scripts/live-inject.mjs +20 -7
  533. package/.claude/skills/monodesign/scripts/live-insert.mjs +0 -0
  534. package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +0 -0
  535. package/.claude/skills/monodesign/scripts/live-poll.mjs +0 -0
  536. package/.claude/skills/monodesign/scripts/live-resume.mjs +0 -0
  537. package/.claude/skills/monodesign/scripts/live-server.mjs +38 -2
  538. package/.claude/skills/monodesign/scripts/live-status.mjs +0 -0
  539. package/.claude/skills/monodesign/scripts/live-target.mjs +0 -0
  540. package/.claude/skills/monodesign/scripts/live-wrap.mjs +0 -0
  541. package/.claude/skills/monodesign/scripts/live.mjs +0 -0
  542. package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +0 -0
  543. package/.claude/skills/monodesign/scripts/palette.mjs +0 -0
  544. package/.claude/skills/monodesign/scripts/pin.mjs +0 -0
  545. package/.claude/skills/monodesign/shape.md +0 -0
  546. package/.claude/skills/monodesign/teach.md +0 -0
  547. package/.claude/skills/monodesign/typeset.md +0 -0
  548. package/.claude/skills/monolean/SKILL.md +0 -0
  549. package/.claude/skills/monolean-audit/SKILL.md +0 -0
  550. package/.claude/skills/monolean-debt/SKILL.md +0 -0
  551. package/.claude/skills/monolean-help/SKILL.md +0 -0
  552. package/.claude/skills/monolean-review/SKILL.md +0 -0
  553. package/.claude/skills/monomind/browse-agentcore.md +0 -0
  554. package/.claude/skills/monomind/browse-electron.md +0 -0
  555. package/.claude/skills/monomind/browse-qa.md +0 -0
  556. package/.claude/skills/monomind/browse-references/authentication.md +0 -0
  557. package/.claude/skills/monomind/browse-references/trust-boundaries.md +0 -0
  558. package/.claude/skills/monomind/browse-references/video-recording.md +0 -0
  559. package/.claude/skills/monomind/browse-slack.md +0 -0
  560. package/.claude/skills/monomind/browse-vercel.md +0 -0
  561. package/.claude/skills/monomind/browse.md +0 -0
  562. package/.claude/skills/monomotion/SKILL.md +0 -0
  563. package/.claude/skills/monomotion/rules/api-control.md +0 -0
  564. package/.claude/skills/monomotion/rules/effects.md +0 -0
  565. package/.claude/skills/monomotion/rules/integration.md +0 -0
  566. package/.claude/skills/monomotion/rules/scroll.md +0 -0
  567. package/.claude/skills/monomotion/rules/sequencing.md +0 -0
  568. package/.claude/skills/monomotion/rules/svg.md +0 -0
  569. package/.claude/skills/monomotion/rules/text.md +0 -0
  570. package/.claude/skills/pair-programming/SKILL.md +0 -0
  571. package/.claude/skills/performance-analysis/SKILL.md +0 -0
  572. package/.claude/skills/skill-builder/SKILL.md +0 -0
  573. package/.claude/skills/specialagent/SKILL.md +0 -0
  574. package/.claude/skills/stop-slop/SKILL.md +0 -0
  575. package/.claude/skills/stop-slop/references/examples.md +0 -0
  576. package/.claude/skills/stop-slop/references/phrases.md +0 -0
  577. package/.claude/skills/stop-slop/references/structures.md +0 -0
  578. package/.claude/skills/swarm-advanced/SKILL.md +0 -0
  579. package/.claude/skills/swarm-orchestration/SKILL.md +0 -0
  580. package/.claude/skills/verification-quality/SKILL.md +0 -0
  581. package/README.md +8 -6
  582. package/bin/preinstall.cjs +0 -0
  583. package/dist/src/agents/registry-builder.d.ts +0 -0
  584. package/dist/src/agents/registry-builder.d.ts.map +0 -0
  585. package/dist/src/agents/registry-builder.js +0 -0
  586. package/dist/src/agents/registry-builder.js.map +0 -0
  587. package/dist/src/autopilot-state.d.ts +0 -0
  588. package/dist/src/autopilot-state.d.ts.map +0 -0
  589. package/dist/src/autopilot-state.js +0 -0
  590. package/dist/src/autopilot-state.js.map +0 -0
  591. package/dist/src/browser/action-builder/analyzer.d.ts +0 -0
  592. package/dist/src/browser/action-builder/analyzer.d.ts.map +0 -0
  593. package/dist/src/browser/action-builder/analyzer.js +0 -0
  594. package/dist/src/browser/action-builder/analyzer.js.map +0 -0
  595. package/dist/src/browser/action-builder/types.d.ts +0 -0
  596. package/dist/src/browser/action-builder/types.d.ts.map +0 -0
  597. package/dist/src/browser/action-builder/types.js +0 -0
  598. package/dist/src/browser/action-builder/types.js.map +0 -0
  599. package/dist/src/browser/adapters/gemini.d.ts +0 -0
  600. package/dist/src/browser/adapters/gemini.d.ts.map +0 -0
  601. package/dist/src/browser/adapters/gemini.js +0 -0
  602. package/dist/src/browser/adapters/gemini.js.map +0 -0
  603. package/dist/src/browser/adapters/index.d.ts +0 -0
  604. package/dist/src/browser/adapters/index.d.ts.map +0 -0
  605. package/dist/src/browser/adapters/index.js +0 -0
  606. package/dist/src/browser/adapters/index.js.map +0 -0
  607. package/dist/src/browser/adapters/instagram.d.ts +0 -0
  608. package/dist/src/browser/adapters/instagram.d.ts.map +0 -0
  609. package/dist/src/browser/adapters/instagram.js +0 -0
  610. package/dist/src/browser/adapters/instagram.js.map +0 -0
  611. package/dist/src/browser/adapters/linkedin.d.ts +0 -0
  612. package/dist/src/browser/adapters/linkedin.d.ts.map +0 -0
  613. package/dist/src/browser/adapters/linkedin.js +0 -0
  614. package/dist/src/browser/adapters/linkedin.js.map +0 -0
  615. package/dist/src/browser/adapters/x.d.ts +0 -0
  616. package/dist/src/browser/adapters/x.d.ts.map +0 -0
  617. package/dist/src/browser/adapters/x.js +0 -0
  618. package/dist/src/browser/adapters/x.js.map +0 -0
  619. package/dist/src/browser/dashboard/server.d.ts +5 -0
  620. package/dist/src/browser/dashboard/server.d.ts.map +1 -1
  621. package/dist/src/browser/dashboard/server.js +59 -4
  622. package/dist/src/browser/dashboard/server.js.map +1 -1
  623. package/dist/src/browser/dashboard/ui.html +18 -8
  624. package/dist/src/browser/workflow/engine.d.ts +0 -0
  625. package/dist/src/browser/workflow/engine.d.ts.map +0 -0
  626. package/dist/src/browser/workflow/engine.js +0 -0
  627. package/dist/src/browser/workflow/engine.js.map +0 -0
  628. package/dist/src/browser/workflow/expression.d.ts +0 -0
  629. package/dist/src/browser/workflow/expression.d.ts.map +0 -0
  630. package/dist/src/browser/workflow/expression.js +0 -0
  631. package/dist/src/browser/workflow/expression.js.map +0 -0
  632. package/dist/src/browser/workflow/store.d.ts +0 -0
  633. package/dist/src/browser/workflow/store.d.ts.map +1 -1
  634. package/dist/src/browser/workflow/store.js +3 -2
  635. package/dist/src/browser/workflow/store.js.map +1 -1
  636. package/dist/src/browser/workflow/types.d.ts +0 -0
  637. package/dist/src/browser/workflow/types.d.ts.map +0 -0
  638. package/dist/src/browser/workflow/types.js +0 -0
  639. package/dist/src/browser/workflow/types.js.map +0 -0
  640. package/dist/src/capabilities/cap-code.d.ts +0 -0
  641. package/dist/src/capabilities/cap-code.d.ts.map +0 -0
  642. package/dist/src/capabilities/cap-code.js +0 -0
  643. package/dist/src/capabilities/cap-code.js.map +0 -0
  644. package/dist/src/capabilities/cap-data.d.ts +0 -0
  645. package/dist/src/capabilities/cap-data.d.ts.map +0 -0
  646. package/dist/src/capabilities/cap-data.js +0 -0
  647. package/dist/src/capabilities/cap-data.js.map +0 -0
  648. package/dist/src/capabilities/cap-documents.d.ts +0 -0
  649. package/dist/src/capabilities/cap-documents.d.ts.map +1 -1
  650. package/dist/src/capabilities/cap-documents.js +21 -16
  651. package/dist/src/capabilities/cap-documents.js.map +1 -1
  652. package/dist/src/capabilities/cap-graph.d.ts +0 -0
  653. package/dist/src/capabilities/cap-graph.d.ts.map +0 -0
  654. package/dist/src/capabilities/cap-graph.js +0 -0
  655. package/dist/src/capabilities/cap-graph.js.map +0 -0
  656. package/dist/src/capabilities/cap-media.d.ts +0 -0
  657. package/dist/src/capabilities/cap-media.d.ts.map +0 -0
  658. package/dist/src/capabilities/cap-media.js +0 -0
  659. package/dist/src/capabilities/cap-media.js.map +0 -0
  660. package/dist/src/capabilities/cap-timeline.d.ts +0 -0
  661. package/dist/src/capabilities/cap-timeline.d.ts.map +0 -0
  662. package/dist/src/capabilities/cap-timeline.js +0 -0
  663. package/dist/src/capabilities/cap-timeline.js.map +0 -0
  664. package/dist/src/capabilities/index.d.ts +0 -0
  665. package/dist/src/capabilities/index.d.ts.map +0 -0
  666. package/dist/src/capabilities/index.js +0 -0
  667. package/dist/src/capabilities/index.js.map +0 -0
  668. package/dist/src/capabilities/manager.d.ts +0 -0
  669. package/dist/src/capabilities/manager.d.ts.map +0 -0
  670. package/dist/src/capabilities/manager.js +0 -0
  671. package/dist/src/capabilities/manager.js.map +0 -0
  672. package/dist/src/capabilities/scanner.d.ts +0 -0
  673. package/dist/src/capabilities/scanner.d.ts.map +0 -0
  674. package/dist/src/capabilities/scanner.js +0 -0
  675. package/dist/src/capabilities/scanner.js.map +0 -0
  676. package/dist/src/capabilities/types.d.ts +0 -0
  677. package/dist/src/capabilities/types.d.ts.map +0 -0
  678. package/dist/src/capabilities/types.js +0 -0
  679. package/dist/src/capabilities/types.js.map +0 -0
  680. package/dist/src/commands/agent-lifecycle.d.ts +0 -0
  681. package/dist/src/commands/agent-lifecycle.d.ts.map +0 -0
  682. package/dist/src/commands/agent-lifecycle.js +0 -0
  683. package/dist/src/commands/agent-lifecycle.js.map +0 -0
  684. package/dist/src/commands/agent-ops.d.ts +0 -0
  685. package/dist/src/commands/agent-ops.d.ts.map +0 -0
  686. package/dist/src/commands/agent-ops.js +0 -0
  687. package/dist/src/commands/agent-ops.js.map +0 -0
  688. package/dist/src/commands/agent.d.ts +0 -0
  689. package/dist/src/commands/agent.d.ts.map +0 -0
  690. package/dist/src/commands/agent.js +0 -0
  691. package/dist/src/commands/agent.js.map +0 -0
  692. package/dist/src/commands/analyze-ast.d.ts +0 -0
  693. package/dist/src/commands/analyze-ast.d.ts.map +0 -0
  694. package/dist/src/commands/analyze-ast.js +0 -0
  695. package/dist/src/commands/analyze-ast.js.map +0 -0
  696. package/dist/src/commands/analyze-diff.d.ts +0 -0
  697. package/dist/src/commands/analyze-diff.d.ts.map +0 -0
  698. package/dist/src/commands/analyze-diff.js +0 -0
  699. package/dist/src/commands/analyze-diff.js.map +0 -0
  700. package/dist/src/commands/analyze-imports.d.ts +0 -0
  701. package/dist/src/commands/analyze-imports.d.ts.map +0 -0
  702. package/dist/src/commands/analyze-imports.js +0 -0
  703. package/dist/src/commands/analyze-imports.js.map +0 -0
  704. package/dist/src/commands/analyze-symbols.d.ts +0 -0
  705. package/dist/src/commands/analyze-symbols.d.ts.map +0 -0
  706. package/dist/src/commands/analyze-symbols.js +0 -0
  707. package/dist/src/commands/analyze-symbols.js.map +0 -0
  708. package/dist/src/commands/analyze.d.ts +0 -0
  709. package/dist/src/commands/analyze.d.ts.map +0 -0
  710. package/dist/src/commands/analyze.js +0 -0
  711. package/dist/src/commands/analyze.js.map +0 -0
  712. package/dist/src/commands/autopilot.d.ts +0 -0
  713. package/dist/src/commands/autopilot.d.ts.map +0 -0
  714. package/dist/src/commands/autopilot.js +0 -0
  715. package/dist/src/commands/autopilot.js.map +0 -0
  716. package/dist/src/commands/browse-action.d.ts +0 -0
  717. package/dist/src/commands/browse-action.d.ts.map +0 -0
  718. package/dist/src/commands/browse-action.js +0 -0
  719. package/dist/src/commands/browse-action.js.map +0 -0
  720. package/dist/src/commands/browse-platform.d.ts +0 -0
  721. package/dist/src/commands/browse-platform.d.ts.map +0 -0
  722. package/dist/src/commands/browse-platform.js +0 -0
  723. package/dist/src/commands/browse-platform.js.map +0 -0
  724. package/dist/src/commands/browse-workflow.d.ts +0 -0
  725. package/dist/src/commands/browse-workflow.d.ts.map +0 -0
  726. package/dist/src/commands/browse-workflow.js +0 -0
  727. package/dist/src/commands/browse-workflow.js.map +0 -0
  728. package/dist/src/commands/browse.d.ts +0 -0
  729. package/dist/src/commands/browse.d.ts.map +0 -0
  730. package/dist/src/commands/browse.js +0 -0
  731. package/dist/src/commands/browse.js.map +0 -0
  732. package/dist/src/commands/cleanup.d.ts +0 -0
  733. package/dist/src/commands/cleanup.d.ts.map +0 -0
  734. package/dist/src/commands/cleanup.js +0 -0
  735. package/dist/src/commands/cleanup.js.map +0 -0
  736. package/dist/src/commands/completions.d.ts +0 -0
  737. package/dist/src/commands/completions.d.ts.map +0 -0
  738. package/dist/src/commands/completions.js +0 -0
  739. package/dist/src/commands/completions.js.map +0 -0
  740. package/dist/src/commands/config.d.ts +0 -0
  741. package/dist/src/commands/config.d.ts.map +0 -0
  742. package/dist/src/commands/config.js +0 -0
  743. package/dist/src/commands/config.js.map +0 -0
  744. package/dist/src/commands/crash-reporting.d.ts +0 -0
  745. package/dist/src/commands/crash-reporting.d.ts.map +0 -0
  746. package/dist/src/commands/crash-reporting.js +0 -0
  747. package/dist/src/commands/crash-reporting.js.map +0 -0
  748. package/dist/src/commands/design-detect.d.ts +0 -0
  749. package/dist/src/commands/design-detect.d.ts.map +0 -0
  750. package/dist/src/commands/design-detect.js +0 -0
  751. package/dist/src/commands/design-detect.js.map +0 -0
  752. package/dist/src/commands/design-palette.d.ts +0 -0
  753. package/dist/src/commands/design-palette.d.ts.map +0 -0
  754. package/dist/src/commands/design-palette.js +0 -0
  755. package/dist/src/commands/design-palette.js.map +0 -0
  756. package/dist/src/commands/doc.d.ts +0 -0
  757. package/dist/src/commands/doc.d.ts.map +0 -0
  758. package/dist/src/commands/doc.js +0 -0
  759. package/dist/src/commands/doc.js.map +0 -0
  760. package/dist/src/commands/doctor-env-checks.d.ts +0 -0
  761. package/dist/src/commands/doctor-env-checks.d.ts.map +0 -0
  762. package/dist/src/commands/doctor-env-checks.js +0 -0
  763. package/dist/src/commands/doctor-env-checks.js.map +0 -0
  764. package/dist/src/commands/doctor-monoes-checks.d.ts +0 -0
  765. package/dist/src/commands/doctor-monoes-checks.d.ts.map +0 -0
  766. package/dist/src/commands/doctor-monoes-checks.js +0 -0
  767. package/dist/src/commands/doctor-monoes-checks.js.map +0 -0
  768. package/dist/src/commands/doctor-project-checks.d.ts +0 -0
  769. package/dist/src/commands/doctor-project-checks.d.ts.map +0 -0
  770. package/dist/src/commands/doctor-project-checks.js +0 -0
  771. package/dist/src/commands/doctor-project-checks.js.map +0 -0
  772. package/dist/src/commands/doctor.d.ts +0 -0
  773. package/dist/src/commands/doctor.d.ts.map +1 -1
  774. package/dist/src/commands/doctor.js +22 -18
  775. package/dist/src/commands/doctor.js.map +1 -1
  776. package/dist/src/commands/download-embeddings.d.ts +8 -0
  777. package/dist/src/commands/download-embeddings.d.ts.map +1 -0
  778. package/dist/src/commands/download-embeddings.js +34 -0
  779. package/dist/src/commands/download-embeddings.js.map +1 -0
  780. package/dist/src/commands/guidance.d.ts +0 -0
  781. package/dist/src/commands/guidance.d.ts.map +0 -0
  782. package/dist/src/commands/guidance.js +0 -0
  783. package/dist/src/commands/guidance.js.map +0 -0
  784. package/dist/src/commands/hooks-core-commands.d.ts +0 -0
  785. package/dist/src/commands/hooks-core-commands.d.ts.map +0 -0
  786. package/dist/src/commands/hooks-core-commands.js +0 -0
  787. package/dist/src/commands/hooks-core-commands.js.map +0 -0
  788. package/dist/src/commands/hooks-coverage-commands.d.ts +0 -0
  789. package/dist/src/commands/hooks-coverage-commands.d.ts.map +0 -0
  790. package/dist/src/commands/hooks-coverage-commands.js +0 -0
  791. package/dist/src/commands/hooks-coverage-commands.js.map +0 -0
  792. package/dist/src/commands/hooks-coverage-gaps.d.ts +0 -0
  793. package/dist/src/commands/hooks-coverage-gaps.d.ts.map +0 -0
  794. package/dist/src/commands/hooks-coverage-gaps.js +0 -0
  795. package/dist/src/commands/hooks-coverage-gaps.js.map +0 -0
  796. package/dist/src/commands/hooks-coverage-routing.d.ts +0 -0
  797. package/dist/src/commands/hooks-coverage-routing.d.ts.map +0 -0
  798. package/dist/src/commands/hooks-coverage-routing.js +0 -0
  799. package/dist/src/commands/hooks-coverage-routing.js.map +0 -0
  800. package/dist/src/commands/hooks-coverage-utils.d.ts +0 -0
  801. package/dist/src/commands/hooks-coverage-utils.d.ts.map +0 -0
  802. package/dist/src/commands/hooks-coverage-utils.js +0 -0
  803. package/dist/src/commands/hooks-coverage-utils.js.map +0 -0
  804. package/dist/src/commands/hooks-extended-commands.d.ts +0 -0
  805. package/dist/src/commands/hooks-extended-commands.d.ts.map +0 -0
  806. package/dist/src/commands/hooks-extended-commands.js +0 -0
  807. package/dist/src/commands/hooks-extended-commands.js.map +0 -0
  808. package/dist/src/commands/hooks-formatting.d.ts +0 -0
  809. package/dist/src/commands/hooks-formatting.d.ts.map +0 -0
  810. package/dist/src/commands/hooks-formatting.js +0 -0
  811. package/dist/src/commands/hooks-formatting.js.map +0 -0
  812. package/dist/src/commands/hooks-routing-commands.d.ts +0 -0
  813. package/dist/src/commands/hooks-routing-commands.d.ts.map +0 -0
  814. package/dist/src/commands/hooks-routing-commands.js +0 -0
  815. package/dist/src/commands/hooks-routing-commands.js.map +0 -0
  816. package/dist/src/commands/hooks-workers.d.ts +0 -0
  817. package/dist/src/commands/hooks-workers.d.ts.map +0 -0
  818. package/dist/src/commands/hooks-workers.js +0 -0
  819. package/dist/src/commands/hooks-workers.js.map +0 -0
  820. package/dist/src/commands/hooks.d.ts +0 -0
  821. package/dist/src/commands/hooks.d.ts.map +1 -1
  822. package/dist/src/commands/hooks.js +14 -0
  823. package/dist/src/commands/hooks.js.map +1 -1
  824. package/dist/src/commands/index.d.ts +0 -0
  825. package/dist/src/commands/index.d.ts.map +1 -1
  826. package/dist/src/commands/index.js +4 -0
  827. package/dist/src/commands/index.js.map +1 -1
  828. package/dist/src/commands/init-subcommands.d.ts +0 -0
  829. package/dist/src/commands/init-subcommands.d.ts.map +0 -0
  830. package/dist/src/commands/init-subcommands.js +0 -0
  831. package/dist/src/commands/init-subcommands.js.map +0 -0
  832. package/dist/src/commands/init-upgrade.d.ts +0 -0
  833. package/dist/src/commands/init-upgrade.d.ts.map +0 -0
  834. package/dist/src/commands/init-upgrade.js +0 -0
  835. package/dist/src/commands/init-upgrade.js.map +0 -0
  836. package/dist/src/commands/init-wizard.d.ts +0 -0
  837. package/dist/src/commands/init-wizard.d.ts.map +1 -1
  838. package/dist/src/commands/init-wizard.js +36 -1
  839. package/dist/src/commands/init-wizard.js.map +1 -1
  840. package/dist/src/commands/init.d.ts +0 -0
  841. package/dist/src/commands/init.d.ts.map +1 -1
  842. package/dist/src/commands/init.js +81 -1
  843. package/dist/src/commands/init.js.map +1 -1
  844. package/dist/src/commands/mcp.d.ts +0 -0
  845. package/dist/src/commands/mcp.d.ts.map +0 -0
  846. package/dist/src/commands/mcp.js +0 -0
  847. package/dist/src/commands/mcp.js.map +0 -0
  848. package/dist/src/commands/memory-admin.d.ts +0 -0
  849. package/dist/src/commands/memory-admin.d.ts.map +0 -0
  850. package/dist/src/commands/memory-admin.js +0 -0
  851. package/dist/src/commands/memory-admin.js.map +0 -0
  852. package/dist/src/commands/memory-crud.d.ts +0 -0
  853. package/dist/src/commands/memory-crud.d.ts.map +0 -0
  854. package/dist/src/commands/memory-crud.js +0 -0
  855. package/dist/src/commands/memory-crud.js.map +0 -0
  856. package/dist/src/commands/memory-list.d.ts +0 -0
  857. package/dist/src/commands/memory-list.d.ts.map +0 -0
  858. package/dist/src/commands/memory-list.js +0 -0
  859. package/dist/src/commands/memory-list.js.map +0 -0
  860. package/dist/src/commands/memory-transfer.d.ts +0 -0
  861. package/dist/src/commands/memory-transfer.d.ts.map +0 -0
  862. package/dist/src/commands/memory-transfer.js +0 -0
  863. package/dist/src/commands/memory-transfer.js.map +0 -0
  864. package/dist/src/commands/memory.d.ts +0 -0
  865. package/dist/src/commands/memory.d.ts.map +0 -0
  866. package/dist/src/commands/memory.js +0 -0
  867. package/dist/src/commands/memory.js.map +0 -0
  868. package/dist/src/commands/monograph.d.ts +0 -0
  869. package/dist/src/commands/monograph.d.ts.map +1 -1
  870. package/dist/src/commands/monograph.js +35 -1
  871. package/dist/src/commands/monograph.js.map +1 -1
  872. package/dist/src/commands/neural-core.d.ts +0 -0
  873. package/dist/src/commands/neural-core.d.ts.map +0 -0
  874. package/dist/src/commands/neural-core.js +0 -0
  875. package/dist/src/commands/neural-core.js.map +0 -0
  876. package/dist/src/commands/neural-optimize.d.ts +0 -0
  877. package/dist/src/commands/neural-optimize.d.ts.map +0 -0
  878. package/dist/src/commands/neural-optimize.js +0 -0
  879. package/dist/src/commands/neural-optimize.js.map +0 -0
  880. package/dist/src/commands/neural-registry.d.ts +0 -0
  881. package/dist/src/commands/neural-registry.d.ts.map +0 -0
  882. package/dist/src/commands/neural-registry.js +0 -0
  883. package/dist/src/commands/neural-registry.js.map +0 -0
  884. package/dist/src/commands/org-observe.d.ts +10 -0
  885. package/dist/src/commands/org-observe.d.ts.map +1 -1
  886. package/dist/src/commands/org-observe.js +195 -31
  887. package/dist/src/commands/org-observe.js.map +1 -1
  888. package/dist/src/commands/org-visualize.d.ts +0 -0
  889. package/dist/src/commands/org-visualize.d.ts.map +0 -0
  890. package/dist/src/commands/org-visualize.js +0 -0
  891. package/dist/src/commands/org-visualize.js.map +0 -0
  892. package/dist/src/commands/org.d.ts +1 -0
  893. package/dist/src/commands/org.d.ts.map +1 -1
  894. package/dist/src/commands/org.js +139 -3
  895. package/dist/src/commands/org.js.map +1 -1
  896. package/dist/src/commands/performance.d.ts +0 -0
  897. package/dist/src/commands/performance.d.ts.map +0 -0
  898. package/dist/src/commands/performance.js +0 -0
  899. package/dist/src/commands/performance.js.map +0 -0
  900. package/dist/src/commands/platforms.d.ts +0 -0
  901. package/dist/src/commands/platforms.d.ts.map +0 -0
  902. package/dist/src/commands/platforms.js +0 -0
  903. package/dist/src/commands/platforms.js.map +0 -0
  904. package/dist/src/commands/providers.d.ts +0 -0
  905. package/dist/src/commands/providers.d.ts.map +0 -0
  906. package/dist/src/commands/providers.js +0 -0
  907. package/dist/src/commands/providers.js.map +0 -0
  908. package/dist/src/commands/report-crash.d.ts +0 -0
  909. package/dist/src/commands/report-crash.d.ts.map +0 -0
  910. package/dist/src/commands/report-crash.js +0 -0
  911. package/dist/src/commands/report-crash.js.map +0 -0
  912. package/dist/src/commands/route.d.ts +1 -9
  913. package/dist/src/commands/route.d.ts.map +1 -1
  914. package/dist/src/commands/route.js +42 -65
  915. package/dist/src/commands/route.js.map +1 -1
  916. package/dist/src/commands/search-universal.d.ts +0 -0
  917. package/dist/src/commands/search-universal.d.ts.map +0 -0
  918. package/dist/src/commands/search-universal.js +0 -0
  919. package/dist/src/commands/search-universal.js.map +0 -0
  920. package/dist/src/commands/security-cve.d.ts +0 -0
  921. package/dist/src/commands/security-cve.d.ts.map +1 -1
  922. package/dist/src/commands/security-cve.js +2 -1
  923. package/dist/src/commands/security-cve.js.map +1 -1
  924. package/dist/src/commands/security-misc.d.ts +0 -0
  925. package/dist/src/commands/security-misc.d.ts.map +0 -0
  926. package/dist/src/commands/security-misc.js +0 -0
  927. package/dist/src/commands/security-misc.js.map +0 -0
  928. package/dist/src/commands/security-scan.d.ts +0 -0
  929. package/dist/src/commands/security-scan.d.ts.map +0 -0
  930. package/dist/src/commands/security-scan.js +0 -0
  931. package/dist/src/commands/security-scan.js.map +0 -0
  932. package/dist/src/commands/security.d.ts +0 -0
  933. package/dist/src/commands/security.d.ts.map +0 -0
  934. package/dist/src/commands/security.js +0 -0
  935. package/dist/src/commands/security.js.map +0 -0
  936. package/dist/src/commands/session.d.ts +0 -0
  937. package/dist/src/commands/session.d.ts.map +0 -0
  938. package/dist/src/commands/session.js +0 -0
  939. package/dist/src/commands/session.js.map +0 -0
  940. package/dist/src/commands/start.d.ts +0 -0
  941. package/dist/src/commands/start.d.ts.map +0 -0
  942. package/dist/src/commands/start.js +0 -0
  943. package/dist/src/commands/start.js.map +0 -0
  944. package/dist/src/commands/status.d.ts +0 -0
  945. package/dist/src/commands/status.d.ts.map +0 -0
  946. package/dist/src/commands/status.js +0 -0
  947. package/dist/src/commands/status.js.map +0 -0
  948. package/dist/src/commands/swarm.d.ts +0 -0
  949. package/dist/src/commands/swarm.d.ts.map +0 -0
  950. package/dist/src/commands/swarm.js +0 -0
  951. package/dist/src/commands/swarm.js.map +0 -0
  952. package/dist/src/commands/task.d.ts +0 -0
  953. package/dist/src/commands/task.d.ts.map +0 -0
  954. package/dist/src/commands/task.js +0 -0
  955. package/dist/src/commands/task.js.map +0 -0
  956. package/dist/src/commands/tokens.d.ts +0 -0
  957. package/dist/src/commands/tokens.d.ts.map +0 -0
  958. package/dist/src/commands/tokens.js +0 -0
  959. package/dist/src/commands/tokens.js.map +0 -0
  960. package/dist/src/commands/update.d.ts +0 -0
  961. package/dist/src/commands/update.d.ts.map +0 -0
  962. package/dist/src/commands/update.js +0 -0
  963. package/dist/src/commands/update.js.map +0 -0
  964. package/dist/src/consensus/audit-writer.d.ts +0 -0
  965. package/dist/src/consensus/audit-writer.d.ts.map +0 -0
  966. package/dist/src/consensus/audit-writer.js +0 -0
  967. package/dist/src/consensus/audit-writer.js.map +0 -0
  968. package/dist/src/consensus/tally.d.ts +0 -0
  969. package/dist/src/consensus/tally.d.ts.map +0 -0
  970. package/dist/src/consensus/tally.js +0 -0
  971. package/dist/src/consensus/tally.js.map +0 -0
  972. package/dist/src/index.d.ts +0 -10
  973. package/dist/src/index.d.ts.map +1 -1
  974. package/dist/src/index.js +4 -15
  975. package/dist/src/index.js.map +1 -1
  976. package/dist/src/init/claudemd-generator.d.ts +0 -0
  977. package/dist/src/init/claudemd-generator.d.ts.map +0 -0
  978. package/dist/src/init/claudemd-generator.js +0 -0
  979. package/dist/src/init/claudemd-generator.js.map +0 -0
  980. package/dist/src/init/copy-assets.d.ts +17 -0
  981. package/dist/src/init/copy-assets.d.ts.map +1 -0
  982. package/dist/src/init/copy-assets.js +271 -0
  983. package/dist/src/init/copy-assets.js.map +1 -0
  984. package/dist/src/init/executor.d.ts +2 -30
  985. package/dist/src/init/executor.d.ts.map +1 -1
  986. package/dist/src/init/executor.js +56 -2493
  987. package/dist/src/init/executor.js.map +1 -1
  988. package/dist/src/init/geminimd-generator.d.ts +0 -0
  989. package/dist/src/init/geminimd-generator.d.ts.map +0 -0
  990. package/dist/src/init/geminimd-generator.js +0 -0
  991. package/dist/src/init/geminimd-generator.js.map +0 -0
  992. package/dist/src/init/helpers-generator.d.ts +0 -0
  993. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  994. package/dist/src/init/helpers-generator.js +9 -0
  995. package/dist/src/init/helpers-generator.js.map +1 -1
  996. package/dist/src/init/index.d.ts +0 -0
  997. package/dist/src/init/index.d.ts.map +0 -0
  998. package/dist/src/init/index.js +0 -0
  999. package/dist/src/init/index.js.map +0 -0
  1000. package/dist/src/init/kimi-generator.d.ts +0 -0
  1001. package/dist/src/init/kimi-generator.d.ts.map +0 -0
  1002. package/dist/src/init/kimi-generator.js +0 -0
  1003. package/dist/src/init/kimi-generator.js.map +0 -0
  1004. package/dist/src/init/mcp-generator.d.ts +0 -0
  1005. package/dist/src/init/mcp-generator.d.ts.map +0 -0
  1006. package/dist/src/init/mcp-generator.js +0 -0
  1007. package/dist/src/init/mcp-generator.js.map +0 -0
  1008. package/dist/src/init/opencode-generator.d.ts +0 -0
  1009. package/dist/src/init/opencode-generator.d.ts.map +0 -0
  1010. package/dist/src/init/opencode-generator.js +0 -0
  1011. package/dist/src/init/opencode-generator.js.map +0 -0
  1012. package/dist/src/init/settings-generator.d.ts +0 -0
  1013. package/dist/src/init/settings-generator.d.ts.map +1 -1
  1014. package/dist/src/init/settings-generator.js +0 -4
  1015. package/dist/src/init/settings-generator.js.map +1 -1
  1016. package/dist/src/init/shared-instructions-generator.d.ts +0 -0
  1017. package/dist/src/init/shared-instructions-generator.d.ts.map +0 -0
  1018. package/dist/src/init/shared-instructions-generator.js +0 -0
  1019. package/dist/src/init/shared-instructions-generator.js.map +0 -0
  1020. package/dist/src/init/shared.d.ts +112 -0
  1021. package/dist/src/init/shared.d.ts.map +1 -0
  1022. package/dist/src/init/shared.js +475 -0
  1023. package/dist/src/init/shared.js.map +1 -0
  1024. package/dist/src/init/statusline-generator.d.ts +0 -0
  1025. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  1026. package/dist/src/init/statusline-generator.js +37 -0
  1027. package/dist/src/init/statusline-generator.js.map +1 -1
  1028. package/dist/src/init/types.d.ts +1 -1
  1029. package/dist/src/init/types.d.ts.map +1 -1
  1030. package/dist/src/init/types.js +0 -0
  1031. package/dist/src/init/types.js.map +0 -0
  1032. package/dist/src/init/upgrade.d.ts +34 -0
  1033. package/dist/src/init/upgrade.d.ts.map +1 -0
  1034. package/dist/src/init/upgrade.js +477 -0
  1035. package/dist/src/init/upgrade.js.map +1 -0
  1036. package/dist/src/init/write-antigravity.d.ts +13 -0
  1037. package/dist/src/init/write-antigravity.d.ts.map +1 -0
  1038. package/dist/src/init/write-antigravity.js +117 -0
  1039. package/dist/src/init/write-antigravity.js.map +1 -0
  1040. package/dist/src/init/write-capabilities.d.ts +9 -0
  1041. package/dist/src/init/write-capabilities.d.ts.map +1 -0
  1042. package/dist/src/init/write-capabilities.js +392 -0
  1043. package/dist/src/init/write-capabilities.js.map +1 -0
  1044. package/dist/src/init/write-claude.d.ts +25 -0
  1045. package/dist/src/init/write-claude.d.ts.map +1 -0
  1046. package/dist/src/init/write-claude.js +279 -0
  1047. package/dist/src/init/write-claude.js.map +1 -0
  1048. package/dist/src/init/write-kimicode.d.ts +19 -0
  1049. package/dist/src/init/write-kimicode.d.ts.map +1 -0
  1050. package/dist/src/init/write-kimicode.js +223 -0
  1051. package/dist/src/init/write-kimicode.js.map +1 -0
  1052. package/dist/src/init/write-opencode.d.ts +14 -0
  1053. package/dist/src/init/write-opencode.d.ts.map +1 -0
  1054. package/dist/src/init/write-opencode.js +130 -0
  1055. package/dist/src/init/write-opencode.js.map +1 -0
  1056. package/dist/src/init/write-runtime-config.d.ts +14 -0
  1057. package/dist/src/init/write-runtime-config.d.ts.map +1 -0
  1058. package/dist/src/init/write-runtime-config.js +214 -0
  1059. package/dist/src/init/write-runtime-config.js.map +1 -0
  1060. package/dist/src/init/write-sample-org.d.ts +9 -0
  1061. package/dist/src/init/write-sample-org.d.ts.map +1 -0
  1062. package/dist/src/init/write-sample-org.js +39 -0
  1063. package/dist/src/init/write-sample-org.js.map +1 -0
  1064. package/dist/src/knowledge/document-pipeline.d.ts +0 -0
  1065. package/dist/src/knowledge/document-pipeline.d.ts.map +0 -0
  1066. package/dist/src/knowledge/document-pipeline.js +0 -0
  1067. package/dist/src/knowledge/document-pipeline.js.map +0 -0
  1068. package/dist/src/knowledge/eval/corpus.d.ts +0 -0
  1069. package/dist/src/knowledge/eval/corpus.d.ts.map +0 -0
  1070. package/dist/src/knowledge/eval/corpus.js +0 -0
  1071. package/dist/src/knowledge/eval/corpus.js.map +0 -0
  1072. package/dist/src/knowledge/eval/golden-set.d.ts +0 -0
  1073. package/dist/src/knowledge/eval/golden-set.d.ts.map +0 -0
  1074. package/dist/src/knowledge/eval/golden-set.js +1 -1
  1075. package/dist/src/knowledge/eval/golden-set.js.map +1 -1
  1076. package/dist/src/knowledge/eval/harness.d.ts +0 -0
  1077. package/dist/src/knowledge/eval/harness.d.ts.map +0 -0
  1078. package/dist/src/knowledge/eval/harness.js +0 -0
  1079. package/dist/src/knowledge/eval/harness.js.map +0 -0
  1080. package/dist/src/knowledge/eval/metrics.d.ts +0 -0
  1081. package/dist/src/knowledge/eval/metrics.d.ts.map +0 -0
  1082. package/dist/src/knowledge/eval/metrics.js +0 -0
  1083. package/dist/src/knowledge/eval/metrics.js.map +0 -0
  1084. package/dist/src/knowledge/eval/model-presence.d.ts +0 -0
  1085. package/dist/src/knowledge/eval/model-presence.d.ts.map +0 -0
  1086. package/dist/src/knowledge/eval/model-presence.js +0 -0
  1087. package/dist/src/knowledge/eval/model-presence.js.map +0 -0
  1088. package/dist/src/knowledge/eval/network-guard.d.ts +0 -0
  1089. package/dist/src/knowledge/eval/network-guard.d.ts.map +0 -0
  1090. package/dist/src/knowledge/eval/network-guard.js +0 -0
  1091. package/dist/src/knowledge/eval/network-guard.js.map +0 -0
  1092. package/dist/src/knowledge/eval/retrievers.d.ts +0 -0
  1093. package/dist/src/knowledge/eval/retrievers.d.ts.map +0 -0
  1094. package/dist/src/knowledge/eval/retrievers.js +0 -0
  1095. package/dist/src/knowledge/eval/retrievers.js.map +0 -0
  1096. package/dist/src/knowledge/eval/signals.d.ts +0 -0
  1097. package/dist/src/knowledge/eval/signals.d.ts.map +0 -0
  1098. package/dist/src/knowledge/eval/signals.js +0 -0
  1099. package/dist/src/knowledge/eval/signals.js.map +0 -0
  1100. package/dist/src/mcp-client.d.ts +0 -0
  1101. package/dist/src/mcp-client.d.ts.map +0 -0
  1102. package/dist/src/mcp-client.js +0 -0
  1103. package/dist/src/mcp-client.js.map +0 -0
  1104. package/dist/src/mcp-server.d.ts +0 -0
  1105. package/dist/src/mcp-server.d.ts.map +0 -0
  1106. package/dist/src/mcp-server.js +0 -0
  1107. package/dist/src/mcp-server.js.map +0 -0
  1108. package/dist/src/mcp-tools/agent-tools.d.ts +0 -0
  1109. package/dist/src/mcp-tools/agent-tools.d.ts.map +0 -0
  1110. package/dist/src/mcp-tools/agent-tools.js +0 -0
  1111. package/dist/src/mcp-tools/agent-tools.js.map +0 -0
  1112. package/dist/src/mcp-tools/analyze-tools.d.ts +0 -0
  1113. package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -1
  1114. package/dist/src/mcp-tools/analyze-tools.js +2 -25
  1115. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  1116. package/dist/src/mcp-tools/auto-install.d.ts +0 -0
  1117. package/dist/src/mcp-tools/auto-install.d.ts.map +1 -1
  1118. package/dist/src/mcp-tools/auto-install.js +2 -1
  1119. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  1120. package/dist/src/mcp-tools/autopilot-tools.d.ts +0 -0
  1121. package/dist/src/mcp-tools/autopilot-tools.d.ts.map +0 -0
  1122. package/dist/src/mcp-tools/autopilot-tools.js +0 -0
  1123. package/dist/src/mcp-tools/autopilot-tools.js.map +0 -0
  1124. package/dist/src/mcp-tools/browser-tools.d.ts +0 -0
  1125. package/dist/src/mcp-tools/browser-tools.d.ts.map +0 -0
  1126. package/dist/src/mcp-tools/browser-tools.js +0 -0
  1127. package/dist/src/mcp-tools/browser-tools.js.map +0 -0
  1128. package/dist/src/mcp-tools/claims-tools.d.ts +0 -0
  1129. package/dist/src/mcp-tools/claims-tools.d.ts.map +0 -0
  1130. package/dist/src/mcp-tools/claims-tools.js +0 -0
  1131. package/dist/src/mcp-tools/claims-tools.js.map +0 -0
  1132. package/dist/src/mcp-tools/config-tools.d.ts +0 -0
  1133. package/dist/src/mcp-tools/config-tools.d.ts.map +0 -0
  1134. package/dist/src/mcp-tools/config-tools.js +0 -0
  1135. package/dist/src/mcp-tools/config-tools.js.map +0 -0
  1136. package/dist/src/mcp-tools/embeddings-tools.d.ts +0 -0
  1137. package/dist/src/mcp-tools/embeddings-tools.d.ts.map +0 -0
  1138. package/dist/src/mcp-tools/embeddings-tools.js +0 -0
  1139. package/dist/src/mcp-tools/embeddings-tools.js.map +0 -0
  1140. package/dist/src/mcp-tools/github-tools.d.ts +0 -0
  1141. package/dist/src/mcp-tools/github-tools.d.ts.map +0 -0
  1142. package/dist/src/mcp-tools/github-tools.js +0 -0
  1143. package/dist/src/mcp-tools/github-tools.js.map +0 -0
  1144. package/dist/src/mcp-tools/graphify-tools.d.ts +0 -0
  1145. package/dist/src/mcp-tools/graphify-tools.d.ts.map +0 -0
  1146. package/dist/src/mcp-tools/graphify-tools.js +0 -0
  1147. package/dist/src/mcp-tools/graphify-tools.js.map +0 -0
  1148. package/dist/src/mcp-tools/guidance-tools.d.ts +0 -0
  1149. package/dist/src/mcp-tools/guidance-tools.d.ts.map +0 -0
  1150. package/dist/src/mcp-tools/guidance-tools.js +0 -0
  1151. package/dist/src/mcp-tools/guidance-tools.js.map +0 -0
  1152. package/dist/src/mcp-tools/hive-mind-tools.d.ts +0 -0
  1153. package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +0 -0
  1154. package/dist/src/mcp-tools/hive-mind-tools.js +0 -0
  1155. package/dist/src/mcp-tools/hive-mind-tools.js.map +0 -0
  1156. package/dist/src/mcp-tools/hooks-embedding.d.ts +0 -0
  1157. package/dist/src/mcp-tools/hooks-embedding.d.ts.map +0 -0
  1158. package/dist/src/mcp-tools/hooks-embedding.js +0 -0
  1159. package/dist/src/mcp-tools/hooks-embedding.js.map +0 -0
  1160. package/dist/src/mcp-tools/hooks-intelligence.d.ts +0 -0
  1161. package/dist/src/mcp-tools/hooks-intelligence.d.ts.map +0 -0
  1162. package/dist/src/mcp-tools/hooks-intelligence.js +0 -0
  1163. package/dist/src/mcp-tools/hooks-intelligence.js.map +0 -0
  1164. package/dist/src/mcp-tools/hooks-routing.d.ts +0 -0
  1165. package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
  1166. package/dist/src/mcp-tools/hooks-routing.js +26 -0
  1167. package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
  1168. package/dist/src/mcp-tools/hooks-tools.d.ts +0 -0
  1169. package/dist/src/mcp-tools/hooks-tools.d.ts.map +0 -0
  1170. package/dist/src/mcp-tools/hooks-tools.js +0 -0
  1171. package/dist/src/mcp-tools/hooks-tools.js.map +0 -0
  1172. package/dist/src/mcp-tools/index.d.ts +0 -0
  1173. package/dist/src/mcp-tools/index.d.ts.map +0 -0
  1174. package/dist/src/mcp-tools/index.js +0 -0
  1175. package/dist/src/mcp-tools/index.js.map +0 -0
  1176. package/dist/src/mcp-tools/knowledge-tools.d.ts +0 -0
  1177. package/dist/src/mcp-tools/knowledge-tools.d.ts.map +0 -0
  1178. package/dist/src/mcp-tools/knowledge-tools.js +0 -0
  1179. package/dist/src/mcp-tools/knowledge-tools.js.map +0 -0
  1180. package/dist/src/mcp-tools/memory-tools.d.ts +0 -0
  1181. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  1182. package/dist/src/mcp-tools/memory-tools.js +2 -37
  1183. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  1184. package/dist/src/mcp-tools/monodesign-tools.d.ts +0 -0
  1185. package/dist/src/mcp-tools/monodesign-tools.d.ts.map +0 -0
  1186. package/dist/src/mcp-tools/monodesign-tools.js +0 -0
  1187. package/dist/src/mcp-tools/monodesign-tools.js.map +0 -0
  1188. package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts +5 -0
  1189. package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts.map +1 -0
  1190. package/dist/src/mcp-tools/monograph/agent-history-tools.js +177 -0
  1191. package/dist/src/mcp-tools/monograph/agent-history-tools.js.map +1 -0
  1192. package/dist/src/mcp-tools/monograph/build-tools.d.ts +9 -0
  1193. package/dist/src/mcp-tools/monograph/build-tools.d.ts.map +1 -0
  1194. package/dist/src/mcp-tools/monograph/build-tools.js +299 -0
  1195. package/dist/src/mcp-tools/monograph/build-tools.js.map +1 -0
  1196. package/dist/src/mcp-tools/monograph/group-tools.d.ts +10 -0
  1197. package/dist/src/mcp-tools/monograph/group-tools.d.ts.map +1 -0
  1198. package/dist/src/mcp-tools/monograph/group-tools.js +225 -0
  1199. package/dist/src/mcp-tools/monograph/group-tools.js.map +1 -0
  1200. package/dist/src/mcp-tools/monograph/health-tools.d.ts +6 -0
  1201. package/dist/src/mcp-tools/monograph/health-tools.d.ts.map +1 -0
  1202. package/dist/src/mcp-tools/monograph/health-tools.js +113 -0
  1203. package/dist/src/mcp-tools/monograph/health-tools.js.map +1 -0
  1204. package/dist/src/mcp-tools/monograph/impact-tools.d.ts +9 -0
  1205. package/dist/src/mcp-tools/monograph/impact-tools.d.ts.map +1 -0
  1206. package/dist/src/mcp-tools/monograph/impact-tools.js +532 -0
  1207. package/dist/src/mcp-tools/monograph/impact-tools.js.map +1 -0
  1208. package/dist/src/mcp-tools/monograph/index.d.ts +10 -0
  1209. package/dist/src/mcp-tools/monograph/index.d.ts.map +1 -0
  1210. package/dist/src/mcp-tools/monograph/index.js +73 -0
  1211. package/dist/src/mcp-tools/monograph/index.js.map +1 -0
  1212. package/dist/src/mcp-tools/monograph/query-tools.d.ts +11 -0
  1213. package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -0
  1214. package/dist/src/mcp-tools/monograph/query-tools.js +500 -0
  1215. package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -0
  1216. package/dist/src/mcp-tools/monograph/shared.d.ts +64 -0
  1217. package/dist/src/mcp-tools/monograph/shared.d.ts.map +1 -0
  1218. package/dist/src/mcp-tools/monograph/shared.js +215 -0
  1219. package/dist/src/mcp-tools/monograph/shared.js.map +1 -0
  1220. package/dist/src/mcp-tools/monograph/visualize-tools.d.ts +10 -0
  1221. package/dist/src/mcp-tools/monograph/visualize-tools.d.ts.map +1 -0
  1222. package/dist/src/mcp-tools/monograph/visualize-tools.js +382 -0
  1223. package/dist/src/mcp-tools/monograph/visualize-tools.js.map +1 -0
  1224. package/dist/src/mcp-tools/monograph-compat.d.ts +0 -0
  1225. package/dist/src/mcp-tools/monograph-compat.d.ts.map +0 -0
  1226. package/dist/src/mcp-tools/monograph-compat.js +0 -0
  1227. package/dist/src/mcp-tools/monograph-compat.js.map +0 -0
  1228. package/dist/src/mcp-tools/monograph-tools.d.ts +4 -23
  1229. package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
  1230. package/dist/src/mcp-tools/monograph-tools.js +4 -2439
  1231. package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
  1232. package/dist/src/mcp-tools/monomind-tools.d.ts +8 -0
  1233. package/dist/src/mcp-tools/monomind-tools.d.ts.map +1 -1
  1234. package/dist/src/mcp-tools/monomind-tools.js +13 -1
  1235. package/dist/src/mcp-tools/monomind-tools.js.map +1 -1
  1236. package/dist/src/mcp-tools/performance-tools.d.ts +0 -0
  1237. package/dist/src/mcp-tools/performance-tools.d.ts.map +0 -0
  1238. package/dist/src/mcp-tools/performance-tools.js +0 -0
  1239. package/dist/src/mcp-tools/performance-tools.js.map +0 -0
  1240. package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.d.ts +0 -0
  1241. package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.d.ts.map +0 -0
  1242. package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +0 -0
  1243. package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js.map +0 -0
  1244. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +0 -0
  1245. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts.map +1 -1
  1246. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js +31 -2
  1247. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js.map +1 -1
  1248. package/dist/src/mcp-tools/quality-tools.d.ts +0 -0
  1249. package/dist/src/mcp-tools/quality-tools.d.ts.map +0 -0
  1250. package/dist/src/mcp-tools/quality-tools.js +0 -0
  1251. package/dist/src/mcp-tools/quality-tools.js.map +0 -0
  1252. package/dist/src/mcp-tools/request-tracker.d.ts +0 -0
  1253. package/dist/src/mcp-tools/request-tracker.d.ts.map +0 -0
  1254. package/dist/src/mcp-tools/request-tracker.js +0 -0
  1255. package/dist/src/mcp-tools/request-tracker.js.map +0 -0
  1256. package/dist/src/mcp-tools/security-tools.d.ts +0 -0
  1257. package/dist/src/mcp-tools/security-tools.d.ts.map +0 -0
  1258. package/dist/src/mcp-tools/security-tools.js +0 -0
  1259. package/dist/src/mcp-tools/security-tools.js.map +0 -0
  1260. package/dist/src/mcp-tools/session-tools.d.ts +0 -0
  1261. package/dist/src/mcp-tools/session-tools.d.ts.map +0 -0
  1262. package/dist/src/mcp-tools/session-tools.js +0 -0
  1263. package/dist/src/mcp-tools/session-tools.js.map +0 -0
  1264. package/dist/src/mcp-tools/swarm-tools.d.ts +0 -0
  1265. package/dist/src/mcp-tools/swarm-tools.d.ts.map +0 -0
  1266. package/dist/src/mcp-tools/swarm-tools.js +0 -0
  1267. package/dist/src/mcp-tools/swarm-tools.js.map +0 -0
  1268. package/dist/src/mcp-tools/system-tools.d.ts +0 -0
  1269. package/dist/src/mcp-tools/system-tools.d.ts.map +0 -0
  1270. package/dist/src/mcp-tools/system-tools.js +0 -0
  1271. package/dist/src/mcp-tools/system-tools.js.map +0 -0
  1272. package/dist/src/mcp-tools/task-tools.d.ts +0 -0
  1273. package/dist/src/mcp-tools/task-tools.d.ts.map +0 -0
  1274. package/dist/src/mcp-tools/task-tools.js +0 -0
  1275. package/dist/src/mcp-tools/task-tools.js.map +0 -0
  1276. package/dist/src/mcp-tools/terminal-tools.d.ts +0 -0
  1277. package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
  1278. package/dist/src/mcp-tools/terminal-tools.js +31 -1
  1279. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  1280. package/dist/src/mcp-tools/transfer-tools.d.ts +0 -0
  1281. package/dist/src/mcp-tools/transfer-tools.d.ts.map +0 -0
  1282. package/dist/src/mcp-tools/transfer-tools.js +0 -0
  1283. package/dist/src/mcp-tools/transfer-tools.js.map +0 -0
  1284. package/dist/src/mcp-tools/types.d.ts +8 -27
  1285. package/dist/src/mcp-tools/types.d.ts.map +1 -1
  1286. package/dist/src/mcp-tools/types.js +9 -91
  1287. package/dist/src/mcp-tools/types.js.map +1 -1
  1288. package/dist/src/memory/bm25-index.d.ts +0 -0
  1289. package/dist/src/memory/bm25-index.d.ts.map +0 -0
  1290. package/dist/src/memory/bm25-index.js +0 -0
  1291. package/dist/src/memory/bm25-index.js.map +0 -0
  1292. package/dist/src/memory/embedding-operations.d.ts +0 -0
  1293. package/dist/src/memory/embedding-operations.d.ts.map +0 -0
  1294. package/dist/src/memory/embedding-operations.js +0 -0
  1295. package/dist/src/memory/embedding-operations.js.map +0 -0
  1296. package/dist/src/memory/ewc-consolidation.d.ts +0 -0
  1297. package/dist/src/memory/ewc-consolidation.d.ts.map +0 -0
  1298. package/dist/src/memory/ewc-consolidation.js +0 -0
  1299. package/dist/src/memory/ewc-consolidation.js.map +0 -0
  1300. package/dist/src/memory/file-permissions.d.ts +15 -0
  1301. package/dist/src/memory/file-permissions.d.ts.map +1 -0
  1302. package/dist/src/memory/file-permissions.js +25 -0
  1303. package/dist/src/memory/file-permissions.js.map +1 -0
  1304. package/dist/src/memory/hnsw-operations.d.ts +0 -0
  1305. package/dist/src/memory/hnsw-operations.d.ts.map +0 -0
  1306. package/dist/src/memory/hnsw-operations.js +0 -0
  1307. package/dist/src/memory/hnsw-operations.js.map +0 -0
  1308. package/dist/src/memory/intelligence.d.ts +0 -0
  1309. package/dist/src/memory/intelligence.d.ts.map +0 -0
  1310. package/dist/src/memory/intelligence.js +0 -0
  1311. package/dist/src/memory/intelligence.js.map +0 -0
  1312. package/dist/src/memory/memory-bridge.d.ts +0 -0
  1313. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  1314. package/dist/src/memory/memory-bridge.js +94 -34
  1315. package/dist/src/memory/memory-bridge.js.map +1 -1
  1316. package/dist/src/memory/memory-crud.d.ts +0 -0
  1317. package/dist/src/memory/memory-crud.d.ts.map +1 -1
  1318. package/dist/src/memory/memory-crud.js +298 -275
  1319. package/dist/src/memory/memory-crud.js.map +1 -1
  1320. package/dist/src/memory/memory-initializer.d.ts +2 -4
  1321. package/dist/src/memory/memory-initializer.d.ts.map +1 -1
  1322. package/dist/src/memory/memory-initializer.js +53 -76
  1323. package/dist/src/memory/memory-initializer.js.map +1 -1
  1324. package/dist/src/memory/memory-kg.d.ts +0 -0
  1325. package/dist/src/memory/memory-kg.d.ts.map +0 -0
  1326. package/dist/src/memory/memory-kg.js +0 -0
  1327. package/dist/src/memory/memory-kg.js.map +0 -0
  1328. package/dist/src/memory/memory-migrations.d.ts +1 -14
  1329. package/dist/src/memory/memory-migrations.d.ts.map +1 -1
  1330. package/dist/src/memory/memory-migrations.js +52 -105
  1331. package/dist/src/memory/memory-migrations.js.map +1 -1
  1332. package/dist/src/memory/memory-read.d.ts +0 -0
  1333. package/dist/src/memory/memory-read.d.ts.map +0 -0
  1334. package/dist/src/memory/memory-read.js +0 -0
  1335. package/dist/src/memory/memory-read.js.map +0 -0
  1336. package/dist/src/memory/memory-schema.d.ts +0 -0
  1337. package/dist/src/memory/memory-schema.d.ts.map +0 -0
  1338. package/dist/src/memory/memory-schema.js +0 -0
  1339. package/dist/src/memory/memory-schema.js.map +0 -0
  1340. package/dist/src/memory/query-router.d.ts +0 -0
  1341. package/dist/src/memory/query-router.d.ts.map +0 -0
  1342. package/dist/src/memory/query-router.js +0 -0
  1343. package/dist/src/memory/query-router.js.map +0 -0
  1344. package/dist/src/memory/sona-optimizer.d.ts +1 -1
  1345. package/dist/src/memory/sona-optimizer.d.ts.map +0 -0
  1346. package/dist/src/memory/sona-optimizer.js +1 -1
  1347. package/dist/src/memory/sona-optimizer.js.map +0 -0
  1348. package/dist/src/memory/text-tokens.d.ts +0 -0
  1349. package/dist/src/memory/text-tokens.d.ts.map +0 -0
  1350. package/dist/src/memory/text-tokens.js +0 -0
  1351. package/dist/src/memory/text-tokens.js.map +0 -0
  1352. package/dist/src/monovector/command-outcomes.d.ts +0 -0
  1353. package/dist/src/monovector/command-outcomes.d.ts.map +0 -0
  1354. package/dist/src/monovector/command-outcomes.js +0 -0
  1355. package/dist/src/monovector/command-outcomes.js.map +0 -0
  1356. package/dist/src/monovector/coverage-router.d.ts +0 -0
  1357. package/dist/src/monovector/coverage-router.d.ts.map +0 -0
  1358. package/dist/src/monovector/coverage-router.js +0 -0
  1359. package/dist/src/monovector/coverage-router.js.map +0 -0
  1360. package/dist/src/monovector/coverage-tools.d.ts +0 -0
  1361. package/dist/src/monovector/coverage-tools.d.ts.map +0 -0
  1362. package/dist/src/monovector/coverage-tools.js +0 -0
  1363. package/dist/src/monovector/coverage-tools.js.map +0 -0
  1364. package/dist/src/monovector/diff-classifier.d.ts +0 -0
  1365. package/dist/src/monovector/diff-classifier.d.ts.map +0 -0
  1366. package/dist/src/monovector/diff-classifier.js +0 -0
  1367. package/dist/src/monovector/diff-classifier.js.map +0 -0
  1368. package/dist/src/monovector/index.d.ts +16 -19
  1369. package/dist/src/monovector/index.d.ts.map +1 -1
  1370. package/dist/src/monovector/index.js +50 -8
  1371. package/dist/src/monovector/index.js.map +1 -1
  1372. package/dist/src/monovector/init-state.d.ts +0 -0
  1373. package/dist/src/monovector/init-state.d.ts.map +0 -0
  1374. package/dist/src/monovector/init-state.js +0 -0
  1375. package/dist/src/monovector/init-state.js.map +0 -0
  1376. package/dist/src/monovector/route-outcomes.d.ts +0 -0
  1377. package/dist/src/monovector/route-outcomes.d.ts.map +0 -0
  1378. package/dist/src/monovector/route-outcomes.js +0 -0
  1379. package/dist/src/monovector/route-outcomes.js.map +0 -0
  1380. package/dist/src/observability/replay-reader.d.ts +0 -0
  1381. package/dist/src/observability/replay-reader.d.ts.map +0 -0
  1382. package/dist/src/observability/replay-reader.js +0 -0
  1383. package/dist/src/observability/replay-reader.js.map +0 -0
  1384. package/dist/src/orgrt/agent-runner.d.ts +0 -0
  1385. package/dist/src/orgrt/agent-runner.d.ts.map +0 -0
  1386. package/dist/src/orgrt/agent-runner.js +0 -0
  1387. package/dist/src/orgrt/agent-runner.js.map +0 -0
  1388. package/dist/src/orgrt/approvals.d.ts +16 -0
  1389. package/dist/src/orgrt/approvals.d.ts.map +1 -0
  1390. package/dist/src/orgrt/approvals.js +72 -0
  1391. package/dist/src/orgrt/approvals.js.map +1 -0
  1392. package/dist/src/orgrt/broker.d.ts +0 -0
  1393. package/dist/src/orgrt/broker.d.ts.map +0 -0
  1394. package/dist/src/orgrt/broker.js +0 -0
  1395. package/dist/src/orgrt/broker.js.map +0 -0
  1396. package/dist/src/orgrt/bus.d.ts +0 -0
  1397. package/dist/src/orgrt/bus.d.ts.map +1 -1
  1398. package/dist/src/orgrt/bus.js +21 -0
  1399. package/dist/src/orgrt/bus.js.map +1 -1
  1400. package/dist/src/orgrt/checkpoint-ops.d.ts +19 -0
  1401. package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -0
  1402. package/dist/src/orgrt/checkpoint-ops.js +219 -0
  1403. package/dist/src/orgrt/checkpoint-ops.js.map +1 -0
  1404. package/dist/src/orgrt/checkpoint.d.ts +33 -1
  1405. package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
  1406. package/dist/src/orgrt/checkpoint.js +50 -6
  1407. package/dist/src/orgrt/checkpoint.js.map +1 -1
  1408. package/dist/src/orgrt/cross-org.d.ts +32 -0
  1409. package/dist/src/orgrt/cross-org.d.ts.map +1 -0
  1410. package/dist/src/orgrt/cross-org.js +256 -0
  1411. package/dist/src/orgrt/cross-org.js.map +1 -0
  1412. package/dist/src/orgrt/daemon.d.ts +131 -157
  1413. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  1414. package/dist/src/orgrt/daemon.js +356 -966
  1415. package/dist/src/orgrt/daemon.js.map +1 -1
  1416. package/dist/src/orgrt/decisions.d.ts +33 -0
  1417. package/dist/src/orgrt/decisions.d.ts.map +1 -0
  1418. package/dist/src/orgrt/decisions.js +169 -0
  1419. package/dist/src/orgrt/decisions.js.map +1 -0
  1420. package/dist/src/orgrt/forwarder.d.ts +0 -0
  1421. package/dist/src/orgrt/forwarder.d.ts.map +0 -0
  1422. package/dist/src/orgrt/forwarder.js +0 -0
  1423. package/dist/src/orgrt/forwarder.js.map +0 -0
  1424. package/dist/src/orgrt/inbox.d.ts +0 -0
  1425. package/dist/src/orgrt/inbox.d.ts.map +0 -0
  1426. package/dist/src/orgrt/inbox.js +0 -0
  1427. package/dist/src/orgrt/inbox.js.map +0 -0
  1428. package/dist/src/orgrt/kimicode-runner.d.ts +0 -0
  1429. package/dist/src/orgrt/kimicode-runner.d.ts.map +1 -1
  1430. package/dist/src/orgrt/kimicode-runner.js +5 -1
  1431. package/dist/src/orgrt/kimicode-runner.js.map +1 -1
  1432. package/dist/src/orgrt/mailbox.d.ts +0 -0
  1433. package/dist/src/orgrt/mailbox.d.ts.map +0 -0
  1434. package/dist/src/orgrt/mailbox.js +0 -0
  1435. package/dist/src/orgrt/mailbox.js.map +0 -0
  1436. package/dist/src/orgrt/migrate.d.ts +0 -0
  1437. package/dist/src/orgrt/migrate.d.ts.map +0 -0
  1438. package/dist/src/orgrt/migrate.js +0 -0
  1439. package/dist/src/orgrt/migrate.js.map +0 -0
  1440. package/dist/src/orgrt/opencode-runner.d.ts +0 -0
  1441. package/dist/src/orgrt/opencode-runner.d.ts.map +1 -1
  1442. package/dist/src/orgrt/opencode-runner.js +10 -2
  1443. package/dist/src/orgrt/opencode-runner.js.map +1 -1
  1444. package/dist/src/orgrt/org-memory.d.ts +45 -0
  1445. package/dist/src/orgrt/org-memory.d.ts.map +1 -0
  1446. package/dist/src/orgrt/org-memory.js +220 -0
  1447. package/dist/src/orgrt/org-memory.js.map +1 -0
  1448. package/dist/src/orgrt/policy.d.ts +4 -0
  1449. package/dist/src/orgrt/policy.d.ts.map +1 -1
  1450. package/dist/src/orgrt/policy.js +13 -1
  1451. package/dist/src/orgrt/policy.js.map +1 -1
  1452. package/dist/src/orgrt/prechecks.d.ts +15 -0
  1453. package/dist/src/orgrt/prechecks.d.ts.map +1 -0
  1454. package/dist/src/orgrt/prechecks.js +21 -0
  1455. package/dist/src/orgrt/prechecks.js.map +1 -0
  1456. package/dist/src/orgrt/provider.d.ts +0 -0
  1457. package/dist/src/orgrt/provider.d.ts.map +0 -0
  1458. package/dist/src/orgrt/provider.js +0 -0
  1459. package/dist/src/orgrt/provider.js.map +0 -0
  1460. package/dist/src/orgrt/questions.d.ts +39 -0
  1461. package/dist/src/orgrt/questions.d.ts.map +1 -0
  1462. package/dist/src/orgrt/questions.js +135 -0
  1463. package/dist/src/orgrt/questions.js.map +1 -0
  1464. package/dist/src/orgrt/remote.d.ts +25 -0
  1465. package/dist/src/orgrt/remote.d.ts.map +1 -0
  1466. package/dist/src/orgrt/remote.js +73 -0
  1467. package/dist/src/orgrt/remote.js.map +1 -0
  1468. package/dist/src/orgrt/reporting.d.ts +0 -0
  1469. package/dist/src/orgrt/reporting.d.ts.map +0 -0
  1470. package/dist/src/orgrt/reporting.js +0 -0
  1471. package/dist/src/orgrt/reporting.js.map +0 -0
  1472. package/dist/src/orgrt/scheduler-integration.d.ts +19 -0
  1473. package/dist/src/orgrt/scheduler-integration.d.ts.map +1 -0
  1474. package/dist/src/orgrt/scheduler-integration.js +90 -0
  1475. package/dist/src/orgrt/scheduler-integration.js.map +1 -0
  1476. package/dist/src/orgrt/scheduler.d.ts +0 -0
  1477. package/dist/src/orgrt/scheduler.d.ts.map +0 -0
  1478. package/dist/src/orgrt/scheduler.js +0 -0
  1479. package/dist/src/orgrt/scheduler.js.map +0 -0
  1480. package/dist/src/orgrt/server.d.ts +0 -0
  1481. package/dist/src/orgrt/server.d.ts.map +1 -1
  1482. package/dist/src/orgrt/server.js +70 -2
  1483. package/dist/src/orgrt/server.js.map +1 -1
  1484. package/dist/src/orgrt/session.d.ts +30 -1
  1485. package/dist/src/orgrt/session.d.ts.map +1 -1
  1486. package/dist/src/orgrt/session.js +184 -53
  1487. package/dist/src/orgrt/session.js.map +1 -1
  1488. package/dist/src/orgrt/state-detector.d.ts +19 -0
  1489. package/dist/src/orgrt/state-detector.d.ts.map +1 -0
  1490. package/dist/src/orgrt/state-detector.js +59 -0
  1491. package/dist/src/orgrt/state-detector.js.map +1 -0
  1492. package/dist/src/orgrt/task-dag.d.ts +27 -0
  1493. package/dist/src/orgrt/task-dag.d.ts.map +1 -0
  1494. package/dist/src/orgrt/task-dag.js +100 -0
  1495. package/dist/src/orgrt/task-dag.js.map +1 -0
  1496. package/dist/src/orgrt/templates.d.ts +0 -0
  1497. package/dist/src/orgrt/templates.d.ts.map +0 -0
  1498. package/dist/src/orgrt/templates.js +0 -0
  1499. package/dist/src/orgrt/templates.js.map +0 -0
  1500. package/dist/src/orgrt/test-loop.d.ts +0 -0
  1501. package/dist/src/orgrt/test-loop.d.ts.map +0 -0
  1502. package/dist/src/orgrt/test-loop.js +0 -0
  1503. package/dist/src/orgrt/test-loop.js.map +0 -0
  1504. package/dist/src/orgrt/tool-fence.d.ts +7 -4
  1505. package/dist/src/orgrt/tool-fence.d.ts.map +1 -1
  1506. package/dist/src/orgrt/tool-fence.js +47 -6
  1507. package/dist/src/orgrt/tool-fence.js.map +1 -1
  1508. package/dist/src/orgrt/types.d.ts +57 -2
  1509. package/dist/src/orgrt/types.d.ts.map +1 -1
  1510. package/dist/src/orgrt/types.js +34 -3
  1511. package/dist/src/orgrt/types.js.map +1 -1
  1512. package/dist/src/orgrt/visualization.d.ts +0 -0
  1513. package/dist/src/orgrt/visualization.d.ts.map +0 -0
  1514. package/dist/src/orgrt/visualization.js +0 -0
  1515. package/dist/src/orgrt/visualization.js.map +0 -0
  1516. package/dist/src/output.d.ts +0 -0
  1517. package/dist/src/output.d.ts.map +0 -0
  1518. package/dist/src/output.js +0 -0
  1519. package/dist/src/output.js.map +0 -0
  1520. package/dist/src/parser.d.ts +0 -0
  1521. package/dist/src/parser.d.ts.map +0 -0
  1522. package/dist/src/parser.js +0 -0
  1523. package/dist/src/parser.js.map +0 -0
  1524. package/dist/src/pricing/model-pricing.d.ts +0 -0
  1525. package/dist/src/pricing/model-pricing.d.ts.map +0 -0
  1526. package/dist/src/pricing/model-pricing.js +0 -0
  1527. package/dist/src/pricing/model-pricing.js.map +0 -0
  1528. package/dist/src/prompt.d.ts +0 -0
  1529. package/dist/src/prompt.d.ts.map +0 -0
  1530. package/dist/src/prompt.js +0 -0
  1531. package/dist/src/prompt.js.map +0 -0
  1532. package/dist/src/routing/embed-worker.d.ts +0 -0
  1533. package/dist/src/routing/embed-worker.d.ts.map +0 -0
  1534. package/dist/src/routing/embed-worker.js +0 -0
  1535. package/dist/src/routing/embed-worker.js.map +0 -0
  1536. package/dist/src/routing/embedder.d.ts +0 -0
  1537. package/dist/src/routing/embedder.d.ts.map +0 -0
  1538. package/dist/src/routing/embedder.js +0 -0
  1539. package/dist/src/routing/embedder.js.map +0 -0
  1540. package/dist/src/routing/llm-caller.d.ts +0 -0
  1541. package/dist/src/routing/llm-caller.d.ts.map +0 -0
  1542. package/dist/src/routing/llm-caller.js +0 -0
  1543. package/dist/src/routing/llm-caller.js.map +0 -0
  1544. package/dist/src/routing/model-download.d.ts +49 -0
  1545. package/dist/src/routing/model-download.d.ts.map +1 -0
  1546. package/dist/src/routing/model-download.js +106 -0
  1547. package/dist/src/routing/model-download.js.map +1 -0
  1548. package/dist/src/routing/route-layer-factory.d.ts +0 -0
  1549. package/dist/src/routing/route-layer-factory.d.ts.map +0 -0
  1550. package/dist/src/routing/route-layer-factory.js +0 -0
  1551. package/dist/src/routing/route-layer-factory.js.map +0 -0
  1552. package/dist/src/services/config-file-manager.d.ts +0 -0
  1553. package/dist/src/services/config-file-manager.d.ts.map +0 -0
  1554. package/dist/src/services/config-file-manager.js +0 -0
  1555. package/dist/src/services/config-file-manager.js.map +0 -0
  1556. package/dist/src/services/crash-reporter.d.ts +5 -0
  1557. package/dist/src/services/crash-reporter.d.ts.map +1 -1
  1558. package/dist/src/services/crash-reporter.js +49 -0
  1559. package/dist/src/services/crash-reporter.js.map +1 -1
  1560. package/dist/src/suggest.d.ts +0 -0
  1561. package/dist/src/suggest.d.ts.map +0 -0
  1562. package/dist/src/suggest.js +0 -0
  1563. package/dist/src/suggest.js.map +0 -0
  1564. package/dist/src/sync/checker.d.ts +0 -0
  1565. package/dist/src/sync/checker.d.ts.map +0 -0
  1566. package/dist/src/sync/checker.js +0 -0
  1567. package/dist/src/sync/checker.js.map +0 -0
  1568. package/dist/src/transfer/anonymization/index.d.ts +18 -15
  1569. package/dist/src/transfer/anonymization/index.d.ts.map +1 -1
  1570. package/dist/src/transfer/anonymization/index.js +7 -119
  1571. package/dist/src/transfer/anonymization/index.js.map +1 -1
  1572. package/dist/src/types.d.ts +0 -0
  1573. package/dist/src/types.d.ts.map +0 -0
  1574. package/dist/src/types.js +0 -0
  1575. package/dist/src/types.js.map +0 -0
  1576. package/dist/src/ui/collector.mjs +0 -0
  1577. package/dist/src/ui/dashboard.html +606 -7
  1578. package/dist/src/ui/data/agent-avatars.html +0 -0
  1579. package/dist/src/ui/data/agent-avatars.json +0 -0
  1580. package/dist/src/ui/data/avatars/account-strategist.svg +0 -0
  1581. package/dist/src/ui/data/avatars/accounts-payable.svg +0 -0
  1582. package/dist/src/ui/data/avatars/adaptive-coordinator.svg +0 -0
  1583. package/dist/src/ui/data/avatars/adaptive-coordinator2.svg +0 -0
  1584. package/dist/src/ui/data/avatars/ai-citation.svg +0 -0
  1585. package/dist/src/ui/data/avatars/ai-engineer.svg +0 -0
  1586. package/dist/src/ui/data/avatars/analytics-reporter.svg +0 -0
  1587. package/dist/src/ui/data/avatars/api-tester.svg +0 -0
  1588. package/dist/src/ui/data/avatars/architecture.svg +0 -0
  1589. package/dist/src/ui/data/avatars/automation-governance.svg +0 -0
  1590. package/dist/src/ui/data/avatars/backend-dev.svg +0 -0
  1591. package/dist/src/ui/data/avatars/benchmarker.svg +0 -0
  1592. package/dist/src/ui/data/avatars/blockchain-auditor.svg +0 -0
  1593. package/dist/src/ui/data/avatars/byzantine-coord.svg +0 -0
  1594. package/dist/src/ui/data/avatars/case-analyst.svg +0 -0
  1595. package/dist/src/ui/data/avatars/cicd-engineer.svg +0 -0
  1596. package/dist/src/ui/data/avatars/cloud-architect.svg +0 -0
  1597. package/dist/src/ui/data/avatars/code-review-swarm.svg +0 -0
  1598. package/dist/src/ui/data/avatars/coder-v119.svg +0 -0
  1599. package/dist/src/ui/data/avatars/coder.svg +0 -0
  1600. package/dist/src/ui/data/avatars/collective-coord.svg +0 -0
  1601. package/dist/src/ui/data/avatars/compliance-auditor.svg +0 -0
  1602. package/dist/src/ui/data/avatars/consensus-coordinator.svg +0 -0
  1603. package/dist/src/ui/data/avatars/content-creator.svg +0 -0
  1604. package/dist/src/ui/data/avatars/crdt-synchronizer.svg +0 -0
  1605. package/dist/src/ui/data/avatars/cro-specialist.svg +0 -0
  1606. package/dist/src/ui/data/avatars/data-consolidator.svg +0 -0
  1607. package/dist/src/ui/data/avatars/data-engineer.svg +0 -0
  1608. package/dist/src/ui/data/avatars/database-optimizer.svg +0 -0
  1609. package/dist/src/ui/data/avatars/deal-strategist.svg +0 -0
  1610. package/dist/src/ui/data/avatars/defender.svg +0 -0
  1611. package/dist/src/ui/data/avatars/devops-automator.svg +0 -0
  1612. package/dist/src/ui/data/avatars/discovery-coach.svg +0 -0
  1613. package/dist/src/ui/data/avatars/email-marketing.svg +0 -0
  1614. package/dist/src/ui/data/avatars/embedded-firmware.svg +0 -0
  1615. package/dist/src/ui/data/avatars/evidence-collector.svg +0 -0
  1616. package/dist/src/ui/data/avatars/experiment-tracker.svg +0 -0
  1617. package/dist/src/ui/data/avatars/feedback-synthesizer.svg +0 -0
  1618. package/dist/src/ui/data/avatars/finance-tracker.svg +0 -0
  1619. package/dist/src/ui/data/avatars/frontend-developer.svg +0 -0
  1620. package/dist/src/ui/data/avatars/game-audio-engineer.svg +0 -0
  1621. package/dist/src/ui/data/avatars/game-designer.svg +0 -0
  1622. package/dist/src/ui/data/avatars/gossip-coordinator.svg +0 -0
  1623. package/dist/src/ui/data/avatars/hierarchical-coord.svg +0 -0
  1624. package/dist/src/ui/data/avatars/incident-commander.svg +0 -0
  1625. package/dist/src/ui/data/avatars/infrastructure.svg +0 -0
  1626. package/dist/src/ui/data/avatars/input-validator.svg +0 -0
  1627. package/dist/src/ui/data/avatars/ios-developer.svg +0 -0
  1628. package/dist/src/ui/data/avatars/issue-tracker.svg +0 -0
  1629. package/dist/src/ui/data/avatars/judge.svg +0 -0
  1630. package/dist/src/ui/data/avatars/launch-strategist.svg +0 -0
  1631. package/dist/src/ui/data/avatars/legal-compliance.svg +0 -0
  1632. package/dist/src/ui/data/avatars/level-designer.svg +0 -0
  1633. package/dist/src/ui/data/avatars/load-balancer.svg +0 -0
  1634. package/dist/src/ui/data/avatars/mcp-builder.svg +0 -0
  1635. package/dist/src/ui/data/avatars/memory-coordinator.svg +0 -0
  1636. package/dist/src/ui/data/avatars/mesh-coordinator.svg +0 -0
  1637. package/dist/src/ui/data/avatars/ml-developer.svg +0 -0
  1638. package/dist/src/ui/data/avatars/mobile-app-builder.svg +0 -0
  1639. package/dist/src/ui/data/avatars/mobile-dev.svg +0 -0
  1640. package/dist/src/ui/data/avatars/model-qa.svg +0 -0
  1641. package/dist/src/ui/data/avatars/narrative-designer.svg +0 -0
  1642. package/dist/src/ui/data/avatars/outbound-strategist.svg +0 -0
  1643. package/dist/src/ui/data/avatars/path-validator.svg +0 -0
  1644. package/dist/src/ui/data/avatars/payment-agent.svg +0 -0
  1645. package/dist/src/ui/data/avatars/perf-analyzer.svg +0 -0
  1646. package/dist/src/ui/data/avatars/pipeline-analyst.svg +0 -0
  1647. package/dist/src/ui/data/avatars/planner.svg +0 -0
  1648. package/dist/src/ui/data/avatars/pr-manager.svg +0 -0
  1649. package/dist/src/ui/data/avatars/pricing-strategist.svg +0 -0
  1650. package/dist/src/ui/data/avatars/product-manager.svg +0 -0
  1651. package/dist/src/ui/data/avatars/production-validator.svg +0 -0
  1652. package/dist/src/ui/data/avatars/project-shepherd.svg +0 -0
  1653. package/dist/src/ui/data/avatars/proposal-strategist.svg +0 -0
  1654. package/dist/src/ui/data/avatars/prosecutor.svg +0 -0
  1655. package/dist/src/ui/data/avatars/pseudocode.svg +0 -0
  1656. package/dist/src/ui/data/avatars/queen-coordinator.svg +0 -0
  1657. package/dist/src/ui/data/avatars/quorum-manager.svg +0 -0
  1658. package/dist/src/ui/data/avatars/raft-manager.svg +0 -0
  1659. package/dist/src/ui/data/avatars/reality-checker.svg +0 -0
  1660. package/dist/src/ui/data/avatars/recruitment.svg +0 -0
  1661. package/dist/src/ui/data/avatars/refinement.svg +0 -0
  1662. package/dist/src/ui/data/avatars/release-manager.svg +0 -0
  1663. package/dist/src/ui/data/avatars/repo-architect.svg +0 -0
  1664. package/dist/src/ui/data/avatars/researcher.svg +0 -0
  1665. package/dist/src/ui/data/avatars/resource-allocator.svg +0 -0
  1666. package/dist/src/ui/data/avatars/reviewer.svg +0 -0
  1667. package/dist/src/ui/data/avatars/safe-executor.svg +0 -0
  1668. package/dist/src/ui/data/avatars/sales-coach.svg +0 -0
  1669. package/dist/src/ui/data/avatars/sales-engineer.svg +0 -0
  1670. package/dist/src/ui/data/avatars/scout-explorer.svg +0 -0
  1671. package/dist/src/ui/data/avatars/security-architect.svg +0 -0
  1672. package/dist/src/ui/data/avatars/security-auditor.svg +0 -0
  1673. package/dist/src/ui/data/avatars/senior-developer.svg +0 -0
  1674. package/dist/src/ui/data/avatars/senior-pm.svg +0 -0
  1675. package/dist/src/ui/data/avatars/seo-specialist.svg +0 -0
  1676. package/dist/src/ui/data/avatars/social-media.svg +0 -0
  1677. package/dist/src/ui/data/avatars/solidity-engineer.svg +0 -0
  1678. package/dist/src/ui/data/avatars/sparc-coder.svg +0 -0
  1679. package/dist/src/ui/data/avatars/sparc-coord.svg +0 -0
  1680. package/dist/src/ui/data/avatars/specification.svg +0 -0
  1681. package/dist/src/ui/data/avatars/sprint-prioritizer.svg +0 -0
  1682. package/dist/src/ui/data/avatars/sre.svg +0 -0
  1683. package/dist/src/ui/data/avatars/studio-operations.svg +0 -0
  1684. package/dist/src/ui/data/avatars/studio-producer.svg +0 -0
  1685. package/dist/src/ui/data/avatars/support-responder.svg +0 -0
  1686. package/dist/src/ui/data/avatars/system-architect.svg +0 -0
  1687. package/dist/src/ui/data/avatars/task-orchestrator.svg +0 -0
  1688. package/dist/src/ui/data/avatars/technical-artist.svg +0 -0
  1689. package/dist/src/ui/data/avatars/technical-writer.svg +0 -0
  1690. package/dist/src/ui/data/avatars/tester.svg +0 -0
  1691. package/dist/src/ui/data/avatars/threat-detection.svg +0 -0
  1692. package/dist/src/ui/data/avatars/trend-researcher.svg +0 -0
  1693. package/dist/src/ui/data/avatars/trial-director.svg +0 -0
  1694. package/dist/src/ui/data/avatars/unity-architect.svg +0 -0
  1695. package/dist/src/ui/data/avatars/visionos-engineer.svg +0 -0
  1696. package/dist/src/ui/data/avatars/worker-specialist.svg +0 -0
  1697. package/dist/src/ui/data/avatars/workflow-architect.svg +0 -0
  1698. package/dist/src/ui/data/avatars/workflow-automation.svg +0 -0
  1699. package/dist/src/ui/data/avatars/zk-steward.svg +0 -0
  1700. package/dist/src/ui/data/mastermind-sessions.json +1 -0
  1701. package/dist/src/ui/mastermind-diagram-fallback.html +0 -0
  1702. package/dist/src/ui/orgs-files.js +0 -0
  1703. package/dist/src/ui/orgs.html +7 -1
  1704. package/dist/src/ui/routes-monograph.mjs +6 -0
  1705. package/dist/src/ui/routes-org.mjs +0 -0
  1706. package/dist/src/ui/server.mjs +327 -7
  1707. package/dist/src/ui/sse-manager.mjs +0 -0
  1708. package/dist/src/update/checker.d.ts +0 -0
  1709. package/dist/src/update/checker.d.ts.map +1 -1
  1710. package/dist/src/update/checker.js +2 -1
  1711. package/dist/src/update/checker.js.map +1 -1
  1712. package/dist/src/update/executor.d.ts +0 -0
  1713. package/dist/src/update/executor.d.ts.map +1 -1
  1714. package/dist/src/update/executor.js +7 -3
  1715. package/dist/src/update/executor.js.map +1 -1
  1716. package/dist/src/update/index.d.ts +0 -1
  1717. package/dist/src/update/index.d.ts.map +1 -1
  1718. package/dist/src/update/index.js +5 -24
  1719. package/dist/src/update/index.js.map +1 -1
  1720. package/dist/src/update/rate-limiter.d.ts +0 -0
  1721. package/dist/src/update/rate-limiter.d.ts.map +0 -0
  1722. package/dist/src/update/rate-limiter.js +0 -0
  1723. package/dist/src/update/rate-limiter.js.map +0 -0
  1724. package/dist/src/update/validator.d.ts +0 -0
  1725. package/dist/src/update/validator.d.ts.map +0 -0
  1726. package/dist/src/update/validator.js +0 -0
  1727. package/dist/src/update/validator.js.map +0 -0
  1728. package/dist/src/utils/cosine-similarity.d.ts +0 -0
  1729. package/dist/src/utils/cosine-similarity.d.ts.map +0 -0
  1730. package/dist/src/utils/cosine-similarity.js +0 -0
  1731. package/dist/src/utils/cosine-similarity.js.map +0 -0
  1732. package/dist/src/utils/db-mutex.d.ts +11 -0
  1733. package/dist/src/utils/db-mutex.d.ts.map +1 -0
  1734. package/dist/src/utils/db-mutex.js +23 -0
  1735. package/dist/src/utils/db-mutex.js.map +1 -0
  1736. package/dist/src/utils/input-guards.d.ts +23 -0
  1737. package/dist/src/utils/input-guards.d.ts.map +1 -1
  1738. package/dist/src/utils/input-guards.js +72 -0
  1739. package/dist/src/utils/input-guards.js.map +1 -1
  1740. package/dist/src/utils/json-file.d.ts +0 -0
  1741. package/dist/src/utils/json-file.d.ts.map +0 -0
  1742. package/dist/src/utils/json-file.js +0 -0
  1743. package/dist/src/utils/json-file.js.map +0 -0
  1744. package/dist/src/utils/npm-command.d.ts +10 -0
  1745. package/dist/src/utils/npm-command.d.ts.map +1 -0
  1746. package/dist/src/utils/npm-command.js +12 -0
  1747. package/dist/src/utils/npm-command.js.map +1 -0
  1748. package/dist/src/utils/parse-jsonl.d.ts +0 -0
  1749. package/dist/src/utils/parse-jsonl.d.ts.map +0 -0
  1750. package/dist/src/utils/parse-jsonl.js +0 -0
  1751. package/dist/src/utils/parse-jsonl.js.map +0 -0
  1752. package/dist/src/utils/paths.d.ts +28 -0
  1753. package/dist/src/utils/paths.d.ts.map +1 -0
  1754. package/dist/src/utils/paths.js +108 -0
  1755. package/dist/src/utils/paths.js.map +1 -0
  1756. package/dist/src/utils/resource-governor.d.ts +0 -0
  1757. package/dist/src/utils/resource-governor.d.ts.map +0 -0
  1758. package/dist/src/utils/resource-governor.js +0 -0
  1759. package/dist/src/utils/resource-governor.js.map +0 -0
  1760. package/dist/tsconfig.tsbuildinfo +1 -1
  1761. package/package.json +6 -5
  1762. package/scripts/deploy-ipfs-node.sh +0 -0
  1763. package/scripts/download-embedding-model.mjs +97 -0
  1764. package/scripts/publish.sh +18 -32
  1765. package/scripts/setup-ipfs-registry.md +0 -0
  1766. package/scripts/understand-analyze.mjs +0 -0
  1767. package/.claude/helpers/auto-memory-hook.mjs +0 -97
  1768. package/dist/src/production/circuit-breaker.d.ts +0 -121
  1769. package/dist/src/production/circuit-breaker.d.ts.map +0 -1
  1770. package/dist/src/production/circuit-breaker.js +0 -262
  1771. package/dist/src/production/circuit-breaker.js.map +0 -1
  1772. package/dist/src/production/error-handler.d.ts +0 -119
  1773. package/dist/src/production/error-handler.d.ts.map +0 -1
  1774. package/dist/src/production/error-handler.js +0 -324
  1775. package/dist/src/production/error-handler.js.map +0 -1
  1776. package/dist/src/production/index.d.ts +0 -6
  1777. package/dist/src/production/index.d.ts.map +0 -1
  1778. package/dist/src/production/index.js +0 -6
  1779. package/dist/src/production/index.js.map +0 -1
  1780. package/dist/src/production/monitoring.d.ts +0 -181
  1781. package/dist/src/production/monitoring.d.ts.map +0 -1
  1782. package/dist/src/production/monitoring.js +0 -375
  1783. package/dist/src/production/monitoring.js.map +0 -1
  1784. package/dist/src/production/rate-limiter.d.ts +0 -125
  1785. package/dist/src/production/rate-limiter.d.ts.map +0 -1
  1786. package/dist/src/production/rate-limiter.js +0 -218
  1787. package/dist/src/production/rate-limiter.js.map +0 -1
  1788. package/dist/src/production/retry.d.ts +0 -48
  1789. package/dist/src/production/retry.d.ts.map +0 -1
  1790. package/dist/src/production/retry.js +0 -189
  1791. package/dist/src/production/retry.js.map +0 -1
  1792. package/dist/src/transfer/types.d.ts +0 -245
  1793. package/dist/src/transfer/types.d.ts.map +0 -1
  1794. package/dist/src/transfer/types.js +0 -6
  1795. package/dist/src/transfer/types.js.map +0 -1
@@ -10,185 +10,18 @@ import { dirname } from 'path';
10
10
  // ESM-compatible __dirname
11
11
  const __filename = fileURLToPath(import.meta.url);
12
12
  const __dirname = dirname(__filename);
13
- const MAX_EXEC_FILE_BYTES = 10 * 1024 * 1024; // 10 MB
14
- /**
15
- * Probe whether an optionalDependency actually resolved in this install
16
- * (npm silently skips optionalDependencies it can't satisfy — see
17
- * docs/AUDIT-BACKLOG.md P1-1/P1-23). Used to caveat generated docs instead
18
- * of presenting these features as unconditionally working.
19
- */
20
- function _isOptionalPackageResolvable(pkg) {
21
- try {
22
- const req = createRequire(import.meta.url);
23
- req.resolve(pkg);
24
- return true;
25
- }
26
- catch {
27
- return false;
28
- }
29
- }
30
- /**
31
- * Atomic write helper — writes to a sibling .tmp file then renames into place.
32
- * SIGINT or crash during a partial write would otherwise corrupt user-critical
33
- * files (.claude/settings.json, .mcp.json, helper scripts that Claude Code
34
- * executes on every hook). Without atomicity a half-written settings.json or
35
- * a zero-byte hook-handler.cjs disables Claude Code's protections silently.
36
- */
37
- function atomicWriteFile(target, content, encoding) {
38
- const tmp = `${target}.${process.pid}.tmp`;
39
- if (encoding && typeof content === 'string') {
40
- fs.writeFileSync(tmp, content, encoding);
41
- }
42
- else if (typeof content === 'string') {
43
- fs.writeFileSync(tmp, content, 'utf-8');
44
- }
45
- else {
46
- fs.writeFileSync(tmp, content);
47
- }
48
- fs.renameSync(tmp, target);
49
- }
50
- import { detectPlatform, DEFAULT_INIT_OPTIONS } from './types.js';
13
+ import { detectPlatform } from './types.js';
51
14
  import { writeSharedInstructions } from './shared-instructions-generator.js';
52
- import { generateSettingsJson, generateSettings } from './settings-generator.js';
53
- import { generateMCPJson } from './mcp-generator.js';
54
- import { generateStatuslineScript } from './statusline-generator.js';
55
- import { FORCE_SYNC_HELPERS, FORCE_SYNC_GENERATORS, INIT_FALLBACK_HELPERS, } from './helpers-generator.js';
56
- import { generateClaudeMd } from './claudemd-generator.js';
57
- import { generateOpencodeJson, generateAgentsMd, generateHooksPlugin, generateStatusCommand, convertAgentMd, convertCommandMd, convertSkillMd, opencodeCommandFilename } from './opencode-generator.js';
58
- import { generateKimiMcpJson, mergeKimiMcpJson, generateKimiAgentsMd, generateKimiGateScript, generateKimiPluginManifest, generateKimiStatuslineSh, mergeKimiTuiTomlStatusline, convertKimiAgentMd, convertKimiSkillMd, convertKimiCommandToFlowSkill, convertKimiPluginCommandMd, kimiCommandFilename } from './kimi-generator.js';
59
- import { generateGeminiMd, generateGeminiRulesMd, generateStatuslineSh, } from './geminimd-generator.js';
60
- /**
61
- * Skills to copy based on configuration
62
- */
63
- const SKILLS_MAP = {
64
- core: [
65
- 'swarm-orchestration',
66
- 'swarm-advanced',
67
- 'hooks-automation',
68
- 'pair-programming',
69
- 'verification-quality',
70
- 'skill-builder',
71
- 'specialagent',
72
- 'monodesign',
73
- 'monomotion',
74
- 'monolean',
75
- 'monolean-review',
76
- 'monolean-audit',
77
- 'monolean-debt',
78
- 'monolean-help',
79
- 'hive-mind-advanced',
80
- // The mastermind command files installed by init invoke
81
- // Skill("mastermind-<name>") at runtime — one top-level
82
- // mastermind-<name>/SKILL.md directory per skill. The glob expands in
83
- // copySkills against the source tree, so newly added mastermind skills
84
- // ship automatically; without them those references break in user projects.
85
- 'mastermind-*',
86
- ],
87
- browser: ['agent-browser-testing'],
88
- // NOTE: memory-toolkit and github-toolkit are single consolidated skills
89
- // (not one skill per capability) — see .claude/skills/memory-toolkit and
90
- // .claude/skills/github-toolkit. The finer-grained names previously listed
91
- // here (memory-advanced, github-code-review, etc.) never had matching
92
- // source directories and silently copied nothing.
93
- memory: ['memory-toolkit'],
94
- github: ['github-toolkit'],
95
- advanced: [
96
- 'agentic-jujutsu',
97
- 'performance-analysis',
98
- ],
99
- };
100
- /**
101
- * Commands to copy based on configuration
102
- */
103
- const COMMANDS_MAP = {
104
- core: [
105
- 'mastermind.md', 'tokens.md', 'monobrowse.md', 'ts.md',
106
- ],
107
- agents: ['agents'],
108
- analysis: ['analysis'],
109
- automation: ['automation'],
110
- coordination: ['coordination'],
111
- github: ['github'],
112
- hiveMind: ['hive-mind'],
113
- hooks: ['hooks'],
114
- mastermind: ['mastermind'],
115
- memory: ['memory'],
116
- monitoring: ['monitoring'],
117
- monograph: ['monograph'],
118
- monomind: ['mastermind'],
119
- optimization: ['optimization'],
120
- pair: ['pair'],
121
- streamChain: ['stream-chain'],
122
- swarm: ['swarm'],
123
- training: ['training'],
124
- truth: ['truth'],
125
- verify: ['verify'],
126
- workflows: ['workflows'],
127
- };
128
- /**
129
- * Agents to copy based on configuration
130
- */
131
- const AGENTS_MAP = {
132
- academic: ['academic'],
133
- analysis: ['analysis'],
134
- architecture: ['architecture'],
135
- consensus: ['consensus'],
136
- core: ['core'],
137
- data: ['data'],
138
- design: ['design'],
139
- development: ['development'],
140
- devops: ['devops'],
141
- documentation: ['documentation'],
142
- engineering: ['engineering'],
143
- gameDevelopment: ['game-development'],
144
- github: ['github'],
145
- goal: ['goal'],
146
- hiveMind: ['hive-mind'],
147
- marketing: ['marketing'],
148
- neural: ['neural'],
149
- optimization: ['optimization'],
150
- paidMedia: ['paid-media'],
151
- payments: ['payments'],
152
- product: ['product'],
153
- projectManagement: ['project-management'],
154
- reasoning: ['reasoning'],
155
- sales: ['sales'],
156
- schemas: ['schemas'],
157
- sona: ['sona'],
158
- spatialComputing: ['spatial-computing'],
159
- specialists: ['specialists'],
160
- specialized: ['specialized'],
161
- sublinear: ['sublinear'],
162
- support: ['support'],
163
- swarm: ['swarm'],
164
- templates: ['templates'],
165
- testing: ['testing'],
166
- };
167
- /**
168
- * Directory structure to create
169
- */
170
- const DIRECTORIES = {
171
- claude: [
172
- '.claude',
173
- '.claude/skills',
174
- '.claude/commands',
175
- '.claude/agents',
176
- '.claude/helpers',
177
- '.gemini',
178
- '.gemini/skills',
179
- '.gemini/rules',
180
- '.gemini/helpers',
181
- ],
182
- runtime: [
183
- '.monomind',
184
- '.monomind/data',
185
- '.monomind/logs',
186
- '.monomind/sessions',
187
- '.monomind/hooks',
188
- '.monomind/agents',
189
- '.monomind/workflows',
190
- ],
191
- };
15
+ // Split modules
16
+ import { DIRECTORIES, MAX_EXEC_FILE_BYTES } from './shared.js';
17
+ import { writeSettings, writeMCPConfig, writeHelpers, writeStatusline, writeClaudeMd } from './write-claude.js';
18
+ import { writeRuntimeConfig, writeInitialMetrics } from './write-runtime-config.js';
19
+ import { writeGeminiFiles } from './write-antigravity.js';
20
+ import { writeOpencodeFiles } from './write-opencode.js';
21
+ import { writeKimiFiles } from './write-kimicode.js';
22
+ import { copySkills, copyCommands, copyAgents } from './copy-assets.js';
23
+ // Re-export upgrade functions so index.ts barrel still works via './executor.js'
24
+ export { executeUpgrade, executeUpgradeWithMissing } from './upgrade.js';
192
25
  /**
193
26
  * Execute initialization
194
27
  */
@@ -238,11 +71,15 @@ export async function executeInit(options) {
238
71
  for (const cap of capMgr.getActive()) {
239
72
  console.log(` ✓ ${cap.name}`);
240
73
  }
241
- // Second Brain: if documents capability is active, index documents
74
+ // Second Brain: if documents capability is active, index the full tree.
75
+ // Even when it is NOT active (code-only projects), ingest common
76
+ // documentation files so the Second Brain is seeded with project context
77
+ // that would otherwise cause zero-hits on every prompt.
242
78
  const activeNames = capMgr.getActive().map((c) => c.name);
243
- if (activeNames.includes('documents')) {
244
- try {
245
- const { ingestDirectory } = await import('../knowledge/document-pipeline.js');
79
+ try {
80
+ const { ingestDirectory, ingestDocument } = await import('../knowledge/document-pipeline.js');
81
+ const fs = await import('node:fs');
82
+ if (activeNames.includes('documents')) {
246
83
  console.log('\nIndexing documents for Second Brain...');
247
84
  const docResult = await ingestDirectory(targetDir, 'shared', { rootDir: targetDir });
248
85
  if (docResult.filesProcessed > 0) {
@@ -251,11 +88,44 @@ export async function executeInit(options) {
251
88
  else {
252
89
  console.log(' ✓ Knowledge base initialized (no new documents to index)');
253
90
  }
254
- result.created.files.push('.monomind/knowledge/');
255
91
  }
256
- catch (docErr) {
257
- result.skipped.push(`knowledge indexing: ${docErr instanceof Error ? docErr.message : String(docErr)}`);
92
+ else {
93
+ // Code-only project: ingest common doc directories and root files
94
+ // so the Second Brain is not empty. Skip silently when nothing exists.
95
+ console.log('\nSeeding Second Brain with project docs...');
96
+ let seeded = 0;
97
+ let seededChunks = 0;
98
+ // Ingest doc directories (doc/, docs/) if present
99
+ for (const docDir of ['doc', 'docs']) {
100
+ const dirPath = path.join(targetDir, docDir);
101
+ if (fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory()) {
102
+ const dirResult = await ingestDirectory(dirPath, 'shared', { rootDir: targetDir });
103
+ seeded += dirResult.filesProcessed;
104
+ seededChunks += dirResult.totalChunks;
105
+ }
106
+ }
107
+ // Ingest common root markdown files
108
+ for (const rootDoc of ['README.md', 'CONTRIBUTING.md', 'CHANGELOG.md', 'CLAUDE.md']) {
109
+ const filePath = path.join(targetDir, rootDoc);
110
+ if (fs.existsSync(filePath)) {
111
+ const fileResult = await ingestDocument(filePath, 'shared', targetDir);
112
+ if (!fileResult.skipped) {
113
+ seeded++;
114
+ seededChunks += fileResult.chunksIndexed;
115
+ }
116
+ }
117
+ }
118
+ if (seeded > 0) {
119
+ console.log(` ✓ ${seededChunks} chunks from ${seeded} documents`);
120
+ }
121
+ else {
122
+ console.log(' ✓ Knowledge base initialized (no project docs found)');
123
+ }
258
124
  }
125
+ result.created.files.push('.monomind/knowledge/');
126
+ }
127
+ catch (docErr) {
128
+ result.skipped.push(`knowledge indexing: ${docErr instanceof Error ? docErr.message : String(docErr)}`);
259
129
  }
260
130
  }
261
131
  catch (scanError) {
@@ -429,15 +299,6 @@ try { await buildAsync(${JSON.stringify(targetDir)}); } finally {
429
299
  * Non-fatal: best-effort health check and auto-install.
430
300
  */
431
301
  async function runDoctorFix(targetDir, result) {
432
- // Run the doctor THIS binary ships, in-process.
433
- //
434
- // This used to be `execSync('npx monomind@latest doctor --install')`, which
435
- // was wrong in three ways at once: it downloaded and ran a DIFFERENT version
436
- // than the one the user deliberately invoked (so `monomind@2.7.0 init` was
437
- // finished by whatever `latest` happened to be), it silently required network
438
- // — on a machine without it, the 120s timeout elapsed and init reported
439
- // "skipped" with no explanation — and `stdio: 'ignore'` discarded everything
440
- // it said, so a failed health check looked identical to a passing one.
441
302
  try {
442
303
  const { doctorCommand } = await import('../commands/doctor.js');
443
304
  if (!doctorCommand.action) {
@@ -449,7 +310,6 @@ async function runDoctorFix(targetDir, result) {
449
310
  flags: { install: true },
450
311
  cwd: targetDir,
451
312
  });
452
- // Report what actually happened rather than asserting success either way.
453
313
  if (res && res.success === false) {
454
314
  result.skipped.push('doctor: reported issues (run: monomind doctor for details)');
455
315
  }
@@ -462,456 +322,6 @@ async function runDoctorFix(targetDir, result) {
462
322
  result.skipped.push(`doctor: auto-fix failed (${detail}) — run: monomind doctor --install`);
463
323
  }
464
324
  }
465
- /**
466
- * Merge new settings into existing settings.json
467
- * Preserves user customizations while adding new features like Agent Teams
468
- * Uses platform-specific commands for Mac, Linux, and Windows
469
- */
470
- function mergeSettingsForUpgrade(existing) {
471
- const merged = { ...existing };
472
- const platform = detectPlatform();
473
- const isWindows = platform.os === 'windows';
474
- // Platform-specific command wrappers
475
- // Windows: Use PowerShell-compatible commands
476
- // Mac/Linux: Use bash-compatible commands with 2>/dev/null
477
- // NOTE: teammateIdleCmd and taskCompletedCmd were removed.
478
- // TeammateIdle/TaskCompleted are not valid Claude Code hook events and caused warnings.
479
- // Agent Teams hook config lives in monomind.agentTeams.hooks instead.
480
- // 1. Merge env vars (preserve existing, add new)
481
- const existingEnv = existing.env || {};
482
- merged.env = {
483
- ...existingEnv,
484
- CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
485
- MONOMIND_V1_ENABLED: existingEnv.MONOMIND_V1_ENABLED || 'true',
486
- MONOMIND_HOOKS_ENABLED: existingEnv.MONOMIND_HOOKS_ENABLED || 'true',
487
- };
488
- // 2. Merge hooks (preserve existing, add new Agent Teams + auto-memory hooks)
489
- const existingHooks = existing.hooks || {};
490
- merged.hooks = { ...existingHooks };
491
- // Cross-platform auto-memory hook commands that resolve paths via git root.
492
- // Uses node -e with git rev-parse so hooks work regardless of CWD (#1259, #1284).
493
- const gitRootResolver = "var c=require('child_process'),p=require('path'),u=require('url'),r;"
494
- + "try{r=c.execSync('git rev-parse --show-toplevel',{encoding:'utf8'}).trim()}"
495
- + 'catch(e){r=process.cwd()}';
496
- const autoMemoryScript = '.claude/helpers/auto-memory-hook.mjs';
497
- const autoMemoryImportCmd = `node -e "${gitRootResolver}var f=p.join(r,'${autoMemoryScript}');import(u.pathToFileURL(f).href)" import`;
498
- const autoMemorySyncCmd = `node -e "${gitRootResolver}var f=p.join(r,'${autoMemoryScript}');import(u.pathToFileURL(f).href)" sync`;
499
- // Add auto-memory import to SessionStart (if not already present)
500
- const sessionStartHooks = existingHooks.SessionStart;
501
- const hasAutoMemoryImport = sessionStartHooks?.some(group => group.hooks?.some(h => h.command?.includes('auto-memory-hook')));
502
- if (!hasAutoMemoryImport) {
503
- const startHooks = merged.hooks;
504
- if (!startHooks.SessionStart) {
505
- startHooks.SessionStart = [{ hooks: [] }];
506
- }
507
- const startGroup = startHooks.SessionStart[0];
508
- if (!startGroup.hooks)
509
- startGroup.hooks = [];
510
- startGroup.hooks.push({
511
- type: 'command',
512
- command: autoMemoryImportCmd,
513
- timeout: 6000,
514
- continueOnError: true,
515
- });
516
- }
517
- // Add auto-memory sync to SessionEnd (if not already present)
518
- const sessionEndHooks = existingHooks.SessionEnd;
519
- const hasAutoMemorySync = sessionEndHooks?.some(group => group.hooks?.some(h => h.command?.includes('auto-memory-hook')));
520
- if (!hasAutoMemorySync) {
521
- const endHooks = merged.hooks;
522
- if (!endHooks.SessionEnd) {
523
- endHooks.SessionEnd = [{ hooks: [] }];
524
- }
525
- const endGroup = endHooks.SessionEnd[0];
526
- if (!endGroup.hooks)
527
- endGroup.hooks = [];
528
- // Insert at beginning so sync runs before other cleanup
529
- endGroup.hooks.unshift({
530
- type: 'command',
531
- command: autoMemorySyncCmd,
532
- timeout: 8000,
533
- continueOnError: true,
534
- });
535
- }
536
- // NOTE: TeammateIdle and TaskCompleted are NOT valid Claude Code hook events.
537
- // They cause warnings when present in settings.json hooks.
538
- // Remove them if they exist from a previous init.
539
- delete merged.hooks.TeammateIdle;
540
- delete merged.hooks.TaskCompleted;
541
- // Their configuration lives in monomind.agentTeams.hooks instead.
542
- // 3. Fix statusLine config (remove invalid fields, ensure correct format)
543
- // Claude Code only supports: type, command, padding
544
- const existingStatusLine = existing.statusLine;
545
- if (existingStatusLine) {
546
- merged.statusLine = {
547
- type: 'command',
548
- command: existingStatusLine.command || `node -e "var c=require('child_process'),p=require('path'),r;try{r=c.execSync('git rev-parse --show-toplevel',{encoding:'utf8'}).trim()}catch(e){r=process.cwd()}var s=p.join(r,'.claude/helpers/statusline.cjs');process.argv.splice(1,0,s);require(s)"`,
549
- // Remove invalid fields: refreshMs, enabled (not supported by Claude Code)
550
- };
551
- }
552
- // 4. Merge monomind settings (preserve existing, add agentTeams + memory)
553
- const existingMonomind = existing.monomind || {};
554
- const existingMemory = existingMonomind.memory || {};
555
- merged.monomind = {
556
- ...existingMonomind,
557
- version: existingMonomind.version || '3.0.0',
558
- enabled: existingMonomind.enabled !== false,
559
- agentTeams: {
560
- enabled: true,
561
- teammateMode: 'auto',
562
- taskListEnabled: true,
563
- mailboxEnabled: true,
564
- coordination: {
565
- autoAssignOnIdle: true,
566
- trainPatternsOnComplete: true,
567
- notifyLeadOnComplete: true,
568
- sharedMemoryNamespace: 'agent-teams',
569
- },
570
- hooks: {
571
- teammateIdle: { enabled: true, autoAssign: true, checkTaskList: true },
572
- taskCompleted: { enabled: true, trainPatterns: true, notifyLead: true },
573
- },
574
- },
575
- memory: {
576
- ...existingMemory,
577
- learningBridge: existingMemory.learningBridge ?? { enabled: true },
578
- memoryGraph: existingMemory.memoryGraph ?? { enabled: true },
579
- agentScopes: existingMemory.agentScopes ?? { enabled: true },
580
- },
581
- };
582
- return merged;
583
- }
584
- /**
585
- * Execute upgrade - updates helpers and creates missing metrics without losing data
586
- * This is safe for existing users who want the latest statusline fixes
587
- * @param targetDir - Target directory
588
- * @param upgradeSettings - If true, merge new settings into existing settings.json
589
- */
590
- export async function executeUpgrade(targetDir, upgradeSettings = false) {
591
- const result = {
592
- success: true,
593
- updated: [],
594
- created: [],
595
- preserved: [],
596
- errors: [],
597
- settingsUpdated: [],
598
- };
599
- try {
600
- // Ensure required directories exist
601
- const dirs = [
602
- '.claude/helpers',
603
- '.monomind/metrics',
604
- '.monomind/security',
605
- '.monomind/learning',
606
- ];
607
- for (const dir of dirs) {
608
- const fullPath = path.join(targetDir, dir);
609
- if (!fs.existsSync(fullPath)) {
610
- fs.mkdirSync(fullPath, { recursive: true });
611
- }
612
- }
613
- // 0. ALWAYS update critical helpers + subdirectories (force overwrite)
614
- const sourceHelpersForUpgrade = findSourceHelpersDir();
615
- if (sourceHelpersForUpgrade) {
616
- const destHelpersDir = path.join(targetDir, '.claude', 'helpers');
617
- // Copy top-level critical files atomically. Membership and fallback
618
- // generators come from the shared HELPER_FILES registry (helpers-generator.ts)
619
- // rather than a hardcoded list here — see that file's comment for why.
620
- const criticalHelpers = FORCE_SYNC_HELPERS;
621
- // Generated fallback for any critical helper missing from the source dir itself
622
- // (e.g. the published npm template lacking auto-memory-hook.mjs).
623
- const criticalGenerators = FORCE_SYNC_GENERATORS;
624
- for (const helperName of criticalHelpers) {
625
- const targetPath = path.join(destHelpersDir, helperName);
626
- const sourcePath = path.join(sourceHelpersForUpgrade, helperName);
627
- if (fs.existsSync(sourcePath)) {
628
- if (fs.existsSync(targetPath)) {
629
- result.updated.push(`.claude/helpers/${helperName}`);
630
- }
631
- else {
632
- result.created.push(`.claude/helpers/${helperName}`);
633
- }
634
- // Atomic copy-via-rename so a partial write can't leave a broken hook
635
- const tmp = targetPath + '.tmp';
636
- fs.copyFileSync(sourcePath, tmp);
637
- try {
638
- fs.chmodSync(tmp, 0o755);
639
- }
640
- catch { }
641
- fs.renameSync(tmp, targetPath);
642
- }
643
- else if (!fs.existsSync(targetPath) && criticalGenerators[helperName]) {
644
- const content = criticalGenerators[helperName]();
645
- const tmp = `${targetPath}.${process.pid}.tmp`;
646
- fs.writeFileSync(tmp, content, 'utf-8');
647
- try {
648
- fs.chmodSync(tmp, 0o755);
649
- }
650
- catch { }
651
- fs.renameSync(tmp, targetPath);
652
- result.created.push(`.claude/helpers/${helperName}`);
653
- }
654
- }
655
- // Always recursively sync subdirectories (utils/, handlers/) — required by hook-handler.cjs.
656
- // Uses recursive copy so any future nested subdirs are also covered.
657
- for (const subdir of ['utils', 'handlers']) {
658
- const srcSubdir = path.join(sourceHelpersForUpgrade, subdir);
659
- const destSubdir = path.join(destHelpersDir, subdir);
660
- if (fs.existsSync(srcSubdir)) {
661
- copyDirRecursive(srcSubdir, destSubdir);
662
- result.updated.push(`.claude/helpers/${subdir}/`);
663
- }
664
- }
665
- }
666
- else {
667
- // Source not found (npx with broken paths) — use generated fallbacks
668
- // for every force-synced helper that has one (see HELPER_FILES registry).
669
- const generatedCritical = Object.fromEntries(Object.entries(FORCE_SYNC_GENERATORS).map(([name, generate]) => [name, generate()]));
670
- for (const [helperName, content] of Object.entries(generatedCritical)) {
671
- const targetPath = path.join(targetDir, '.claude', 'helpers', helperName);
672
- if (fs.existsSync(targetPath)) {
673
- result.updated.push(`.claude/helpers/${helperName}`);
674
- }
675
- else {
676
- result.created.push(`.claude/helpers/${helperName}`);
677
- }
678
- // Atomic write (PID-suffixed) so a partial hook-handler.cjs cannot
679
- // ship if init is interrupted, and concurrent inits don't collide on
680
- // the same .tmp filename.
681
- const tmp = `${targetPath}.${process.pid}.tmp`;
682
- fs.writeFileSync(tmp, content, 'utf-8');
683
- try {
684
- fs.chmodSync(tmp, 0o755);
685
- }
686
- catch { }
687
- fs.renameSync(tmp, targetPath);
688
- }
689
- }
690
- // 1. Statusline fallback — only generate if source copy above didn't cover it
691
- const statuslinePath = path.join(targetDir, '.claude', 'helpers', 'statusline.cjs');
692
- if (!sourceHelpersForUpgrade || !fs.existsSync(path.join(sourceHelpersForUpgrade, 'statusline.cjs'))) {
693
- const upgradeOptions = {
694
- ...DEFAULT_INIT_OPTIONS,
695
- targetDir,
696
- force: true,
697
- statusline: {
698
- ...DEFAULT_INIT_OPTIONS.statusline,
699
- refreshInterval: 5000,
700
- },
701
- };
702
- const statuslineContent = generateStatuslineScript(upgradeOptions);
703
- if (fs.existsSync(statuslinePath)) {
704
- result.updated.push('.claude/helpers/statusline.cjs');
705
- }
706
- else {
707
- result.created.push('.claude/helpers/statusline.cjs');
708
- }
709
- atomicWriteFile(statuslinePath, statuslineContent);
710
- }
711
- // 2. Create MISSING metrics files only (preserve existing data)
712
- const metricsDir = path.join(targetDir, '.monomind', 'metrics');
713
- const securityDir = path.join(targetDir, '.monomind', 'security');
714
- // v1-progress.json
715
- const progressPath = path.join(metricsDir, 'v1-progress.json');
716
- if (!fs.existsSync(progressPath)) {
717
- const progress = {
718
- version: '3.0.0',
719
- initialized: new Date().toISOString(),
720
- domains: { completed: 0, total: 5, status: 'INITIALIZING' },
721
- ddd: { progress: 0, modules: 0, totalFiles: 0, totalLines: 0 },
722
- swarm: { activeAgents: 0, maxAgents: 15, topology: 'hierarchical-mesh' },
723
- learning: { status: 'READY', patternsLearned: 0, sessionsCompleted: 0 },
724
- _note: 'Metrics will update as you use Monomind'
725
- };
726
- atomicWriteFile(progressPath, JSON.stringify(progress, null, 2));
727
- result.created.push('.monomind/metrics/v1-progress.json');
728
- }
729
- else {
730
- result.preserved.push('.monomind/metrics/v1-progress.json');
731
- }
732
- // swarm-activity.json
733
- const activityPath = path.join(metricsDir, 'swarm-activity.json');
734
- if (!fs.existsSync(activityPath)) {
735
- const activity = {
736
- timestamp: new Date().toISOString(),
737
- processes: { mcp_server: 0, estimated_agents: 0 },
738
- swarm: { active: false, agent_count: 0, coordination_active: false },
739
- integration: { mcp_active: false },
740
- _initialized: true
741
- };
742
- atomicWriteFile(activityPath, JSON.stringify(activity, null, 2));
743
- result.created.push('.monomind/metrics/swarm-activity.json');
744
- }
745
- else {
746
- result.preserved.push('.monomind/metrics/swarm-activity.json');
747
- }
748
- // learning.json
749
- const learningPath = path.join(metricsDir, 'learning.json');
750
- if (!fs.existsSync(learningPath)) {
751
- const learning = {
752
- initialized: new Date().toISOString(),
753
- routing: { accuracy: 0, decisions: 0 },
754
- patterns: { shortTerm: 0, longTerm: 0, quality: 0 },
755
- sessions: { total: 0, current: null },
756
- _note: 'Intelligence grows as you use Monomind'
757
- };
758
- atomicWriteFile(learningPath, JSON.stringify(learning, null, 2));
759
- result.created.push('.monomind/metrics/learning.json');
760
- }
761
- else {
762
- result.preserved.push('.monomind/metrics/learning.json');
763
- }
764
- // audit-status.json
765
- const auditPath = path.join(securityDir, 'audit-status.json');
766
- if (!fs.existsSync(auditPath)) {
767
- const audit = {
768
- initialized: new Date().toISOString(),
769
- status: 'PENDING',
770
- cvesFixed: 0,
771
- totalCves: 3,
772
- lastScan: null,
773
- _note: 'Run: npx monomind@latest security scan'
774
- };
775
- atomicWriteFile(auditPath, JSON.stringify(audit, null, 2));
776
- result.created.push('.monomind/security/audit-status.json');
777
- }
778
- else {
779
- result.preserved.push('.monomind/security/audit-status.json');
780
- }
781
- // 3. Merge settings if requested
782
- if (upgradeSettings) {
783
- const settingsPath = path.join(targetDir, '.claude', 'settings.json');
784
- if (fs.existsSync(settingsPath) && fs.statSync(settingsPath).size <= MAX_EXEC_FILE_BYTES) {
785
- try {
786
- const existingSettings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
787
- const mergedSettings = mergeSettingsForUpgrade(existingSettings);
788
- atomicWriteFile(settingsPath, JSON.stringify(mergedSettings, null, 2));
789
- result.updated.push('.claude/settings.json');
790
- result.settingsUpdated = [
791
- 'env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS',
792
- 'hooks.SessionStart (auto-memory import)',
793
- 'hooks.SessionEnd (auto-memory sync)',
794
- 'hooks.TeammateIdle (removed — not a valid Claude Code hook)',
795
- 'hooks.TaskCompleted (removed — not a valid Claude Code hook)',
796
- 'monomind.agentTeams',
797
- 'monomind.memory (learningBridge, memoryGraph, agentScopes)',
798
- ];
799
- }
800
- catch (settingsError) {
801
- result.errors.push(`Settings merge failed: ${settingsError instanceof Error ? settingsError.message : String(settingsError)}`);
802
- }
803
- }
804
- else {
805
- // Create new settings.json with defaults
806
- const defaultSettings = generateSettings(DEFAULT_INIT_OPTIONS);
807
- atomicWriteFile(settingsPath, JSON.stringify(defaultSettings, null, 2));
808
- result.created.push('.claude/settings.json');
809
- result.settingsUpdated = ['Created new settings.json with Agent Teams'];
810
- }
811
- }
812
- }
813
- catch (error) {
814
- result.success = false;
815
- result.errors.push(error instanceof Error ? error.message : String(error));
816
- }
817
- return result;
818
- }
819
- /**
820
- * Execute upgrade with --add-missing flag
821
- * Adds any new skills, agents, and commands that don't exist yet
822
- * @param targetDir - Target directory
823
- * @param upgradeSettings - If true, merge new settings into existing settings.json
824
- */
825
- export async function executeUpgradeWithMissing(targetDir, upgradeSettings = false) {
826
- // First do the normal upgrade (pass through upgradeSettings)
827
- const result = await executeUpgrade(targetDir, upgradeSettings);
828
- if (!result.success) {
829
- return result;
830
- }
831
- // Initialize tracking arrays
832
- result.addedSkills = [];
833
- result.addedAgents = [];
834
- result.addedCommands = [];
835
- try {
836
- // Ensure target directories exist
837
- const skillsDir = path.join(targetDir, '.claude', 'skills');
838
- const agentsDir = path.join(targetDir, '.claude', 'agents');
839
- const commandsDir = path.join(targetDir, '.claude', 'commands');
840
- for (const dir of [skillsDir, agentsDir, commandsDir]) {
841
- if (!fs.existsSync(dir)) {
842
- fs.mkdirSync(dir, { recursive: true });
843
- }
844
- }
845
- // Find source directories
846
- const sourceSkillsDir = findSourceDir('skills');
847
- const sourceAgentsDir = findSourceDir('agents');
848
- const sourceCommandsDir = findSourceDir('commands');
849
- // Debug: Log source directories found
850
- if (process.env.DEBUG || process.env.MONOMIND_DEBUG) {
851
- console.log('[DEBUG] Source directories:');
852
- console.log(` Skills: ${sourceSkillsDir || 'NOT FOUND'}`);
853
- console.log(` Agents: ${sourceAgentsDir || 'NOT FOUND'}`);
854
- console.log(` Commands: ${sourceCommandsDir || 'NOT FOUND'}`);
855
- }
856
- // Add missing skills
857
- if (sourceSkillsDir) {
858
- const allSkills = Object.values(SKILLS_MAP).flat();
859
- const debugMode = process.env.DEBUG || process.env.MONOMIND_DEBUG;
860
- if (debugMode) {
861
- console.log(`[DEBUG] Checking ${allSkills.length} skills from SKILLS_MAP`);
862
- }
863
- for (const skillName of [...new Set(allSkills)]) {
864
- const sourcePath = path.join(sourceSkillsDir, skillName);
865
- const targetPath = path.join(skillsDir, skillName);
866
- const sourceExists = fs.existsSync(sourcePath);
867
- const targetExists = fs.existsSync(targetPath);
868
- if (debugMode) {
869
- console.log(`[DEBUG] Skill '${skillName}': source=${sourceExists}, target=${targetExists}`);
870
- }
871
- if (sourceExists && !targetExists) {
872
- copyDirRecursive(sourcePath, targetPath);
873
- result.addedSkills.push(skillName);
874
- result.created.push(`.claude/skills/${skillName}`);
875
- }
876
- }
877
- }
878
- // Add missing agents
879
- if (sourceAgentsDir) {
880
- const allAgents = Object.values(AGENTS_MAP).flat();
881
- for (const agentCategory of [...new Set(allAgents)]) {
882
- const sourcePath = path.join(sourceAgentsDir, agentCategory);
883
- const targetPath = path.join(agentsDir, agentCategory);
884
- if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
885
- copyDirRecursive(sourcePath, targetPath);
886
- result.addedAgents.push(agentCategory);
887
- result.created.push(`.claude/agents/${agentCategory}`);
888
- }
889
- }
890
- }
891
- // Add missing commands
892
- if (sourceCommandsDir) {
893
- const allCommands = Object.values(COMMANDS_MAP).flat();
894
- for (const cmdName of [...new Set(allCommands)]) {
895
- const sourcePath = path.join(sourceCommandsDir, cmdName);
896
- const targetPath = path.join(commandsDir, cmdName);
897
- if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
898
- if (fs.statSync(sourcePath).isDirectory()) {
899
- copyDirRecursive(sourcePath, targetPath);
900
- }
901
- else {
902
- fs.copyFileSync(sourcePath, targetPath);
903
- }
904
- result.addedCommands.push(cmdName);
905
- result.created.push(`.claude/commands/${cmdName}`);
906
- }
907
- }
908
- }
909
- }
910
- catch (error) {
911
- result.errors.push(`Add missing failed: ${error instanceof Error ? error.message : String(error)}`);
912
- }
913
- return result;
914
- }
915
325
  /**
916
326
  * Create directory structure
917
327
  */
@@ -928,1852 +338,6 @@ async function createDirectories(targetDir, options, result) {
928
338
  }
929
339
  }
930
340
  }
931
- /**
932
- * Write settings.json
933
- */
934
- async function writeSettings(targetDir, options, result) {
935
- const settingsPath = path.join(targetDir, '.claude', 'settings.json');
936
- const generated = JSON.parse(generateSettingsJson(options));
937
- if (fs.existsSync(settingsPath) && !options.force && fs.statSync(settingsPath).size <= MAX_EXEC_FILE_BYTES) {
938
- // Merge hooks/env/permissions into existing settings instead of skipping
939
- try {
940
- const existing = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
941
- let merged = false;
942
- // Merge hooks (the critical missing piece — #1484)
943
- if (generated.hooks && !existing.hooks) {
944
- existing.hooks = generated.hooks;
945
- merged = true;
946
- }
947
- // Merge env vars (for CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS etc.)
948
- if (generated.env) {
949
- existing.env = { ...(existing.env || {}), ...generated.env };
950
- merged = true;
951
- }
952
- // Merge permissions (add monomind allow rules)
953
- if (generated.permissions?.allow) {
954
- const existingAllow = existing.permissions?.allow || [];
955
- const newRules = generated.permissions.allow.filter((r) => !existingAllow.includes(r));
956
- if (newRules.length > 0) {
957
- existing.permissions = existing.permissions || {};
958
- existing.permissions.allow = [...existingAllow, ...newRules];
959
- merged = true;
960
- }
961
- }
962
- if (merged) {
963
- atomicWriteFile(settingsPath, JSON.stringify(existing, null, 2));
964
- result.created.files.push('.claude/settings.json (merged hooks)');
965
- }
966
- else {
967
- result.skipped.push('.claude/settings.json');
968
- }
969
- }
970
- catch (e) {
971
- // Existing file is corrupt — overwrite
972
- if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
973
- console.error('[writeSettings] existing settings.json unparseable, overwriting with generated defaults:', e);
974
- atomicWriteFile(settingsPath, JSON.stringify(generated, null, 2));
975
- result.created.files.push('.claude/settings.json');
976
- }
977
- return;
978
- }
979
- atomicWriteFile(settingsPath, JSON.stringify(generated, null, 2));
980
- result.created.files.push('.claude/settings.json');
981
- }
982
- /**
983
- * Write .mcp.json
984
- */
985
- async function writeMCPConfig(targetDir, options, result) {
986
- const mcpPath = path.join(targetDir, '.mcp.json');
987
- if (fs.existsSync(mcpPath) && !options.force) {
988
- result.skipped.push('.mcp.json');
989
- return;
990
- }
991
- const content = generateMCPJson(options);
992
- atomicWriteFile(mcpPath, content);
993
- result.created.files.push('.mcp.json');
994
- }
995
- /**
996
- * Provenance manifest for generated .claude content.
997
- *
998
- * init used to "clean stale" entries by deleting every name under
999
- * .claude/{skills,commands,agents} that was absent from the current version's
1000
- * SKILLS_MAP/COMMANDS_MAP/AGENTS_MAP. Every user-authored command and skill is
1001
- * absent from those maps, so that pass deleted user content on the very first
1002
- * run — unrecoverable data loss.
1003
- *
1004
- * The manifest records exactly which entries *this tool* wrote, so the stale
1005
- * sweep can be restricted to those. Anything init did not write is never
1006
- * removed. Projects initialised by an older version have no manifest, so their
1007
- * first run under the fix deletes nothing and seeds the manifest instead;
1008
- * stale generated content may survive one extra run, which is the correct
1009
- * trade (preserving stale generated content is recoverable, deleting user
1010
- * content is not).
1011
- */
1012
- const INIT_MANIFEST_REL = path.join('.monomind', 'init-manifest.json');
1013
- /**
1014
- * Read the provenance manifest. Returns null when absent or unreadable —
1015
- * callers must treat that as "provenance unknown", i.e. delete nothing.
1016
- */
1017
- function readInitManifest(targetDir) {
1018
- const manifestPath = path.join(targetDir, INIT_MANIFEST_REL);
1019
- try {
1020
- if (!fs.existsSync(manifestPath))
1021
- return null;
1022
- const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
1023
- if (!parsed || typeof parsed !== 'object')
1024
- return null;
1025
- return {
1026
- version: typeof parsed.version === 'number' ? parsed.version : 1,
1027
- skills: Array.isArray(parsed.skills) ? parsed.skills.filter((s) => typeof s === 'string') : [],
1028
- commands: Array.isArray(parsed.commands) ? parsed.commands.filter((s) => typeof s === 'string') : [],
1029
- agents: Array.isArray(parsed.agents) ? parsed.agents.filter((s) => typeof s === 'string') : [],
1030
- };
1031
- }
1032
- catch {
1033
- return null;
1034
- }
1035
- }
1036
- /**
1037
- * Names init previously generated in one section. Empty set when no manifest
1038
- * exists — which makes the stale sweep a no-op rather than a delete-everything.
1039
- */
1040
- function previouslyGenerated(targetDir, section) {
1041
- return new Set(readInitManifest(targetDir)?.[section] ?? []);
1042
- }
1043
- /**
1044
- * Record the entries init just wrote for one section, merging into any
1045
- * existing manifest so a partial run (e.g. --only-claude, or a section whose
1046
- * source dir was missing) never drops provenance for the other sections.
1047
- */
1048
- function recordGenerated(targetDir, section, entries) {
1049
- const manifestPath = path.join(targetDir, INIT_MANIFEST_REL);
1050
- const existing = readInitManifest(targetDir);
1051
- const manifest = existing ?? { version: 1, skills: [], commands: [], agents: [] };
1052
- manifest.version = 1;
1053
- manifest[section] = [...new Set(entries)].sort();
1054
- try {
1055
- fs.mkdirSync(path.dirname(manifestPath), { recursive: true });
1056
- atomicWriteFile(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
1057
- }
1058
- catch {
1059
- // Non-fatal: without a manifest the next run simply deletes nothing.
1060
- }
1061
- }
1062
- /**
1063
- * Copy skills from source
1064
- */
1065
- async function copySkills(targetDir, options, result) {
1066
- const skillsConfig = options.skills;
1067
- const targetSkillsDir = path.join(targetDir, '.claude', 'skills');
1068
- // Determine which skills to copy
1069
- const skillsToCopy = [];
1070
- if (skillsConfig.all) {
1071
- // Copy all available skills
1072
- Object.values(SKILLS_MAP).forEach(skills => skillsToCopy.push(...skills));
1073
- }
1074
- else {
1075
- if (skillsConfig.core)
1076
- skillsToCopy.push(...SKILLS_MAP.core);
1077
- if (skillsConfig.memory)
1078
- skillsToCopy.push(...SKILLS_MAP.memory);
1079
- if (skillsConfig.github)
1080
- skillsToCopy.push(...SKILLS_MAP.github);
1081
- if (skillsConfig.browser)
1082
- skillsToCopy.push(...SKILLS_MAP.browser);
1083
- if (skillsConfig.advanced)
1084
- skillsToCopy.push(...SKILLS_MAP.advanced);
1085
- }
1086
- // Find source skills directory
1087
- const sourceSkillsDir = findSourceDir('skills', options.sourceBaseDir);
1088
- if (!sourceSkillsDir) {
1089
- result.errors.push('Could not find source skills directory');
1090
- return;
1091
- }
1092
- // Expand glob-style entries ('mastermind-*') against the source tree.
1093
- // Only directories that actually contain a SKILL.md count — this also
1094
- // filters exFAT AppleDouble junk (._mastermind-…).
1095
- for (const entry of skillsToCopy.filter(e => e.endsWith('*'))) {
1096
- const prefix = entry.slice(0, -1);
1097
- skillsToCopy.splice(skillsToCopy.indexOf(entry), 1);
1098
- skillsToCopy.push(...fs.readdirSync(sourceSkillsDir).filter(n => n.startsWith(prefix) &&
1099
- fs.existsSync(path.join(sourceSkillsDir, n, 'SKILL.md'))));
1100
- }
1101
- // Remove stale skill directories that a PREVIOUS init generated and this
1102
- // version no longer ships. Entries init never wrote (user-authored skills,
1103
- // skills installed by other tools) are left untouched — see readInitManifest.
1104
- const knownSkills = new Set([...new Set(skillsToCopy)]);
1105
- const priorSkills = previouslyGenerated(targetDir, 'skills');
1106
- if (fs.existsSync(targetSkillsDir)) {
1107
- for (const existing of fs.readdirSync(targetSkillsDir)) {
1108
- if (!knownSkills.has(existing) && priorSkills.has(existing)) {
1109
- const stalePath = path.join(targetSkillsDir, existing);
1110
- fs.rmSync(stalePath, { recursive: true, force: true });
1111
- result.created.files.push(`[cleaned] .claude/skills/${existing} (stale)`);
1112
- }
1113
- }
1114
- }
1115
- // Always copy/overwrite skills (never skip — ensures new version content lands)
1116
- const writtenSkills = [];
1117
- for (const skillName of knownSkills) {
1118
- const sourcePath = path.join(sourceSkillsDir, skillName);
1119
- const targetPath = path.join(targetSkillsDir, skillName);
1120
- if (fs.existsSync(sourcePath)) {
1121
- // Deliberately NOT rmSync'd first. copyDirRecursive overwrites every
1122
- // file it ships, so wiping the directory adds nothing except destroying
1123
- // anything the user put inside it — notes beside a shipped skill, an
1124
- // extra command in a shipped folder. `init --force` did exactly that.
1125
- // The cost of not wiping is that a file removed from a newer version
1126
- // lingers; the cost of wiping is silent data loss, which is worse.
1127
- copyDirRecursive(sourcePath, targetPath);
1128
- writtenSkills.push(skillName);
1129
- result.created.files.push(`.claude/skills/${skillName}`);
1130
- result.summary.skillsCount++;
1131
- }
1132
- else {
1133
- // A skill referenced in SKILLS_MAP has no matching source directory —
1134
- // surface this instead of silently copying nothing, so drift between
1135
- // SKILLS_MAP and the actual .claude/skills/ tree gets caught.
1136
- result.errors.push(`Skill '${skillName}' listed in SKILLS_MAP has no source directory at ${sourcePath} — skipped`);
1137
- }
1138
- }
1139
- // Record provenance so the next run can distinguish "we wrote this" from
1140
- // "the user wrote this". Keep entries this run did not re-write but that a
1141
- // previous run generated and that still exist, so provenance is not lost
1142
- // when a section is partially skipped.
1143
- const retainedSkills = [...priorSkills].filter(n => !writtenSkills.includes(n) && fs.existsSync(path.join(targetSkillsDir, n)));
1144
- recordGenerated(targetDir, 'skills', [...writtenSkills, ...retainedSkills]);
1145
- }
1146
- /**
1147
- * Copy commands from source
1148
- */
1149
- async function copyCommands(targetDir, options, result) {
1150
- const commandsConfig = options.commands;
1151
- const targetCommandsDir = path.join(targetDir, '.claude', 'commands');
1152
- // Determine which commands to copy
1153
- const commandsToCopy = [];
1154
- if (commandsConfig.all) {
1155
- Object.values(COMMANDS_MAP).forEach(cmds => commandsToCopy.push(...cmds));
1156
- }
1157
- else {
1158
- if (commandsConfig.core)
1159
- commandsToCopy.push(...COMMANDS_MAP.core);
1160
- if (commandsConfig.agents)
1161
- commandsToCopy.push(...(COMMANDS_MAP.agents || []));
1162
- if (commandsConfig.analysis)
1163
- commandsToCopy.push(...COMMANDS_MAP.analysis);
1164
- if (commandsConfig.automation)
1165
- commandsToCopy.push(...COMMANDS_MAP.automation);
1166
- if (commandsConfig.coordination)
1167
- commandsToCopy.push(...(COMMANDS_MAP.coordination || []));
1168
- if (commandsConfig.github)
1169
- commandsToCopy.push(...COMMANDS_MAP.github);
1170
- if (commandsConfig.hiveMind)
1171
- commandsToCopy.push(...(COMMANDS_MAP.hiveMind || []));
1172
- if (commandsConfig.hooks)
1173
- commandsToCopy.push(...COMMANDS_MAP.hooks);
1174
- if (commandsConfig.mastermind)
1175
- commandsToCopy.push(...(COMMANDS_MAP.mastermind || []));
1176
- if (commandsConfig.memory)
1177
- commandsToCopy.push(...(COMMANDS_MAP.memory || []));
1178
- if (commandsConfig.monitoring)
1179
- commandsToCopy.push(...COMMANDS_MAP.monitoring);
1180
- if (commandsConfig.monograph)
1181
- commandsToCopy.push(...(COMMANDS_MAP.monograph || []));
1182
- if (commandsConfig.monomind)
1183
- commandsToCopy.push(...(COMMANDS_MAP.monomind || []));
1184
- if (commandsConfig.optimization)
1185
- commandsToCopy.push(...COMMANDS_MAP.optimization);
1186
- if (commandsConfig.pair)
1187
- commandsToCopy.push(...(COMMANDS_MAP.pair || []));
1188
- if (commandsConfig.streamChain)
1189
- commandsToCopy.push(...(COMMANDS_MAP.streamChain || []));
1190
- if (commandsConfig.swarm)
1191
- commandsToCopy.push(...(COMMANDS_MAP.swarm || []));
1192
- if (commandsConfig.training)
1193
- commandsToCopy.push(...(COMMANDS_MAP.training || []));
1194
- if (commandsConfig.truth)
1195
- commandsToCopy.push(...(COMMANDS_MAP.truth || []));
1196
- if (commandsConfig.verify)
1197
- commandsToCopy.push(...(COMMANDS_MAP.verify || []));
1198
- if (commandsConfig.workflows)
1199
- commandsToCopy.push(...(COMMANDS_MAP.workflows || []));
1200
- }
1201
- // Find source commands directory
1202
- const sourceCommandsDir = findSourceDir('commands', options.sourceBaseDir);
1203
- if (!sourceCommandsDir) {
1204
- result.errors.push('Could not find source commands directory');
1205
- return;
1206
- }
1207
- // Remove stale command files/directories that a PREVIOUS init generated and
1208
- // this version no longer ships. User-authored commands are never touched.
1209
- const knownCommands = new Set([...new Set(commandsToCopy)]);
1210
- const priorCommands = previouslyGenerated(targetDir, 'commands');
1211
- if (fs.existsSync(targetCommandsDir)) {
1212
- for (const existing of fs.readdirSync(targetCommandsDir)) {
1213
- if (!knownCommands.has(existing) && priorCommands.has(existing)) {
1214
- const stalePath = path.join(targetCommandsDir, existing);
1215
- fs.rmSync(stalePath, { recursive: true, force: true });
1216
- result.created.files.push(`[cleaned] .claude/commands/${existing} (stale)`);
1217
- }
1218
- }
1219
- }
1220
- // Always copy/overwrite commands (never skip — ensures new version content lands)
1221
- const writtenCommands = [];
1222
- for (const cmdName of knownCommands) {
1223
- const sourcePath = path.join(sourceCommandsDir, cmdName);
1224
- const targetPath = path.join(targetCommandsDir, cmdName);
1225
- if (fs.existsSync(sourcePath)) {
1226
- // No pre-copy rmSync — see the note in copySkills. Both branches below
1227
- // overwrite what they ship, so wiping first only destroys files the user
1228
- // added inside a shipped command directory.
1229
- if (fs.statSync(sourcePath).isDirectory()) {
1230
- copyDirRecursive(sourcePath, targetPath);
1231
- }
1232
- else {
1233
- fs.copyFileSync(sourcePath, targetPath);
1234
- }
1235
- writtenCommands.push(cmdName);
1236
- result.created.files.push(`.claude/commands/${cmdName}`);
1237
- result.summary.commandsCount++;
1238
- }
1239
- }
1240
- const retainedCommands = [...priorCommands].filter(n => !writtenCommands.includes(n) && fs.existsSync(path.join(targetCommandsDir, n)));
1241
- recordGenerated(targetDir, 'commands', [...writtenCommands, ...retainedCommands]);
1242
- }
1243
- /**
1244
- * Copy agents from source
1245
- */
1246
- async function copyAgents(targetDir, options, result) {
1247
- const agentsConfig = options.agents;
1248
- const targetAgentsDir = path.join(targetDir, '.claude', 'agents');
1249
- // Determine which agents to copy
1250
- const agentsToCopy = [];
1251
- if (agentsConfig.all) {
1252
- Object.values(AGENTS_MAP).forEach(agents => agentsToCopy.push(...agents));
1253
- }
1254
- else {
1255
- if (agentsConfig.core)
1256
- agentsToCopy.push(...AGENTS_MAP.core);
1257
- if (agentsConfig.consensus)
1258
- agentsToCopy.push(...AGENTS_MAP.consensus);
1259
- if (agentsConfig.github)
1260
- agentsToCopy.push(...AGENTS_MAP.github);
1261
- if (agentsConfig.hiveMind)
1262
- agentsToCopy.push(...AGENTS_MAP.hiveMind);
1263
- if (agentsConfig.swarm)
1264
- agentsToCopy.push(...AGENTS_MAP.swarm);
1265
- if (agentsConfig.optimization)
1266
- agentsToCopy.push(...(AGENTS_MAP.optimization || []));
1267
- if (agentsConfig.testing)
1268
- agentsToCopy.push(...(AGENTS_MAP.testing || []));
1269
- }
1270
- // Find source agents directory
1271
- const sourceAgentsDir = findSourceDir('agents', options.sourceBaseDir);
1272
- if (!sourceAgentsDir) {
1273
- result.errors.push('Could not find source agents directory');
1274
- return;
1275
- }
1276
- // Remove stale agent category directories that a PREVIOUS init generated and
1277
- // this version no longer ships. User-authored agent dirs are never touched.
1278
- const knownAgents = new Set([...new Set(agentsToCopy)]);
1279
- const priorAgents = previouslyGenerated(targetDir, 'agents');
1280
- if (fs.existsSync(targetAgentsDir)) {
1281
- for (const existing of fs.readdirSync(targetAgentsDir)) {
1282
- if (!knownAgents.has(existing) && priorAgents.has(existing)) {
1283
- const stalePath = path.join(targetAgentsDir, existing);
1284
- fs.rmSync(stalePath, { recursive: true, force: true });
1285
- result.created.files.push(`[cleaned] .claude/agents/${existing} (stale)`);
1286
- }
1287
- }
1288
- }
1289
- // Always copy/overwrite agents (never skip — ensures new version content lands)
1290
- const writtenAgents = [];
1291
- for (const agentCategory of knownAgents) {
1292
- const sourcePath = path.join(sourceAgentsDir, agentCategory);
1293
- const targetPath = path.join(targetAgentsDir, agentCategory);
1294
- if (fs.existsSync(sourcePath)) {
1295
- // Deliberately NOT rmSync'd first. copyDirRecursive overwrites every
1296
- // file it ships, so wiping the directory adds nothing except destroying
1297
- // anything the user put inside it — notes beside a shipped skill, an
1298
- // extra command in a shipped folder. `init --force` did exactly that.
1299
- // The cost of not wiping is that a file removed from a newer version
1300
- // lingers; the cost of wiping is silent data loss, which is worse.
1301
- copyDirRecursive(sourcePath, targetPath);
1302
- // Count agent files (.md only — .yaml agents were migrated to .md)
1303
- const mdFiles = countFiles(sourcePath, '.md');
1304
- result.summary.agentsCount += mdFiles;
1305
- writtenAgents.push(agentCategory);
1306
- result.created.files.push(`.claude/agents/${agentCategory}`);
1307
- }
1308
- }
1309
- const retainedAgents = [...priorAgents].filter(n => !writtenAgents.includes(n) && fs.existsSync(path.join(targetAgentsDir, n)));
1310
- recordGenerated(targetDir, 'agents', [...writtenAgents, ...retainedAgents]);
1311
- }
1312
- /**
1313
- * Find source helpers directory.
1314
- * Validates that the directory contains hook-handler.cjs AND its required
1315
- * subdirectory files (utils/telemetry.cjs etc.) to avoid accepting a partial
1316
- * or corrupted source that would reproduce the missing-utils/ bug class.
1317
- */
1318
- function findSourceHelpersDir(sourceBaseDir) {
1319
- const possiblePaths = [];
1320
- // All sentinel files must exist — hook-handler.cjs requires these at startup
1321
- const SENTINEL_FILES = [
1322
- 'hook-handler.cjs',
1323
- path.join('utils', 'telemetry.cjs'),
1324
- path.join('utils', 'monograph.cjs'),
1325
- path.join('utils', 'micro-agents.cjs'),
1326
- ];
1327
- // If explicit source base directory is provided, check it first
1328
- if (sourceBaseDir) {
1329
- possiblePaths.push(path.join(sourceBaseDir, '.claude', 'helpers'));
1330
- }
1331
- // Strategy 1: require.resolve to find package root (most reliable for npx)
1332
- // Try both published package names (@monoes/monomindcli is the scoped CLI package,
1333
- // monomind is the umbrella — neither is @monomind/cli which is the monorepo name only)
1334
- for (const pkgName of ['@monoes/monomindcli/package.json', 'monomind/packages/@monomind/cli/package.json', '@monomind/cli/package.json']) {
1335
- try {
1336
- const esmRequire = createRequire(import.meta.url);
1337
- const pkgJsonPath = esmRequire.resolve(pkgName);
1338
- const pkgRoot = path.dirname(pkgJsonPath);
1339
- possiblePaths.push(path.join(pkgRoot, '.claude', 'helpers'));
1340
- break;
1341
- }
1342
- catch {
1343
- // Not installed under this name — try next
1344
- }
1345
- }
1346
- // Strategy 2: __dirname-based (dist/src/init -> package root)
1347
- const packageRoot = path.resolve(__dirname, '..', '..', '..');
1348
- const packageHelpers = path.join(packageRoot, '.claude', 'helpers');
1349
- possiblePaths.push(packageHelpers);
1350
- // Strategy 3: Walk up from __dirname looking for package root
1351
- let currentDir = __dirname;
1352
- for (let i = 0; i < 10; i++) {
1353
- const parentDir = path.dirname(currentDir);
1354
- if (parentDir === currentDir)
1355
- break; // hit filesystem root
1356
- const helpersPath = path.join(parentDir, '.claude', 'helpers');
1357
- possiblePaths.push(helpersPath);
1358
- currentDir = parentDir;
1359
- }
1360
- // NOTE: deliberately no cwd-ancestor-search fallback here (removed — see
1361
- // docs/AUDIT-BACKLOG.md P3-25). Searching process.cwd() and its parents for
1362
- // ".claude/helpers" could pick up an unrelated project's own helper scripts
1363
- // (stale, customized, or untrusted) when `monomind init` is run from a
1364
- // nested subdirectory of some other checkout. Helper source resolution is
1365
- // restricted to the package's own bundled location(s) above; if none of
1366
- // those are found, callers should treat it as a corrupt install rather than
1367
- // silently falling back to scanning ancestor directories for someone else's
1368
- // files.
1369
- // Return first path that exists AND contains ALL sentinel files
1370
- for (const p of possiblePaths) {
1371
- if (fs.existsSync(p) && SENTINEL_FILES.every(f => fs.existsSync(path.join(p, f)))) {
1372
- return p;
1373
- }
1374
- }
1375
- return null;
1376
- }
1377
- /**
1378
- * Write helper scripts
1379
- */
1380
- async function writeHelpers(targetDir, options, result) {
1381
- const helpersDir = path.join(targetDir, '.claude', 'helpers');
1382
- // Find source helpers directory (works for npm package and local dev)
1383
- const sourceHelpersDir = findSourceHelpersDir(options.sourceBaseDir);
1384
- // Try to copy existing helpers from source first (recursive — includes utils/ and handlers/)
1385
- if (sourceHelpersDir && fs.existsSync(sourceHelpersDir)) {
1386
- const copyRecursive = (srcDir, destDir, relBase) => {
1387
- fs.mkdirSync(destDir, { recursive: true });
1388
- for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
1389
- // Skip exFAT/macOS AppleDouble junk files (e.g. "._foo.cjs").
1390
- if (entry.name.startsWith('._'))
1391
- continue;
1392
- const srcPath = path.join(srcDir, entry.name);
1393
- const destPath = path.join(destDir, entry.name);
1394
- const relPath = relBase ? `${relBase}/${entry.name}` : entry.name;
1395
- if (entry.isDirectory()) {
1396
- copyRecursive(srcPath, destPath, relPath);
1397
- }
1398
- else {
1399
- if (!fs.existsSync(destPath) || options.force) {
1400
- fs.copyFileSync(srcPath, destPath);
1401
- if (entry.name.endsWith('.sh') || entry.name.endsWith('.mjs')) {
1402
- fs.chmodSync(destPath, '755');
1403
- }
1404
- result.created.files.push(`.claude/helpers/${relPath}`);
1405
- }
1406
- else {
1407
- result.skipped.push(`.claude/helpers/${relPath}`);
1408
- }
1409
- }
1410
- }
1411
- };
1412
- copyRecursive(sourceHelpersDir, helpersDir, '');
1413
- const geminiHelpersDir = path.join(targetDir, '.gemini', 'helpers');
1414
- copyRecursive(sourceHelpersDir, geminiHelpersDir, '');
1415
- }
1416
- // Always run the fallback generator too — it only fills in files still missing
1417
- // after the source copy above (it no-ops on anything the copy already wrote).
1418
- // Without this, a source dir that's present but incomplete (e.g. missing
1419
- // auto-memory-hook.mjs) silently ships a project wired to hooks that reference
1420
- // a file that was never installed.
1421
- const helpers = Object.fromEntries(Object.entries(INIT_FALLBACK_HELPERS).map(([name, generate]) => [name, generate()]));
1422
- for (const [name, content] of Object.entries(helpers)) {
1423
- const filePath = path.join(helpersDir, name);
1424
- // If the source dir has this file, copyRecursive above already applied
1425
- // the correct (force-aware) copy — never let this generated fallback
1426
- // clobber it with a bare-bones stub. Only step in when source truly
1427
- // doesn't have the file, regardless of `force`.
1428
- const inSource = !!(sourceHelpersDir && fs.existsSync(path.join(sourceHelpersDir, name)));
1429
- if (inSource)
1430
- continue;
1431
- if (!fs.existsSync(filePath) || options.force) {
1432
- atomicWriteFile(filePath, content);
1433
- // Make shell scripts executable
1434
- if (!name.endsWith('.js')) {
1435
- fs.chmodSync(filePath, '755');
1436
- }
1437
- result.created.files.push(`.claude/helpers/${name}`);
1438
- }
1439
- else {
1440
- result.skipped.push(`.claude/helpers/${name}`);
1441
- }
1442
- }
1443
- }
1444
- /**
1445
- * Find source .claude directory for statusline files
1446
- */
1447
- function findSourceClaudeDir(sourceBaseDir) {
1448
- const possiblePaths = [];
1449
- // If explicit source base directory is provided, check it first
1450
- if (sourceBaseDir) {
1451
- possiblePaths.push(path.join(sourceBaseDir, '.claude'));
1452
- }
1453
- // IMPORTANT: Check the package's own .claude directory
1454
- // Go up 3 levels: dist/src/init -> dist/src -> dist -> root
1455
- const packageRoot = path.resolve(__dirname, '..', '..', '..');
1456
- const packageClaude = path.join(packageRoot, '.claude');
1457
- if (fs.existsSync(packageClaude)) {
1458
- possiblePaths.unshift(packageClaude); // Add to beginning (highest priority)
1459
- }
1460
- // From dist/src/init -> go up to project root
1461
- let currentDir = __dirname;
1462
- for (let i = 0; i < 10; i++) {
1463
- const parentDir = path.dirname(currentDir);
1464
- const claudePath = path.join(parentDir, '.claude');
1465
- if (fs.existsSync(claudePath)) {
1466
- possiblePaths.push(claudePath);
1467
- }
1468
- currentDir = parentDir;
1469
- }
1470
- for (const p of possiblePaths) {
1471
- if (fs.existsSync(p)) {
1472
- return p;
1473
- }
1474
- }
1475
- return null;
1476
- }
1477
- /**
1478
- * Write statusline configuration
1479
- */
1480
- async function writeStatusline(targetDir, options, result) {
1481
- const claudeDir = path.join(targetDir, '.claude');
1482
- const helpersDir = path.join(targetDir, '.claude', 'helpers');
1483
- // Find source .claude directory (works for npm package and local dev)
1484
- const sourceClaudeDir = findSourceClaudeDir(options.sourceBaseDir);
1485
- // Try to copy existing advanced statusline files from source
1486
- const advancedStatuslineFiles = [
1487
- { src: 'statusline.sh', dest: 'statusline.sh', dir: claudeDir },
1488
- { src: 'statusline.mjs', dest: 'statusline.mjs', dir: claudeDir },
1489
- ];
1490
- if (sourceClaudeDir) {
1491
- for (const file of advancedStatuslineFiles) {
1492
- const sourcePath = path.join(sourceClaudeDir, file.src);
1493
- const destPath = path.join(file.dir, file.dest);
1494
- if (fs.existsSync(sourcePath)) {
1495
- if (!fs.existsSync(destPath) || options.force) {
1496
- fs.copyFileSync(sourcePath, destPath);
1497
- // Make shell scripts and mjs executable
1498
- if (file.src.endsWith('.sh') || file.src.endsWith('.mjs')) {
1499
- fs.chmodSync(destPath, '755');
1500
- }
1501
- result.created.files.push(`.claude/${file.dest}`);
1502
- }
1503
- else {
1504
- result.skipped.push(`.claude/${file.dest}`);
1505
- }
1506
- }
1507
- }
1508
- }
1509
- // ALWAYS generate statusline.cjs — the generated version includes
1510
- // vectors/size, tests, ADRs, hooks, and integration stats that the
1511
- // pre-installed static copy in the npm package lacks.
1512
- // This must overwrite any copy from writeHelpers() which copies the legacy file.
1513
- const statuslineScript = generateStatuslineScript(options);
1514
- const statuslinePath = path.join(helpersDir, 'statusline.cjs');
1515
- atomicWriteFile(statuslinePath, statuslineScript);
1516
- result.created.files.push('.claude/helpers/statusline.cjs');
1517
- }
1518
- /**
1519
- * Write runtime configuration (.monomind/)
1520
- */
1521
- async function writeRuntimeConfig(targetDir, options, result) {
1522
- const configPath = path.join(targetDir, '.monomind', 'config.yaml');
1523
- if (fs.existsSync(configPath) && !options.force) {
1524
- result.skipped.push('.monomind/config.yaml');
1525
- return;
1526
- }
1527
- const config = `# Monomind Runtime Configuration
1528
- # Generated: ${new Date().toISOString()}
1529
-
1530
- version: "3.0.0"
1531
-
1532
- swarm:
1533
- topology: ${options.runtime.topology}
1534
- maxAgents: ${options.runtime.maxAgents}
1535
- autoScale: true
1536
- coordinationStrategy: consensus
1537
-
1538
- memory:
1539
- backend: ${options.runtime.memoryBackend}
1540
- enableHNSW: ${options.runtime.enableHNSW}
1541
- persistPath: .monomind/data
1542
- cacheSize: 100
1543
- # ADR-049: Self-Learning Memory
1544
- learningBridge:
1545
- enabled: ${options.runtime.enableLearningBridge ?? options.runtime.enableNeural}
1546
- confidenceDecayRate: 0.005
1547
- accessBoostAmount: 0.03
1548
- consolidationThreshold: 10
1549
- agentScopes:
1550
- enabled: ${options.runtime.enableAgentScopes ?? true}
1551
- defaultScope: project
1552
-
1553
- neural:
1554
- enabled: ${options.runtime.enableNeural}
1555
- modelPath: .monomind/neural
1556
-
1557
- hooks:
1558
- enabled: true
1559
- autoExecute: true
1560
-
1561
- mcp:
1562
- autoStart: ${options.mcp.autoStart}
1563
- port: ${options.mcp.port}
1564
- `;
1565
- atomicWriteFile(configPath, config);
1566
- result.created.files.push('.monomind/config.yaml');
1567
- // Write .monomind/.gitignore — commit config/knowledge/metrics, exclude sensitive data
1568
- const gitignorePath = path.join(targetDir, '.monomind', '.gitignore');
1569
- const gitignore = `# Monomind — exclude files that may contain secrets or sensitive prompt data
1570
- # Sessions contain conversation history (prompts, code snippets, user data)
1571
- sessions/
1572
- # Security scan results may expose vulnerability details
1573
- security/
1574
- # Temporary and machine-specific files
1575
- *.tmp
1576
- *.log
1577
- daemon.pid
1578
- # Never commit credentials or keys
1579
- *.key
1580
- *.token
1581
- *.secret
1582
- .env
1583
- `;
1584
- if (!fs.existsSync(gitignorePath) || options.force) {
1585
- atomicWriteFile(gitignorePath, gitignore);
1586
- result.created.files.push('.monomind/.gitignore');
1587
- }
1588
- // Ensure the project-level .gitignore does NOT blanket-ignore .monomind/
1589
- // A blanket ignore prevents config, metrics, and knowledge graph from being committed.
1590
- // We remove any bare `.monomind/` or `**/.monomind/` lines and add specific excludes instead.
1591
- const projectGitignorePath = path.join(targetDir, '.gitignore');
1592
- if (fs.existsSync(projectGitignorePath) && fs.statSync(projectGitignorePath).size <= MAX_EXEC_FILE_BYTES) {
1593
- const existing = fs.readFileSync(projectGitignorePath, 'utf-8');
1594
- const blanketPattern = /^(\*\*\/)?\.monomind\/?\s*$/gm;
1595
- if (blanketPattern.test(existing)) {
1596
- const fixed = existing
1597
- .split('\n')
1598
- .filter(line => !/^(\*\*\/)?\.monomind\/?\s*$/.test(line))
1599
- .join('\n');
1600
- const specificExcludes = [
1601
- '# monomind runtime — exclude sensitive and machine-specific data',
1602
- '.monomind/sessions/',
1603
- '.monomind/security/',
1604
- '.monomind/*.tmp',
1605
- '.monomind/*.log',
1606
- '.monomind/daemon.pid',
1607
- '.monomind/*.db',
1608
- '.monomind/*.db-wal',
1609
- '.monomind/*.db-shm',
1610
- ].join('\n');
1611
- atomicWriteFile(projectGitignorePath, fixed.trimEnd() + '\n' + specificExcludes + '\n');
1612
- result.updated.push('.gitignore (replaced blanket .monomind/ ignore with specific excludes)');
1613
- }
1614
- }
1615
- // Write CAPABILITIES.md with full system overview
1616
- await writeCapabilitiesDoc(targetDir, options, result);
1617
- }
1618
- /**
1619
- * Write initial metrics files for statusline
1620
- * Creates baseline data so statusline shows meaningful state instead of all zeros
1621
- */
1622
- async function writeInitialMetrics(targetDir, options, result) {
1623
- const metricsDir = path.join(targetDir, '.monomind', 'metrics');
1624
- const learningDir = path.join(targetDir, '.monomind', 'learning');
1625
- const securityDir = path.join(targetDir, '.monomind', 'security');
1626
- // Ensure directories exist
1627
- for (const dir of [metricsDir, learningDir, securityDir]) {
1628
- if (!fs.existsSync(dir)) {
1629
- fs.mkdirSync(dir, { recursive: true });
1630
- }
1631
- }
1632
- // Create initial v1-progress.json
1633
- const progressPath = path.join(metricsDir, 'v1-progress.json');
1634
- if (!fs.existsSync(progressPath) || options.force) {
1635
- const progress = {
1636
- version: '3.0.0',
1637
- initialized: new Date().toISOString(),
1638
- domains: {
1639
- completed: 0,
1640
- total: 5,
1641
- status: 'INITIALIZING'
1642
- },
1643
- ddd: {
1644
- progress: 0,
1645
- modules: 0,
1646
- totalFiles: 0,
1647
- totalLines: 0
1648
- },
1649
- swarm: {
1650
- activeAgents: 0,
1651
- maxAgents: options.runtime.maxAgents,
1652
- topology: options.runtime.topology
1653
- },
1654
- learning: {
1655
- status: 'READY',
1656
- patternsLearned: 0,
1657
- sessionsCompleted: 0
1658
- },
1659
- _note: 'Metrics will update as you use Monomind (workers refresh at session start).'
1660
- };
1661
- atomicWriteFile(progressPath, JSON.stringify(progress, null, 2));
1662
- result.created.files.push('.monomind/metrics/v1-progress.json');
1663
- }
1664
- // Create initial swarm-activity.json
1665
- const activityPath = path.join(metricsDir, 'swarm-activity.json');
1666
- if (!fs.existsSync(activityPath) || options.force) {
1667
- const activity = {
1668
- timestamp: new Date().toISOString(),
1669
- processes: {
1670
- mcp_server: 0,
1671
- estimated_agents: 0
1672
- },
1673
- swarm: {
1674
- active: false,
1675
- agent_count: 0,
1676
- coordination_active: false
1677
- },
1678
- integration: {
1679
- mcp_active: false
1680
- },
1681
- _initialized: true
1682
- };
1683
- atomicWriteFile(activityPath, JSON.stringify(activity, null, 2));
1684
- result.created.files.push('.monomind/metrics/swarm-activity.json');
1685
- }
1686
- // Create initial learning.json
1687
- const learningPath = path.join(metricsDir, 'learning.json');
1688
- if (!fs.existsSync(learningPath) || options.force) {
1689
- const learning = {
1690
- initialized: new Date().toISOString(),
1691
- routing: {
1692
- accuracy: 0,
1693
- decisions: 0
1694
- },
1695
- patterns: {
1696
- shortTerm: 0,
1697
- longTerm: 0,
1698
- quality: 0
1699
- },
1700
- sessions: {
1701
- total: 0,
1702
- current: null
1703
- },
1704
- _note: 'Intelligence grows as you use Monomind'
1705
- };
1706
- atomicWriteFile(learningPath, JSON.stringify(learning, null, 2));
1707
- result.created.files.push('.monomind/metrics/learning.json');
1708
- }
1709
- // Create initial audit-status.json
1710
- const auditPath = path.join(securityDir, 'audit-status.json');
1711
- if (!fs.existsSync(auditPath) || options.force) {
1712
- const audit = {
1713
- initialized: new Date().toISOString(),
1714
- status: 'PENDING',
1715
- cvesFixed: 0,
1716
- totalCves: 3,
1717
- lastScan: null,
1718
- _note: 'Run: npx monomind@latest security scan'
1719
- };
1720
- atomicWriteFile(auditPath, JSON.stringify(audit, null, 2));
1721
- result.created.files.push('.monomind/security/audit-status.json');
1722
- }
1723
- }
1724
- /**
1725
- * Write CAPABILITIES.md - comprehensive overview of all Monomind features
1726
- */
1727
- async function writeCapabilitiesDoc(targetDir, options, result) {
1728
- const capabilitiesPath = path.join(targetDir, '.monomind', 'CAPABILITIES.md');
1729
- if (fs.existsSync(capabilitiesPath) && !options.force) {
1730
- result.skipped.push('.monomind/CAPABILITIES.md');
1731
- return;
1732
- }
1733
- const hooksAvailable = _isOptionalPackageResolvable('@monoes/hooks');
1734
- const capabilities = `# Monomind - Complete Capabilities Reference
1735
- > Generated: ${new Date().toISOString()}
1736
- > Full documentation: https://github.com/monoes/monomind
1737
-
1738
- ## 📋 Table of Contents
1739
-
1740
- 1. [Overview](#overview)
1741
- 2. [Swarm Orchestration](#swarm-orchestration)
1742
- 3. [Available Agents (60+)](#available-agents)
1743
- 4. [CLI Commands](#cli-commands)
1744
- 5. [Hooks System (29 Hook Subcommands + 15 Background Workers)](#hooks-system)
1745
- 6. [Memory & Intelligence](#memory--intelligence)
1746
- 7. [Hive-Mind Consensus](#hive-mind-consensus)
1747
- 8. [Performance Targets](#performance-targets)
1748
- 9. [Integration Ecosystem](#integration-ecosystem)
1749
-
1750
- ---
1751
-
1752
- ## Overview
1753
-
1754
- Monomind is a domain-driven design architecture for multi-agent AI coordination with:
1755
-
1756
- - **15-Agent Swarm Coordination** with hierarchical and mesh topologies
1757
- - **ANN Vector Search** - indexed pattern retrieval via SQLite (better-sqlite3, sql.js WASM fallback)
1758
- - **Keyword Routing** - deterministic task→agent routing with outcome measurement
1759
- - **Byzantine Fault Tolerance** - Queen-led consensus mechanisms
1760
- - **MCP Server Integration** - Model Context Protocol support
1761
-
1762
- ### Current Configuration
1763
- | Setting | Value |
1764
- |---------|-------|
1765
- | Topology | ${options.runtime.topology} |
1766
- | Max Agents | ${options.runtime.maxAgents} |
1767
- | Memory Backend | ${options.runtime.memoryBackend} |
1768
- | HNSW Indexing | ${options.runtime.enableHNSW ? 'Enabled' : 'Disabled'} |
1769
- | Neural Learning | ${options.runtime.enableNeural ? 'Enabled' : 'Disabled'} |
1770
- | Learning | ${options.runtime.enableLearningBridge ? 'Enabled' : 'Disabled'} |
1771
- | Agent Scopes | ${options.runtime.enableAgentScopes ? 'Enabled (project/local/user)' : 'Disabled'} |
1772
-
1773
- ---
1774
-
1775
- ## Swarm Orchestration
1776
-
1777
- ### Topologies
1778
- | Topology | Description | Best For |
1779
- |----------|-------------|----------|
1780
- | \`hierarchical\` | Queen controls workers directly | Anti-drift, tight control |
1781
- | \`mesh\` | Fully connected peer network | Distributed tasks |
1782
- | \`hierarchical-mesh\` | V1 hybrid (recommended) | 10+ agents |
1783
- | \`ring\` | Circular communication | Sequential workflows |
1784
- | \`star\` | Central coordinator | Simple coordination |
1785
- | \`adaptive\` | Dynamic based on load | Variable workloads |
1786
-
1787
- ### Strategies
1788
- - \`balanced\` - Even distribution across agents
1789
- - \`specialized\` - Clear roles, no overlap (anti-drift)
1790
- - \`adaptive\` - Dynamic task routing
1791
-
1792
- ### Quick Commands
1793
- \`\`\`bash
1794
- # Initialize swarm
1795
- npx monomind@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized
1796
-
1797
- # Check status
1798
- npx monomind@latest swarm status
1799
-
1800
- # Monitor activity
1801
- npx monomind@latest swarm monitor
1802
- \`\`\`
1803
-
1804
- ---
1805
-
1806
- ## Available Agents
1807
-
1808
- ### Core Development (5)
1809
- \`coder\`, \`reviewer\`, \`tester\`, \`planner\`, \`researcher\`
1810
-
1811
- ### V1 Specialized (4)
1812
- \`security-architect\`, \`security-auditor\`, \`memory-specialist\`, \`performance-engineer\`
1813
-
1814
- ### Swarm Coordination (5)
1815
- \`hierarchical-coordinator\`, \`mesh-coordinator\`, \`adaptive-coordinator\`, \`collective-intelligence-coordinator\`, \`swarm-memory-manager\`
1816
-
1817
- ### Consensus & Distributed (7)
1818
- \`byzantine-coordinator\`, \`raft-manager\`, \`gossip-coordinator\`, \`consensus-builder\`, \`crdt-synchronizer\`, \`quorum-manager\`, \`security-manager\`
1819
-
1820
- ### Performance & Optimization (5)
1821
- \`perf-analyzer\`, \`performance-benchmarker\`, \`task-orchestrator\`, \`memory-coordinator\`, \`smart-agent\`
1822
-
1823
- ### GitHub & Repository (9)
1824
- \`github-modes\`, \`pr-manager\`, \`code-review-swarm\`, \`issue-tracker\`, \`release-manager\`, \`workflow-automation\`, \`project-board-sync\`, \`repo-architect\`, \`multi-repo-swarm\`
1825
-
1826
- ### Specialized Development (8)
1827
- \`backend-dev\`, \`mobile-dev\`, \`ml-developer\`, \`cicd-engineer\`, \`api-docs\`, \`system-architect\`, \`code-analyzer\`, \`base-template-generator\`
1828
-
1829
- ### Testing & Validation (2)
1830
- \`tdd-london-swarm\`, \`production-validator\`
1831
-
1832
- ### Agent Routing by Task
1833
- | Task Type | Recommended Agents | Topology |
1834
- |-----------|-------------------|----------|
1835
- | Bug Fix | researcher, coder, tester | mesh |
1836
- | New Feature | coordinator, architect, coder, tester, reviewer | hierarchical |
1837
- | Refactoring | architect, coder, reviewer | mesh |
1838
- | Performance | researcher, perf-engineer, coder | hierarchical |
1839
- | Security | security-architect, auditor, reviewer | hierarchical |
1840
- | Docs | researcher, api-docs | mesh |
1841
-
1842
- ---
1843
-
1844
- ## CLI Commands
1845
-
1846
- ### Core Commands
1847
- | Command | Subcommands | Description |
1848
- |---------|-------------|-------------|
1849
- | \`init\` | 5 | Project initialization |
1850
- | \`agent\` | 7 | Agent lifecycle management |
1851
- | \`swarm\` | 6 | Multi-agent coordination |
1852
- | \`memory\` | 12 | SQLite with ANN vector search |
1853
- | \`mcp\` | 9 | MCP server management |
1854
- | \`task\` | 5 | Task assignment |
1855
- | \`session\` | 6 | Session persistence |
1856
- | \`config\` | 7 | Configuration |
1857
- | \`status\` | 3 | System monitoring |
1858
- | \`hooks\` | 29 | Self-learning hooks + 15 background workers${hooksAvailable ? '' : ' (background workers unavailable in this install)'} |
1859
-
1860
- > Note: there is no \`hive-mind\`, \`workflow\`, \`neural\`, \`embeddings\`, \`claims\`, \`migrate\`, or \`process\` CLI command.
1861
- > Hive-Mind consensus (byzantine/raft/quorum) is available exclusively via MCP tools, not the CLI.
1862
- > Neural pattern learning was merged into \`hooks intelligence\`.
1863
-
1864
- ### Advanced Commands
1865
- | Command | Subcommands | Description |
1866
- |---------|-------------|-------------|
1867
- | \`security\` | 6 | Security scanning |
1868
- | \`performance\` | 4 | Profiling & benchmarks |
1869
- | \`providers\` | 4 | AI provider config |
1870
- | \`guidance\` | 1 | Governance gate setup |
1871
- | \`doctor\` | 1 | Health diagnostics |
1872
- | \`completions\` | 4 | Shell completions |
1873
-
1874
- ### Example Commands
1875
- \`\`\`bash
1876
- # Initialize
1877
- npx monomind@latest init --wizard
1878
-
1879
- # Spawn agent
1880
- npx monomind@latest agent spawn -t coder --name my-coder
1881
-
1882
- # Memory operations
1883
- npx monomind@latest memory store --key "pattern" --value "data" --namespace patterns
1884
- npx monomind@latest memory search --query "authentication"
1885
-
1886
- # Diagnostics
1887
- npx monomind@latest doctor --fix
1888
- \`\`\`
1889
-
1890
- ---
1891
-
1892
- ## Hooks System
1893
-
1894
- ### 29 Available Hook Subcommands${hooksAvailable ? '' : ' — background workers unavailable in this install (@monoes/hooks did not resolve)'}
1895
-
1896
- #### Core Hooks (6)
1897
- | Hook | Description |
1898
- |------|-------------|
1899
- | \`pre-edit\` | Context before file edits |
1900
- | \`post-edit\` | Record edit outcomes |
1901
- | \`pre-command\` | Risk assessment |
1902
- | \`post-command\` | Command metrics |
1903
- | \`pre-task\` | Task start + agent suggestions |
1904
- | \`post-task\` | Task completion learning |
1905
-
1906
- #### Session Hooks (4)
1907
- | Hook | Description |
1908
- |------|-------------|
1909
- | \`session-start\` | Start/restore session |
1910
- | \`session-end\` | Persist state |
1911
- | \`session-restore\` | Restore previous |
1912
- | \`notify\` | Cross-agent notifications |
1913
-
1914
- #### Intelligence Hooks (5)
1915
- | Hook | Description |
1916
- |------|-------------|
1917
- | \`route\` | Optimal agent routing |
1918
- | \`explain\` | Routing decisions |
1919
- | \`pretrain\` | Bootstrap intelligence |
1920
- | \`build-agents\` | Generate configs |
1921
- | \`transfer\` | Pattern transfer |
1922
-
1923
- #### Coverage Hooks (3)
1924
- | Hook | Description |
1925
- |------|-------------|
1926
- | \`coverage-route\` | Coverage-based routing |
1927
- | \`coverage-suggest\` | Improvement suggestions |
1928
- | \`coverage-gaps\` | Gap analysis |
1929
-
1930
- ### 15 Background Workers (@monoes/hooks, run in-process)
1931
- | Worker | Priority | Purpose |
1932
- |--------|----------|---------|
1933
- | \`performance\` | normal | Benchmark performance |
1934
- | \`health\` | high | System health monitoring |
1935
- | \`swarm\` | high | Swarm activity monitoring |
1936
- | \`git\` | normal | Branch/change tracking |
1937
- | \`learning\` | normal | Learning optimization |
1938
- | \`adr\` | low | ADR compliance |
1939
- | \`ddd\` | low | DDD progress |
1940
- | \`security\` | high | Secret/vulnerability scan |
1941
- | \`patterns\` | normal | Pattern consolidation |
1942
- | \`cache\` | background | Cache cleanup |
1943
- | \`progress\` | normal | Progress tracking |
1944
- | \`map\` | normal | Codebase mapping |
1945
- | \`audit\` | high | Security audit metrics |
1946
- | \`optimize\` | normal | Performance snapshot |
1947
- | \`consolidate\` | low | Memory consolidation |
1948
-
1949
- Metrics-producing workers (ddd, map, audit, optimize, consolidate) refresh at
1950
- session start when their output is >6h old; run on demand with
1951
- \`monomind hooks worker run <name>\`.
1952
-
1953
- ---
1954
-
1955
- ## Memory & Intelligence
1956
-
1957
- ### Intelligence System
1958
- - **Keyword routing**: Deterministic task→agent routing with outcome measurement
1959
- - **ANN pattern search**: Indexed vector search via SQLite
1960
- - **ReasoningBank**: Stores learned patterns and trajectories for retrieval
1961
- - **Int8 Quantization**: ~4x memory reduction for stored embeddings
1962
-
1963
- Routing and learning are JS-only — no native neural engine is required. Route
1964
- and command outcomes are recorded and scored so routing quality is measured.
1965
-
1966
- ### Self-Learning Memory (ADR-049)
1967
-
1968
- | Component | Status | Description |
1969
- |-----------|--------|-------------|
1970
- | **Learning** | ${options.runtime.enableLearningBridge ? '✅ Enabled' : '⏸ Disabled'} | Connects insights to the pattern store |
1971
- | **AgentMemoryScope** | ${options.runtime.enableAgentScopes ? '✅ Enabled' : '⏸ Disabled'} | 3-scope agent memory (project/local/user) |
1972
-
1973
- **Learning** — Insights trigger learning trajectories. Confidence evolves: +0.03 on access, -0.005/hour decay.
1974
-
1975
- **AgentMemoryScope** - Maps Claude Code 3-scope directories:
1976
- - \`project\`: \`<gitRoot>/.claude/agent-memory/<agent>/\`
1977
- - \`local\`: \`<gitRoot>/.claude/agent-memory-local/<agent>/\`
1978
- - \`user\`: \`~/.claude/agent-memory/<agent>/\`
1979
-
1980
- High-confidence insights (>0.8) can transfer between agents.
1981
-
1982
- ### Memory Commands
1983
- \`\`\`bash
1984
- # Store pattern
1985
- npx monomind@latest memory store --key "name" --value "data" --namespace patterns
1986
-
1987
- # Semantic search
1988
- npx monomind@latest memory search --query "authentication"
1989
-
1990
- # List entries
1991
- npx monomind@latest memory list --namespace patterns
1992
-
1993
- # Initialize database
1994
- npx monomind@latest memory init --force
1995
- \`\`\`
1996
-
1997
- ---
1998
-
1999
- ## Hive-Mind Consensus
2000
-
2001
- > **Experimental, MCP-only.** There is no \`hive-mind\` CLI command — this is
2002
- > single-process vote counting exposed exclusively via MCP tools
2003
- > (\`hive-mind-tools.ts\`), not distributed networking. Reach it through the
2004
- > MCP server (\`npx monomind@latest mcp start\`) once connected to an MCP client.
2005
-
2006
- ### Queen Types
2007
- | Type | Role |
2008
- |------|------|
2009
- | Strategic Queen | Long-term planning |
2010
- | Tactical Queen | Execution coordination |
2011
- | Adaptive Queen | Dynamic optimization |
2012
-
2013
- ### Worker Types (8)
2014
- \`researcher\`, \`coder\`, \`analyst\`, \`tester\`, \`architect\`, \`reviewer\`, \`optimizer\`, \`documenter\`
2015
-
2016
- ### Consensus Mechanisms
2017
- | Mechanism | Fault Tolerance | Status |
2018
- |-----------|-----------------|--------|
2019
- | \`byzantine\` / \`bft\` | f < n/3 faulty | Implemented (vote counting) |
2020
- | \`raft\` | f < n/2 failed | Implemented (vote counting) |
2021
- | \`quorum\` | Configurable | Implemented |
2022
- | \`gossip\` | Eventually consistent | Planned — not implemented, rejected by \`hive_mind_init\` |
2023
- | \`crdt\` | Conflict-free | Planned — not implemented, rejected by \`hive_mind_init\` |
2024
-
2025
- ---
2026
-
2027
- ## Performance Targets
2028
-
2029
- | Metric | Target | Status |
2030
- |--------|--------|--------|
2031
- | ANN Search | Indexed vector search | ✅ Implemented (SQLite) |
2032
- | Memory Reduction | 50-75% | ✅ Implemented (~4x via Int8 quantization) |
2033
- | Pattern Learning | Recorded + retrievable | ✅ Implemented (ReasoningBank) |
2034
- | MCP Response | <100ms | ✅ Achieved |
2035
- | CLI Startup | <500ms | ✅ Achieved |
2036
- | Graph Build (1k) | <200ms | ✅ 2.78ms (71.9x headroom) |
2037
- | PageRank (1k) | <100ms | ✅ 12.21ms (8.2x headroom) |
2038
- | Insight Recording | <5ms/each | ✅ 0.12ms (41x headroom) |
2039
- | Consolidation | <500ms | ✅ 0.26ms (1,955x headroom) |
2040
- | Knowledge Transfer | <100ms | ✅ 1.25ms (80x headroom) |
2041
-
2042
- ---
2043
-
2044
- ## Integration Ecosystem
2045
-
2046
- ### Integrated Packages
2047
- | Package | Version | Purpose |
2048
- |---------|---------|---------|
2049
- | better-sqlite3 (sql.js WASM fallback) | latest | SQLite vector database (ANN search) |
2050
-
2051
- ### Optional Integrations
2052
- | Package | Command |
2053
- |---------|---------|
2054
- | agentic-jujutsu | \`npx agentic-jujutsu@latest\` |
2055
-
2056
- ### MCP Server Setup
2057
- \`\`\`bash
2058
- # Add Monomind MCP
2059
- claude mcp add monomind -- npx -y monomind@latest mcp start
2060
- \`\`\`
2061
-
2062
- ---
2063
-
2064
- ## Quick Reference
2065
-
2066
- ### Essential Commands
2067
- \`\`\`bash
2068
- # Setup
2069
- npx monomind@latest init --wizard
2070
- npx monomind@latest doctor --fix
2071
-
2072
- # Swarm
2073
- npx monomind@latest swarm init --topology hierarchical --max-agents 8
2074
- npx monomind@latest swarm status
2075
-
2076
- # Agents
2077
- npx monomind@latest agent spawn -t coder
2078
- npx monomind@latest agent list
2079
-
2080
- # Memory
2081
- npx monomind@latest memory search --query "patterns"
2082
-
2083
- # Hooks
2084
- npx monomind@latest hooks pre-task --description "task"
2085
- npx monomind@latest hooks worker run optimize
2086
- \`\`\`
2087
-
2088
- ### File Structure
2089
- \`\`\`
2090
- .monomind/
2091
- ├── config.yaml # Runtime configuration
2092
- ├── CAPABILITIES.md # This file
2093
- ├── data/ # Memory storage
2094
- ├── logs/ # Operation logs
2095
- ├── sessions/ # Session state
2096
- ├── hooks/ # Custom hooks
2097
- ├── agents/ # Agent configs
2098
- └── workflows/ # Workflow templates
2099
- \`\`\`
2100
-
2101
- ---
2102
-
2103
- **Full Documentation**: https://github.com/monoes/monomind
2104
- **Issues**: https://github.com/monoes/monomind/issues
2105
- `;
2106
- atomicWriteFile(capabilitiesPath, capabilities);
2107
- result.created.files.push('.monomind/CAPABILITIES.md');
2108
- }
2109
- /**
2110
- * Write CLAUDE.md with swarm guidance
2111
- */
2112
- async function writeClaudeMd(targetDir, options, result) {
2113
- const claudeMdPath = path.join(targetDir, 'CLAUDE.md');
2114
- if (fs.existsSync(claudeMdPath) && !options.force) {
2115
- result.skipped.push('CLAUDE.md');
2116
- }
2117
- else {
2118
- // Determine template: explicit option > infer from components > 'standard'
2119
- const inferredTemplate = (!options.components.commands && !options.components.agents) ? 'minimal' : undefined;
2120
- const content = generateClaudeMd(options, inferredTemplate);
2121
- atomicWriteFile(claudeMdPath, content);
2122
- result.created.files.push('CLAUDE.md');
2123
- }
2124
- // Also write/append global ~/.claude/CLAUDE.md so monomind tools are used automatically (#1497)
2125
- const homeDir = process.env.HOME || process.env.USERPROFILE || '';
2126
- if (homeDir) {
2127
- const globalClaudeDir = path.join(homeDir, '.claude');
2128
- const globalClaudeMd = path.join(globalClaudeDir, 'CLAUDE.md');
2129
- const monomindBlock = [
2130
- '',
2131
- '# Monomind Integration (auto-generated by monomind init)',
2132
- 'When working on multi-file tasks or complex features, use ToolSearch to find and invoke monomind MCP tools.',
2133
- 'Key tools: memory_store, memory_search, hooks_route, swarm_init, agent_spawn.',
2134
- '**Code navigation**: ALWAYS call `mcp__monomind__monograph_query` BEFORE grep/rg/find for code exploration — it returns file path + line number from a pre-built knowledge graph. Call `mcp__monomind__monograph_suggest` with a task description for multi-file tasks. Only fall back to grep if monograph returns 0 results or the DB is not built.',
2135
- 'Check system-reminder tags for [INTELLIGENCE] pattern suggestions and [MONOGRAPH] context before starting work.',
2136
- '',
2137
- ].join('\n');
2138
- try {
2139
- if (!fs.existsSync(globalClaudeDir)) {
2140
- fs.mkdirSync(globalClaudeDir, { recursive: true });
2141
- }
2142
- if (fs.existsSync(globalClaudeMd) && fs.statSync(globalClaudeMd).size <= MAX_EXEC_FILE_BYTES) {
2143
- const existing = fs.readFileSync(globalClaudeMd, 'utf-8');
2144
- if (!existing.includes('Monomind Integration')) {
2145
- fs.appendFileSync(globalClaudeMd, monomindBlock);
2146
- result.created.files.push('~/.claude/CLAUDE.md (appended monomind block)');
2147
- }
2148
- else if (!existing.includes('monograph_query')) {
2149
- // Upgrade existing block to include monograph instructions
2150
- const updated = existing.replace(/# Monomind Integration[^\n]*\n(?:(?!^#).+\n)*/m, monomindBlock.trimStart() + '\n');
2151
- atomicWriteFile(globalClaudeMd, updated);
2152
- result.created.files.push('~/.claude/CLAUDE.md (upgraded monomind block)');
2153
- }
2154
- }
2155
- else {
2156
- atomicWriteFile(globalClaudeMd, monomindBlock.trimStart());
2157
- result.created.files.push('~/.claude/CLAUDE.md');
2158
- }
2159
- }
2160
- catch (e) {
2161
- // Non-critical — global CLAUDE.md is best-effort
2162
- if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
2163
- console.error('[writeClaudeMd] failed to write/append ~/.claude/CLAUDE.md:', e);
2164
- }
2165
- // Also inject the token-display hook into ~/.claude/settings.json
2166
- const globalSettingsPath = path.join(globalClaudeDir, 'settings.json');
2167
- try {
2168
- if (!fs.existsSync(globalClaudeDir)) {
2169
- fs.mkdirSync(globalClaudeDir, { recursive: true });
2170
- }
2171
- let globalSettings = {};
2172
- if (fs.existsSync(globalSettingsPath) && fs.statSync(globalSettingsPath).size <= MAX_EXEC_FILE_BYTES) {
2173
- try {
2174
- globalSettings = JSON.parse(fs.readFileSync(globalSettingsPath, 'utf-8'));
2175
- }
2176
- catch (e) {
2177
- // malformed JSON — start fresh
2178
- if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
2179
- console.error('[writeClaudeMd] ~/.claude/settings.json unparseable, starting fresh:', e);
2180
- }
2181
- }
2182
- // Inject SessionStart token hook if not already present
2183
- const hooks = globalSettings.hooks ?? {};
2184
- const sessionStartHooks = hooks['SessionStart'] ?? [];
2185
- const tokenHookCommand = 'npx --yes monomind@latest tokens today';
2186
- const alreadyPresent = sessionStartHooks.some(entry => Array.isArray(entry.hooks) && entry.hooks.some(h => h.command === tokenHookCommand));
2187
- if (!alreadyPresent) {
2188
- sessionStartHooks.push({
2189
- hooks: [{ type: 'command', command: tokenHookCommand, timeout: 10000 }],
2190
- });
2191
- hooks['SessionStart'] = sessionStartHooks;
2192
- globalSettings.hooks = hooks;
2193
- atomicWriteFile(globalSettingsPath, JSON.stringify(globalSettings, null, 2));
2194
- result.created.files.push('~/.claude/settings.json (added token hook)');
2195
- }
2196
- }
2197
- catch (e) {
2198
- // Non-critical — global settings hook is best-effort
2199
- if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
2200
- console.error('[writeClaudeMd] failed to inject token hook into ~/.claude/settings.json:', e);
2201
- }
2202
- }
2203
- }
2204
- /**
2205
- * Write Antigravity (agy) integration files:
2206
- * GEMINI.md — agent instructions read by agy
2207
- * .gemini/rules/monomind.md — workflow rules file
2208
- * .gemini/helpers/statusline.sh — shell wrapper for the agy status bar
2209
- * .gemini/settings.json — wires the statusline command into agy
2210
- */
2211
- async function writeGeminiFiles(targetDir, options, result) {
2212
- // GEMINI.md
2213
- const geminiMdPath = path.join(targetDir, 'GEMINI.md');
2214
- if (!fs.existsSync(geminiMdPath) || options.force) {
2215
- atomicWriteFile(geminiMdPath, generateGeminiMd(options));
2216
- result.created.files.push('GEMINI.md');
2217
- }
2218
- else {
2219
- result.skipped.push('GEMINI.md');
2220
- }
2221
- // .gemini/rules/monomind.md
2222
- const geminiRulesDir = path.join(targetDir, '.gemini', 'rules');
2223
- fs.mkdirSync(geminiRulesDir, { recursive: true });
2224
- const rulesPath = path.join(geminiRulesDir, 'monomind.md');
2225
- if (!fs.existsSync(rulesPath) || options.force) {
2226
- atomicWriteFile(rulesPath, generateGeminiRulesMd(options));
2227
- result.created.files.push('.gemini/rules/monomind.md');
2228
- }
2229
- else {
2230
- result.skipped.push('.gemini/rules/monomind.md');
2231
- }
2232
- // .gemini/helpers/statusline.sh
2233
- const geminiHelpersDir = path.join(targetDir, '.gemini', 'helpers');
2234
- fs.mkdirSync(geminiHelpersDir, { recursive: true });
2235
- const statuslineShPath = path.join(geminiHelpersDir, 'statusline.sh');
2236
- if (!fs.existsSync(statuslineShPath) || options.force) {
2237
- atomicWriteFile(statuslineShPath, generateStatuslineSh());
2238
- try {
2239
- fs.chmodSync(statuslineShPath, 0o755);
2240
- }
2241
- catch { /* ignore on Windows */ }
2242
- result.created.files.push('.gemini/helpers/statusline.sh');
2243
- }
2244
- else {
2245
- result.skipped.push('.gemini/helpers/statusline.sh');
2246
- }
2247
- // .gemini/settings.json — only write if not already present (user may have
2248
- // their own agy settings; never clobber on force either — we only add to it)
2249
- const geminiSettingsPath = path.join(targetDir, '.gemini', 'settings.json');
2250
- try {
2251
- let existing = {};
2252
- if (fs.existsSync(geminiSettingsPath) && fs.statSync(geminiSettingsPath).size <= MAX_EXEC_FILE_BYTES) {
2253
- existing = JSON.parse(fs.readFileSync(geminiSettingsPath, 'utf-8'));
2254
- }
2255
- if (!existing.statusLine) {
2256
- existing.statusLine = { type: 'command', command: '.gemini/helpers/statusline.sh' };
2257
- atomicWriteFile(geminiSettingsPath, JSON.stringify(existing, null, 2));
2258
- result.created.files.push('.gemini/settings.json (statusLine wired)');
2259
- }
2260
- else {
2261
- result.skipped.push('.gemini/settings.json (statusLine already configured)');
2262
- }
2263
- }
2264
- catch (e) {
2265
- result.errors.push(`writeGeminiFiles: failed to write .gemini/settings.json: ${e instanceof Error ? e.message : String(e)}`);
2266
- }
2267
- // Also update the global ~/.gemini/antigravity-cli/settings.json (best-effort)
2268
- const homeDir = process.env.HOME || process.env.USERPROFILE || '';
2269
- if (homeDir) {
2270
- const globalAgyDir = path.join(homeDir, '.gemini', 'antigravity-cli');
2271
- const globalAgySettings = path.join(globalAgyDir, 'settings.json');
2272
- const globalStatuslineSh = path.join(globalAgyDir, 'statusline.sh');
2273
- try {
2274
- // Only touch the global config when it already exists — i.e. the user
2275
- // actually runs agy. Creating the directory for non-agy users would be
2276
- // init mutating state outside the project for no benefit.
2277
- if (fs.existsSync(globalAgyDir)) {
2278
- // Write/overwrite the global statusline wrapper
2279
- if (!fs.existsSync(globalStatuslineSh) || options.force) {
2280
- atomicWriteFile(globalStatuslineSh, generateStatuslineSh());
2281
- try {
2282
- fs.chmodSync(globalStatuslineSh, 0o755);
2283
- }
2284
- catch { /* ignore */ }
2285
- result.created.files.push('~/.gemini/antigravity-cli/statusline.sh');
2286
- }
2287
- // Inject statusLine into global agy settings without clobbering existing keys
2288
- let globalSettings = {};
2289
- if (fs.existsSync(globalAgySettings) && fs.statSync(globalAgySettings).size <= MAX_EXEC_FILE_BYTES) {
2290
- try {
2291
- globalSettings = JSON.parse(fs.readFileSync(globalAgySettings, 'utf-8'));
2292
- }
2293
- catch { /* reset */ }
2294
- }
2295
- if (!globalSettings.statusLine) {
2296
- globalSettings.statusLine = {
2297
- type: 'command',
2298
- command: `${globalAgyDir}/statusline.sh`,
2299
- };
2300
- atomicWriteFile(globalAgySettings, JSON.stringify(globalSettings, null, 2));
2301
- result.created.files.push('~/.gemini/antigravity-cli/settings.json (statusLine wired)');
2302
- }
2303
- }
2304
- }
2305
- catch (e) {
2306
- // Non-critical — global agy settings is best-effort
2307
- if (process.env.DEBUG || process.env.MONOMIND_DEBUG) {
2308
- console.error('[writeGeminiFiles] failed to update global agy settings:', e);
2309
- }
2310
- }
2311
- }
2312
- }
2313
- /**
2314
- * Write opencode artifacts. ADDITIVE — only invoked when
2315
- * `components.opencode` is set. Never touches .claude/ or .gemini/.
2316
- *
2317
- * Tier 1: opencode.json (MCP server + permissions + instructions).
2318
- * Tier 2 (added next): AGENTS.md + .opencode/{agent,command,skills}/ converted
2319
- * from the Claude tree.
2320
- */
2321
- async function writeOpencodeFiles(targetDir, options, result) {
2322
- // opencode.json — write only if absent (or --force). Never clobber a user's
2323
- // hand-written config; mirror writeGeminiFiles' skip-if-exists policy.
2324
- const opencodeJsonPath = path.join(targetDir, 'opencode.json');
2325
- if (!fs.existsSync(opencodeJsonPath) || options.force) {
2326
- atomicWriteFile(opencodeJsonPath, generateOpencodeJson(options));
2327
- result.created.files.push('opencode.json');
2328
- }
2329
- else {
2330
- result.skipped.push('opencode.json');
2331
- }
2332
- // AGENTS.md — opencode's instructions file (CLAUDE.md equivalent).
2333
- const agentsMdPath = path.join(targetDir, 'AGENTS.md');
2334
- if (!fs.existsSync(agentsMdPath) || options.force) {
2335
- atomicWriteFile(agentsMdPath, generateAgentsMd());
2336
- result.created.files.push('AGENTS.md');
2337
- }
2338
- else {
2339
- result.skipped.push('AGENTS.md');
2340
- }
2341
- // Hook-shim plugin (Tier 3) — bridges monomind's gate handlers into
2342
- // opencode's tool.execute.before. .opencode/plugins/ (plural) per opencode docs.
2343
- const pluginDir = path.join(targetDir, '.opencode', 'plugins');
2344
- const pluginPath = path.join(pluginDir, 'monomind-hooks.ts');
2345
- if (!fs.existsSync(pluginPath) || options.force) {
2346
- fs.mkdirSync(pluginDir, { recursive: true });
2347
- atomicWriteFile(pluginPath, generateHooksPlugin());
2348
- result.created.files.push('.opencode/plugins/monomind-hooks.ts');
2349
- }
2350
- else {
2351
- result.skipped.push('.opencode/plugins/monomind-hooks.ts');
2352
- }
2353
- // /monomind-status command — the opencode equivalent of the Claude Code
2354
- // statusline (opencode has no custom statusbar UI). Runs statusline.cjs
2355
- // unchanged and reports a formatted summary.
2356
- const statusCmdPath = path.join(targetDir, '.opencode', 'command', 'monomind-status.md');
2357
- if (!fs.existsSync(statusCmdPath) || options.force) {
2358
- fs.mkdirSync(path.dirname(statusCmdPath), { recursive: true });
2359
- atomicWriteFile(statusCmdPath, generateStatusCommand());
2360
- result.created.files.push('.opencode/command/monomind-status.md');
2361
- }
2362
- else {
2363
- result.skipped.push('.opencode/command/monomind-status.md');
2364
- }
2365
- // Convert the .claude/{agents,commands,skills} tree that copyAgents/Skills/
2366
- // Commands just wrote into opencode shape. Reading from the target .claude/
2367
- // dir (not the package source) means only the user's selected subset is
2368
- // converted, and we never re-implement the MAP filtering logic.
2369
- const claudeDir = path.join(targetDir, '.claude');
2370
- let agentCount = 0, commandCount = 0, skillCount = 0;
2371
- const seenAgents = new Set();
2372
- // Agents → .opencode/agent/<name>.md (flattened, deduped by name)
2373
- const srcAgents = path.join(claudeDir, 'agents');
2374
- if (fs.existsSync(srcAgents)) {
2375
- const destAgents = path.join(targetDir, '.opencode', 'agent');
2376
- for (const rel of walkMdFiles(srcAgents)) {
2377
- const abs = path.join(srcAgents, rel);
2378
- if (!isLikelyUserFile(rel))
2379
- continue; // skip READMEs etc.
2380
- const src = fs.readFileSync(abs, 'utf-8');
2381
- const fallback = path.basename(rel, '.md');
2382
- const converted = convertAgentMd(src, fallback);
2383
- const name = extractFmName(converted) || fallback;
2384
- if (seenAgents.has(name))
2385
- continue;
2386
- seenAgents.add(name);
2387
- fs.mkdirSync(destAgents, { recursive: true });
2388
- atomicWriteFile(path.join(destAgents, `${name}.md`), converted);
2389
- agentCount++;
2390
- }
2391
- }
2392
- // Commands → .opencode/command/<category>-<name>.md (namespace preserved)
2393
- const srcCommands = path.join(claudeDir, 'commands');
2394
- if (fs.existsSync(srcCommands)) {
2395
- const destCommands = path.join(targetDir, '.opencode', 'command');
2396
- for (const rel of walkMdFiles(srcCommands)) {
2397
- const abs = path.join(srcCommands, rel);
2398
- if (!isLikelyUserFile(rel))
2399
- continue;
2400
- const segs = rel.split(path.sep);
2401
- const category = segs.length > 1 ? segs[0] : 'monomind';
2402
- const fileBase = path.basename(rel, '.md');
2403
- const src = fs.readFileSync(abs, 'utf-8');
2404
- const converted = convertCommandMd(src, category, fileBase);
2405
- fs.mkdirSync(destCommands, { recursive: true });
2406
- atomicWriteFile(path.join(destCommands, opencodeCommandFilename(category, fileBase)), converted);
2407
- commandCount++;
2408
- }
2409
- }
2410
- // Skills → .opencode/skills/<name>/SKILL.md (same shape)
2411
- const srcSkills = path.join(claudeDir, 'skills');
2412
- if (fs.existsSync(srcSkills)) {
2413
- for (const rel of walkMdFiles(srcSkills)) {
2414
- // rel looks like "<skillName>/SKILL.md"
2415
- const segs = rel.split(path.sep);
2416
- if (segs.length < 2 || segs[segs.length - 1] !== 'SKILL.md')
2417
- continue;
2418
- const skillName = segs[0];
2419
- const abs = path.join(srcSkills, rel);
2420
- const src = fs.readFileSync(abs, 'utf-8');
2421
- const converted = convertSkillMd(src, skillName);
2422
- const destDir = path.join(targetDir, '.opencode', 'skills', skillName);
2423
- fs.mkdirSync(destDir, { recursive: true });
2424
- atomicWriteFile(path.join(destDir, 'SKILL.md'), converted);
2425
- skillCount++;
2426
- }
2427
- }
2428
- if (agentCount)
2429
- result.created.files.push(`.opencode/agent/ (${agentCount} agents)`);
2430
- if (commandCount)
2431
- result.created.files.push(`.opencode/command/ (${commandCount} commands)`);
2432
- if (skillCount)
2433
- result.created.files.push(`.opencode/skills/ (${skillCount} skills)`);
2434
- }
2435
- /**
2436
- * Write Kimi Code artifacts. ADDITIVE — only invoked when
2437
- * `components.kimicode` is set. Never touches .claude/, .gemini/, .opencode/.
2438
- *
2439
- * Tier 1: .kimi-code/mcp.json (merged, never clobbered), AGENTS.md (skip-if-exists),
2440
- * .kimi-code/{agents,skills}/ converted from the Claude tree.
2441
- * Tier 2: .kimi-code/plugin/hooks/monomind-gate.mjs — stdin/exit-code bridge into
2442
- * the existing .claude/helpers gate handlers (kimi has no project-level
2443
- * hooks, so enforcement only activates via the Tier 3 plugin).
2444
- * Tier 3: .kimi-code/plugin/kimi.plugin.json + commands/ — installable via
2445
- * `/plugins install ./.kimi-code/plugin` for /monomind:* slash commands
2446
- * and auto-wired hooks.
2447
- */
2448
- async function writeKimiFiles(targetDir, options, result) {
2449
- const kimiDir = path.join(targetDir, '.kimi-code');
2450
- // .kimi-code/mcp.json — MERGE the monomind server into an existing file;
2451
- // never clobber the user's other servers. Even --force merges (it refreshes
2452
- // the monomind entry only) — a full overwrite would destroy unrelated
2453
- // servers the user configured. Unparseable existing file → skip.
2454
- const mcpJsonPath = path.join(kimiDir, 'mcp.json');
2455
- if (!fs.existsSync(mcpJsonPath)) {
2456
- fs.mkdirSync(kimiDir, { recursive: true });
2457
- atomicWriteFile(mcpJsonPath, generateKimiMcpJson(options));
2458
- result.created.files.push('.kimi-code/mcp.json');
2459
- }
2460
- else {
2461
- const current = fs.readFileSync(mcpJsonPath, 'utf-8');
2462
- const merged = mergeKimiMcpJson(current, options);
2463
- if (merged === null) {
2464
- result.skipped.push('.kimi-code/mcp.json (unparseable — not touched)');
2465
- }
2466
- else if (merged !== current) {
2467
- atomicWriteFile(mcpJsonPath, merged);
2468
- result.updated.push('.kimi-code/mcp.json (merged monomind server)');
2469
- }
2470
- else {
2471
- result.skipped.push('.kimi-code/mcp.json');
2472
- }
2473
- }
2474
- // AGENTS.md — kimi's workspace instructions file. Skip-if-exists, ALWAYS:
2475
- // the opencode target or a hand-written file may already provide one, and
2476
- // under --force the two generators would otherwise flip the file depending
2477
- // on write order. Users who want regeneration delete the file first —
2478
- // same never-clobber spirit as the mcp.json merge above.
2479
- const agentsMdPath = path.join(targetDir, 'AGENTS.md');
2480
- if (!fs.existsSync(agentsMdPath)) {
2481
- atomicWriteFile(agentsMdPath, generateKimiAgentsMd());
2482
- result.created.files.push('AGENTS.md');
2483
- }
2484
- else {
2485
- result.skipped.push('AGENTS.md');
2486
- }
2487
- // Convert the .claude/{agents,commands,skills} tree that copyAgents/Skills/
2488
- // Commands just wrote into kimi shape — same approach as writeOpencodeFiles:
2489
- // reading from the target .claude/ dir means only the user's selected subset
2490
- // is converted.
2491
- const claudeDir = path.join(targetDir, '.claude');
2492
- let agentCount = 0, commandCount = 0, skillCount = 0;
2493
- const seenAgents = new Set();
2494
- // Agents → .kimi-code/agents/<name>.md (flattened, deduped by name)
2495
- const srcAgents = path.join(claudeDir, 'agents');
2496
- if (fs.existsSync(srcAgents)) {
2497
- const destAgents = path.join(kimiDir, 'agents');
2498
- for (const rel of walkMdFiles(srcAgents)) {
2499
- const abs = path.join(srcAgents, rel);
2500
- if (!isLikelyUserFile(rel))
2501
- continue;
2502
- const src = fs.readFileSync(abs, 'utf-8');
2503
- const fallback = path.basename(rel, '.md');
2504
- const converted = convertKimiAgentMd(src, fallback);
2505
- const name = extractFmName(converted) || fallback;
2506
- if (seenAgents.has(name))
2507
- continue;
2508
- seenAgents.add(name);
2509
- fs.mkdirSync(destAgents, { recursive: true });
2510
- atomicWriteFile(path.join(destAgents, `${name}.md`), converted);
2511
- agentCount++;
2512
- }
2513
- }
2514
- // Skills → .kimi-code/skills/<name>/SKILL.md (same shape).
2515
- // Track the directory names written here so command flow-skills below never
2516
- // overwrite a REAL skill that happens to share the <category>-<name> slug
2517
- // (e.g. a skill dir "mastermind-debug" vs a command "mastermind/debug.md").
2518
- const writtenSkillDirs = new Set();
2519
- const srcSkills = path.join(claudeDir, 'skills');
2520
- if (fs.existsSync(srcSkills)) {
2521
- for (const rel of walkMdFiles(srcSkills)) {
2522
- const segs = rel.split(path.sep);
2523
- if (segs.length < 2 || segs[segs.length - 1] !== 'SKILL.md')
2524
- continue;
2525
- const skillName = segs[0];
2526
- const abs = path.join(srcSkills, rel);
2527
- const src = fs.readFileSync(abs, 'utf-8');
2528
- const converted = convertKimiSkillMd(src, skillName);
2529
- const destDir = path.join(kimiDir, 'skills', skillName);
2530
- fs.mkdirSync(destDir, { recursive: true });
2531
- atomicWriteFile(path.join(destDir, 'SKILL.md'), converted);
2532
- writtenSkillDirs.add(skillName);
2533
- skillCount++;
2534
- }
2535
- }
2536
- // Commands → TWO outputs from the same source pass:
2537
- // (a) .kimi-code/skills/<cat>-<name>/SKILL.md as type:flow skills — the only
2538
- // project-level invocable-command mechanism kimi has (/skill:<name>).
2539
- // (b) .kimi-code/plugin/commands/<cat>-<name>.md for the Tier 3 plugin
2540
- // (/monomind:<name> slash commands once installed).
2541
- const srcCommands = path.join(claudeDir, 'commands');
2542
- const pluginDir = path.join(kimiDir, 'plugin');
2543
- // Always create plugin/commands/ — the manifest declares ./commands/ and a
2544
- // missing path surfaces as a plugin diagnostic in kimi (e.g. --skip-claude
2545
- // runs where no commands were converted).
2546
- const destPluginCommands = path.join(pluginDir, 'commands');
2547
- fs.mkdirSync(destPluginCommands, { recursive: true });
2548
- if (fs.existsSync(srcCommands)) {
2549
- for (const rel of walkMdFiles(srcCommands)) {
2550
- const abs = path.join(srcCommands, rel);
2551
- if (!isLikelyUserFile(rel))
2552
- continue;
2553
- const segs = rel.split(path.sep);
2554
- const category = segs.length > 1 ? segs[0] : 'monomind';
2555
- const fileBase = path.basename(rel, '.md');
2556
- const src = fs.readFileSync(abs, 'utf-8');
2557
- // (a) flow skill — skipped when a real skill already owns this directory
2558
- // name (real skills win; the plugin command below still provides the
2559
- // command under /monomind:<name>).
2560
- const flowSkill = convertKimiCommandToFlowSkill(src, category, fileBase);
2561
- const flowName = extractFmName(flowSkill) || `${category}-${fileBase}`;
2562
- if (writtenSkillDirs.has(flowName)) {
2563
- result.skipped.push(`.kimi-code/skills/${flowName}/ (command flow-skill conflicts with a real skill — plugin command kept)`);
2564
- }
2565
- else {
2566
- const flowDir = path.join(kimiDir, 'skills', flowName);
2567
- fs.mkdirSync(flowDir, { recursive: true });
2568
- atomicWriteFile(path.join(flowDir, 'SKILL.md'), flowSkill);
2569
- writtenSkillDirs.add(flowName);
2570
- skillCount++;
2571
- }
2572
- // (b) plugin command
2573
- const pluginCmd = convertKimiPluginCommandMd(src, category, fileBase);
2574
- fs.mkdirSync(destPluginCommands, { recursive: true });
2575
- atomicWriteFile(path.join(destPluginCommands, kimiCommandFilename(category, fileBase)), pluginCmd);
2576
- commandCount++;
2577
- }
2578
- }
2579
- // Tier 2: hook gate bridge script.
2580
- const hooksDir = path.join(pluginDir, 'hooks');
2581
- const gatePath = path.join(hooksDir, 'monomind-gate.mjs');
2582
- if (!fs.existsSync(gatePath) || options.force) {
2583
- fs.mkdirSync(hooksDir, { recursive: true });
2584
- atomicWriteFile(gatePath, generateKimiGateScript());
2585
- result.created.files.push('.kimi-code/plugin/hooks/monomind-gate.mjs');
2586
- }
2587
- else {
2588
- result.skipped.push('.kimi-code/plugin/hooks/monomind-gate.mjs');
2589
- }
2590
- // Tier 3: plugin manifest.
2591
- const manifestPath = path.join(pluginDir, 'kimi.plugin.json');
2592
- if (!fs.existsSync(manifestPath) || options.force) {
2593
- fs.mkdirSync(pluginDir, { recursive: true });
2594
- atomicWriteFile(manifestPath, generateKimiPluginManifest(options));
2595
- result.created.files.push('.kimi-code/plugin/kimi.plugin.json');
2596
- }
2597
- else {
2598
- result.skipped.push('.kimi-code/plugin/kimi.plugin.json');
2599
- }
2600
- if (agentCount)
2601
- result.created.files.push(`.kimi-code/agents/ (${agentCount} agents)`);
2602
- if (skillCount)
2603
- result.created.files.push(`.kimi-code/skills/ (${skillCount} skills)`);
2604
- if (commandCount)
2605
- result.created.files.push(`.kimi-code/plugin/commands/ (${commandCount} commands)`);
2606
- // Statusline — the footer under kimi's chatbox. Lives in the USER's
2607
- // ~/.kimi-code/ (kimi has no project-level statusline config), gated on
2608
- // that directory already existing (i.e. the user actually runs kimi —
2609
- // init must not create global state for non-kimi users). The tui.toml
2610
- // merge never clobbers an existing [status_line].command.
2611
- const homeDir = process.env.HOME || process.env.USERPROFILE || '';
2612
- if (homeDir) {
2613
- const kimiHome = path.join(homeDir, '.kimi-code');
2614
- if (fs.existsSync(kimiHome)) {
2615
- try {
2616
- const statuslineShPath = path.join(kimiHome, 'statusline.sh');
2617
- if (!fs.existsSync(statuslineShPath) || options.force) {
2618
- atomicWriteFile(statuslineShPath, generateKimiStatuslineSh());
2619
- try {
2620
- fs.chmodSync(statuslineShPath, 0o755);
2621
- }
2622
- catch { /* ignore on Windows */ }
2623
- result.created.files.push('~/.kimi-code/statusline.sh');
2624
- }
2625
- else {
2626
- result.skipped.push('~/.kimi-code/statusline.sh');
2627
- }
2628
- const tuiTomlPath = path.join(kimiHome, 'tui.toml');
2629
- const relCommand = '~/.kimi-code/statusline.sh';
2630
- const existingToml = fs.existsSync(tuiTomlPath) ? fs.readFileSync(tuiTomlPath, 'utf-8') : '';
2631
- const mergedToml = mergeKimiTuiTomlStatusline(existingToml, relCommand);
2632
- if (mergedToml !== existingToml) {
2633
- atomicWriteFile(tuiTomlPath, mergedToml);
2634
- result.created.files.push('~/.kimi-code/tui.toml ([status_line].command wired)');
2635
- }
2636
- else {
2637
- result.skipped.push('~/.kimi-code/tui.toml (status_line.command already set)');
2638
- }
2639
- }
2640
- catch (e) {
2641
- // Best-effort, like the agy global settings — a statusline failure
2642
- // must never fail init.
2643
- if (process.env.DEBUG || process.env.MONOMIND_DEBUG) {
2644
- console.error('[writeKimiFiles] failed to wire kimi statusline:', e);
2645
- }
2646
- }
2647
- }
2648
- }
2649
- }
2650
- /** Recursively collect .md files under dir, returned relative to dir. */
2651
- function walkMdFiles(dir) {
2652
- const out = [];
2653
- const visit = (d, prefix) => {
2654
- let entries;
2655
- try {
2656
- entries = fs.readdirSync(d, { withFileTypes: true });
2657
- }
2658
- catch {
2659
- return;
2660
- }
2661
- for (const e of entries) {
2662
- const rel = prefix ? `${prefix}${path.sep}${e.name}` : e.name;
2663
- if (e.isDirectory())
2664
- visit(path.join(d, e.name), rel);
2665
- else if (e.isFile() && /\.md$/i.test(e.name))
2666
- out.push(rel);
2667
- }
2668
- };
2669
- visit(dir, '');
2670
- return out;
2671
- }
2672
- /** Skip READMEs and other non-definition markdown. */
2673
- function isLikelyUserFile(rel) {
2674
- const base = path.basename(rel).toLowerCase();
2675
- if (base === 'readme.md' || base === 'readme')
2676
- return false;
2677
- return true;
2678
- }
2679
- /** Pull the `name:` scalar from a frontmatter block (best-effort). */
2680
- function extractFmName(md) {
2681
- const m = md.match(/^---\r?\n[\s\S]*?\r?\n---/);
2682
- if (!m)
2683
- return null;
2684
- const fm = m[0];
2685
- const nm = fm.match(/^name\s*:\s*(.+?)\s*$/m);
2686
- return nm ? nm[1].replace(/^["']|["']$/g, '') : null;
2687
- }
2688
- /**
2689
- * Find source directory for skills/commands/agents
2690
- */
2691
- function findSourceDir(type, sourceBaseDir) {
2692
- // Build list of possible paths to check
2693
- const possiblePaths = [];
2694
- // If explicit source base directory is provided, use it first
2695
- if (sourceBaseDir) {
2696
- possiblePaths.push(path.join(sourceBaseDir, '.claude', type));
2697
- }
2698
- // IMPORTANT: Check the package's own .claude directory first
2699
- // This is the primary path when running as an npm package
2700
- // __dirname is typically /path/to/node_modules/@monomind/cli/dist/src/init
2701
- // We need to go up 3 levels to reach the package root (dist/src/init -> dist/src -> dist -> root)
2702
- const packageRoot = path.resolve(__dirname, '..', '..', '..');
2703
- const packageDotClaude = path.join(packageRoot, '.claude', type);
2704
- if (fs.existsSync(packageDotClaude)) {
2705
- possiblePaths.unshift(packageDotClaude); // Add to beginning (highest priority)
2706
- }
2707
- // From dist/src/init -> go up to project root
2708
- const distPath = __dirname;
2709
- // Try to find the project root by looking for .claude directory
2710
- let currentDir = distPath;
2711
- for (let i = 0; i < 10; i++) {
2712
- const parentDir = path.dirname(currentDir);
2713
- const dotClaudePath = path.join(parentDir, '.claude', type);
2714
- if (fs.existsSync(dotClaudePath)) {
2715
- possiblePaths.push(dotClaudePath);
2716
- }
2717
- currentDir = parentDir;
2718
- }
2719
- // Also check relative to process.cwd() for development
2720
- const cwdBased = [
2721
- path.join(process.cwd(), '.claude', type),
2722
- path.join(process.cwd(), '..', '.claude', type),
2723
- path.join(process.cwd(), '..', '..', '.claude', type),
2724
- ];
2725
- possiblePaths.push(...cwdBased);
2726
- // Check v2 directory for agents
2727
- if (type === 'agents') {
2728
- possiblePaths.push(path.join(process.cwd(), 'v2', '.claude', type), path.join(process.cwd(), '..', 'v2', '.claude', type));
2729
- }
2730
- // Plugin directory
2731
- possiblePaths.push(path.join(process.cwd(), 'plugin', type), path.join(process.cwd(), '..', 'plugin', type));
2732
- for (const p of possiblePaths) {
2733
- if (fs.existsSync(p)) {
2734
- return p;
2735
- }
2736
- }
2737
- return null;
2738
- }
2739
- /**
2740
- * Copy directory recursively
2741
- */
2742
- function copyDirRecursive(src, dest) {
2743
- fs.mkdirSync(dest, { recursive: true });
2744
- const entries = fs.readdirSync(src, { withFileTypes: true });
2745
- for (const entry of entries) {
2746
- // Skip exFAT/macOS AppleDouble junk files (e.g. "._foo.js") so they don't
2747
- // get perpetuated into every newly-initialized project.
2748
- if (entry.name.startsWith('._'))
2749
- continue;
2750
- const srcPath = path.join(src, entry.name);
2751
- const destPath = path.join(dest, entry.name);
2752
- if (entry.isDirectory()) {
2753
- copyDirRecursive(srcPath, destPath);
2754
- }
2755
- else {
2756
- fs.copyFileSync(srcPath, destPath);
2757
- }
2758
- }
2759
- }
2760
- /**
2761
- * Count files with extension in directory
2762
- */
2763
- function countFiles(dir, ext) {
2764
- let count = 0;
2765
- const entries = fs.readdirSync(dir, { withFileTypes: true });
2766
- for (const entry of entries) {
2767
- const fullPath = path.join(dir, entry.name);
2768
- if (entry.isDirectory()) {
2769
- count += countFiles(fullPath, ext);
2770
- }
2771
- else if (entry.name.endsWith(ext)) {
2772
- count++;
2773
- }
2774
- }
2775
- return count;
2776
- }
2777
341
  /**
2778
342
  * Count enabled hooks
2779
343
  */
@@ -2813,7 +377,6 @@ function _registerMonomindProject(dir) {
2813
377
  }
2814
378
  }
2815
379
  catch (e) {
2816
- // Unparseable registry — proceeding with an empty list will overwrite it below, losing previously registered projects
2817
380
  if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
2818
381
  console.error('[_registerMonomindProject] ~/.monomind-projects.json unparseable, resetting:', e);
2819
382
  }
@@ -2867,7 +430,7 @@ export function findMonomindProjects(maxDepth = 3) {
2867
430
  if (fs.existsSync(marker)) {
2868
431
  found.add(dir);
2869
432
  return;
2870
- } // don't recurse into a monomind project
433
+ }
2871
434
  let entries;
2872
435
  try {
2873
436
  entries = fs.readdirSync(dir, { withFileTypes: true });