@monoes/monomindcli 2.8.4 → 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 (363) 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/doctor.d.ts.map +1 -1
  23. package/dist/src/commands/doctor.js +22 -18
  24. package/dist/src/commands/doctor.js.map +1 -1
  25. package/dist/src/commands/download-embeddings.d.ts +8 -0
  26. package/dist/src/commands/download-embeddings.d.ts.map +1 -0
  27. package/dist/src/commands/download-embeddings.js +34 -0
  28. package/dist/src/commands/download-embeddings.js.map +1 -0
  29. package/dist/src/commands/hooks.d.ts.map +1 -1
  30. package/dist/src/commands/hooks.js +14 -0
  31. package/dist/src/commands/hooks.js.map +1 -1
  32. package/dist/src/commands/index.d.ts.map +1 -1
  33. package/dist/src/commands/index.js +4 -0
  34. package/dist/src/commands/index.js.map +1 -1
  35. package/dist/src/commands/init-wizard.js +1 -1
  36. package/dist/src/commands/init-wizard.js.map +1 -1
  37. package/dist/src/commands/init.d.ts.map +1 -1
  38. package/dist/src/commands/init.js +48 -1
  39. package/dist/src/commands/init.js.map +1 -1
  40. package/dist/src/commands/monograph.d.ts.map +1 -1
  41. package/dist/src/commands/monograph.js +35 -1
  42. package/dist/src/commands/monograph.js.map +1 -1
  43. package/dist/src/commands/org-observe.d.ts +10 -0
  44. package/dist/src/commands/org-observe.d.ts.map +1 -1
  45. package/dist/src/commands/org-observe.js +195 -31
  46. package/dist/src/commands/org-observe.js.map +1 -1
  47. package/dist/src/commands/org.d.ts +1 -0
  48. package/dist/src/commands/org.d.ts.map +1 -1
  49. package/dist/src/commands/org.js +139 -3
  50. package/dist/src/commands/org.js.map +1 -1
  51. package/dist/src/commands/route.d.ts +1 -9
  52. package/dist/src/commands/route.d.ts.map +1 -1
  53. package/dist/src/commands/route.js +42 -65
  54. package/dist/src/commands/route.js.map +1 -1
  55. package/dist/src/commands/security-cve.d.ts.map +1 -1
  56. package/dist/src/commands/security-cve.js +2 -1
  57. package/dist/src/commands/security-cve.js.map +1 -1
  58. package/dist/src/index.d.ts +0 -10
  59. package/dist/src/index.d.ts.map +1 -1
  60. package/dist/src/index.js +4 -15
  61. package/dist/src/index.js.map +1 -1
  62. package/dist/src/init/copy-assets.d.ts +17 -0
  63. package/dist/src/init/copy-assets.d.ts.map +1 -0
  64. package/dist/src/init/copy-assets.js +271 -0
  65. package/dist/src/init/copy-assets.js.map +1 -0
  66. package/dist/src/init/executor.d.ts +2 -30
  67. package/dist/src/init/executor.d.ts.map +1 -1
  68. package/dist/src/init/executor.js +56 -2493
  69. package/dist/src/init/executor.js.map +1 -1
  70. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  71. package/dist/src/init/helpers-generator.js +9 -0
  72. package/dist/src/init/helpers-generator.js.map +1 -1
  73. package/dist/src/init/settings-generator.d.ts.map +1 -1
  74. package/dist/src/init/settings-generator.js +0 -4
  75. package/dist/src/init/settings-generator.js.map +1 -1
  76. package/dist/src/init/shared.d.ts +112 -0
  77. package/dist/src/init/shared.d.ts.map +1 -0
  78. package/dist/src/init/shared.js +475 -0
  79. package/dist/src/init/shared.js.map +1 -0
  80. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  81. package/dist/src/init/statusline-generator.js +37 -0
  82. package/dist/src/init/statusline-generator.js.map +1 -1
  83. package/dist/src/init/types.d.ts +1 -1
  84. package/dist/src/init/types.d.ts.map +1 -1
  85. package/dist/src/init/upgrade.d.ts +34 -0
  86. package/dist/src/init/upgrade.d.ts.map +1 -0
  87. package/dist/src/init/upgrade.js +477 -0
  88. package/dist/src/init/upgrade.js.map +1 -0
  89. package/dist/src/init/write-antigravity.d.ts +13 -0
  90. package/dist/src/init/write-antigravity.d.ts.map +1 -0
  91. package/dist/src/init/write-antigravity.js +117 -0
  92. package/dist/src/init/write-antigravity.js.map +1 -0
  93. package/dist/src/init/write-capabilities.d.ts +9 -0
  94. package/dist/src/init/write-capabilities.d.ts.map +1 -0
  95. package/dist/src/init/write-capabilities.js +392 -0
  96. package/dist/src/init/write-capabilities.js.map +1 -0
  97. package/dist/src/init/write-claude.d.ts +25 -0
  98. package/dist/src/init/write-claude.d.ts.map +1 -0
  99. package/dist/src/init/write-claude.js +279 -0
  100. package/dist/src/init/write-claude.js.map +1 -0
  101. package/dist/src/init/write-kimicode.d.ts +19 -0
  102. package/dist/src/init/write-kimicode.d.ts.map +1 -0
  103. package/dist/src/init/write-kimicode.js +223 -0
  104. package/dist/src/init/write-kimicode.js.map +1 -0
  105. package/dist/src/init/write-opencode.d.ts +14 -0
  106. package/dist/src/init/write-opencode.d.ts.map +1 -0
  107. package/dist/src/init/write-opencode.js +130 -0
  108. package/dist/src/init/write-opencode.js.map +1 -0
  109. package/dist/src/init/write-runtime-config.d.ts +14 -0
  110. package/dist/src/init/write-runtime-config.d.ts.map +1 -0
  111. package/dist/src/init/write-runtime-config.js +214 -0
  112. package/dist/src/init/write-runtime-config.js.map +1 -0
  113. package/dist/src/init/write-sample-org.d.ts +9 -0
  114. package/dist/src/init/write-sample-org.d.ts.map +1 -0
  115. package/dist/src/init/write-sample-org.js +39 -0
  116. package/dist/src/init/write-sample-org.js.map +1 -0
  117. package/dist/src/knowledge/eval/golden-set.js +1 -1
  118. package/dist/src/knowledge/eval/golden-set.js.map +1 -1
  119. package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -1
  120. package/dist/src/mcp-tools/analyze-tools.js +2 -25
  121. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  122. package/dist/src/mcp-tools/auto-install.d.ts.map +1 -1
  123. package/dist/src/mcp-tools/auto-install.js +2 -1
  124. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  125. package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
  126. package/dist/src/mcp-tools/hooks-routing.js +26 -0
  127. package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
  128. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  129. package/dist/src/mcp-tools/memory-tools.js +2 -37
  130. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  131. package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts +5 -0
  132. package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts.map +1 -0
  133. package/dist/src/mcp-tools/monograph/agent-history-tools.js +177 -0
  134. package/dist/src/mcp-tools/monograph/agent-history-tools.js.map +1 -0
  135. package/dist/src/mcp-tools/monograph/build-tools.d.ts +9 -0
  136. package/dist/src/mcp-tools/monograph/build-tools.d.ts.map +1 -0
  137. package/dist/src/mcp-tools/monograph/build-tools.js +299 -0
  138. package/dist/src/mcp-tools/monograph/build-tools.js.map +1 -0
  139. package/dist/src/mcp-tools/monograph/group-tools.d.ts +10 -0
  140. package/dist/src/mcp-tools/monograph/group-tools.d.ts.map +1 -0
  141. package/dist/src/mcp-tools/monograph/group-tools.js +225 -0
  142. package/dist/src/mcp-tools/monograph/group-tools.js.map +1 -0
  143. package/dist/src/mcp-tools/monograph/health-tools.d.ts +6 -0
  144. package/dist/src/mcp-tools/monograph/health-tools.d.ts.map +1 -0
  145. package/dist/src/mcp-tools/monograph/health-tools.js +113 -0
  146. package/dist/src/mcp-tools/monograph/health-tools.js.map +1 -0
  147. package/dist/src/mcp-tools/monograph/impact-tools.d.ts +9 -0
  148. package/dist/src/mcp-tools/monograph/impact-tools.d.ts.map +1 -0
  149. package/dist/src/mcp-tools/monograph/impact-tools.js +532 -0
  150. package/dist/src/mcp-tools/monograph/impact-tools.js.map +1 -0
  151. package/dist/src/mcp-tools/monograph/index.d.ts +10 -0
  152. package/dist/src/mcp-tools/monograph/index.d.ts.map +1 -0
  153. package/dist/src/mcp-tools/monograph/index.js +73 -0
  154. package/dist/src/mcp-tools/monograph/index.js.map +1 -0
  155. package/dist/src/mcp-tools/monograph/query-tools.d.ts +11 -0
  156. package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -0
  157. package/dist/src/mcp-tools/monograph/query-tools.js +500 -0
  158. package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -0
  159. package/dist/src/mcp-tools/monograph/shared.d.ts +64 -0
  160. package/dist/src/mcp-tools/monograph/shared.d.ts.map +1 -0
  161. package/dist/src/mcp-tools/monograph/shared.js +215 -0
  162. package/dist/src/mcp-tools/monograph/shared.js.map +1 -0
  163. package/dist/src/mcp-tools/monograph/visualize-tools.d.ts +10 -0
  164. package/dist/src/mcp-tools/monograph/visualize-tools.d.ts.map +1 -0
  165. package/dist/src/mcp-tools/monograph/visualize-tools.js +382 -0
  166. package/dist/src/mcp-tools/monograph/visualize-tools.js.map +1 -0
  167. package/dist/src/mcp-tools/monograph-tools.d.ts +4 -23
  168. package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
  169. package/dist/src/mcp-tools/monograph-tools.js +4 -2439
  170. package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
  171. package/dist/src/mcp-tools/monomind-tools.d.ts +8 -0
  172. package/dist/src/mcp-tools/monomind-tools.d.ts.map +1 -1
  173. package/dist/src/mcp-tools/monomind-tools.js +13 -1
  174. package/dist/src/mcp-tools/monomind-tools.js.map +1 -1
  175. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts.map +1 -1
  176. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js +31 -2
  177. package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js.map +1 -1
  178. package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
  179. package/dist/src/mcp-tools/terminal-tools.js +31 -1
  180. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  181. package/dist/src/mcp-tools/types.d.ts +8 -27
  182. package/dist/src/mcp-tools/types.d.ts.map +1 -1
  183. package/dist/src/mcp-tools/types.js +9 -91
  184. package/dist/src/mcp-tools/types.js.map +1 -1
  185. package/dist/src/memory/file-permissions.d.ts +15 -0
  186. package/dist/src/memory/file-permissions.d.ts.map +1 -0
  187. package/dist/src/memory/file-permissions.js +25 -0
  188. package/dist/src/memory/file-permissions.js.map +1 -0
  189. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  190. package/dist/src/memory/memory-bridge.js +94 -34
  191. package/dist/src/memory/memory-bridge.js.map +1 -1
  192. package/dist/src/memory/memory-crud.d.ts.map +1 -1
  193. package/dist/src/memory/memory-crud.js +298 -275
  194. package/dist/src/memory/memory-crud.js.map +1 -1
  195. package/dist/src/memory/memory-initializer.d.ts +2 -4
  196. package/dist/src/memory/memory-initializer.d.ts.map +1 -1
  197. package/dist/src/memory/memory-initializer.js +53 -76
  198. package/dist/src/memory/memory-initializer.js.map +1 -1
  199. package/dist/src/memory/memory-migrations.d.ts +1 -14
  200. package/dist/src/memory/memory-migrations.d.ts.map +1 -1
  201. package/dist/src/memory/memory-migrations.js +52 -105
  202. package/dist/src/memory/memory-migrations.js.map +1 -1
  203. package/dist/src/memory/sona-optimizer.d.ts +1 -1
  204. package/dist/src/memory/sona-optimizer.js +1 -1
  205. package/dist/src/monovector/index.d.ts +16 -19
  206. package/dist/src/monovector/index.d.ts.map +1 -1
  207. package/dist/src/monovector/index.js +50 -8
  208. package/dist/src/monovector/index.js.map +1 -1
  209. package/dist/src/orgrt/approvals.d.ts +16 -0
  210. package/dist/src/orgrt/approvals.d.ts.map +1 -0
  211. package/dist/src/orgrt/approvals.js +72 -0
  212. package/dist/src/orgrt/approvals.js.map +1 -0
  213. package/dist/src/orgrt/bus.d.ts.map +1 -1
  214. package/dist/src/orgrt/bus.js +21 -0
  215. package/dist/src/orgrt/bus.js.map +1 -1
  216. package/dist/src/orgrt/checkpoint-ops.d.ts +19 -0
  217. package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -0
  218. package/dist/src/orgrt/checkpoint-ops.js +219 -0
  219. package/dist/src/orgrt/checkpoint-ops.js.map +1 -0
  220. package/dist/src/orgrt/checkpoint.d.ts +33 -1
  221. package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
  222. package/dist/src/orgrt/checkpoint.js +50 -6
  223. package/dist/src/orgrt/checkpoint.js.map +1 -1
  224. package/dist/src/orgrt/cross-org.d.ts +32 -0
  225. package/dist/src/orgrt/cross-org.d.ts.map +1 -0
  226. package/dist/src/orgrt/cross-org.js +256 -0
  227. package/dist/src/orgrt/cross-org.js.map +1 -0
  228. package/dist/src/orgrt/daemon.d.ts +131 -157
  229. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  230. package/dist/src/orgrt/daemon.js +356 -966
  231. package/dist/src/orgrt/daemon.js.map +1 -1
  232. package/dist/src/orgrt/decisions.d.ts +33 -0
  233. package/dist/src/orgrt/decisions.d.ts.map +1 -0
  234. package/dist/src/orgrt/decisions.js +169 -0
  235. package/dist/src/orgrt/decisions.js.map +1 -0
  236. package/dist/src/orgrt/kimicode-runner.d.ts.map +1 -1
  237. package/dist/src/orgrt/kimicode-runner.js +5 -1
  238. package/dist/src/orgrt/kimicode-runner.js.map +1 -1
  239. package/dist/src/orgrt/opencode-runner.d.ts.map +1 -1
  240. package/dist/src/orgrt/opencode-runner.js +10 -2
  241. package/dist/src/orgrt/opencode-runner.js.map +1 -1
  242. package/dist/src/orgrt/org-memory.d.ts +45 -0
  243. package/dist/src/orgrt/org-memory.d.ts.map +1 -0
  244. package/dist/src/orgrt/org-memory.js +220 -0
  245. package/dist/src/orgrt/org-memory.js.map +1 -0
  246. package/dist/src/orgrt/policy.d.ts +4 -0
  247. package/dist/src/orgrt/policy.d.ts.map +1 -1
  248. package/dist/src/orgrt/policy.js +13 -1
  249. package/dist/src/orgrt/policy.js.map +1 -1
  250. package/dist/src/orgrt/prechecks.d.ts +15 -0
  251. package/dist/src/orgrt/prechecks.d.ts.map +1 -0
  252. package/dist/src/orgrt/prechecks.js +21 -0
  253. package/dist/src/orgrt/prechecks.js.map +1 -0
  254. package/dist/src/orgrt/questions.d.ts +39 -0
  255. package/dist/src/orgrt/questions.d.ts.map +1 -0
  256. package/dist/src/orgrt/questions.js +135 -0
  257. package/dist/src/orgrt/questions.js.map +1 -0
  258. package/dist/src/orgrt/remote.d.ts +25 -0
  259. package/dist/src/orgrt/remote.d.ts.map +1 -0
  260. package/dist/src/orgrt/remote.js +73 -0
  261. package/dist/src/orgrt/remote.js.map +1 -0
  262. package/dist/src/orgrt/scheduler-integration.d.ts +19 -0
  263. package/dist/src/orgrt/scheduler-integration.d.ts.map +1 -0
  264. package/dist/src/orgrt/scheduler-integration.js +90 -0
  265. package/dist/src/orgrt/scheduler-integration.js.map +1 -0
  266. package/dist/src/orgrt/server.d.ts.map +1 -1
  267. package/dist/src/orgrt/server.js +70 -2
  268. package/dist/src/orgrt/server.js.map +1 -1
  269. package/dist/src/orgrt/session.d.ts +30 -1
  270. package/dist/src/orgrt/session.d.ts.map +1 -1
  271. package/dist/src/orgrt/session.js +184 -53
  272. package/dist/src/orgrt/session.js.map +1 -1
  273. package/dist/src/orgrt/state-detector.d.ts +19 -0
  274. package/dist/src/orgrt/state-detector.d.ts.map +1 -0
  275. package/dist/src/orgrt/state-detector.js +59 -0
  276. package/dist/src/orgrt/state-detector.js.map +1 -0
  277. package/dist/src/orgrt/task-dag.d.ts +27 -0
  278. package/dist/src/orgrt/task-dag.d.ts.map +1 -0
  279. package/dist/src/orgrt/task-dag.js +100 -0
  280. package/dist/src/orgrt/task-dag.js.map +1 -0
  281. package/dist/src/orgrt/tool-fence.d.ts +7 -4
  282. package/dist/src/orgrt/tool-fence.d.ts.map +1 -1
  283. package/dist/src/orgrt/tool-fence.js +47 -6
  284. package/dist/src/orgrt/tool-fence.js.map +1 -1
  285. package/dist/src/orgrt/types.d.ts +57 -2
  286. package/dist/src/orgrt/types.d.ts.map +1 -1
  287. package/dist/src/orgrt/types.js +34 -3
  288. package/dist/src/orgrt/types.js.map +1 -1
  289. package/dist/src/routing/model-download.d.ts +49 -0
  290. package/dist/src/routing/model-download.d.ts.map +1 -0
  291. package/dist/src/routing/model-download.js +106 -0
  292. package/dist/src/routing/model-download.js.map +1 -0
  293. package/dist/src/services/crash-reporter.d.ts +5 -0
  294. package/dist/src/services/crash-reporter.d.ts.map +1 -1
  295. package/dist/src/services/crash-reporter.js +49 -0
  296. package/dist/src/services/crash-reporter.js.map +1 -1
  297. package/dist/src/transfer/anonymization/index.d.ts +18 -15
  298. package/dist/src/transfer/anonymization/index.d.ts.map +1 -1
  299. package/dist/src/transfer/anonymization/index.js +7 -119
  300. package/dist/src/transfer/anonymization/index.js.map +1 -1
  301. package/dist/src/ui/dashboard.html +606 -7
  302. package/dist/src/ui/orgs.html +7 -1
  303. package/dist/src/ui/routes-monograph.mjs +6 -0
  304. package/dist/src/ui/server.mjs +327 -7
  305. package/dist/src/update/checker.d.ts.map +1 -1
  306. package/dist/src/update/checker.js +2 -1
  307. package/dist/src/update/checker.js.map +1 -1
  308. package/dist/src/update/executor.d.ts.map +1 -1
  309. package/dist/src/update/executor.js +7 -3
  310. package/dist/src/update/executor.js.map +1 -1
  311. package/dist/src/update/index.d.ts +0 -1
  312. package/dist/src/update/index.d.ts.map +1 -1
  313. package/dist/src/update/index.js +5 -24
  314. package/dist/src/update/index.js.map +1 -1
  315. package/dist/src/utils/db-mutex.d.ts +11 -0
  316. package/dist/src/utils/db-mutex.d.ts.map +1 -0
  317. package/dist/src/utils/db-mutex.js +23 -0
  318. package/dist/src/utils/db-mutex.js.map +1 -0
  319. package/dist/src/utils/input-guards.d.ts +23 -0
  320. package/dist/src/utils/input-guards.d.ts.map +1 -1
  321. package/dist/src/utils/input-guards.js +72 -0
  322. package/dist/src/utils/input-guards.js.map +1 -1
  323. package/dist/src/utils/npm-command.d.ts +10 -0
  324. package/dist/src/utils/npm-command.d.ts.map +1 -0
  325. package/dist/src/utils/npm-command.js +12 -0
  326. package/dist/src/utils/npm-command.js.map +1 -0
  327. package/dist/src/utils/paths.d.ts +28 -0
  328. package/dist/src/utils/paths.d.ts.map +1 -0
  329. package/dist/src/utils/paths.js +108 -0
  330. package/dist/src/utils/paths.js.map +1 -0
  331. package/dist/tsconfig.tsbuildinfo +1 -1
  332. package/package.json +17 -17
  333. package/scripts/download-embedding-model.mjs +97 -0
  334. package/scripts/publish.sh +0 -0
  335. package/scripts/sync-claude-assets.sh +0 -0
  336. package/dist/src/production/circuit-breaker.d.ts +0 -121
  337. package/dist/src/production/circuit-breaker.d.ts.map +0 -1
  338. package/dist/src/production/circuit-breaker.js +0 -262
  339. package/dist/src/production/circuit-breaker.js.map +0 -1
  340. package/dist/src/production/error-handler.d.ts +0 -119
  341. package/dist/src/production/error-handler.d.ts.map +0 -1
  342. package/dist/src/production/error-handler.js +0 -324
  343. package/dist/src/production/error-handler.js.map +0 -1
  344. package/dist/src/production/index.d.ts +0 -6
  345. package/dist/src/production/index.d.ts.map +0 -1
  346. package/dist/src/production/index.js +0 -6
  347. package/dist/src/production/index.js.map +0 -1
  348. package/dist/src/production/monitoring.d.ts +0 -181
  349. package/dist/src/production/monitoring.d.ts.map +0 -1
  350. package/dist/src/production/monitoring.js +0 -375
  351. package/dist/src/production/monitoring.js.map +0 -1
  352. package/dist/src/production/rate-limiter.d.ts +0 -125
  353. package/dist/src/production/rate-limiter.d.ts.map +0 -1
  354. package/dist/src/production/rate-limiter.js +0 -218
  355. package/dist/src/production/rate-limiter.js.map +0 -1
  356. package/dist/src/production/retry.d.ts +0 -48
  357. package/dist/src/production/retry.d.ts.map +0 -1
  358. package/dist/src/production/retry.js +0 -189
  359. package/dist/src/production/retry.js.map +0 -1
  360. package/dist/src/transfer/types.d.ts +0 -245
  361. package/dist/src/transfer/types.d.ts.map +0 -1
  362. package/dist/src/transfer/types.js +0 -6
  363. package/dist/src/transfer/types.js.map +0 -1
