collabmd 0.1.47 → 0.1.49

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 (305) hide show
  1. package/README.md +70 -11
  2. package/bin/collabmd.js +3 -0
  3. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-C-nmgL5g.js +1 -0
  4. package/dist/client/assets/JetBrainsMono-Regular-BQaDgvhP.woff2 +0 -0
  5. package/dist/client/assets/abnfDiagram-VCTEODGH-CdVZqicp.js +1 -0
  6. package/dist/client/assets/{architectureDiagram-5GKGNRK7-I39sYjHI.js → architectureDiagram-5GKGNRK7-wUo0bXif.js} +3 -3
  7. package/dist/client/assets/babel-CY5KOv-I.js +16 -0
  8. package/dist/client/assets/{blockDiagram-NRAW4CY4-C6DtJy5Y.js → blockDiagram-I7D4REHJ-BRSK3m49.js} +4 -4
  9. package/dist/client/assets/browser-utils-DbXSMI-6.js +1 -0
  10. package/dist/client/assets/{c4Diagram-UCG6FXSJ-CtWtxS9_.js → c4Diagram-7LVT6UL2-yD2poxqw.js} +1 -1
  11. package/dist/client/assets/channel-Fa4GS_-F.js +1 -0
  12. package/dist/client/assets/chunk-2E4U76K2-BPnTT-J3.js +2 -0
  13. package/dist/client/assets/{chunk-TEH6E4GO-DVayPj-q.js → chunk-4HAMMTFA-DStbIfJ1.js} +20 -20
  14. package/dist/client/assets/{chunk-75Z2AOVW-CdFSaPjz.js → chunk-75Z2AOVW-C5pGd3W9.js} +1 -1
  15. package/dist/client/assets/{chunk-CLGD4ZFX-DQLgbQrv.js → chunk-CLGD4ZFX-BMeArk03.js} +1 -1
  16. package/dist/client/assets/chunk-DU6HZSFF-Zkp69c6c.js +127 -0
  17. package/dist/client/assets/{chunk-F27PBJKO-CNHIFhjo.js → chunk-F27PBJKO-D4xNct1r.js} +1 -1
  18. package/dist/client/assets/{chunk-GMAD6QVW-CbcBqPM5.js → chunk-GMAD6QVW-NZ6WpDb8.js} +1 -1
  19. package/dist/client/assets/{chunk-OBVCFTLP-BJR7u1jh.js → chunk-GVQU2GXP-D8SDprfX.js} +1 -1
  20. package/dist/client/assets/{chunk-G27WJ6UU-D9-eg537.js → chunk-IMKFNOWR-D8jEuU3Q.js} +2 -2
  21. package/dist/client/assets/{chunk-JQ64N6SF-DSFNH4bh.js → chunk-L3NEJ4N5-aijKP-eh.js} +1 -1
  22. package/dist/client/assets/chunk-OSK3NFVY-CCbLQAMa.js +10 -0
  23. package/dist/client/assets/{chunk-P2QGCYS3-BRpqY32H.js → chunk-P2QGCYS3-Oag_FdCq.js} +1 -1
  24. package/dist/client/assets/{chunk-POPQ4Y6H-Cb4SlVZF.js → chunk-POPQ4Y6H-CYnpIgXT.js} +1 -1
  25. package/dist/client/assets/{chunk-PWAF6VOD-Cz8IwBB5.js → chunk-PWAF6VOD-JSNrcBmP.js} +1 -1
  26. package/dist/client/assets/{chunk-RM4UPSZO-CWRwxNWJ.js → chunk-RM4UPSZO-DOWllDY8.js} +4 -4
  27. package/dist/client/assets/{chunk-RHFEMEQ7-CWY8cf4H.js → chunk-SHT3W25Y-BiQGljao.js} +5 -5
  28. package/dist/client/assets/{chunk-SVP7TREG-CyHOmcac.js → chunk-SVP7TREG-DB485R5x.js} +1 -1
  29. package/dist/client/assets/{chunk-LCL6LL3I-DmDkVukh.js → chunk-TICWLB2K-8rAVvoS3.js} +4 -4
  30. package/dist/client/assets/{chunk-CKBBP62Z-DG26UiBv.js → chunk-TLUHSLCS-DTY5v0aj.js} +2 -2
  31. package/dist/client/assets/classDiagram-ZZMXUADV-BsQWoR3Q.js +1 -0
  32. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BsQWoR3Q.js +1 -0
  33. package/dist/client/assets/{comment-thread-store-CdcwrObc.js → comment-thread-store-CX98zR6q.js} +1 -1
  34. package/dist/client/assets/comment-threads-BnRwo5B9.js +4 -0
  35. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CdTPi2yO.js → cynefinDiagram-5FMLGOSQ-rTz9RhFH.js} +1 -1
  36. package/dist/client/assets/{dagre-3AP2YEHR-5gtJtd0O.js → dagre-GXQ25YYZ-Cr67wLpQ.js} +2 -2
  37. package/dist/client/assets/{diagram-S7CK7UJ4-BudWz9WU.js → diagram-S7CK7UJ4-DywERe__.js} +2 -2
  38. package/dist/client/assets/{diagram-UQ7AKVKN-3v4rbH-s.js → diagram-UQ7AKVKN-CNYlXtu4.js} +1 -1
  39. package/dist/client/assets/diagram-VSXAHHWV-0H1a61Bn.js +3 -0
  40. package/dist/client/assets/{diagram-VX7I27RA-C_-rj0sw.js → diagram-VX7I27RA-CsJbsx5F.js} +1 -1
  41. package/dist/client/assets/{diagram-Z3DM3KII-B4yxavgj.js → diagram-Z3DM3KII-D0mLxEgI.js} +1 -1
  42. package/dist/client/assets/dist--hk9I5HQ.js +1 -0
  43. package/dist/client/assets/{dist-DutPuFmC.js → dist-B1XEa-Zs.js} +1 -1
  44. package/dist/client/assets/dist-Bd1JucQF.js +1 -0
  45. package/dist/client/assets/{dist-DZAAWTG-.js → dist-C0G3AaXG.js} +1 -1
  46. package/dist/client/assets/dist-ChRoo3IB.js +9 -0
  47. package/dist/client/assets/dist-Dm4w5UId.js +1 -0
  48. package/dist/client/assets/{dist-B_yQaEv_.js → dist-DpYDHR9p.js} +1 -1
  49. package/dist/client/assets/{dist-CietwTVS.js → dist-DzNmC81X.js} +1 -1
  50. package/dist/client/assets/{dist-DDUn5zTz.js → dist-GvvCNBe4.js} +1 -1
  51. package/dist/client/assets/dist-JaU3aRlD.js +19 -0
  52. package/dist/client/assets/{dist-Bw3VIE_v.js → dist-TW8iFRyW.js} +1 -1
  53. package/dist/client/assets/{dist-Dir5dDKZ.js → dist-jVU5Be5P.js} +1 -1
  54. package/dist/client/assets/document-formatter-rDDjRfZ2.js +2 -0
  55. package/dist/client/assets/drawioEditor-JubEEha7.js +9 -0
  56. package/dist/client/assets/ebnfDiagram-PWID7BFC-HeTxHpCU.js +1 -0
  57. package/dist/client/assets/editor-session-Bk6oIvSr.js +54 -0
  58. package/dist/client/assets/embedded-editor-base-BlCgz6mw.css +1 -0
  59. package/dist/client/assets/{erDiagram-SSCWMZ5O-C-iy6VkX.js → erDiagram-RLTQ6QDP-CbrDdd5P.js} +2 -2
  60. package/dist/client/assets/{es-CAsWR6hG.js → es-Bfdp096f.js} +13 -13
  61. package/dist/client/assets/estree-CuT_pB8K.js +44 -0
  62. package/dist/client/assets/excalidraw-element-link-YLIaTnVF.js +7 -0
  63. package/dist/client/assets/{excalidraw-scene-BOben2gr.js → excalidraw-scene-6uROebca.js} +1 -1
  64. package/dist/client/assets/{excalidraw-editor-BlcN6umJ.css → excalidrawEditor-BbSbI80a.css} +1 -1
  65. package/dist/client/assets/excalidrawEditor-dBMbRX_S.js +9 -0
  66. package/dist/client/assets/export-page-CRRQ2NEl.js +57 -0
  67. package/dist/client/assets/exportDocument-BlQRd9_m.js +2 -0
  68. package/dist/client/assets/exportDocument-CNSbjZwu.css +1 -0
  69. package/dist/client/assets/{file-icon-svg-CQAjlWjK.js → file-icon-svg-Y_kpF957.js} +1 -1
  70. package/dist/client/assets/file-kind-BwMIcZbi.js +1 -0
  71. package/dist/client/assets/file-search-DDLyyLDU.js +1 -0
  72. package/dist/client/assets/flowDiagram-HODETNUW-D5Gy0wmg.js +1 -0
  73. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DtKHAbez.js → ganttDiagram-EL5Y4UJY-BHgOYiZz.js} +1 -1
  74. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-oue8fQ5o.js → gitGraphDiagram-WWUBYQGX-Dl__X3Sk.js} +1 -1
  75. package/dist/client/assets/html-Cdnr2qzU.js +25 -0
  76. package/dist/client/assets/image-ZVKINSPA-DgzW5zAy.js +1 -0
  77. package/dist/client/assets/index-D3RER1SZ.js +1023 -0
  78. package/dist/client/assets/index-DREVKl_K.css +1 -0
  79. package/dist/client/assets/{infoDiagram-RXCK75RN-BMzo6KIn.js → infoDiagram-27XIBGKW-DBpoANC9.js} +1 -1
  80. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BIM3h287.js → ishikawaDiagram-5VMMS53U-BMPC6hfp.js} +1 -1
  81. package/dist/client/assets/{journeyDiagram-EYS64GPL-mF6Lh8O-.js → journeyDiagram-3NMN7TZE-B1sApUmM.js} +2 -2
  82. package/dist/client/assets/{kanban-definition-3QL26DDD-DLN2NyoR.js → kanban-definition-UXKFOSKX-C9yP4td1.js} +4 -4
  83. package/dist/client/assets/{line-BfTWJmgf.js → line-BFl3ujec.js} +1 -1
  84. package/dist/client/assets/markdown-CByV-4CU.js +70 -0
  85. package/dist/client/assets/{mermaid.core-CLZBlpIW.js → mermaid.core-BrY09czX.js} +5 -5
  86. package/dist/client/assets/mermaid.core-DfcNfOTv.js +1 -0
  87. package/dist/client/assets/{mindmap-definition-FBJOCRG2-CRyHaHTk.js → mindmap-definition-YA3MSWOX-BUQHcYbK.js} +8 -8
  88. package/dist/client/assets/pegDiagram-XKGWAZYB-Bi2Iml7Z.js +1 -0
  89. package/dist/client/assets/{pieDiagram-E7YTZNPT-B5OZPb88.js → pieDiagram-E7YTZNPT-_gYXnMoi.js} +1 -1
  90. package/dist/client/assets/preview-render-compiler-CfxJYldJ.js +41 -0
  91. package/dist/client/assets/preview-render-compiler-Cu8_i9iS.js +1 -0
  92. package/dist/client/assets/{preview-render-worker-BmN79bVc.js → preview-render-worker-c4Yi93qW.js} +41 -35
  93. package/dist/client/assets/prod-BiJL30sl.js +1 -0
  94. package/dist/client/assets/prod-qAk7rHa4.js +177 -0
  95. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Drrw14YH.js → quadrantDiagram-AXDQQJYC-DwexhEhd.js} +1 -1
  96. package/dist/client/assets/quick-switcher-controller-BoIK_wuG.js +1 -0
  97. package/dist/client/assets/railroadDiagram-O6MQD6OU-BVA5UbMu.js +1 -0
  98. package/dist/client/assets/{requirementDiagram-EFPCY7ZU-CRZG6mRB.js → requirementDiagram-BXWQKSXE-C4cKwiIw.js} +2 -2
  99. package/dist/client/assets/runtime-config-DcmnGcXU.js +1 -0
  100. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DvarEJpo.js → sankeyDiagram-P5KCCOFB-B5HHkRT2.js} +1 -1
  101. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-B4oWlb-w.js → sequenceDiagram-WJ2MYXX4-BX6jqJFD.js} +6 -6
  102. package/dist/client/assets/standalone-6z5x8CWe.js +29 -0
  103. package/dist/client/assets/{stateDiagram-HBIQ2CUA-qbHIIqRZ.js → stateDiagram-D77RDMKH-CmqxyRGx.js} +1 -1
  104. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-zoLLQVyh.js +1 -0
  105. package/dist/client/assets/{swimlanes-XN3QIQJK-xB6CtUGj.js → swimlanes-42K2YHIH-Bmgb9Zld.js} +1 -1
  106. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DS-KQN37.js +8 -0
  107. package/dist/client/assets/{timeline-definition-24CTP7MA-Lj_yTNlY.js → timeline-definition-24CTP7MA-BA-lVH6P.js} +1 -1
  108. package/dist/client/assets/vault-api-client-iZLhMJKe.js +6 -0
  109. package/dist/client/assets/{vennDiagram-4TSXK5OY-BekRp5Y0.js → vennDiagram-4TSXK5OY-DNdUC_Xj.js} +1 -1
  110. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-kdnV_Hdm.js → wardleyDiagram-VM6X3IG4-C2oY-YbF.js} +1 -1
  111. package/dist/client/assets/wiki-link-resolver-DFIwErjc.js +1 -0
  112. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DufGwNSB.js → xychartDiagram-S5SC5T6Z-CoIR8CBX.js} +1 -1
  113. package/dist/client/assets/yaml-9ltHPDNO.js +154 -0
  114. package/dist/client/assets/{yjs-provider-reset-guard-DE0vINDP.js → yjs-provider-reset-guard-9ul1qF6k.js} +1 -1
  115. package/dist/client/drawio-editor.html +11 -3
  116. package/dist/client/excalidraw-editor.html +45 -2
  117. package/dist/client/export-document.html +3 -3
  118. package/dist/client/index.html +106 -52
  119. package/integrations/pi/index.ts +94 -0
  120. package/package.json +41 -29
  121. package/src/client/app/drawio-editor.html +2 -2
  122. package/src/client/app/excalidraw-editor.html +2 -2
  123. package/src/client/app/export-document.html +1 -1
  124. package/src/client/app/index.html +88 -50
  125. package/src/client/app/main-entry.js +15 -1
  126. package/src/client/application/app-shell/chat-feature.js +7 -22
  127. package/src/client/application/app-shell/export-feature.js +17 -1
  128. package/src/client/application/app-shell/git-feature.js +51 -14
  129. package/src/client/application/app-shell/presence-feature.js +8 -25
  130. package/src/client/application/app-shell/ui-feature-identity.js +13 -0
  131. package/src/client/application/app-shell/ui-feature-shell.js +199 -99
  132. package/src/client/application/app-shell/ui-feature-sidebar.js +43 -7
  133. package/src/client/application/app-shell/ui-feature-tab-activity.js +19 -6
  134. package/src/client/application/app-shell/ui-feature-toolbar.js +16 -129
  135. package/src/client/application/app-shell-elements.js +8 -0
  136. package/src/client/application/preview-render-compiler.js +1 -87
  137. package/src/client/application/preview-render-scheduler.js +8 -24
  138. package/src/client/application/preview-renderer.js +2 -2
  139. package/src/client/application/webmcp-diagram-renderer.js +47 -0
  140. package/src/client/application/workspace-coordinator.js +23 -4
  141. package/src/client/application/workspace-preview-controller.js +120 -2
  142. package/src/client/application/workspace-route-controller.js +11 -1
  143. package/src/client/assets/vendor/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
  144. package/src/client/assets/vendor/jetbrains-mono/OFL.txt +93 -0
  145. package/src/client/bootstrap/collabmd-app-shell.js +99 -6
  146. package/src/client/domain/document-formatter.js +193 -0
  147. package/src/client/domain/excalidraw-element-link.js +73 -0
  148. package/src/client/domain/excalidraw-scene.js +21 -0
  149. package/src/client/domain/file-search.js +73 -0
  150. package/src/client/domain/git-labels.js +5 -0
  151. package/src/client/domain/hash-routes.js +8 -0
  152. package/src/client/domain/room.js +1 -5
  153. package/src/client/domain/runtime-paths.js +5 -0
  154. package/src/client/domain/vault-paths.js +6 -4
  155. package/src/client/domain/wiki-link-completions.js +20 -20
  156. package/src/client/drawio-editor.js +8 -3
  157. package/src/client/excalidraw-editor.js +287 -16
  158. package/src/client/export/export-host.js +59 -36
  159. package/src/client/export/export-page.js +14 -4
  160. package/src/client/export/export-pipeline.js +270 -42
  161. package/src/client/infrastructure/agent-connection-api-client.js +23 -0
  162. package/src/client/infrastructure/auth-client.js +3 -13
  163. package/src/client/infrastructure/editor-session.js +15 -0
  164. package/src/client/infrastructure/editor-view-adapter.js +73 -14
  165. package/src/client/infrastructure/excalidraw-room-client.js +80 -1
  166. package/src/client/infrastructure/git-api-client.js +39 -33
  167. package/src/client/infrastructure/lobby-presence.js +2 -5
  168. package/src/client/infrastructure/runtime-config.js +11 -1
  169. package/src/client/infrastructure/tab-activity-lock.js +2 -5
  170. package/src/client/infrastructure/vault-api-client.js +33 -26
  171. package/src/client/infrastructure/webmcp-tool-registry.js +283 -0
  172. package/src/client/infrastructure/workspace-sync-client.js +6 -4
  173. package/src/client/presentation/agent-connection-controller.js +255 -0
  174. package/src/client/presentation/backlinks-panel.js +3 -0
  175. package/src/client/presentation/bases-preview-controller.js +59 -26
  176. package/src/client/presentation/comment-ui/comment-ui-card.js +4 -2
  177. package/src/client/presentation/create-menu-presenter.js +19 -16
  178. package/src/client/presentation/excalidraw-embed-controller.js +164 -4
  179. package/src/client/presentation/file-action-controller.js +15 -2
  180. package/src/client/presentation/file-explorer-controller.js +3 -0
  181. package/src/client/presentation/file-explorer-view.js +71 -12
  182. package/src/client/presentation/file-history-view-controller.js +19 -12
  183. package/src/client/presentation/file-tree-state.js +1 -11
  184. package/src/client/presentation/git-diff-view-controller.js +70 -53
  185. package/src/client/presentation/git-panel-controller.js +86 -32
  186. package/src/client/presentation/image-lightbox-controller.js +20 -16
  187. package/src/client/presentation/layout-controller.js +3 -1
  188. package/src/client/presentation/quick-switcher-controller.js +74 -232
  189. package/src/client/presentation/quick-switcher-text-search.js +10 -14
  190. package/src/client/styles/components/navigation.css +1 -2
  191. package/src/client/styles/components/scrollbars.css +10 -0
  192. package/src/client/styles/export-document.css +44 -29
  193. package/src/client/styles/features/agent-connection.css +202 -0
  194. package/src/client/styles/features/collaboration-chat.css +8 -1
  195. package/src/client/styles/features/collaboration-dialogs.css +16 -1
  196. package/src/client/styles/features/collaboration-presence.css +30 -5
  197. package/src/client/styles/features/diff-toolbar.css +1 -1
  198. package/src/client/styles/features/media-lightbox.css +12 -3
  199. package/src/client/styles/features/preview-markdown.css +54 -0
  200. package/src/client/styles/features/quick-switcher.css +20 -11
  201. package/src/client/styles/foundation/themes.css +2 -0
  202. package/src/client/styles/foundation/tokens.css +8 -0
  203. package/src/client/styles/layout/editor-page.css +25 -11
  204. package/src/client/styles/layout/responsive.css +2 -20
  205. package/src/client/styles/layout/shell.css +77 -24
  206. package/src/client/styles/layout/sidebar.css +7 -4
  207. package/src/client/styles/layout/view-modes.css +2 -0
  208. package/src/client/styles/overrides/codemirror.css +31 -19
  209. package/src/client/styles/primitives/controls.css +21 -54
  210. package/src/client/styles/style.css +1 -0
  211. package/src/client/styles/surfaces/excalidraw-editor.css +42 -0
  212. package/src/domain/agent-tool-definitions.js +796 -0
  213. package/src/domain/collabmd-content-capabilities.js +149 -0
  214. package/src/domain/collaboration-protocol.js +2 -0
  215. package/src/domain/comment-threads.js +3 -5
  216. package/src/domain/diagram-source.js +50 -0
  217. package/src/domain/editable-content-revision.js +10 -0
  218. package/src/domain/editable-text.js +3 -0
  219. package/src/domain/exact-text-edits.js +69 -0
  220. package/src/domain/excalidraw-agent-scene.js +522 -0
  221. package/src/domain/excalidraw-agent-verification.js +460 -0
  222. package/src/domain/excalidraw-room-codec.js +1 -5
  223. package/src/domain/file-kind.js +12 -1
  224. package/src/domain/video-embed.js +76 -0
  225. package/src/server/application/agent-connection-service.js +178 -0
  226. package/src/server/application/agent-content-service.js +773 -0
  227. package/src/server/application/workspace-reconciliation.js +5 -7
  228. package/src/server/config/env.js +51 -1
  229. package/src/server/create-app-server.js +36 -0
  230. package/src/server/domain/bases/base-query-service.js +1 -5
  231. package/src/server/domain/collaboration/collaboration-room.js +121 -25
  232. package/src/server/domain/collaboration/protocol.js +4 -0
  233. package/src/server/domain/hosted-workspace.js +21 -0
  234. package/src/server/domain/markdown-reference-extractor.js +15 -1
  235. package/src/server/domain/ripgrep-search-service.js +110 -37
  236. package/src/server/infrastructure/git/git-service.js +19 -1
  237. package/src/server/infrastructure/git/history-service.js +1 -1
  238. package/src/server/infrastructure/git/local-exclude.js +25 -0
  239. package/src/server/infrastructure/git/parsers.js +19 -17
  240. package/src/server/infrastructure/git/path-utils.js +0 -16
  241. package/src/server/infrastructure/git/status-service.js +1 -1
  242. package/src/server/infrastructure/git/untracked-files.js +12 -21
  243. package/src/server/infrastructure/http/create-agent-api-handler.js +171 -0
  244. package/src/server/infrastructure/http/create-git-api-command-handler.js +32 -0
  245. package/src/server/infrastructure/http/create-request-handler.js +28 -0
  246. package/src/server/infrastructure/http/create-static-handler.js +6 -0
  247. package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +199 -0
  248. package/src/server/infrastructure/persistence/agent-connection-store.js +120 -0
  249. package/src/server/infrastructure/persistence/path-utils.js +10 -4
  250. package/src/server/infrastructure/persistence/pull-backup-store.js +2 -27
  251. package/src/server/infrastructure/persistence/vault-file-store.js +11 -2
  252. package/src/server/shared/agent-tool-image.js +22 -0
  253. package/src/server/shared/agent-tool-rate-limiter.js +20 -0
  254. package/src/server/startup/git-remote-bootstrap.js +5 -33
  255. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BPH4FJkv.js +0 -1
  256. package/dist/client/assets/abnfDiagram-VCTEODGH-BNDLzJ7L.js +0 -1
  257. package/dist/client/assets/browser-utils--H_DkyEF.js +0 -1
  258. package/dist/client/assets/channel-CaoKA_We.js +0 -1
  259. package/dist/client/assets/chunk-DSNCTWBM-8xkug7fQ.js +0 -2
  260. package/dist/client/assets/chunk-DU6HZSFF-COXDzJK1.js +0 -127
  261. package/dist/client/assets/chunk-R7TYR2AO-CTd0Yj98.js +0 -10
  262. package/dist/client/assets/classDiagram-DTDB5LWJ-7fEmn0zV.js +0 -1
  263. package/dist/client/assets/classDiagram-v2-JRS7N3AN-7fEmn0zV.js +0 -1
  264. package/dist/client/assets/comment-threads-9J6Em-_y.js +0 -4
  265. package/dist/client/assets/comment-ui-shared-DWkk9Vh3.js +0 -7
  266. package/dist/client/assets/diagram-VSXAHHWV-CQRVEZR7.js +0 -3
  267. package/dist/client/assets/dist-73RPdcyU.js +0 -1
  268. package/dist/client/assets/dist-CH-sQu3r.js +0 -1
  269. package/dist/client/assets/drawio-editor-BjrxTe3l.js +0 -9
  270. package/dist/client/assets/drawioEditor-DUVZjSSr.js +0 -2
  271. package/dist/client/assets/ebnfDiagram-PWID7BFC-OXa8VEp1.js +0 -1
  272. package/dist/client/assets/editor-session-DfZuRgB_.js +0 -54
  273. package/dist/client/assets/embedded-editor-base-DvMynhKu.css +0 -1
  274. package/dist/client/assets/excalidraw-editor-D7pnUCLH.js +0 -9
  275. package/dist/client/assets/excalidraw-mermaid-stub-BNckbX2n.js +0 -1
  276. package/dist/client/assets/excalidraw-mermaid-stub-DE5FTiZB.js +0 -1
  277. package/dist/client/assets/excalidrawEditor-B0jOK3lv.js +0 -2
  278. package/dist/client/assets/export-page-Bs3xE1fg.js +0 -57
  279. package/dist/client/assets/exportDocument-Dg9MjkIk.js +0 -2
  280. package/dist/client/assets/exportDocument-PnYU3v1s.css +0 -1
  281. package/dist/client/assets/file-kind-BbqgGzpc.js +0 -1
  282. package/dist/client/assets/flowDiagram-A5DVABFB-CiW1eN8C.js +0 -1
  283. package/dist/client/assets/image-ZVKINSPA-0zXSnE7M.js +0 -1
  284. package/dist/client/assets/index-BIpgxyGZ.css +0 -1
  285. package/dist/client/assets/index-Z5sI0Bj-.js +0 -2
  286. package/dist/client/assets/main-Dwnj9Gaq.js +0 -903
  287. package/dist/client/assets/pegDiagram-XKGWAZYB-B31fKPR2.js +0 -1
  288. package/dist/client/assets/preview-render-compiler-BApvlLLo.js +0 -35
  289. package/dist/client/assets/preview-render-compiler-BQ_3h9vD.js +0 -1
  290. package/dist/client/assets/preview-render-profile-CE-5rVTC.js +0 -1
  291. package/dist/client/assets/prod-BiYPMR1i.js +0 -177
  292. package/dist/client/assets/prod-VxdGZ5Ly.js +0 -1
  293. package/dist/client/assets/quick-switcher-controller-ButWPmCI.js +0 -12
  294. package/dist/client/assets/railroadDiagram-O6MQD6OU-BPifP0MB.js +0 -1
  295. package/dist/client/assets/runtime-config-BLrEKVO1.js +0 -1
  296. package/dist/client/assets/stateDiagram-v2-4QOOHH4V-B--gjrit.js +0 -1
  297. package/dist/client/assets/swimlanesDiagram-VK2B7HYN-DO8XNXEg.js +0 -8
  298. package/dist/client/assets/vault-api-client-_LpV1aIn.js +0 -6
  299. package/dist/client/assets/vault-utils-wdQ0RNR9.js +0 -1
  300. package/src/client/app/drawio-editor-entry.js +0 -1
  301. package/src/client/app/excalidraw-editor-entry.js +0 -1
  302. package/src/client/excalidraw-mermaid-stub.js +0 -7
  303. package/src/client/main.js +0 -16
  304. /package/dist/client/assets/{drawio-editor-UQQ8XHou.css → drawioEditor-UQQ8XHou.css} +0 -0
  305. /package/dist/client/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
