@monoes/monomindcli 2.8.3 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/.claude/helpers/auto-memory-hook.mjs +0 -0
  2. package/.claude/helpers/handlers/route-handler.cjs +12 -0
  3. package/.claude/helpers/handlers/session-restore-handler.cjs +28 -7
  4. package/.claude/helpers/hook-handler.cjs +0 -0
  5. package/.claude/helpers/utils/micro-agents.cjs +22 -0
  6. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +11 -6
  7. package/.claude/skills/monodesign/scripts/live-inject.mjs +20 -7
  8. package/.claude/skills/monodesign/scripts/live-server.mjs +38 -2
  9. package/LICENSE +191 -0
  10. package/README.md +8 -6
  11. package/dist/src/browser/dashboard/server.d.ts +5 -0
  12. package/dist/src/browser/dashboard/server.d.ts.map +1 -1
  13. package/dist/src/browser/dashboard/server.js +59 -4
  14. package/dist/src/browser/dashboard/server.js.map +1 -1
  15. package/dist/src/browser/dashboard/ui.html +18 -8
  16. package/dist/src/browser/workflow/store.d.ts.map +1 -1
  17. package/dist/src/browser/workflow/store.js +3 -2
  18. package/dist/src/browser/workflow/store.js.map +1 -1
  19. package/dist/src/capabilities/cap-documents.d.ts.map +1 -1
  20. package/dist/src/capabilities/cap-documents.js +14 -9
  21. package/dist/src/capabilities/cap-documents.js.map +1 -1
  22. package/dist/src/commands/design-palette.d.ts +5 -0
  23. package/dist/src/commands/design-palette.d.ts.map +1 -1
  24. package/dist/src/commands/design-palette.js +8 -5
  25. package/dist/src/commands/design-palette.js.map +1 -1
  26. package/dist/src/commands/doctor.d.ts.map +1 -1
  27. package/dist/src/commands/doctor.js +22 -18
  28. package/dist/src/commands/doctor.js.map +1 -1
  29. package/dist/src/commands/download-embeddings.d.ts +8 -0
  30. package/dist/src/commands/download-embeddings.d.ts.map +1 -0
  31. package/dist/src/commands/download-embeddings.js +34 -0
  32. package/dist/src/commands/download-embeddings.js.map +1 -0
  33. package/dist/src/commands/hooks.d.ts.map +1 -1
  34. package/dist/src/commands/hooks.js +14 -0
  35. package/dist/src/commands/hooks.js.map +1 -1
  36. package/dist/src/commands/index.d.ts.map +1 -1
  37. package/dist/src/commands/index.js +4 -0
  38. package/dist/src/commands/index.js.map +1 -1
  39. package/dist/src/commands/init-wizard.js +1 -1
  40. package/dist/src/commands/init-wizard.js.map +1 -1
  41. package/dist/src/commands/init.d.ts.map +1 -1
  42. package/dist/src/commands/init.js +48 -1
  43. package/dist/src/commands/init.js.map +1 -1
  44. package/dist/src/commands/monograph.d.ts.map +1 -1
  45. package/dist/src/commands/monograph.js +35 -1
  46. package/dist/src/commands/monograph.js.map +1 -1
  47. package/dist/src/commands/org-observe.d.ts +10 -0
  48. package/dist/src/commands/org-observe.d.ts.map +1 -1
  49. package/dist/src/commands/org-observe.js +195 -31
  50. package/dist/src/commands/org-observe.js.map +1 -1
  51. package/dist/src/commands/org.d.ts +1 -0
  52. package/dist/src/commands/org.d.ts.map +1 -1
  53. package/dist/src/commands/org.js +139 -3
  54. package/dist/src/commands/org.js.map +1 -1
  55. package/dist/src/commands/route.d.ts +1 -9
  56. package/dist/src/commands/route.d.ts.map +1 -1
  57. package/dist/src/commands/route.js +42 -65
  58. package/dist/src/commands/route.js.map +1 -1
  59. package/dist/src/commands/security-cve.d.ts.map +1 -1
  60. package/dist/src/commands/security-cve.js +2 -1
  61. package/dist/src/commands/security-cve.js.map +1 -1
  62. package/dist/src/index.d.ts +0 -10
  63. package/dist/src/index.d.ts.map +1 -1
  64. package/dist/src/index.js +4 -15
  65. package/dist/src/index.js.map +1 -1
  66. package/dist/src/init/copy-assets.d.ts +17 -0
  67. package/dist/src/init/copy-assets.d.ts.map +1 -0
  68. package/dist/src/init/copy-assets.js +271 -0
  69. package/dist/src/init/copy-assets.js.map +1 -0
  70. package/dist/src/init/executor.d.ts +2 -30
  71. package/dist/src/init/executor.d.ts.map +1 -1
  72. package/dist/src/init/executor.js +56 -2493
  73. package/dist/src/init/executor.js.map +1 -1
  74. package/dist/src/init/geminimd-generator.js +2 -2
  75. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  76. package/dist/src/init/helpers-generator.js +9 -0
  77. package/dist/src/init/helpers-generator.js.map +1 -1
  78. package/dist/src/init/kimi-generator.js +3 -3
  79. package/dist/src/init/kimi-generator.js.map +1 -1
  80. package/dist/src/init/settings-generator.d.ts.map +1 -1
  81. package/dist/src/init/settings-generator.js +0 -4
  82. package/dist/src/init/settings-generator.js.map +1 -1
  83. package/dist/src/init/shared.d.ts +112 -0
  84. package/dist/src/init/shared.d.ts.map +1 -0
  85. package/dist/src/init/shared.js +475 -0
  86. package/dist/src/init/shared.js.map +1 -0
  87. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  88. package/dist/src/init/statusline-generator.js +37 -0
  89. package/dist/src/init/statusline-generator.js.map +1 -1
  90. package/dist/src/init/types.d.ts +1 -1
  91. package/dist/src/init/types.d.ts.map +1 -1
  92. package/dist/src/init/upgrade.d.ts +34 -0
  93. package/dist/src/init/upgrade.d.ts.map +1 -0
  94. package/dist/src/init/upgrade.js +477 -0
  95. package/dist/src/init/upgrade.js.map +1 -0
  96. package/dist/src/init/write-antigravity.d.ts +13 -0
  97. package/dist/src/init/write-antigravity.d.ts.map +1 -0
  98. package/dist/src/init/write-antigravity.js +117 -0
  99. package/dist/src/init/write-antigravity.js.map +1 -0
  100. package/dist/src/init/write-capabilities.d.ts +9 -0
  101. package/dist/src/init/write-capabilities.d.ts.map +1 -0
  102. package/dist/src/init/write-capabilities.js +392 -0
  103. package/dist/src/init/write-capabilities.js.map +1 -0
  104. package/dist/src/init/write-claude.d.ts +25 -0
  105. package/dist/src/init/write-claude.d.ts.map +1 -0
  106. package/dist/src/init/write-claude.js +279 -0
  107. package/dist/src/init/write-claude.js.map +1 -0
  108. package/dist/src/init/write-kimicode.d.ts +19 -0
  109. package/dist/src/init/write-kimicode.d.ts.map +1 -0
  110. package/dist/src/init/write-kimicode.js +223 -0
  111. package/dist/src/init/write-kimicode.js.map +1 -0
  112. package/dist/src/init/write-opencode.d.ts +14 -0
  113. package/dist/src/init/write-opencode.d.ts.map +1 -0
  114. package/dist/src/init/write-opencode.js +130 -0
  115. package/dist/src/init/write-opencode.js.map +1 -0
  116. package/dist/src/init/write-runtime-config.d.ts +14 -0
  117. package/dist/src/init/write-runtime-config.d.ts.map +1 -0
  118. package/dist/src/init/write-runtime-config.js +214 -0
  119. package/dist/src/init/write-runtime-config.js.map +1 -0
  120. package/dist/src/init/write-sample-org.d.ts +9 -0
  121. package/dist/src/init/write-sample-org.d.ts.map +1 -0
  122. package/dist/src/init/write-sample-org.js +39 -0
  123. package/dist/src/init/write-sample-org.js.map +1 -0
  124. package/dist/src/knowledge/eval/golden-set.js +1 -1
  125. package/dist/src/knowledge/eval/golden-set.js.map +1 -1
  126. package/dist/src/mcp-client.d.ts.map +1 -1
  127. package/dist/src/mcp-client.js +7 -3
  128. package/dist/src/mcp-client.js.map +1 -1
  129. package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -1
  130. package/dist/src/mcp-tools/analyze-tools.js +2 -25
  131. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  132. package/dist/src/mcp-tools/auto-install.d.ts.map +1 -1
  133. package/dist/src/mcp-tools/auto-install.js +2 -1
  134. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  135. package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
  136. package/dist/src/mcp-tools/hooks-routing.js +26 -0
  137. package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
  138. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  139. package/dist/src/mcp-tools/memory-tools.js +2 -37
  140. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  141. package/dist/src/mcp-tools/monodesign-tools.d.ts +19 -0
  142. package/dist/src/mcp-tools/monodesign-tools.d.ts.map +1 -0
  143. package/dist/src/mcp-tools/monodesign-tools.js +233 -0
  144. package/dist/src/mcp-tools/monodesign-tools.js.map +1 -0
  145. package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts +5 -0
  146. package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts.map +1 -0
  147. package/dist/src/mcp-tools/monograph/agent-history-tools.js +177 -0
  148. package/dist/src/mcp-tools/monograph/agent-history-tools.js.map +1 -0
  149. package/dist/src/mcp-tools/monograph/build-tools.d.ts +9 -0
  150. package/dist/src/mcp-tools/monograph/build-tools.d.ts.map +1 -0
  151. package/dist/src/mcp-tools/monograph/build-tools.js +299 -0
  152. package/dist/src/mcp-tools/monograph/build-tools.js.map +1 -0
  153. package/dist/src/mcp-tools/monograph/group-tools.d.ts +10 -0
  154. package/dist/src/mcp-tools/monograph/group-tools.d.ts.map +1 -0
  155. package/dist/src/mcp-tools/monograph/group-tools.js +225 -0
  156. package/dist/src/mcp-tools/monograph/group-tools.js.map +1 -0
  157. package/dist/src/mcp-tools/monograph/health-tools.d.ts +6 -0
  158. package/dist/src/mcp-tools/monograph/health-tools.d.ts.map +1 -0
  159. package/dist/src/mcp-tools/monograph/health-tools.js +113 -0
  160. package/dist/src/mcp-tools/monograph/health-tools.js.map +1 -0
  161. package/dist/src/mcp-tools/monograph/impact-tools.d.ts +9 -0
  162. package/dist/src/mcp-tools/monograph/impact-tools.d.ts.map +1 -0
  163. package/dist/src/mcp-tools/monograph/impact-tools.js +532 -0
  164. package/dist/src/mcp-tools/monograph/impact-tools.js.map +1 -0
  165. package/dist/src/mcp-tools/monograph/index.d.ts +10 -0
  166. package/dist/src/mcp-tools/monograph/index.d.ts.map +1 -0
  167. package/dist/src/mcp-tools/monograph/index.js +73 -0
  168. package/dist/src/mcp-tools/monograph/index.js.map +1 -0
  169. package/dist/src/mcp-tools/monograph/query-tools.d.ts +11 -0
  170. package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -0
  171. package/dist/src/mcp-tools/monograph/query-tools.js +500 -0
  172. package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -0
  173. package/dist/src/mcp-tools/monograph/shared.d.ts +64 -0
  174. package/dist/src/mcp-tools/monograph/shared.d.ts.map +1 -0
  175. package/dist/src/mcp-tools/monograph/shared.js +215 -0
  176. package/dist/src/mcp-tools/monograph/shared.js.map +1 -0
  177. package/dist/src/mcp-tools/monograph/visualize-tools.d.ts +10 -0
  178. package/dist/src/mcp-tools/monograph/visualize-tools.d.ts.map +1 -0
  179. package/dist/src/mcp-tools/monograph/visualize-tools.js +382 -0
  180. package/dist/src/mcp-tools/monograph/visualize-tools.js.map +1 -0
  181. package/dist/src/mcp-tools/monograph-tools.d.ts +4 -23
  182. package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
  183. package/dist/src/mcp-tools/monograph-tools.js +4 -2439
  184. package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
  185. package/dist/src/mcp-tools/monomind-tools.d.ts +8 -0
  186. package/dist/src/mcp-tools/monomind-tools.d.ts.map +1 -1
  187. package/dist/src/mcp-tools/monomind-tools.js +13 -1
  188. package/dist/src/mcp-tools/monomind-tools.js.map +1 -1
  189. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts.map +1 -1
  190. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js +31 -2
  191. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js.map +1 -1
  192. package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
  193. package/dist/src/mcp-tools/terminal-tools.js +31 -1
  194. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  195. package/dist/src/mcp-tools/types.d.ts +8 -27
  196. package/dist/src/mcp-tools/types.d.ts.map +1 -1
  197. package/dist/src/mcp-tools/types.js +9 -91
  198. package/dist/src/mcp-tools/types.js.map +1 -1
  199. package/dist/src/memory/file-permissions.d.ts +15 -0
  200. package/dist/src/memory/file-permissions.d.ts.map +1 -0
  201. package/dist/src/memory/file-permissions.js +25 -0
  202. package/dist/src/memory/file-permissions.js.map +1 -0
  203. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  204. package/dist/src/memory/memory-bridge.js +94 -34
  205. package/dist/src/memory/memory-bridge.js.map +1 -1
  206. package/dist/src/memory/memory-crud.d.ts.map +1 -1
  207. package/dist/src/memory/memory-crud.js +298 -275
  208. package/dist/src/memory/memory-crud.js.map +1 -1
  209. package/dist/src/memory/memory-initializer.d.ts +2 -4
  210. package/dist/src/memory/memory-initializer.d.ts.map +1 -1
  211. package/dist/src/memory/memory-initializer.js +53 -76
  212. package/dist/src/memory/memory-initializer.js.map +1 -1
  213. package/dist/src/memory/memory-migrations.d.ts +1 -14
  214. package/dist/src/memory/memory-migrations.d.ts.map +1 -1
  215. package/dist/src/memory/memory-migrations.js +52 -105
  216. package/dist/src/memory/memory-migrations.js.map +1 -1
  217. package/dist/src/memory/sona-optimizer.d.ts +1 -1
  218. package/dist/src/memory/sona-optimizer.js +1 -1
  219. package/dist/src/monovector/index.d.ts +16 -19
  220. package/dist/src/monovector/index.d.ts.map +1 -1
  221. package/dist/src/monovector/index.js +50 -8
  222. package/dist/src/monovector/index.js.map +1 -1
  223. package/dist/src/orgrt/approvals.d.ts +16 -0
  224. package/dist/src/orgrt/approvals.d.ts.map +1 -0
  225. package/dist/src/orgrt/approvals.js +72 -0
  226. package/dist/src/orgrt/approvals.js.map +1 -0
  227. package/dist/src/orgrt/bus.d.ts.map +1 -1
  228. package/dist/src/orgrt/bus.js +21 -0
  229. package/dist/src/orgrt/bus.js.map +1 -1
  230. package/dist/src/orgrt/checkpoint-ops.d.ts +19 -0
  231. package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -0
  232. package/dist/src/orgrt/checkpoint-ops.js +219 -0
  233. package/dist/src/orgrt/checkpoint-ops.js.map +1 -0
  234. package/dist/src/orgrt/checkpoint.d.ts +33 -1
  235. package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
  236. package/dist/src/orgrt/checkpoint.js +50 -6
  237. package/dist/src/orgrt/checkpoint.js.map +1 -1
  238. package/dist/src/orgrt/cross-org.d.ts +32 -0
  239. package/dist/src/orgrt/cross-org.d.ts.map +1 -0
  240. package/dist/src/orgrt/cross-org.js +256 -0
  241. package/dist/src/orgrt/cross-org.js.map +1 -0
  242. package/dist/src/orgrt/daemon.d.ts +131 -157
  243. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  244. package/dist/src/orgrt/daemon.js +356 -966
  245. package/dist/src/orgrt/daemon.js.map +1 -1
  246. package/dist/src/orgrt/decisions.d.ts +33 -0
  247. package/dist/src/orgrt/decisions.d.ts.map +1 -0
  248. package/dist/src/orgrt/decisions.js +169 -0
  249. package/dist/src/orgrt/decisions.js.map +1 -0
  250. package/dist/src/orgrt/kimicode-runner.d.ts.map +1 -1
  251. package/dist/src/orgrt/kimicode-runner.js +5 -1
  252. package/dist/src/orgrt/kimicode-runner.js.map +1 -1
  253. package/dist/src/orgrt/opencode-runner.d.ts.map +1 -1
  254. package/dist/src/orgrt/opencode-runner.js +10 -2
  255. package/dist/src/orgrt/opencode-runner.js.map +1 -1
  256. package/dist/src/orgrt/org-memory.d.ts +45 -0
  257. package/dist/src/orgrt/org-memory.d.ts.map +1 -0
  258. package/dist/src/orgrt/org-memory.js +220 -0
  259. package/dist/src/orgrt/org-memory.js.map +1 -0
  260. package/dist/src/orgrt/policy.d.ts +4 -0
  261. package/dist/src/orgrt/policy.d.ts.map +1 -1
  262. package/dist/src/orgrt/policy.js +13 -1
  263. package/dist/src/orgrt/policy.js.map +1 -1
  264. package/dist/src/orgrt/prechecks.d.ts +15 -0
  265. package/dist/src/orgrt/prechecks.d.ts.map +1 -0
  266. package/dist/src/orgrt/prechecks.js +21 -0
  267. package/dist/src/orgrt/prechecks.js.map +1 -0
  268. package/dist/src/orgrt/questions.d.ts +39 -0
  269. package/dist/src/orgrt/questions.d.ts.map +1 -0
  270. package/dist/src/orgrt/questions.js +135 -0
  271. package/dist/src/orgrt/questions.js.map +1 -0
  272. package/dist/src/orgrt/remote.d.ts +25 -0
  273. package/dist/src/orgrt/remote.d.ts.map +1 -0
  274. package/dist/src/orgrt/remote.js +73 -0
  275. package/dist/src/orgrt/remote.js.map +1 -0
  276. package/dist/src/orgrt/scheduler-integration.d.ts +19 -0
  277. package/dist/src/orgrt/scheduler-integration.d.ts.map +1 -0
  278. package/dist/src/orgrt/scheduler-integration.js +90 -0
  279. package/dist/src/orgrt/scheduler-integration.js.map +1 -0
  280. package/dist/src/orgrt/server.d.ts.map +1 -1
  281. package/dist/src/orgrt/server.js +70 -2
  282. package/dist/src/orgrt/server.js.map +1 -1
  283. package/dist/src/orgrt/session.d.ts +30 -1
  284. package/dist/src/orgrt/session.d.ts.map +1 -1
  285. package/dist/src/orgrt/session.js +184 -53
  286. package/dist/src/orgrt/session.js.map +1 -1
  287. package/dist/src/orgrt/state-detector.d.ts +19 -0
  288. package/dist/src/orgrt/state-detector.d.ts.map +1 -0
  289. package/dist/src/orgrt/state-detector.js +59 -0
  290. package/dist/src/orgrt/state-detector.js.map +1 -0
  291. package/dist/src/orgrt/task-dag.d.ts +27 -0
  292. package/dist/src/orgrt/task-dag.d.ts.map +1 -0
  293. package/dist/src/orgrt/task-dag.js +100 -0
  294. package/dist/src/orgrt/task-dag.js.map +1 -0
  295. package/dist/src/orgrt/tool-fence.d.ts +7 -4
  296. package/dist/src/orgrt/tool-fence.d.ts.map +1 -1
  297. package/dist/src/orgrt/tool-fence.js +47 -6
  298. package/dist/src/orgrt/tool-fence.js.map +1 -1
  299. package/dist/src/orgrt/types.d.ts +57 -2
  300. package/dist/src/orgrt/types.d.ts.map +1 -1
  301. package/dist/src/orgrt/types.js +34 -3
  302. package/dist/src/orgrt/types.js.map +1 -1
  303. package/dist/src/routing/model-download.d.ts +49 -0
  304. package/dist/src/routing/model-download.d.ts.map +1 -0
  305. package/dist/src/routing/model-download.js +106 -0
  306. package/dist/src/routing/model-download.js.map +1 -0
  307. package/dist/src/services/crash-reporter.d.ts +5 -0
  308. package/dist/src/services/crash-reporter.d.ts.map +1 -1
  309. package/dist/src/services/crash-reporter.js +49 -0
  310. package/dist/src/services/crash-reporter.js.map +1 -1
  311. package/dist/src/transfer/anonymization/index.d.ts +18 -15
  312. package/dist/src/transfer/anonymization/index.d.ts.map +1 -1
  313. package/dist/src/transfer/anonymization/index.js +7 -119
  314. package/dist/src/transfer/anonymization/index.js.map +1 -1
  315. package/dist/src/ui/dashboard.html +606 -7
  316. package/dist/src/ui/orgs.html +7 -1
  317. package/dist/src/ui/routes-monograph.mjs +6 -0
  318. package/dist/src/ui/server.mjs +327 -7
  319. package/dist/src/update/checker.d.ts.map +1 -1
  320. package/dist/src/update/checker.js +2 -1
  321. package/dist/src/update/checker.js.map +1 -1
  322. package/dist/src/update/executor.d.ts.map +1 -1
  323. package/dist/src/update/executor.js +7 -3
  324. package/dist/src/update/executor.js.map +1 -1
  325. package/dist/src/update/index.d.ts +0 -1
  326. package/dist/src/update/index.d.ts.map +1 -1
  327. package/dist/src/update/index.js +5 -24
  328. package/dist/src/update/index.js.map +1 -1
  329. package/dist/src/utils/db-mutex.d.ts +11 -0
  330. package/dist/src/utils/db-mutex.d.ts.map +1 -0
  331. package/dist/src/utils/db-mutex.js +23 -0
  332. package/dist/src/utils/db-mutex.js.map +1 -0
  333. package/dist/src/utils/input-guards.d.ts +23 -0
  334. package/dist/src/utils/input-guards.d.ts.map +1 -1
  335. package/dist/src/utils/input-guards.js +72 -0
  336. package/dist/src/utils/input-guards.js.map +1 -1
  337. package/dist/src/utils/npm-command.d.ts +10 -0
  338. package/dist/src/utils/npm-command.d.ts.map +1 -0
  339. package/dist/src/utils/npm-command.js +12 -0
  340. package/dist/src/utils/npm-command.js.map +1 -0
  341. package/dist/src/utils/paths.d.ts +28 -0
  342. package/dist/src/utils/paths.d.ts.map +1 -0
  343. package/dist/src/utils/paths.js +108 -0
  344. package/dist/src/utils/paths.js.map +1 -0
  345. package/dist/tsconfig.tsbuildinfo +1 -1
  346. package/package.json +17 -17
  347. package/scripts/download-embedding-model.mjs +97 -0
  348. package/scripts/publish.sh +0 -0
  349. package/scripts/sync-claude-assets.sh +0 -0
  350. package/dist/src/production/circuit-breaker.d.ts +0 -121
  351. package/dist/src/production/circuit-breaker.d.ts.map +0 -1
  352. package/dist/src/production/circuit-breaker.js +0 -262
  353. package/dist/src/production/circuit-breaker.js.map +0 -1
  354. package/dist/src/production/error-handler.d.ts +0 -119
  355. package/dist/src/production/error-handler.d.ts.map +0 -1
  356. package/dist/src/production/error-handler.js +0 -324
  357. package/dist/src/production/error-handler.js.map +0 -1
  358. package/dist/src/production/index.d.ts +0 -6
  359. package/dist/src/production/index.d.ts.map +0 -1
  360. package/dist/src/production/index.js +0 -6
  361. package/dist/src/production/index.js.map +0 -1
  362. package/dist/src/production/monitoring.d.ts +0 -181
  363. package/dist/src/production/monitoring.d.ts.map +0 -1
  364. package/dist/src/production/monitoring.js +0 -375
  365. package/dist/src/production/monitoring.js.map +0 -1
  366. package/dist/src/production/rate-limiter.d.ts +0 -125
  367. package/dist/src/production/rate-limiter.d.ts.map +0 -1
  368. package/dist/src/production/rate-limiter.js +0 -218
  369. package/dist/src/production/rate-limiter.js.map +0 -1
  370. package/dist/src/production/retry.d.ts +0 -48
  371. package/dist/src/production/retry.d.ts.map +0 -1
  372. package/dist/src/production/retry.js +0 -189
  373. package/dist/src/production/retry.js.map +0 -1
  374. package/dist/src/transfer/types.d.ts +0 -245
  375. package/dist/src/transfer/types.d.ts.map +0 -1
  376. package/dist/src/transfer/types.js +0 -6
  377. package/dist/src/transfer/types.js.map +0 -1