@@ -0,0 +1,532 @@
1
+ import { join } from 'path';
2
+ import { existsSync, readdirSync } from 'fs';
3
+ import { getProjectCwd } from '../types.js';
4
+ import { getDbPath, _isValidDb, text } from './shared.js';
5
+ // ── monograph_impact ──────────────────────────────────────────────────────────
6
+ export const monographImpactTool = {
7
+ name: 'monograph_impact',
8
+ description: 'Blast radius analysis: finds all direct and transitive callers of a symbol and computes a risk score.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ name: { type: 'string', description: 'Symbol name to analyze' },
13
+ filePath: { type: 'string', description: 'Optional file path to disambiguate' },
14
+ depth: { type: 'number', description: 'Max BFS depth (default 3, max 6)' },
15
+ },
16
+ required: ['name'],
17
+ },
18
+ handler: async (input) => {
19
+ const { openDb, closeDb } = await import('@monoes/monograph');
20
+ const { getMonographImpact } = await import('@monoes/monograph');
21
+ const db = openDb(getDbPath());
22
+ try {
23
+ // Cap name/filePath; enforce depth ≤ 6 as documented in the schema description.
24
+ const MAX_IMPACT_NAME_LEN = 512;
25
+ const MAX_IMPACT_PATH_LEN = 4 * 1024;
26
+ const rawImpactName = input.name;
27
+ const impactName = typeof rawImpactName === 'string' && rawImpactName.length > MAX_IMPACT_NAME_LEN
28
+ ? rawImpactName.slice(0, MAX_IMPACT_NAME_LEN) : rawImpactName;
29
+ const rawImpactPath = input.filePath;
30
+ const impactPath = typeof rawImpactPath === 'string' && rawImpactPath.length > MAX_IMPACT_PATH_LEN
31
+ ? rawImpactPath.slice(0, MAX_IMPACT_PATH_LEN) : rawImpactPath;
32
+ const rawDepth = input.depth;
33
+ const depth = rawDepth === undefined
34
+ ? undefined
35
+ : (typeof rawDepth === 'number' && Number.isFinite(rawDepth) && rawDepth > 0
36
+ ? Math.min(Math.floor(rawDepth), 6) : 3);
37
+ const result = getMonographImpact(db, {
38
+ name: impactName,
39
+ filePath: impactPath,
40
+ depth,
41
+ });
42
+ if (!result || !result.node)
43
+ return text(`No symbol found: ${impactName}`);
44
+ // Format impact as structured text for direct LLM consumption
45
+ const root = result.node;
46
+ const rootLoc = root.filePath ? (root.startLine != null ? `${root.filePath}:${root.startLine}` : root.filePath) : '';
47
+ const lines = [
48
+ `[${root.label ?? '?'}] ${root.name} ${rootLoc}`,
49
+ '',
50
+ `Blast radius: ${result.affectedFiles?.length ?? 0} symbols affected`,
51
+ ];
52
+ if (result.riskScore != null) {
53
+ const riskLabel = result.riskScore >= 0.8 ? 'HIGH' : result.riskScore >= 0.5 ? 'MEDIUM' : 'LOW';
54
+ lines.push(`Risk score: ${result.riskScore.toFixed(2)} (${riskLabel})`);
55
+ }
56
+ lines.push('');
57
+ const affected = [
58
+ ...(result.directCallers ?? []),
59
+ ...(result.transitiveCallers ?? []).flatMap(t => t.nodes ?? []),
60
+ ];
61
+ if (affected.length > 0) {
62
+ lines.push(`Affected callers (${affected.length}):`);
63
+ for (const sym of affected.slice(0, 20)) {
64
+ const fp = sym.filePath ?? sym.file_path ?? '';
65
+ const ln = sym.startLine ?? sym.start_line;
66
+ const symLoc = fp ? (ln != null ? `${fp}:${ln}` : fp) : '';
67
+ const depth_marker = sym.depth != null ? ` [depth ${sym.depth}]` : '';
68
+ lines.push(` [${sym.label ?? '?'}] ${sym.name ?? sym.id} ${symLoc}${depth_marker}`);
69
+ }
70
+ if (affected.length > 20)
71
+ lines.push(` … ${affected.length - 20} more`);
72
+ }
73
+ return text(lines.join('\n').trim());
74
+ }
75
+ finally {
76
+ closeDb(db);
77
+ }
78
+ },
79
+ };
80
+ // ── monograph_api_impact ──────────────────────────────────────────────────────
81
+ export const monographApiImpactTool = {
82
+ name: 'monograph_api_impact',
83
+ description: 'Analyze the blast radius of an API route: finds the handler, performs forward BFS through CALLS edges, and computes a risk score.',
84
+ inputSchema: {
85
+ type: 'object',
86
+ properties: {
87
+ routePath: { type: 'string', description: 'Route path to analyze (e.g. /api/users)' },
88
+ method: { type: 'string', description: 'Optional HTTP method filter: GET, POST, etc.' },
89
+ },
90
+ required: ['routePath'],
91
+ },
92
+ handler: async (input) => {
93
+ const { openDb, closeDb } = await import('@monoes/monograph');
94
+ const { getMonographApiImpact } = await import('@monoes/monograph');
95
+ const db = openDb(getDbPath());
96
+ try {
97
+ const result = getMonographApiImpact(db, {
98
+ routePath: input.routePath,
99
+ method: input.method,
100
+ });
101
+ if (!result.route)
102
+ return text(`Route not found: ${input.routePath}. Run monograph_build or check the path.`);
103
+ const riskLabel = result.riskScore >= 0.7 ? 'HIGH' : result.riskScore >= 0.4 ? 'MEDIUM' : 'LOW';
104
+ const lines = [
105
+ `Route: ${result.route.method} ${result.route.path} risk=${riskLabel} (${result.riskScore.toFixed(2)})`,
106
+ ];
107
+ if (result.handler) {
108
+ const hLoc = result.handler.filePath
109
+ ? (result.handler.startLine != null ? `${result.handler.filePath}:${result.handler.startLine}` : result.handler.filePath)
110
+ : '';
111
+ lines.push(`Handler: ${result.handler.name}${hLoc ? ` ${hLoc}` : ''}`);
112
+ }
113
+ if (result.callees.length > 0) {
114
+ lines.push(`Callees (${result.callees.length}):`);
115
+ for (const c of result.callees.slice(0, 15)) {
116
+ const loc = c.node.filePath
117
+ ? (c.node.startLine != null ? `${c.node.filePath}:${c.node.startLine}` : c.node.filePath)
118
+ : '';
119
+ lines.push(` ${' '.repeat(c.depth)}→ ${c.node.name} [${c.node.label}]${loc ? ` ${loc}` : ''}`);
120
+ }
121
+ if (result.callees.length > 15)
122
+ lines.push(` … ${result.callees.length - 15} more`);
123
+ }
124
+ if (result.affectedProcesses.length > 0) {
125
+ lines.push(`Affected processes: ${result.affectedProcesses.map(p => p.name).join(', ')}`);
126
+ }
127
+ return text(lines.join('\n'));
128
+ }
129
+ finally {
130
+ closeDb(db);
131
+ }
132
+ },
133
+ };
134
+ // ── monograph_dead_code ──────────────────────────────────────────────────────
135
+ export const monographDeadCodeTool = {
136
+ name: 'monograph_dead_code',
137
+ description: 'Detect dead code: exported functions with zero inbound references, files with no importers, and stale dist build artifacts. Returns structured JSON with candidates grouped by category. Always verify candidates with grep before deleting.',
138
+ inputSchema: {
139
+ type: 'object',
140
+ properties: {
141
+ path: { type: 'string', description: 'Absolute path to the repo (defaults to project cwd)' },
142
+ categories: {
143
+ type: 'array',
144
+ items: { type: 'string', enum: ['dead-functions', 'orphan-files', 'stale-dist'] },
145
+ description: 'Which categories to check (default: all three)',
146
+ },
147
+ },
148
+ },
149
+ handler: async (input) => {
150
+ const { openDb } = await import('@monoes/monograph');
151
+ const repoPath = input.path ?? getProjectCwd();
152
+ const cats = input.categories ?? ['dead-functions', 'orphan-files', 'stale-dist'];
153
+ const result = {};
154
+ const dbPath = getDbPath(repoPath);
155
+ // openDb's fileMustExist option isn't in the currently-published
156
+ // @monoes/monograph release this CLI depends on — check validity
157
+ // ourselves so a missing DB doesn't get silently auto-created empty.
158
+ if (!_isValidDb(dbPath)) {
159
+ return text(JSON.stringify({ error: 'No monograph index found. Run monograph_build first.' }));
160
+ }
161
+ let db = null;
162
+ try {
163
+ db = openDb(dbPath);
164
+ // _isValidDb's size check can't distinguish a real index from an
165
+ // empty-but-schema-migrated DB (better-sqlite3 auto-creates + migrates
166
+ // on open, and other unguarded openDb() call sites in this file can
167
+ // create exactly that as a side effect of an unrelated tool call before
168
+ // monograph_build ever runs). Verify actual content post-open so this
169
+ // reports "never built" instead of a misleading "0 dead functions found".
170
+ const { count } = db.prepare('SELECT COUNT(*) as count FROM nodes').get();
171
+ if (count === 0) {
172
+ return text(JSON.stringify({ error: 'No monograph index found. Run monograph_build first.' }));
173
+ }
174
+ }
175
+ catch {
176
+ return text(JSON.stringify({ error: 'No monograph index found. Run monograph_build first.' }));
177
+ }
178
+ try {
179
+ if (cats.includes('dead-functions')) {
180
+ const { detectDeadCodeNodes } = await import('@monoes/monograph');
181
+ const { readFileSync } = await import('fs');
182
+ const nodes = detectDeadCodeNodes(db);
183
+ // Filter out stale graph nodes: verify the function name actually appears in the source file
184
+ const verified = nodes.filter(n => {
185
+ if (!n.filePath)
186
+ return false;
187
+ try {
188
+ const content = readFileSync(join(repoPath, n.filePath), 'utf-8');
189
+ return content.includes(n.name);
190
+ }
191
+ catch {
192
+ return false;
193
+ }
194
+ });
195
+ const staleCount = nodes.length - verified.length;
196
+ result['dead-functions'] = {
197
+ count: verified.length,
198
+ candidates: verified.map(n => ({
199
+ name: n.name,
200
+ location: n.filePath ? (n.startLine ? `${n.filePath}:${n.startLine}` : n.filePath) : null,
201
+ })),
202
+ ...(staleCount > 0 ? { staleIndexEntries: staleCount, note: 'Some graph entries reference deleted functions. Rebuild the index with monograph_build to clean up.' } : {}),
203
+ };
204
+ }
205
+ if (cats.includes('orphan-files')) {
206
+ const rows = db.prepare(`
207
+ SELECT n.name, n.file_path,
208
+ (SELECT COUNT(*) FROM edges e WHERE e.source_id = n.id AND e.relation = 'IMPORTS') as imports_out,
209
+ (SELECT COUNT(*) FROM edges e WHERE e.target_id = n.id AND e.relation = 'IMPORTS') as imported_by
210
+ FROM nodes n
211
+ WHERE n.label = 'File'
212
+ AND (SELECT COUNT(*) FROM edges e WHERE e.target_id = n.id AND e.relation = 'IMPORTS') = 0
213
+ AND n.file_path NOT LIKE '%/test/%'
214
+ AND n.file_path NOT LIKE '%/tests/%'
215
+ AND n.file_path NOT LIKE '%.test.%'
216
+ AND n.file_path NOT LIKE '%__tests__%'
217
+ AND n.file_path NOT LIKE '%/spec/%'
218
+ AND n.file_path NOT LIKE '%.spec.%'
219
+ AND n.file_path NOT LIKE '%/index.%'
220
+ AND n.file_path NOT LIKE 'bin/%'
221
+ AND n.file_path NOT LIKE 'scripts/%'
222
+ AND n.file_path NOT LIKE '%/cli.ts'
223
+ AND n.file_path NOT LIKE '%/cli.js'
224
+ AND n.file_path NOT LIKE '%/main.ts'
225
+ AND n.file_path NOT LIKE '%/main.js'
226
+ AND n.file_path NOT LIKE '%/dist/%'
227
+ AND n.file_path NOT LIKE '%node_modules%'
228
+ ORDER BY n.file_path
229
+ `).all();
230
+ const withOutbound = rows.filter((r) => r.imports_out > 0);
231
+ const isolated = rows.filter((r) => r.imports_out === 0);
232
+ result['orphan-files'] = {
233
+ count: withOutbound.length,
234
+ note: 'Files that import other modules but nothing imports them. May be lazy-loaded or dynamically imported — verify with grep.',
235
+ candidates: withOutbound.map((r) => ({ file: r.file_path, outboundImports: r.imports_out })),
236
+ ...(isolated.length > 0 ? {
237
+ isolated: {
238
+ count: isolated.length,
239
+ note: 'Files with zero edges in either direction — likely standalone scripts or entry points.',
240
+ files: isolated.map((r) => r.file_path),
241
+ },
242
+ } : {}),
243
+ };
244
+ }
245
+ if (cats.includes('stale-dist')) {
246
+ result['stale-dist'] = findStaleDist(repoPath);
247
+ }
248
+ return text(JSON.stringify(result, null, 2));
249
+ }
250
+ finally {
251
+ db.close();
252
+ }
253
+ },
254
+ };
255
+ function findStaleDist(repoPath) {
256
+ const distSrc = join(repoPath, 'dist', 'src');
257
+ const src = join(repoPath, 'src');
258
+ // Scan a single package for stale dist artifacts
259
+ const scanPkg = (pkgPath, pkgName) => {
260
+ const pkgDistSrc = join(pkgPath, 'dist', 'src');
261
+ const pkgSrc = join(pkgPath, 'src');
262
+ if (!existsSync(pkgDistSrc) || !existsSync(pkgSrc))
263
+ return null;
264
+ const staleDirs = [];
265
+ const staleFiles = [];
266
+ let resourceForks = 0;
267
+ try {
268
+ const distDirs = readdirSync(pkgDistSrc, { withFileTypes: true })
269
+ .filter(d => d.isDirectory() && !d.name.startsWith('.') && !d.name.startsWith('._'));
270
+ const srcDirs = new Set(readdirSync(pkgSrc, { withFileTypes: true })
271
+ .filter(d => d.isDirectory() && !d.name.startsWith('.'))
272
+ .map(d => d.name));
273
+ for (const d of distDirs) {
274
+ if (!srcDirs.has(d.name))
275
+ staleDirs.push(d.name);
276
+ }
277
+ }
278
+ catch { /* skip */ }
279
+ try {
280
+ const distFiles = readdirSync(pkgDistSrc)
281
+ .filter(f => f.endsWith('.js') && !f.startsWith('.') && !f.startsWith('._'));
282
+ for (const f of distFiles) {
283
+ const tsName = f.replace(/\.js$/, '.ts');
284
+ if (!existsSync(join(pkgSrc, tsName)))
285
+ staleFiles.push(f);
286
+ }
287
+ }
288
+ catch { /* skip */ }
289
+ // Count macOS resource fork files
290
+ const countRF = (dir) => {
291
+ try {
292
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
293
+ if (entry.name.startsWith('._'))
294
+ resourceForks++;
295
+ else if (entry.isDirectory())
296
+ countRF(join(dir, entry.name));
297
+ }
298
+ }
299
+ catch { /* skip */ }
300
+ };
301
+ countRF(pkgDistSrc);
302
+ if (staleDirs.length === 0 && staleFiles.length === 0 && resourceForks === 0)
303
+ return null;
304
+ return {
305
+ package: pkgName,
306
+ staleDirs,
307
+ staleFiles,
308
+ ...(resourceForks > 0 ? { macosResourceForks: resourceForks } : {}),
309
+ };
310
+ };
311
+ // Single-package repo
312
+ if (existsSync(distSrc) && existsSync(src)) {
313
+ const finding = scanPkg(repoPath, '.');
314
+ return {
315
+ count: finding ? finding.staleDirs.length + finding.staleFiles.length : 0,
316
+ note: 'Directories/files in dist/src/ with no corresponding source. Fix: rm -rf dist && npm run build.',
317
+ ...(finding ? { findings: [finding] } : {}),
318
+ };
319
+ }
320
+ // Monorepo: scan all packages
321
+ const packagesDir = join(repoPath, 'packages');
322
+ if (!existsSync(packagesDir))
323
+ return { count: 0, note: 'No dist/src or packages/ found' };
324
+ const findings = [];
325
+ try {
326
+ for (const scope of readdirSync(packagesDir, { withFileTypes: true })) {
327
+ if (!scope.isDirectory())
328
+ continue;
329
+ const scopeDir = join(packagesDir, scope.name);
330
+ if (scope.name.startsWith('@')) {
331
+ for (const pkg of readdirSync(scopeDir, { withFileTypes: true })) {
332
+ if (!pkg.isDirectory())
333
+ continue;
334
+ const f = scanPkg(join(scopeDir, pkg.name), `${scope.name}/${pkg.name}`);
335
+ if (f)
336
+ findings.push(f);
337
+ }
338
+ }
339
+ else {
340
+ const f = scanPkg(scopeDir, scope.name);
341
+ if (f)
342
+ findings.push(f);
343
+ }
344
+ }
345
+ }
346
+ catch { /* skip */ }
347
+ return {
348
+ count: findings.reduce((s, f) => s + (f.staleDirs?.length ?? 0) + (f.staleFiles?.length ?? 0), 0),
349
+ note: 'Directories/files in dist/src/ with no corresponding source. Fix: rm -rf dist && npm run build.',
350
+ findings,
351
+ };
352
+ }
353
+ // ── monograph_route_map ───────────────────────────────────────────────────────
354
+ export const monographRouteMapTool = {
355
+ name: 'monograph_route_map',
356
+ description: 'List all HTTP routes in the codebase with their handler info. Supports filtering by URL prefix or HTTP method.',
357
+ inputSchema: {
358
+ type: 'object',
359
+ properties: {
360
+ prefix: { type: 'string', description: 'Filter routes whose path contains this prefix (e.g. /api)' },
361
+ method: { type: 'string', description: 'Filter by HTTP method: GET, POST, PUT, DELETE, PATCH, ANY' },
362
+ includeMiddleware: { type: 'boolean', description: 'Include middleware/use routes (default: false)' },
363
+ },
364
+ },
365
+ handler: async (input) => {
366
+ const { openDb, closeDb } = await import('@monoes/monograph');
367
+ const { getMonographRouteMap } = await import('@monoes/monograph');
368
+ const db = openDb(getDbPath());
369
+ try {
370
+ const result = getMonographRouteMap(db, {
371
+ prefix: input.prefix,
372
+ method: input.method,
373
+ includeMiddleware: input.includeMiddleware,
374
+ });
375
+ if (result.routes.length === 0)
376
+ return text('No routes found. Run monograph_build first or adjust your filters.');
377
+ const lines = [`Routes (${result.total} total):`];
378
+ for (const r of result.routes) {
379
+ const loc = r.handlerFile
380
+ ? (r.handlerLine != null ? `${r.handlerFile}:${r.handlerLine}` : r.handlerFile)
381
+ : '';
382
+ const mw = r.middlewareChain.length > 0 ? ` middleware: ${r.middlewareChain.join(' → ')}` : '';
383
+ lines.push(` ${r.method} ${r.path}${r.handlerName ? ` → ${r.handlerName}` : ''}${loc ? ` (${loc})` : ''}${mw}`);
384
+ }
385
+ return text(lines.join('\n'));
386
+ }
387
+ finally {
388
+ closeDb(db);
389
+ }
390
+ },
391
+ };
392
+ // ── monograph_shape_check ─────────────────────────────────────────────────────
393
+ export const monographShapeCheckTool = {
394
+ name: 'monograph_shape_check',
395
+ description: 'Validate API route response shapes: checks that handler return keys match consumer property accesses. Detects shape mismatches between producer and consumer.',
396
+ inputSchema: {
397
+ type: 'object',
398
+ properties: {
399
+ route: { type: 'string', description: 'Filter by route path substring (e.g. /api/users)' },
400
+ file: { type: 'string', description: 'Filter by source file path substring' },
401
+ },
402
+ },
403
+ handler: async (input) => {
404
+ const { openDb, closeDb } = await import('@monoes/monograph');
405
+ const { getShapeCheck } = await import('@monoes/monograph');
406
+ const db = openDb(getDbPath());
407
+ const repoPath = getProjectCwd();
408
+ try {
409
+ const result = getShapeCheck(db, repoPath, {
410
+ route: input.route,
411
+ file: input.file,
412
+ });
413
+ // Render as structured text so LLMs can act on it directly without parsing JSON.
414
+ const lines = [];
415
+ lines.push(`Shape check: ${result.message}`);
416
+ if (result.route) {
417
+ const handlerLoc = result.route.handlerFile
418
+ ? ` Handler: ${result.route.handlerName} [${result.route.handlerFile}]`
419
+ : ` Handler: ${result.route.handlerName}`;
420
+ lines.push(`Route: ${result.route.method} ${result.route.path}`);
421
+ lines.push(handlerLoc);
422
+ }
423
+ if (result.shape.returnedKeys.length > 0) {
424
+ lines.push(` Returned keys: ${result.shape.returnedKeys.join(', ')}`);
425
+ }
426
+ if (result.shape.accessedKeys.length > 0) {
427
+ lines.push(` Accessed keys: ${result.shape.accessedKeys.join(', ')}`);
428
+ }
429
+ if (result.shape.mismatches.length > 0) {
430
+ lines.push(` Mismatches (accessed but not returned): ${result.shape.mismatches.join(', ')}`);
431
+ }
432
+ if (result.shape.extra.length > 0) {
433
+ lines.push(` Unused returned keys: ${result.shape.extra.join(', ')}`);
434
+ }
435
+ if (result.consumers.length > 0) {
436
+ lines.push(` Consumers (${result.consumers.length}):`);
437
+ for (const c of result.consumers.slice(0, 10)) {
438
+ lines.push(` - ${c.name} [${c.filePath}]`);
439
+ }
440
+ if (result.consumers.length > 10) {
441
+ lines.push(` … ${result.consumers.length - 10} more`);
442
+ }
443
+ }
444
+ return text(lines.join('\n'));
445
+ }
446
+ finally {
447
+ closeDb(db);
448
+ }
449
+ },
450
+ };
451
+ // ── monograph_rename ──────────────────────────────────────────────────────────
452
+ export const monographRenameTool = {
453
+ name: 'monograph_rename',
454
+ description: 'Dry-run multi-file rename: finds all references to a symbol and shows before/after diffs without writing files.',
455
+ inputSchema: {
456
+ type: 'object',
457
+ properties: {
458
+ oldName: { type: 'string', description: 'Current symbol name' },
459
+ newName: { type: 'string', description: 'New symbol name' },
460
+ filePath: { type: 'string', description: 'Optional file path to disambiguate the symbol' },
461
+ dryRun: { type: 'boolean', description: 'Always true — files are never modified (default: true)' },
462
+ },
463
+ required: ['oldName', 'newName'],
464
+ },
465
+ handler: async (input) => {
466
+ const { openDb, closeDb } = await import('@monoes/monograph');
467
+ const { getMonographRename } = await import('@monoes/monograph');
468
+ const db = openDb(getDbPath());
469
+ try {
470
+ const result = getMonographRename(db, {
471
+ oldName: input.oldName,
472
+ newName: input.newName,
473
+ filePath: input.filePath,
474
+ dryRun: input.dryRun ?? true,
475
+ });
476
+ // Format as structured text for direct LLM navigation instead of raw JSON
477
+ const rn = result;
478
+ if (!rn)
479
+ return text(`Symbol not found: ${input.oldName}`);
480
+ const occurrences = rn.occurrences ?? rn.references ?? [];
481
+ const lines = [
482
+ `Rename: ${input.oldName} → ${input.newName} (dry-run)`,
483
+ `Occurrences: ${occurrences.length}`,
484
+ '',
485
+ ];
486
+ for (const occ of occurrences.slice(0, 30)) {
487
+ const fp = occ.filePath ?? occ.file_path ?? '';
488
+ const ln = occ.line ?? occ.startLine ?? occ.start_line;
489
+ const loc = fp ? (ln != null ? `${fp}:${ln}` : fp) : '';
490
+ lines.push(` ${loc || occ}`);
491
+ }
492
+ if (occurrences.length > 30)
493
+ lines.push(` … ${occurrences.length - 30} more`);
494
+ return text(lines.join('\n').trim());
495
+ }
496
+ finally {
497
+ closeDb(db);
498
+ }
499
+ },
500
+ };
501
+ // ── monograph_tool_map ────────────────────────────────────────────────────────
502
+ export const monographToolMapTool = {
503
+ name: 'monograph_tool_map',
504
+ description: 'List MCP/RPC tool definitions in the knowledge graph with handler associations. Shows which functions handle each tool.',
505
+ inputSchema: {
506
+ type: 'object',
507
+ properties: {
508
+ tool: { type: 'string', description: 'Filter by tool name substring' },
509
+ },
510
+ },
511
+ handler: async (input) => {
512
+ const { openDb, closeDb } = await import('@monoes/monograph');
513
+ const { getToolMap } = await import('@monoes/monograph');
514
+ const db = openDb(getDbPath());
515
+ try {
516
+ const results = getToolMap(db, { tool: input.tool });
517
+ if (results.length === 0)
518
+ return text('No tools found. Run monograph_build first.');
519
+ const lines = results.map(r => {
520
+ const loc = r.handlerFile
521
+ ? (r.handlerLine != null ? `${r.handlerFile}:${r.handlerLine}` : r.handlerFile)
522
+ : (r.filePath ?? '');
523
+ return `${r.name}${r.handlerName ? ` → ${r.handlerName}` : ''}${loc ? ` (${loc})` : ''}`;
524
+ });
525
+ return text(`Tools (${results.length}):\n${lines.join('\n')}`);
526
+ }
527
+ finally {
528
+ closeDb(db);
529
+ }
530
+ },
531
+ };
532
+ //# sourceMappingURL=impact-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impact-tools.js","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/impact-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAA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AC,CAAC;QACzD,MAAM,EAAE,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAA0B,EAAE,CAAC,CAAC;YAC3E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC,4CAA4C,CAAC,CAAC;YACpF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAC5B,MAAM,GAAG,GAAG,CAAC,CAAC,WAAW;oBACvB,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;oBAC/E,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;gBACvB,OAAO,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC5F,CAAC,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,UAAU,OAAO,CAAC,MAAM,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjE,CAAC;gBAAS,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IAC5B,CAAC;CACF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { MCPTool } from '../types.js';
2
+ export { preferSymbolHits } from './shared.js';
3
+ /**
4
+ * Full tool list regardless of gating — used by the graphify compat shims,
5
+ * which must resolve targets (e.g. monograph_community) even when the
6
+ * advanced set is not exposed over MCP.
7
+ */
8
+ export declare const allMonographTools: MCPTool[];
9
+ export declare const monographTools: MCPTool[];
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAuE/C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,EAAuD,CAAC;AAE/F,eAAO,MAAM,cAAc,EAAE,OAAO,EAAsD,CAAC"}