@@ -0,0 +1,796 @@
1
+ function objectSchema(properties = {}, required = Object.keys(properties)) {
2
+ return { additionalProperties: false, properties, required, type: 'object' };
3
+ }
4
+
5
+ const REVISION_SCHEMA = {
6
+ description: 'Lowercase SHA-256 revision returned by read_document.',
7
+ pattern: '^[a-f0-9]{64}$',
8
+ type: 'string',
9
+ };
10
+
11
+ const DOCUMENT_SCHEMA = objectSchema({
12
+ kind: { type: 'string' },
13
+ mtimeMs: { minimum: 0, type: 'number' },
14
+ path: { type: 'string' },
15
+ size: { minimum: 0, type: 'number' },
16
+ });
17
+ const WORKSPACE_ENTRY_SCHEMA = objectSchema({
18
+ agentEditable: { type: 'boolean' },
19
+ embeddable: { type: 'boolean' },
20
+ kind: { type: ['string', 'null'] },
21
+ mtimeMs: { minimum: 0, type: 'number' },
22
+ nodeType: { enum: ['directory', 'file'], type: 'string' },
23
+ path: { type: 'string' },
24
+ readable: { type: 'boolean' },
25
+ size: { minimum: 0, type: 'number' },
26
+ });
27
+
28
+ const DOCUMENT_REFERENCE_SCHEMA = objectSchema({
29
+ exists: { type: 'boolean' },
30
+ kind: { type: ['string', 'null'] },
31
+ line: { minimum: 1, type: 'integer' },
32
+ rawTarget: { type: 'string' },
33
+ resolvedPath: { type: ['string', 'null'] },
34
+ targetPath: { type: 'string' },
35
+ });
36
+
37
+ const VIDEO_REFERENCE_SCHEMA = objectSchema({
38
+ kind: { type: ['string', 'null'] },
39
+ line: { minimum: 1, type: 'integer' },
40
+ mimeType: { type: ['string', 'null'] },
41
+ source: { type: 'string' },
42
+ supported: { type: 'boolean' },
43
+ url: { type: ['string', 'null'] },
44
+ });
45
+
46
+ const BACKLINK_SCHEMA = objectSchema({
47
+ contexts: { items: { type: 'string' }, type: 'array' },
48
+ file: { type: 'string' },
49
+ });
50
+
51
+ const VALIDATION_ISSUE_SCHEMA = objectSchema({
52
+ code: { type: 'string' },
53
+ line: { minimum: 1, type: 'integer' },
54
+ message: { type: 'string' },
55
+ target: { type: 'string' },
56
+ });
57
+
58
+ const DIAGRAM_RENDER_OUTPUT_PROPERTIES = {
59
+ endLine: { minimum: 1, type: 'integer' },
60
+ format: { enum: ['png', 'svg'], type: 'string' },
61
+ kind: { enum: ['mermaid', 'plantuml'], type: 'string' },
62
+ mimeType: { enum: ['image/png', 'image/svg+xml'], type: 'string' },
63
+ path: { type: 'string' },
64
+ renderer: { type: 'string' },
65
+ revision: REVISION_SCHEMA,
66
+ startLine: { minimum: 1, type: 'integer' },
67
+ warnings: { items: { type: 'string' }, type: 'array' },
68
+ };
69
+
70
+ const SEARCH_SNIPPET_SCHEMA = objectSchema({
71
+ column: { minimum: 1, type: 'integer' },
72
+ line: { minimum: 1, type: 'integer' },
73
+ matchEnd: { minimum: 0, type: 'integer' },
74
+ matchStart: { minimum: 0, type: 'integer' },
75
+ text: { type: 'string' },
76
+ });
77
+
78
+ const SEARCH_FILE_SCHEMA = objectSchema({
79
+ file: { type: 'string' },
80
+ kind: { type: 'string' },
81
+ matchCount: { minimum: 0, type: 'integer' },
82
+ snippets: { items: SEARCH_SNIPPET_SCHEMA, type: 'array' },
83
+ truncated: { type: 'boolean' },
84
+ });
85
+
86
+ const SYNTAX_GUIDE_SCHEMA = objectSchema({
87
+ examples: { items: { type: 'string' }, type: 'array' },
88
+ extensions: { items: { type: 'string' }, type: 'array' },
89
+ guide: { type: 'string' },
90
+ kind: { type: 'string' },
91
+ });
92
+
93
+ const CAPABILITY_SCHEMA = objectSchema({
94
+ agentCreatable: { type: 'boolean' },
95
+ agentEditable: { type: 'boolean' },
96
+ commentsSupported: { type: 'boolean' },
97
+ editable: { type: 'boolean' },
98
+ examples: { items: { type: 'string' }, type: 'array' },
99
+ extensions: { items: { type: 'string' }, type: 'array' },
100
+ guide: { type: 'string' },
101
+ kind: { type: 'string' },
102
+ readable: { type: 'boolean' },
103
+ searchable: { type: 'boolean' },
104
+ });
105
+
106
+ const EXCALIDRAW_ELEMENT_TYPES = ['arrow', 'diamond', 'ellipse', 'freedraw', 'line', 'rectangle', 'text'];
107
+ const EXCALIDRAW_POINT_SCHEMA = {
108
+ items: { type: 'number' },
109
+ maxItems: 2,
110
+ minItems: 2,
111
+ type: 'array',
112
+ };
113
+ const EXCALIDRAW_ELEMENT_INPUT_SCHEMA = {
114
+ additionalProperties: false,
115
+ properties: {
116
+ autoResize: { type: 'boolean' },
117
+ afterElementId: {
118
+ description: 'Place this new element immediately after an existing or concurrently created element.',
119
+ maxLength: 128,
120
+ minLength: 1,
121
+ type: 'string',
122
+ },
123
+ backgroundColor: { type: 'string' },
124
+ endArrowhead: { type: ['string', 'null'] },
125
+ beforeElementId: {
126
+ description: 'Place this new element immediately before an existing or concurrently created element.',
127
+ maxLength: 128,
128
+ minLength: 1,
129
+ type: 'string',
130
+ },
131
+ containerId: { maxLength: 128, minLength: 1, type: ['string', 'null'] },
132
+ endElementId: { maxLength: 128, minLength: 1, type: 'string' },
133
+ fillStyle: { enum: ['cross-hatch', 'hachure', 'solid', 'zigzag'], type: 'string' },
134
+ fontFamily: { minimum: 1, type: 'integer' },
135
+ fontSize: { exclusiveMinimum: 0, type: 'number' },
136
+ lineHeight: { exclusiveMinimum: 0, type: 'number' },
137
+ groupIds: {
138
+ items: { maxLength: 128, minLength: 1, type: 'string' },
139
+ maxItems: 20,
140
+ type: 'array',
141
+ uniqueItems: true,
142
+ },
143
+ height: { minimum: 0, type: 'number' },
144
+ id: { maxLength: 128, minLength: 1, type: 'string' },
145
+ opacity: { maximum: 100, minimum: 0, type: 'number' },
146
+ points: { items: EXCALIDRAW_POINT_SCHEMA, maxItems: 1000, minItems: 2, type: 'array' },
147
+ roughness: { maximum: 2, minimum: 0, type: 'number' },
148
+ startArrowhead: { type: ['string', 'null'] },
149
+ startElementId: { maxLength: 128, minLength: 1, type: 'string' },
150
+ strokeColor: { type: 'string' },
151
+ strokeStyle: { enum: ['dashed', 'dotted', 'solid'], type: 'string' },
152
+ strokeWidth: { exclusiveMinimum: 0, type: 'number' },
153
+ text: { maxLength: 20000, type: 'string' },
154
+ type: { enum: EXCALIDRAW_ELEMENT_TYPES, type: 'string' },
155
+ width: { minimum: 0, type: 'number' },
156
+ x: { type: 'number' },
157
+ y: { type: 'number' },
158
+ },
159
+ required: ['id', 'type', 'x', 'y'],
160
+ type: 'object',
161
+ };
162
+ const EXCALIDRAW_UPDATE_SCHEMA = objectSchema({
163
+ id: { maxLength: 128, minLength: 1, type: 'string' },
164
+ set: {
165
+ additionalProperties: true,
166
+ description: 'Excalidraw element fields to shallow-merge. id, type, and version cannot change.',
167
+ type: 'object',
168
+ },
169
+ });
170
+ const EXCALIDRAW_REPLACEMENT_ELEMENT_INPUT_SCHEMA = {
171
+ ...EXCALIDRAW_ELEMENT_INPUT_SCHEMA,
172
+ required: ['type', 'x', 'y'],
173
+ };
174
+ const EXCALIDRAW_REPLACE_SCHEMA = objectSchema({
175
+ element: EXCALIDRAW_REPLACEMENT_ELEMENT_INPUT_SCHEMA,
176
+ id: { maxLength: 128, minLength: 1, type: 'string' },
177
+ }, ['element', 'id']);
178
+ const EXCALIDRAW_REORDER_SCHEMA = objectSchema({
179
+ action: { enum: ['bringToFront', 'sendToBack'], type: 'string' },
180
+ afterElementId: { maxLength: 128, minLength: 1, type: 'string' },
181
+ beforeElementId: { maxLength: 128, minLength: 1, type: 'string' },
182
+ id: { maxLength: 128, minLength: 1, type: 'string' },
183
+ }, ['id']);
184
+ const EXCALIDRAW_TRANSLATE_SCHEMA = objectSchema({
185
+ dx: { type: 'number' },
186
+ dy: { type: 'number' },
187
+ ids: {
188
+ description: 'Requested targets. Bound text, its container, and all members of referenced groups move atomically.',
189
+ items: { maxLength: 128, minLength: 1, type: 'string' },
190
+ maxItems: 200,
191
+ minItems: 1,
192
+ type: 'array',
193
+ uniqueItems: true,
194
+ },
195
+ });
196
+ const EXCALIDRAW_BOUNDS_SCHEMA = objectSchema({
197
+ height: { minimum: 0, type: 'number' },
198
+ width: { minimum: 0, type: 'number' },
199
+ x: { type: 'number' },
200
+ y: { type: 'number' },
201
+ });
202
+ const EXCALIDRAW_SUMMARY_ELEMENT_SCHEMA = {
203
+ additionalProperties: false,
204
+ properties: {
205
+ behind: {
206
+ description: 'ID of the immediately higher element that paints in front of this element.',
207
+ type: 'string',
208
+ },
209
+ endElementId: { type: 'string' },
210
+ containerId: { type: 'string' },
211
+ fontSize: { exclusiveMinimum: 0, type: 'number' },
212
+ height: { minimum: 0, type: 'number' },
213
+ id: { type: 'string' },
214
+ inFrontOf: {
215
+ description: 'ID of the immediately lower element that this element paints in front of.',
216
+ type: 'string',
217
+ },
218
+ paintOrder: {
219
+ description: 'Zero-based back-to-front paint position.',
220
+ minimum: 0,
221
+ type: 'integer',
222
+ },
223
+ lineHeight: { exclusiveMinimum: 0, type: 'number' },
224
+ startElementId: { type: 'string' },
225
+ text: { type: 'string' },
226
+ textAlign: { type: 'string' },
227
+ type: { type: 'string' },
228
+ verticalAlign: { type: 'string' },
229
+ width: { minimum: 0, type: 'number' },
230
+ x: { type: 'number' },
231
+ y: { type: 'number' },
232
+ },
233
+ required: ['height', 'id', 'paintOrder', 'type', 'width', 'x', 'y'],
234
+ type: 'object',
235
+ };
236
+ const EXCALIDRAW_WARNING_SCHEMA = objectSchema({
237
+ code: { type: 'string' },
238
+ elementIds: { items: { type: 'string' }, type: 'array' },
239
+ message: { type: 'string' },
240
+ });
241
+ const EXCALIDRAW_INSPECTION_PROPERTIES = {
242
+ bounds: EXCALIDRAW_BOUNDS_SCHEMA,
243
+ elementCount: { minimum: 0, type: 'integer' },
244
+ elements: { items: EXCALIDRAW_SUMMARY_ELEMENT_SCHEMA, type: 'array' },
245
+ truncated: { type: 'boolean' },
246
+ warnings: { items: EXCALIDRAW_WARNING_SCHEMA, type: 'array' },
247
+ };
248
+ const EXCALIDRAW_INSPECTION_SCHEMA = objectSchema(EXCALIDRAW_INSPECTION_PROPERTIES);
249
+ const EXCALIDRAW_INSPECTION_OUTPUT_SCHEMA = objectSchema({
250
+ ...EXCALIDRAW_INSPECTION_PROPERTIES,
251
+ path: { type: 'string' },
252
+ revision: REVISION_SCHEMA,
253
+ });
254
+ const EXCALIDRAW_RENDER_RESULT_PROPERTIES = {
255
+ elementCount: { minimum: 0, type: 'integer' },
256
+ format: { enum: ['png', 'svg'], type: 'string' },
257
+ height: { minimum: 1, type: 'integer' },
258
+ mimeType: { enum: ['image/png', 'image/svg+xml'], type: 'string' },
259
+ renderer: { type: 'string' },
260
+ rendererVersion: { type: 'string' },
261
+ scale: { exclusiveMinimum: 0, type: 'number' },
262
+ warnings: { items: { type: 'string' }, type: 'array' },
263
+ width: { minimum: 1, type: 'integer' },
264
+ };
265
+ const EXCALIDRAW_RENDER_OUTPUT_PROPERTIES = {
266
+ ...EXCALIDRAW_RENDER_RESULT_PROPERTIES,
267
+ path: { type: 'string' },
268
+ revision: REVISION_SCHEMA,
269
+ };
270
+ const EXCALIDRAW_RENDER_INPUT_PROPERTIES = {
271
+ format: {
272
+ description: 'Image format. PNG is most widely supported by MCP clients.',
273
+ enum: ['png', 'svg'],
274
+ type: 'string',
275
+ },
276
+ padding: {
277
+ description: 'Scene padding in diagram units.',
278
+ maximum: 100,
279
+ minimum: 0,
280
+ type: 'number',
281
+ },
282
+ path: {
283
+ description: 'Vault-relative .excalidraw path.',
284
+ maxLength: 1024,
285
+ minLength: 1,
286
+ type: 'string',
287
+ },
288
+ scale: {
289
+ description: 'Requested output scale; automatically reduced when needed to stay within 4096 pixels.',
290
+ maximum: 4,
291
+ minimum: 0.25,
292
+ type: 'number',
293
+ },
294
+ };
295
+ const EXCALIDRAW_INLINE_VERIFY_INPUT_SCHEMA = objectSchema({
296
+ format: EXCALIDRAW_RENDER_INPUT_PROPERTIES.format,
297
+ inspectOcclusion: {
298
+ description: 'Inspect fully occluded elements. Defaults to true.',
299
+ type: 'boolean',
300
+ },
301
+ padding: EXCALIDRAW_RENDER_INPUT_PROPERTIES.padding,
302
+ render: {
303
+ description: 'Also return an image rendered from the exact created or edited revision.',
304
+ type: 'boolean',
305
+ },
306
+ scale: EXCALIDRAW_RENDER_INPUT_PROPERTIES.scale,
307
+ }, []);
308
+ const EXCALIDRAW_INLINE_VERIFICATION_SCHEMA = objectSchema({
309
+ inspection: EXCALIDRAW_INSPECTION_SCHEMA,
310
+ ...EXCALIDRAW_RENDER_RESULT_PROPERTIES,
311
+ }, ['inspection']);
312
+
313
+ export const AGENT_TOOL_DEFINITIONS = Object.freeze([
314
+ {
315
+ annotations: { idempotentHint: true, readOnlyHint: true },
316
+ description: 'List readable CollabMD Vault documents by path and kind.',
317
+ inputSchema: objectSchema({
318
+ cursor: {
319
+ description: 'Path from the previous nextCursor; omit for the first page.',
320
+ type: 'string',
321
+ },
322
+ kinds: {
323
+ description: 'Optional CollabMD content kinds to include.',
324
+ items: { type: 'string' },
325
+ type: 'array',
326
+ uniqueItems: true,
327
+ },
328
+ limit: {
329
+ description: 'Maximum documents to return.',
330
+ maximum: 200,
331
+ minimum: 1,
332
+ type: 'integer',
333
+ },
334
+ prefix: {
335
+ description: 'Optional Vault directory or path prefix.',
336
+ type: 'string',
337
+ },
338
+ }, []),
339
+ method: 'listDocuments',
340
+ name: 'list_documents',
341
+ outputSchema: objectSchema({
342
+ documents: { items: DOCUMENT_SCHEMA, type: 'array' },
343
+ nextCursor: { type: ['string', 'null'] },
344
+ truncated: { type: 'boolean' },
345
+ }),
346
+ scope: 'vault:read',
347
+ untrustedContentHint: true,
348
+ webMcp: true,
349
+ },
350
+ {
351
+ annotations: { idempotentHint: true, readOnlyHint: true },
352
+ description: 'List current Vault files and directories, including binary metadata and agent capability flags.',
353
+ inputSchema: objectSchema({
354
+ cursor: {
355
+ description: 'Path from the previous nextCursor; omit for the first page.',
356
+ type: 'string',
357
+ },
358
+ limit: {
359
+ description: 'Maximum entries to return.',
360
+ maximum: 200,
361
+ minimum: 1,
362
+ type: 'integer',
363
+ },
364
+ prefix: {
365
+ description: 'Optional Vault directory or path prefix.',
366
+ type: 'string',
367
+ },
368
+ }, []),
369
+ method: 'listWorkspaceEntries',
370
+ name: 'list_workspace_entries',
371
+ outputSchema: objectSchema({
372
+ entries: { items: WORKSPACE_ENTRY_SCHEMA, type: 'array' },
373
+ nextCursor: { type: ['string', 'null'] },
374
+ truncated: { type: 'boolean' },
375
+ }),
376
+ scope: 'vault:read',
377
+ untrustedContentHint: true,
378
+ webMcp: true,
379
+ },
380
+
381
+ {
382
+ annotations: { idempotentHint: true, readOnlyHint: true },
383
+ description: 'Search current Vault text with one fixed case-insensitive term. Returns path and line evidence.',
384
+ inputSchema: objectSchema({
385
+ limit: {
386
+ description: 'Maximum matching documents to return.',
387
+ maximum: 50,
388
+ minimum: 1,
389
+ type: 'integer',
390
+ },
391
+ query: {
392
+ description: 'Literal case-insensitive text to find; regular expressions are not supported.',
393
+ maxLength: 500,
394
+ minLength: 2,
395
+ type: 'string',
396
+ },
397
+ }, ['query']),
398
+ method: 'searchVault',
399
+ name: 'search_vault',
400
+ outputSchema: objectSchema({
401
+ backend: { type: 'string' },
402
+ files: { items: SEARCH_FILE_SCHEMA, type: 'array' },
403
+ matchCount: { minimum: 0, type: 'integer' },
404
+ ok: { type: 'boolean' },
405
+ query: { type: 'string' },
406
+ search: {
407
+ additionalProperties: false,
408
+ properties: {
409
+ available: { type: 'boolean' },
410
+ backend: { type: 'string' },
411
+ minQueryLength: { minimum: 1, type: 'integer' },
412
+ unavailableReason: { type: 'string' },
413
+ version: { type: 'string' },
414
+ },
415
+ required: ['available', 'backend', 'minQueryLength', 'unavailableReason', 'version'],
416
+ type: 'object',
417
+ },
418
+ truncated: { type: 'boolean' },
419
+ }),
420
+ scope: 'vault:read',
421
+ untrustedContentHint: true,
422
+ webMcp: true,
423
+ },
424
+ {
425
+ annotations: { idempotentHint: true, readOnlyHint: true },
426
+ description: 'Read a current CollabMD document range and return full-document revision for citations and edits.',
427
+ inputSchema: objectSchema({
428
+ lineCount: {
429
+ description: 'Maximum number of lines to return.',
430
+ maximum: 500,
431
+ minimum: 1,
432
+ type: 'integer',
433
+ },
434
+ path: {
435
+ description: 'Vault-relative document path.',
436
+ maxLength: 1024,
437
+ minLength: 1,
438
+ type: 'string',
439
+ },
440
+ startLine: {
441
+ description: 'One-based first line to return.',
442
+ minimum: 1,
443
+ type: 'integer',
444
+ },
445
+ }, ['path']),
446
+ method: 'readDocument',
447
+ name: 'read_document',
448
+ outputSchema: objectSchema({
449
+ content: { type: 'string' },
450
+ endLine: { minimum: 1, type: 'integer' },
451
+ kind: { type: 'string' },
452
+ path: { type: 'string' },
453
+ revision: REVISION_SCHEMA,
454
+ startLine: { minimum: 1, type: 'integer' },
455
+ totalLines: { minimum: 1, type: 'integer' },
456
+ truncated: { type: 'boolean' },
457
+ }),
458
+ scope: 'vault:read',
459
+ untrustedContentHint: true,
460
+ webMcp: true,
461
+ },
462
+ {
463
+ annotations: { idempotentHint: true, readOnlyHint: true },
464
+ description: 'Inspect resolved and missing wiki-links, embeds, public video embeds, and backlinks for one Markdown document.',
465
+ inputSchema: objectSchema({
466
+ path: {
467
+ description: 'Vault-relative Markdown path.',
468
+ maxLength: 1024,
469
+ minLength: 1,
470
+ type: 'string',
471
+ },
472
+ }, ['path']),
473
+ method: 'inspectDocumentReferences',
474
+ name: 'inspect_document_references',
475
+ outputSchema: objectSchema({
476
+ backlinks: { items: BACKLINK_SCHEMA, type: 'array' },
477
+ embeds: { items: DOCUMENT_REFERENCE_SCHEMA, type: 'array' },
478
+ path: { type: 'string' },
479
+ revision: REVISION_SCHEMA,
480
+ videos: { items: VIDEO_REFERENCE_SCHEMA, type: 'array' },
481
+ wikiLinks: { items: DOCUMENT_REFERENCE_SCHEMA, type: 'array' },
482
+ }),
483
+ scope: 'vault:read',
484
+ untrustedContentHint: true,
485
+ webMcp: true,
486
+ },
487
+ {
488
+ annotations: { idempotentHint: true, readOnlyHint: true },
489
+ description: 'Validate one Markdown document for missing wiki-link/embed targets and unsupported public video embeds.',
490
+ inputSchema: objectSchema({
491
+ path: {
492
+ description: 'Vault-relative Markdown path.',
493
+ maxLength: 1024,
494
+ minLength: 1,
495
+ type: 'string',
496
+ },
497
+ }, ['path']),
498
+ method: 'validateDocument',
499
+ name: 'validate_document',
500
+ outputSchema: objectSchema({
501
+ issues: { items: VALIDATION_ISSUE_SCHEMA, type: 'array' },
502
+ path: { type: 'string' },
503
+ revision: REVISION_SCHEMA,
504
+ valid: { type: 'boolean' },
505
+ }),
506
+ scope: 'vault:read',
507
+ untrustedContentHint: true,
508
+ webMcp: true,
509
+ },
510
+ {
511
+ annotations: { idempotentHint: true, readOnlyHint: true },
512
+ description: 'Render one standalone or fenced Mermaid/PlantUML diagram. Markdown with multiple diagrams requires the opening fence startLine. Mermaid rendering requires WebMCP.',
513
+ inputSchema: objectSchema({
514
+ format: {
515
+ description: 'Image format. PNG is most widely supported by MCP clients.',
516
+ enum: ['png', 'svg'],
517
+ type: 'string',
518
+ },
519
+ path: {
520
+ description: 'Vault-relative Markdown, Mermaid, or PlantUML path.',
521
+ maxLength: 1024,
522
+ minLength: 1,
523
+ type: 'string',
524
+ },
525
+ startLine: {
526
+ description: 'Opening fence line for a diagram embedded in Markdown.',
527
+ minimum: 1,
528
+ type: 'integer',
529
+ },
530
+ }, ['path']),
531
+ method: 'renderDiagram',
532
+ name: 'render_diagram',
533
+ outputSchema: objectSchema(DIAGRAM_RENDER_OUTPUT_PROPERTIES),
534
+ resultKind: 'image',
535
+ scope: 'vault:read',
536
+ untrustedContentHint: true,
537
+ webMcp: true,
538
+ },
539
+
540
+ {
541
+ annotations: { idempotentHint: true, readOnlyHint: true },
542
+ description: 'Inspect an Excalidraw scene structurally. Returns paint order, geometry, bindings, bounds, occlusion, clipping, and validity warnings.',
543
+ inputSchema: objectSchema({
544
+ path: {
545
+ description: 'Vault-relative .excalidraw path.',
546
+ maxLength: 1024,
547
+ minLength: 1,
548
+ type: 'string',
549
+ },
550
+ }, ['path']),
551
+ method: 'inspectExcalidraw',
552
+ name: 'inspect_excalidraw',
553
+ outputSchema: EXCALIDRAW_INSPECTION_OUTPUT_SCHEMA,
554
+ scope: 'vault:read',
555
+ untrustedContentHint: true,
556
+ webMcp: true,
557
+ },
558
+ {
559
+ annotations: { idempotentHint: true, readOnlyHint: true },
560
+ description: 'Render supported basic elements as PNG or SVG. Returns renderer metadata and warns when preview is not pixel-identical to Excalidraw.',
561
+ inputSchema: objectSchema(EXCALIDRAW_RENDER_INPUT_PROPERTIES, ['path']),
562
+ method: 'renderExcalidraw',
563
+ name: 'render_excalidraw',
564
+ outputSchema: objectSchema(EXCALIDRAW_RENDER_OUTPUT_PROPERTIES),
565
+ resultKind: 'image',
566
+ scope: 'vault:read',
567
+ untrustedContentHint: true,
568
+ webMcp: true,
569
+ },
570
+ {
571
+ annotations: { idempotentHint: true, readOnlyHint: true },
572
+ description: 'Inspect and render one Excalidraw revision in a single operation.',
573
+ inputSchema: objectSchema({
574
+ ...EXCALIDRAW_RENDER_INPUT_PROPERTIES,
575
+ inspectOcclusion: {
576
+ description: 'Inspect fully occluded elements. Defaults to true.',
577
+ type: 'boolean',
578
+ },
579
+ }, ['path']),
580
+ method: 'verifyExcalidraw',
581
+ name: 'verify_excalidraw',
582
+ outputSchema: objectSchema({
583
+ ...EXCALIDRAW_RENDER_OUTPUT_PROPERTIES,
584
+ inspection: EXCALIDRAW_INSPECTION_SCHEMA,
585
+ }),
586
+ resultKind: 'image',
587
+ scope: 'vault:read',
588
+ untrustedContentHint: true,
589
+ webMcp: true,
590
+ },
591
+ {
592
+ annotations: { idempotentHint: true, readOnlyHint: true },
593
+ description: 'Describe CollabMD-supported content kinds, extensions, syntax, and agent write support.',
594
+ inputSchema: objectSchema({
595
+ kind: {
596
+ description: 'Optional content kind. Omit to list all capabilities.',
597
+ type: 'string',
598
+ },
599
+ }, []),
600
+ method: 'getSyntax',
601
+ name: 'get_collabmd_syntax',
602
+ outputSchema: {
603
+ oneOf: [
604
+ objectSchema({ capabilities: { items: CAPABILITY_SCHEMA, type: 'array' } }),
605
+ SYNTAX_GUIDE_SCHEMA,
606
+ ],
607
+ },
608
+ scope: 'vault:read',
609
+ webMcp: true,
610
+ },
611
+ {
612
+ annotations: { destructiveHint: false, idempotentHint: true, readOnlyHint: false },
613
+ description: 'Create a valid editable .excalidraw scene from basic Excalidraw elements, with optional same-revision verification.',
614
+ inputSchema: objectSchema({
615
+ elements: {
616
+ description: 'One to 200 basic Excalidraw elements in back-to-front order. Text may bind to a container with containerId; groupIds define atomic movement groups. Arrows may bind with startElementId and endElementId. beforeElementId or afterElementId sets explicit placement.',
617
+ items: EXCALIDRAW_ELEMENT_INPUT_SCHEMA,
618
+ maxItems: 200,
619
+ minItems: 1,
620
+ type: 'array',
621
+ },
622
+ path: {
623
+ description: 'New Vault-relative path ending in .excalidraw.',
624
+ maxLength: 1024,
625
+ minLength: 1,
626
+ type: 'string',
627
+ },
628
+ verify: EXCALIDRAW_INLINE_VERIFY_INPUT_SCHEMA,
629
+ }, ['path', 'elements']),
630
+ method: 'createExcalidraw',
631
+ name: 'create_excalidraw',
632
+ outputSchema: objectSchema({
633
+ elementCount: { minimum: 1, type: 'integer' },
634
+ path: { type: 'string' },
635
+ revision: REVISION_SCHEMA,
636
+ verification: EXCALIDRAW_INLINE_VERIFICATION_SCHEMA,
637
+ }),
638
+ resultKind: 'optional-image',
639
+ scope: 'vault:edit',
640
+ webMcp: true,
641
+ },
642
+ {
643
+ annotations: { destructiveHint: false, idempotentHint: false, readOnlyHint: false },
644
+ description: 'Create, update, replace, translate, reorder, or delete elements in an existing .excalidraw scene when its revision still matches.',
645
+ inputSchema: objectSchema({
646
+ create: {
647
+ items: EXCALIDRAW_ELEMENT_INPUT_SCHEMA,
648
+ maxItems: 200,
649
+ type: 'array',
650
+ },
651
+ delete: {
652
+ description: 'Element IDs to tombstone.',
653
+ items: { maxLength: 128, minLength: 1, type: 'string' },
654
+ maxItems: 200,
655
+ type: 'array',
656
+ uniqueItems: true,
657
+ },
658
+ path: {
659
+ description: 'Vault-relative .excalidraw path returned by read_document.',
660
+ maxLength: 1024,
661
+ minLength: 1,
662
+ type: 'string',
663
+ },
664
+ revision: REVISION_SCHEMA,
665
+ reorder: {
666
+ description: 'Layer changes applied in array order. Each entry uses exactly one action, beforeElementId, or afterElementId directive.',
667
+ items: EXCALIDRAW_REORDER_SCHEMA,
668
+ maxItems: 200,
669
+ type: 'array',
670
+ },
671
+ replace: {
672
+ description: 'Atomic same-ID element replacement. Layer position is preserved by default.',
673
+ items: EXCALIDRAW_REPLACE_SCHEMA,
674
+ maxItems: 200,
675
+ type: 'array',
676
+ },
677
+ update: {
678
+ items: EXCALIDRAW_UPDATE_SCHEMA,
679
+ maxItems: 200,
680
+ type: 'array',
681
+ },
682
+ translate: EXCALIDRAW_TRANSLATE_SCHEMA,
683
+ verify: EXCALIDRAW_INLINE_VERIFY_INPUT_SCHEMA,
684
+ }, ['path', 'revision']),
685
+ method: 'editExcalidraw',
686
+ name: 'edit_excalidraw',
687
+ outputSchema: objectSchema({
688
+ created: { minimum: 0, type: 'integer' },
689
+ deleted: { minimum: 0, type: 'integer' },
690
+ elementCount: { minimum: 0, type: 'integer' },
691
+ path: { type: 'string' },
692
+ reordered: { minimum: 0, type: 'integer' },
693
+ replaced: { minimum: 0, type: 'integer' },
694
+ revision: REVISION_SCHEMA,
695
+ translated: {
696
+ description: 'Number of explicitly requested translation targets; related bound or grouped elements may also move.',
697
+ minimum: 0,
698
+ type: 'integer',
699
+ },
700
+ updated: { minimum: 0, type: 'integer' },
701
+ verification: EXCALIDRAW_INLINE_VERIFICATION_SCHEMA,
702
+ }, ['created', 'deleted', 'elementCount', 'path', 'reordered', 'replaced', 'revision', 'translated', 'updated']),
703
+ resultKind: 'optional-image',
704
+ scope: 'vault:edit',
705
+ webMcp: true,
706
+ },
707
+ {
708
+ annotations: { destructiveHint: false, idempotentHint: false, readOnlyHint: false },
709
+ description: 'Apply bounded exact replacements to a document only when its revision still matches.',
710
+ inputSchema: objectSchema({
711
+ path: {
712
+ description: 'Vault-relative path returned by read_document.',
713
+ maxLength: 1024,
714
+ minLength: 1,
715
+ type: 'string',
716
+ },
717
+ replacements: {
718
+ description: 'One to 20 exact text replacements; each oldText must resolve unambiguously.',
719
+ items: {
720
+ additionalProperties: false,
721
+ properties: {
722
+ newText: {
723
+ description: 'Replacement text, normalized to LF line endings.',
724
+ type: 'string',
725
+ },
726
+ oldText: {
727
+ description: 'Exact current text to replace.',
728
+ minLength: 1,
729
+ type: 'string',
730
+ },
731
+ },
732
+ required: ['oldText', 'newText'],
733
+ type: 'object',
734
+ },
735
+ maxItems: 20,
736
+ minItems: 1,
737
+ type: 'array',
738
+ },
739
+ revision: REVISION_SCHEMA,
740
+ }, ['path', 'revision', 'replacements']),
741
+ method: 'applyTextEdits',
742
+ name: 'apply_text_edits',
743
+ outputSchema: objectSchema({
744
+ path: { type: 'string' },
745
+ replacementCount: { minimum: 1, type: 'integer' },
746
+ revision: REVISION_SCHEMA,
747
+ }),
748
+ scope: 'vault:edit',
749
+ webMcp: true,
750
+ },
751
+ {
752
+ annotations: { destructiveHint: false, idempotentHint: true, readOnlyHint: false },
753
+ description: 'Create a new supported CollabMD text document. An identical retry succeeds; different content at an existing path fails.',
754
+ inputSchema: objectSchema({
755
+ content: {
756
+ description: 'Initial document text, normalized to LF line endings.',
757
+ maxLength: 200000,
758
+ type: 'string',
759
+ },
760
+ path: {
761
+ description: 'New Vault-relative path with a supported text extension.',
762
+ maxLength: 1024,
763
+ minLength: 1,
764
+ type: 'string',
765
+ },
766
+ }, ['path', 'content']),
767
+ method: 'createDocument',
768
+ name: 'create_document',
769
+ outputSchema: objectSchema({
770
+ kind: { type: 'string' },
771
+ path: { type: 'string' },
772
+ revision: REVISION_SCHEMA,
773
+ }),
774
+ scope: 'vault:edit',
775
+ webMcp: true,
776
+ },
777
+ ]);
778
+
779
+ const DEFINITIONS_BY_NAME = new Map(AGENT_TOOL_DEFINITIONS.map((definition) => [definition.name, definition]));
780
+
781
+ export function getAgentToolDefinition(name) {
782
+ return DEFINITIONS_BY_NAME.get(name) ?? null;
783
+ }
784
+
785
+ export function listAgentToolDefinitions(scopes = []) {
786
+ const allowed = new Set(scopes);
787
+ return AGENT_TOOL_DEFINITIONS.filter(({ scope }) => allowed.has(scope));
788
+ }
789
+
790
+ export function listWebMcpToolDefinitions() {
791
+ return AGENT_TOOL_DEFINITIONS.filter(({ webMcp }) => webMcp);
792
+ }
793
+
794
+ export function toWebMcpToolName(name) {
795
+ return `collabmd_${name}`;
796
+ }