@@ -0,0 +1,299 @@
1
+ import { join, resolve, sep } from 'path';
2
+ import { getProjectCwd } from '../types.js';
3
+ import { getDbPath, _isValidDb, text } from './shared.js';
4
+ // ── Active watcher registry ──────────────────────────────────────────────────
5
+ const _activeWatchers = new Map();
6
+ // ── monograph_build ───────────────────────────────────────────────────────────
7
+ export const monographBuildTool = {
8
+ name: 'monograph_build',
9
+ description: 'Build (or rebuild) the Monograph knowledge graph for a path. Parses all code via tree-sitter and indexes into SQLite.',
10
+ inputSchema: {
11
+ type: 'object',
12
+ properties: {
13
+ path: { type: 'string', description: 'Absolute path to the repo (defaults to project cwd)' },
14
+ codeOnly: { type: 'boolean', description: 'Only index code files (skip docs, config)' },
15
+ force: { type: 'boolean', description: 'Force full rebuild even if index is fresh' },
16
+ incremental: { type: 'boolean', description: 'Skip rebuild when index already matches HEAD (default false). Use when you want a no-op if the graph is fresh.' },
17
+ },
18
+ },
19
+ handler: async (input) => {
20
+ const { buildAsync } = await import('@monoes/monograph');
21
+ const repoPath = input.path ?? getProjectCwd();
22
+ let progressLog = '';
23
+ await buildAsync(repoPath, {
24
+ codeOnly: input.codeOnly ?? false,
25
+ force: input.force ?? false,
26
+ incremental: input.incremental ?? false,
27
+ onProgress: (p) => { progressLog += `[${p.phase}] ${p.message ?? ''}\n`; },
28
+ });
29
+ const skipped = progressLog.includes('skipping rebuild');
30
+ const summary = skipped ? `Index was already fresh — no rebuild needed for ${repoPath}` : `Monograph build complete for ${repoPath}`;
31
+ return text(`${summary}\n${progressLog}`);
32
+ },
33
+ };
34
+ // ── monograph_watch ───────────────────────────────────────────────────────────
35
+ export const monographWatchTool = {
36
+ name: 'monograph_watch',
37
+ description: 'Start incremental file watcher. Rebuilds index on file changes (3s debounce).',
38
+ inputSchema: {
39
+ type: 'object',
40
+ properties: {
41
+ path: { type: 'string', description: 'Repo path (defaults to project cwd)' },
42
+ },
43
+ },
44
+ handler: async (input) => {
45
+ const { MonographWatcher } = await import('@monoes/monograph');
46
+ const repoPath = input.path ?? getProjectCwd();
47
+ if (_activeWatchers.has(repoPath)) {
48
+ return text(`Monograph watcher already running for ${repoPath}.`);
49
+ }
50
+ const watcher = new MonographWatcher(repoPath);
51
+ watcher.on('monograph:updated', (_paths) => {
52
+ import('@monoes/monograph').then(({ buildAsync }) => buildAsync(repoPath)).catch((e) => {
53
+ if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
54
+ console.error('[monograph_watch] background rebuild failed:', e);
55
+ });
56
+ });
57
+ await watcher.start();
58
+ _activeWatchers.set(repoPath, watcher);
59
+ return text(`Monograph watcher started for ${repoPath}. Watching for file changes...`);
60
+ },
61
+ };
62
+ // ── monograph_watch_stop ──────────────────────────────────────────────────────
63
+ export const monographWatchStopTool = {
64
+ name: 'monograph_watch_stop',
65
+ description: 'Stop the Monograph file watcher.',
66
+ inputSchema: {
67
+ type: 'object',
68
+ properties: {
69
+ path: { type: 'string', description: 'Repo path whose watcher to stop (defaults to project cwd)' },
70
+ },
71
+ },
72
+ handler: async (input) => {
73
+ const repoPath = input.path ?? getProjectCwd();
74
+ const watcher = _activeWatchers.get(repoPath);
75
+ if (!watcher) {
76
+ return text(`No active watcher found for ${repoPath}.`);
77
+ }
78
+ await watcher.stop();
79
+ _activeWatchers.delete(repoPath);
80
+ return text(`Monograph watcher stopped for ${repoPath}.`);
81
+ },
82
+ };
83
+ // ── monograph_detect_changes ──────────────────────────────────────────────────
84
+ export const monographDetectChangesTool = {
85
+ name: 'monograph_detect_changes',
86
+ description: 'Git diff → affected symbols: identifies which indexed symbols live in files changed since the base branch.',
87
+ inputSchema: {
88
+ type: 'object',
89
+ properties: {
90
+ baseBranch: { type: 'string', description: 'Base branch to diff against (default: main)' },
91
+ includeTests: { type: 'boolean', description: 'Include test files (default: true)' },
92
+ },
93
+ },
94
+ handler: async (input) => {
95
+ const { openDb, closeDb } = await import('@monoes/monograph');
96
+ const { detectMonographChanges } = await import('@monoes/monograph');
97
+ const db = openDb(getDbPath());
98
+ try {
99
+ const result = detectMonographChanges(db, {
100
+ baseBranch: input.baseBranch,
101
+ includeTests: input.includeTests,
102
+ }, getProjectCwd());
103
+ // Format as structured text for direct LLM navigation instead of raw JSON
104
+ const r = result;
105
+ if (!r || (!r.changedFiles?.length && !r.affectedSymbols?.length)) {
106
+ return text('No changed files found relative to the base branch.');
107
+ }
108
+ const lines = [];
109
+ const base = r.baseBranch ?? 'main';
110
+ const changedFiles = r.changedFiles ?? [];
111
+ lines.push(`Changed files vs ${base}: ${changedFiles.length}`);
112
+ if (changedFiles.length > 0) {
113
+ for (const f of changedFiles.slice(0, 20))
114
+ lines.push(` ${f}`);
115
+ if (changedFiles.length > 20)
116
+ lines.push(` … ${changedFiles.length - 20} more`);
117
+ }
118
+ lines.push('');
119
+ const affected = r.affectedSymbols ?? r.affected ?? [];
120
+ if (affected.length > 0) {
121
+ lines.push(`Affected symbols (${affected.length}):`);
122
+ for (const sym of affected.slice(0, 30)) {
123
+ const fp = sym.filePath ?? sym.file_path ?? '';
124
+ const ln = sym.startLine ?? sym.start_line;
125
+ const loc = fp ? (ln != null ? `${fp}:${ln}` : fp) : '';
126
+ lines.push(` [${sym.label ?? '?'}] ${sym.name ?? sym.id} ${loc}`);
127
+ }
128
+ if (affected.length > 30)
129
+ lines.push(` … ${affected.length - 30} more`);
130
+ }
131
+ return text(lines.join('\n').trim());
132
+ }
133
+ finally {
134
+ closeDb(db);
135
+ }
136
+ },
137
+ };
138
+ // ── monograph_inject_context ──────────────────────────────────────────────────
139
+ export const monographInjectContextTool = {
140
+ name: 'monograph_inject_context',
141
+ description: 'Inject monograph capabilities description into AGENTS.md or CLAUDE.md for AI agent discovery.',
142
+ inputSchema: {
143
+ type: 'object',
144
+ properties: {
145
+ targets: {
146
+ type: 'array',
147
+ items: { type: 'string', enum: ['claude', 'agents-md'] },
148
+ description: 'Which files to update (default: both)',
149
+ },
150
+ },
151
+ },
152
+ handler: async (input) => {
153
+ const { injectAiContext } = await import('@monoes/monograph');
154
+ const repoPath = getProjectCwd();
155
+ const result = await injectAiContext({
156
+ repoPath,
157
+ targets: input.targets,
158
+ });
159
+ return text(`Injected context into: ${result.updated.join(', ') || 'none'}`);
160
+ },
161
+ };
162
+ // ── monograph_skill_gen ───────────────────────────────────────────────────────
163
+ export const monographSkillGenTool = {
164
+ name: 'monograph_skill_gen',
165
+ description: 'Generate per-community skill files summarizing code structure for AI navigation.',
166
+ inputSchema: {
167
+ type: 'object',
168
+ properties: {
169
+ outputDir: { type: 'string', description: 'Output directory for skill files (default: .monomind/skills/)' },
170
+ },
171
+ },
172
+ handler: async (input) => {
173
+ const { generateSkillFiles } = await import('@monoes/monograph');
174
+ const repoPath = getProjectCwd();
175
+ const allowedRoot = resolve(repoPath);
176
+ if (input.outputDir) {
177
+ const outDir = resolve(input.outputDir);
178
+ if (outDir !== allowedRoot && !outDir.startsWith(allowedRoot + sep)) {
179
+ return text(`Error: outputDir must be within the project directory (${allowedRoot})`);
180
+ }
181
+ }
182
+ const result = await generateSkillFiles(repoPath, input.outputDir ? resolve(input.outputDir) : undefined);
183
+ const dir = result.filesWritten.length > 0
184
+ ? result.filesWritten[0].replace(/\/[^/]+$/, '/')
185
+ : join(repoPath, '.monomind', 'skills') + '/';
186
+ return text(`Generated ${result.communityCount} skill files in ${dir}`);
187
+ },
188
+ };
189
+ // ── monograph_install_skills ──────────────────────────────────────────────────
190
+ export const monographInstallSkillsTool = {
191
+ name: 'monograph_install_skills',
192
+ description: 'Install monograph skill files for a specific IDE/platform (claude, cursor, vscode, zed).',
193
+ inputSchema: {
194
+ type: 'object',
195
+ properties: {
196
+ platform: {
197
+ type: 'string',
198
+ description: 'Target platform: claude, cursor, vscode, or zed',
199
+ },
200
+ repoPath: {
201
+ type: 'string',
202
+ description: 'Absolute path to the repository (defaults to cwd)',
203
+ },
204
+ },
205
+ required: ['platform'],
206
+ },
207
+ handler: async (input) => {
208
+ const { openDb, closeDb } = await import('@monoes/monograph');
209
+ const { installSkillsForPlatform } = await import('@monoes/monograph');
210
+ const rawRepoPath = input.repoPath ?? getProjectCwd();
211
+ const repoPath = resolve(rawRepoPath);
212
+ const allowedRoot = resolve(getProjectCwd());
213
+ if (repoPath !== allowedRoot && !repoPath.startsWith(allowedRoot + sep)) {
214
+ return text(`Error: repoPath must be within the project directory (${allowedRoot})`);
215
+ }
216
+ const platform = input.platform;
217
+ const validPlatforms = ['claude', 'cursor', 'vscode', 'zed'];
218
+ if (!validPlatforms.includes(platform)) {
219
+ return text(`Invalid platform "${platform}". Must be one of: ${validPlatforms.join(', ')}`);
220
+ }
221
+ // Load community data from graph
222
+ const dbPath = getDbPath(repoPath);
223
+ // openDb's fileMustExist option isn't in the currently-published
224
+ // @monoes/monograph release this CLI depends on — check validity
225
+ // ourselves so a missing DB doesn't get silently auto-created empty.
226
+ if (!_isValidDb(dbPath)) {
227
+ return text('Graph not built yet. Run monograph_build first.');
228
+ }
229
+ let db;
230
+ try {
231
+ db = openDb(dbPath);
232
+ }
233
+ catch {
234
+ return text('Graph not built yet. Run monograph_build first.');
235
+ }
236
+ let communities;
237
+ try {
238
+ // Query distinct community IDs with exported symbols
239
+ const communityIds = db.prepare(`
240
+ SELECT DISTINCT community_id
241
+ FROM nodes
242
+ WHERE community_id IS NOT NULL
243
+ AND label NOT IN ('File', 'Folder', 'Community', 'Concept')
244
+ ORDER BY community_id
245
+ `).all();
246
+ if (communityIds.length === 0) {
247
+ closeDb(db);
248
+ return text('No communities found in graph. Run monograph_build first.');
249
+ }
250
+ communities = communityIds.map(({ community_id }) => {
251
+ // Derive a readable name from folder paths
252
+ const pathRows = db.prepare(`
253
+ SELECT file_path FROM nodes
254
+ WHERE community_id = ? AND file_path IS NOT NULL
255
+ AND label NOT IN ('File', 'Folder', 'Community', 'Concept')
256
+ LIMIT 20
257
+ `).all(community_id);
258
+ let name = `community-${community_id}`;
259
+ const folderCounts = new Map();
260
+ for (const row of pathRows) {
261
+ const parts = row.file_path.replace(/\\/g, '/').split('/').filter(Boolean);
262
+ if (parts.length >= 2) {
263
+ const folder = parts[parts.length - 2].toLowerCase();
264
+ if (!['src', 'lib', 'core', 'utils', 'common', 'shared', 'helpers', 'dist'].includes(folder)) {
265
+ folderCounts.set(folder, (folderCounts.get(folder) ?? 0) + 1);
266
+ }
267
+ }
268
+ }
269
+ let bestCount = 0;
270
+ for (const [folder, count] of folderCounts) {
271
+ if (count > bestCount) {
272
+ bestCount = count;
273
+ name = folder;
274
+ }
275
+ }
276
+ // Collect exported symbol names
277
+ const symbolRows = db.prepare(`
278
+ SELECT name FROM nodes
279
+ WHERE community_id = ? AND is_exported = 1
280
+ AND label NOT IN ('File', 'Folder', 'Community', 'Concept')
281
+ ORDER BY name
282
+ LIMIT 50
283
+ `).all(community_id);
284
+ return { name, symbols: symbolRows.map(r => r.name) };
285
+ });
286
+ }
287
+ catch (err) {
288
+ closeDb(db);
289
+ const msg = err instanceof Error ? err.message : String(err);
290
+ return text(`Failed to query graph: ${msg}`);
291
+ }
292
+ closeDb(db);
293
+ const result = await installSkillsForPlatform(repoPath, communities, {
294
+ platform: platform,
295
+ });
296
+ return text(`Installed ${result.filesWritten.length} skill files for ${result.platform} in ${result.outputDir}`);
297
+ },
298
+ };
299
+ //# sourceMappingURL=build-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-tools.js","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/build-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE1D,gFAAgF;AAChF,MAAM,eAAe,GAAG,IAAI,GAAG,EAAe,CAAC;AAE/C,iFAAiF;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAY;IACzC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,uHAAuH;IACpI,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qDAAqD,EAAE;YAC5F,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,2CAA2C,EAAE;YACvF,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,2CAA2C,EAAE;YACpF,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WA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C,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACxD,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,OAAO,CAAC,EAAE,CAAC,CAAC;YACZ,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,CAAC,EAAE,CAAC,CAAC;QAEZ,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,QAAQ,EAAE,WAAW,EAAE;YACnE,QAAQ,EAAE,QAAkD;SAC7D,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,aAAa,MAAM,CAAC,YAAY,CAAC,MAAM,oBAAoB,MAAM,CAAC,QAAQ,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IACnH,CAAC;CACF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { MCPTool } from '../types.js';
2
+ export declare const monographCommunityTool: MCPTool;
3
+ export declare const monographSurprisesTool: MCPTool;
4
+ export declare const monographGroupListTool: MCPTool;
5
+ export declare const monographGroupQueryTool: MCPTool;
6
+ export declare const monographGroupSyncTool: MCPTool;
7
+ export declare const monographGroupContractsTool: MCPTool;
8
+ export declare const monographGroupStatusTool: MCPTool;
9
+ export declare const monographListReposTool: MCPTool;
10
+ //# sourceMappingURL=group-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-tools.d.ts","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/group-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAM3C,eAAO,MAAM,sBAAsB,EAAE,OA8BpC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAoCpC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAyBpC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,OA+BrC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAoBpC,CAAC;AAIF,eAAO,MAAM,2BAA2B,EAAE,OAiBzC,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,OAoBtC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAgBpC,CAAC"}
@@ -0,0 +1,225 @@
1
+ import { join } from 'path';
2
+ import { getProjectCwd } from '../types.js';
3
+ import { getDbPath, text } from './shared.js';
4
+ // ── monograph_community ───────────────────────────────────────────────────────
5
+ export const monographCommunityTool = {
6
+ name: 'monograph_community',
7
+ description: 'Get all nodes belonging to a community (by numeric community ID).',
8
+ inputSchema: {
9
+ type: 'object',
10
+ properties: {
11
+ id: { type: 'number', description: 'Community ID' },
12
+ },
13
+ required: ['id'],
14
+ },
15
+ handler: async (input) => {
16
+ // Validate community ID — must be a finite integer. parseInt(NaN) or a float
17
+ // would silently become 0 in SQLite (NaN → NULL → 0 coercion), which would
18
+ // return all nodes in community 0 instead of an error.
19
+ const rawId = typeof input.id === 'number' ? input.id : parseInt(String(input.id), 10);
20
+ if (!Number.isFinite(rawId) || rawId !== Math.floor(rawId)) {
21
+ return text(`Invalid community ID: ${input.id} (must be an integer)`);
22
+ }
23
+ const communityId = rawId;
24
+ const { openDb, closeDb } = await import('@monoes/monograph');
25
+ const db = openDb(getDbPath());
26
+ try {
27
+ const rows = db.prepare('SELECT id, label, name, file_path, start_line FROM nodes WHERE community_id = ?').all(communityId);
28
+ if (rows.length === 0)
29
+ return text(`No nodes in community ${communityId}`);
30
+ return text(rows.map(r => {
31
+ const loc = r.file_path ? (r.start_line != null ? `${r.file_path}:${r.start_line}` : r.file_path) : '';
32
+ return `[${r.label}] ${r.name} ${loc}`;
33
+ }).join('\n'));
34
+ }
35
+ finally {
36
+ closeDb(db);
37
+ }
38
+ },
39
+ };
40
+ // ── monograph_surprises ───────────────────────────────────────────────────────
41
+ export const monographSurprisesTool = {
42
+ name: 'monograph_surprises',
43
+ description: 'Show unexpected cross-community or low-confidence edges ranked by surprise score.',
44
+ inputSchema: {
45
+ type: 'object',
46
+ properties: { limit: { type: 'number', description: 'Max results (default 20)' } },
47
+ },
48
+ handler: async (input) => {
49
+ const { openDb, closeDb } = await import('@monoes/monograph');
50
+ const db = openDb(getDbPath());
51
+ try {
52
+ // Cap limit: passed directly to the SQL LIMIT clause.
53
+ const MAX_SURPRISES_LIMIT = 1_000;
54
+ const rawSurprisesLimit = input.limit ?? 20;
55
+ const limit = Number.isFinite(rawSurprisesLimit) && rawSurprisesLimit > 0
56
+ ? Math.min(Math.floor(rawSurprisesLimit), MAX_SURPRISES_LIMIT)
57
+ : 20;
58
+ const rows = db.prepare(`
59
+ SELECT e.confidence, e.confidence_score, e.relation,
60
+ n1.name as src_name, n1.file_path as src_file, n1.start_line as src_line,
61
+ n2.name as tgt_name, n2.file_path as tgt_file, n2.start_line as tgt_line
62
+ FROM edges e
63
+ JOIN nodes n1 ON n1.id = e.source_id
64
+ JOIN nodes n2 ON n2.id = e.target_id
65
+ WHERE e.confidence != 'EXTRACTED'
66
+ ORDER BY e.confidence_score ASC LIMIT ?
67
+ `).all(limit);
68
+ if (rows.length === 0)
69
+ return text('No surprising connections found.');
70
+ return text(rows.map(r => {
71
+ const srcLoc = r.src_file ? (r.src_line != null ? `${r.src_file}:${r.src_line}` : r.src_file) : '';
72
+ const tgtLoc = r.tgt_file ? (r.tgt_line != null ? `${r.tgt_file}:${r.tgt_line}` : r.tgt_file) : '';
73
+ const locHint = srcLoc || tgtLoc ? ` [${srcLoc}${tgtLoc ? ` → ${tgtLoc}` : ''}]` : '';
74
+ return `[${r.confidence}] ${r.src_name} --${r.relation}--> ${r.tgt_name} (score: ${r.confidence_score})${locHint}`;
75
+ }).join('\n'));
76
+ }
77
+ finally {
78
+ closeDb(db);
79
+ }
80
+ },
81
+ };
82
+ // ── monograph_group_list ──────────────────────────────────────────────────────
83
+ export const monographGroupListTool = {
84
+ name: 'monograph_group_list',
85
+ description: 'List repos in a group.yaml with index metadata (node count and indexed_at timestamp). Useful for checking which repos have been indexed.',
86
+ inputSchema: {
87
+ type: 'object',
88
+ properties: {
89
+ configPath: { type: 'string', description: 'Path to group.yaml (defaults to group.yaml in project cwd)' },
90
+ },
91
+ },
92
+ handler: async (input) => {
93
+ const { getGroupList } = await import('@monoes/monograph');
94
+ const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
95
+ const result = await getGroupList(configPath);
96
+ const firstGroup = result.groups?.[0];
97
+ const allRepos = result.groups?.flatMap((g) => g.repos ?? []) ?? [];
98
+ if (!allRepos.length) {
99
+ return text(`Group: ${firstGroup?.name ?? 'unknown'}\nNo repos configured. Check ${configPath}`);
100
+ }
101
+ const lines = [`Group: ${firstGroup?.name ?? 'unknown'} (${allRepos.length} repos)`];
102
+ for (const r of allRepos) {
103
+ const indexed = r.indexedAt ? r.indexedAt.slice(0, 10) : 'never';
104
+ lines.push(` ${r.name} nodes=${r.nodeCount} indexed=${indexed} ${r.path}`);
105
+ }
106
+ return text(lines.join('\n'));
107
+ },
108
+ };
109
+ // ── monograph_group_query ─────────────────────────────────────────────────────
110
+ export const monographGroupQueryTool = {
111
+ name: 'monograph_group_query',
112
+ description: 'BM25 keyword search merged across all repos in a group.yaml using Reciprocal Rank Fusion (RRF). Returns results tagged with which repo they came from.',
113
+ inputSchema: {
114
+ type: 'object',
115
+ properties: {
116
+ query: { type: 'string', description: 'Search terms' },
117
+ configPath: { type: 'string', description: 'Path to group.yaml (defaults to group.yaml in project cwd)' },
118
+ limit: { type: 'number', description: 'Max results (default 20)' },
119
+ },
120
+ required: ['query'],
121
+ },
122
+ handler: async (input) => {
123
+ const { runGroupQuery } = await import('@monoes/monograph');
124
+ const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
125
+ // Cap query and limit forwarded to runGroupQuery.
126
+ const MAX_GROUP_QUERY_LEN = 16 * 1024;
127
+ const MAX_GROUP_LIMIT = 1_000;
128
+ const rawGroupQuery = input.query;
129
+ const groupQuery = typeof rawGroupQuery === 'string' && rawGroupQuery.length > MAX_GROUP_QUERY_LEN
130
+ ? rawGroupQuery.slice(0, MAX_GROUP_QUERY_LEN)
131
+ : rawGroupQuery;
132
+ const rawGroupLimit = input.limit;
133
+ const groupLimit = Number.isFinite(rawGroupLimit) && (rawGroupLimit ?? 0) > 0
134
+ ? Math.min(Math.floor(rawGroupLimit), MAX_GROUP_LIMIT)
135
+ : rawGroupLimit;
136
+ const results = await runGroupQuery(configPath, groupQuery, groupLimit);
137
+ if (results.length === 0)
138
+ return text('No results found.');
139
+ const lines = results.map(r => `[${r.label}] ${r.name} ${r.filePath ?? ''} repo:${r.repo} (score: ${r.score.toFixed(4)})`);
140
+ return text(lines.join('\n'));
141
+ },
142
+ };
143
+ // ── monograph_group_sync ──────────────────────────────────────────────────────
144
+ export const monographGroupSyncTool = {
145
+ name: 'monograph_group_sync',
146
+ description: 'Scan all repos in a group.yaml for Route nodes, detect shared HTTP contracts across repos, and persist the Contract Registry to disk.',
147
+ inputSchema: {
148
+ type: 'object',
149
+ properties: {
150
+ configPath: { type: 'string', description: 'Path to group.yaml (defaults to group.yaml in project cwd)' },
151
+ },
152
+ },
153
+ handler: async (input) => {
154
+ const { runGroupSync } = await import('@monoes/monograph');
155
+ const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
156
+ try {
157
+ const result = await runGroupSync(configPath);
158
+ return text(JSON.stringify(result, null, 2));
159
+ }
160
+ catch (err) {
161
+ const msg = err instanceof Error ? err.message : String(err);
162
+ return text(`Group sync failed: ${msg}`);
163
+ }
164
+ },
165
+ };
166
+ // ── monograph_group_contracts ─────────────────────────────────────────────────
167
+ export const monographGroupContractsTool = {
168
+ name: 'monograph_group_contracts',
169
+ description: 'List public API contracts (exported symbols, interfaces, and types) for all groups defined in group.yaml.',
170
+ inputSchema: {
171
+ type: 'object',
172
+ properties: {
173
+ configPath: { type: 'string', description: 'Path to group.yaml (defaults to group.yaml in project cwd)' },
174
+ },
175
+ },
176
+ handler: async (input) => {
177
+ const { getGroupContracts } = await import('../monograph-compat.js');
178
+ const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
179
+ const contracts = await getGroupContracts(configPath);
180
+ if (contracts.length === 0)
181
+ return text(`No contracts found. Ensure groups are defined in ${configPath}.`);
182
+ const lines = contracts.map(c => `[${c.groupName}] ${c.symbol} — ${c.filePath}:${c.line}`);
183
+ return text(lines.join('\n'));
184
+ },
185
+ };
186
+ // ── monograph_group_status ────────────────────────────────────────────────────
187
+ export const monographGroupStatusTool = {
188
+ name: 'monograph_group_status',
189
+ description: 'Show health status for all groups: whether each group is indexed, has contracts, and was recently synced.',
190
+ inputSchema: {
191
+ type: 'object',
192
+ properties: {
193
+ configPath: { type: 'string', description: 'Path to group.yaml (defaults to group.yaml in project cwd)' },
194
+ },
195
+ },
196
+ handler: async (input) => {
197
+ const { getGroupStatus } = await import('../monograph-compat.js');
198
+ const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
199
+ const status = await getGroupStatus(configPath);
200
+ const lines = [`Groups: ${status.totalGroups} (${status.indexedGroups} indexed, ${status.stalledGroups} stalled)`];
201
+ for (const g of status.groups) {
202
+ const icon = g.indexed ? (g.stale ? '⚠️' : '✅') : '❌';
203
+ lines.push(`${icon} ${g.name} — ${g.contractCount} contracts${g.lastSync ? ` (synced ${g.lastSync.slice(0, 10)})` : ''}`);
204
+ }
205
+ return text(lines.join('\n'));
206
+ },
207
+ };
208
+ // ── monograph_list_repos ──────────────────────────────────────────────────────
209
+ export const monographListReposTool = {
210
+ name: 'monograph_list_repos',
211
+ description: 'List all repositories tracked in the global monograph registry (~/.monograph/registry.json).',
212
+ inputSchema: {
213
+ type: 'object',
214
+ properties: {},
215
+ },
216
+ handler: async (_input) => {
217
+ const { listRepos } = await import('@monoes/monograph');
218
+ const repos = listRepos();
219
+ if (repos.length === 0)
220
+ return text('No repositories registered. Run monograph build in a repo to register it.');
221
+ const lines = repos.map(r => `${r.name} — ${r.path}${r.lastIndexed ? ` (indexed ${r.lastIndexed.slice(0, 10)})` : ''}${r.nodeCount != null ? ` [${r.nodeCount} nodes, ${r.edgeCount ?? 0} edges]` : ''}`);
222
+ return text(lines.join('\n'));
223
+ },
224
+ };
225
+ //# sourceMappingURL=group-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-tools.js","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/group-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE9C,iFAAiF;AAEjF,MAAM,CAAC,MAAM,sBAAsB,GAAY;IAC7C,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,mEAAmE;IAChF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;SACpD;QACD,QAAQ,EAAE,CAAC,IAAI,CAAC;KACjB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACvB,6EAA6E;QAC7E,2EAA2E;QAC3E,uDAAuD;QACvD,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACvF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,yBAAy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M,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAC1B,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAC5K,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChC,CAAC;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { MCPTool } from '../types.js';
2
+ export declare const monographStatsTool: MCPTool;
3
+ export declare const monographHealthTool: MCPTool;
4
+ export declare const monographStalenessTool: MCPTool;
5
+ export declare const monographDoctorTool: MCPTool;
6
+ //# sourceMappingURL=health-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health-tools.d.ts","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/health-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAM3C,eAAO,MAAM,kBAAkB,EAAE,OAiBhC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,OA+CjC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAwBpC,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,OAejC,CAAC"}