@inkeep/open-knowledge 0.2.0 → 0.4.0-beta.6

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 (503) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +6097 -0
  2. package/dist/alias-JE7RI5QX-Bia4gLMF.mjs +1 -0
  3. package/dist/assets/skills/open-knowledge/SKILL.md +347 -0
  4. package/dist/awk2-POPGKRAI-DDrFV-7v.mjs +1 -0
  5. package/dist/banner-DdbR6AZr.mjs +3 -0
  6. package/dist/base64-4YMZCVJ5-DDKKOjMm.mjs +1 -0
  7. package/dist/basename-AA2KJYZQ-BK5zVs3W.mjs +1 -0
  8. package/dist/bash-IJWYRKFO-B9r1a0X9.mjs +1 -0
  9. package/dist/build-B6buVrsB.mjs +2 -0
  10. package/dist/cat-RDUMLXKC-CeNrSElK.mjs +1 -0
  11. package/dist/chmod-SYMGL4JA-DFJ4ylQU.mjs +1 -0
  12. package/dist/chokidar-CxU7f6JW.mjs +4 -0
  13. package/dist/chunk-24IMIIXA-B6yIPkk2.mjs +2 -0
  14. package/dist/chunk-3THT3N7L-DztAF386.mjs +2 -0
  15. package/dist/chunk-3ZUFRYJ4-qsYuZX7b.mjs +2 -0
  16. package/dist/chunk-44UOCSGV-CaFxJDHm.mjs +2 -0
  17. package/dist/chunk-4GTNDTRF-PuLVuVJW.mjs +8 -0
  18. package/dist/chunk-4HHKTUW3-CQ53AiA_.mjs +3 -0
  19. package/dist/chunk-4Q4SM6WR-BlQvqCag.mjs +5 -0
  20. package/dist/chunk-55VFSPNA-DLwfww5b.mjs +3 -0
  21. package/dist/chunk-5QMZ5MUS-CAp625aG.mjs +5 -0
  22. package/dist/chunk-5QVNJEHU-dbrKfPGl.mjs +9 -0
  23. package/dist/chunk-5V6VZH6T-DMPvCPbn.mjs +2 -0
  24. package/dist/chunk-62RKD26F-B9la0pfD.mjs +21 -0
  25. package/dist/chunk-64BAICW3-D92CLSK-.mjs +2 -0
  26. package/dist/chunk-74CEPOFO-BcZUJMO1.mjs +23 -0
  27. package/dist/chunk-7L36YK2X-D7Z_Qw_C.mjs +3 -0
  28. package/dist/chunk-7TSDKFEO-DUQhJkDy.mjs +2 -0
  29. package/dist/chunk-A4HU7SVR-DKLaJeys.mjs +3 -0
  30. package/dist/chunk-A4JSPFCI-CEm2r8SB.mjs +7 -0
  31. package/dist/chunk-A5O5YHGN-DvJz5Cpw.mjs +2 -0
  32. package/dist/chunk-A65PWWJC-DV6RO_es.mjs +3 -0
  33. package/dist/chunk-A7A2DBEE-dTNL-45u.mjs +7 -0
  34. package/dist/chunk-A7ICOL4V-BvXPAaHu.mjs +14 -0
  35. package/dist/chunk-ALLTKNUZ-Cu6JFoC4.mjs +6 -0
  36. package/dist/chunk-APT7OOP2-DmUrFuRy.mjs +2 -0
  37. package/dist/chunk-BBXLRYSX-K758HlCs.mjs +6 -0
  38. package/dist/chunk-BRGMQKJV-BXc-9Cgj.mjs +63 -0
  39. package/dist/chunk-CR5AFCPT-DxNsgM0M.mjs +24 -0
  40. package/dist/chunk-CWQS3NFK-Co4ALolT.mjs +2 -0
  41. package/dist/chunk-D4J545R4-DkHLjHX6.mjs +12 -0
  42. package/dist/chunk-D6CWQ5DW-7lvT8dGP.mjs +6 -0
  43. package/dist/chunk-D7MEQ3VN-D8jJZr4A.mjs +5 -0
  44. package/dist/chunk-DCAAORBQ-C3s1D8OY.mjs +2 -0
  45. package/dist/chunk-DXB73IDG-DIKSLkPq.mjs +2 -0
  46. package/dist/chunk-EEXR5ZDP-CETL3_Uw.mjs +3 -0
  47. package/dist/chunk-EIZGF4BS-DOoQW9jQ.mjs +9 -0
  48. package/dist/chunk-F23WWYKW-BK2tpXPf.mjs +17 -0
  49. package/dist/chunk-F55TLFGB-Vy5RU2P3.mjs +10 -0
  50. package/dist/chunk-FEIOJCZD-C25Und0M.mjs +75 -0
  51. package/dist/chunk-FK9Q3tQk.mjs +1 -0
  52. package/dist/chunk-GCTKCWKD-Di-RB9Qt.mjs +4 -0
  53. package/dist/chunk-GFQRA5P5-DnjwTqP3.mjs +8 -0
  54. package/dist/chunk-GOV5EKKI-CKV9jOGv.mjs +10 -0
  55. package/dist/chunk-GXVXFKBA-CUKDClxt.mjs +6 -0
  56. package/dist/chunk-HDQ56CKY-MTQ75a8z.mjs +16 -0
  57. package/dist/chunk-HJQJAYMS-D-8Vc6Zb.mjs +3 -0
  58. package/dist/chunk-HJWBQKYG-XrOcsn2f.mjs +6 -0
  59. package/dist/chunk-HWBSOZZR-BZF8XsyZ.mjs +37 -0
  60. package/dist/chunk-HWKDQ44K-wgmyck2O.mjs +4 -0
  61. package/dist/chunk-I57KEIP3-DipCOPKf.mjs +11 -0
  62. package/dist/chunk-IPJHKYVM-C3IodQq7.mjs +2 -0
  63. package/dist/chunk-J642UCRS-YiNealfn.mjs +2 -0
  64. package/dist/chunk-JVPRLUMK-VMFWXimu.mjs +8 -0
  65. package/dist/chunk-KMEYNNUA-pRogdye4.mjs +16 -0
  66. package/dist/chunk-LL3S3NLB-ByBS5IDP.mjs +2 -0
  67. package/dist/chunk-LPQPILI2-FRQB9gt5.mjs +12 -0
  68. package/dist/chunk-LTZRCH7N-46S7WKw8.mjs +32 -0
  69. package/dist/chunk-LWEGUNWT-DdGmM3wr.mjs +8 -0
  70. package/dist/chunk-MDDMCKUK-CuRdI1Uv.mjs +7 -0
  71. package/dist/chunk-MDLLFABN-Wd1iVjXi.mjs +73 -0
  72. package/dist/chunk-MHTUABJP-BWrqic3t.mjs +9 -0
  73. package/dist/chunk-MIZPJHVH-DWdPvcYR.mjs +8 -0
  74. package/dist/chunk-MLXIYONF-CiCzoeGt.mjs +16 -0
  75. package/dist/chunk-MYE6AGBJ-DJo74dVC.mjs +17 -0
  76. package/dist/chunk-NAERJDUW-CIHrNgJB.mjs +9 -0
  77. package/dist/chunk-NCNPKYJZ-BVljycUZ.mjs +3 -0
  78. package/dist/chunk-NUYSJFDK-BTseBdxv.mjs +8 -0
  79. package/dist/chunk-NYQYO467-BgXuDHUQ.mjs +33 -0
  80. package/dist/chunk-OARHFVLG-Cr0x3Si_.mjs +21 -0
  81. package/dist/chunk-OCLXQMOG-BW6rwyzS.mjs +7 -0
  82. package/dist/chunk-OCS6LSEM-D7VAOziZ.mjs +14 -0
  83. package/dist/chunk-OJDRYQWQ-ikvLWpfV.mjs +2 -0
  84. package/dist/chunk-OL3S66CO-CQnF8cPH.mjs +100 -0
  85. package/dist/chunk-PBXLG62G-CgbPJTiw.mjs +9 -0
  86. package/dist/chunk-PP6PSHAB-CO4MYU__.mjs +5 -0
  87. package/dist/chunk-PYSFUGCK-DsRn64Ef.mjs +11 -0
  88. package/dist/chunk-QCDB2VPH-BUMOhlW7.mjs +7 -0
  89. package/dist/chunk-QJ7O6ZN3-F0_rcDPM.mjs +6 -0
  90. package/dist/chunk-R6QSAL5T-CeW6f7-x.mjs +2 -0
  91. package/dist/chunk-R6VWJ2ZL-FwG_Za20.mjs +2 -0
  92. package/dist/chunk-RPNGRAAP-BmkapBPD.mjs +8 -0
  93. package/dist/chunk-SDNKECQQ-DkebEzkd.mjs +6 -0
  94. package/dist/chunk-SYMJJMQ4-DOZMaECk.mjs +22 -0
  95. package/dist/chunk-T56QNPHK-DPXaSSfC.mjs +15 -0
  96. package/dist/chunk-TLSUDHID-BovZg0r1.mjs +7 -0
  97. package/dist/chunk-TOMNU26N-AAglMy4J.mjs +5 -0
  98. package/dist/chunk-TXBZCHCQ-WeVWfqYv.mjs +6 -0
  99. package/dist/chunk-UNYNJIFU-CqGlXAg7.mjs +140 -0
  100. package/dist/chunk-V7TAPXDL-DQgGPvBY.mjs +28 -0
  101. package/dist/chunk-VJFXDYWH-DIo0Ia0_.mjs +11 -0
  102. package/dist/chunk-VLGZJRPG-DymOu90-.mjs +17 -0
  103. package/dist/chunk-VOBGTVA6-Bfa1NTzt.mjs +7 -0
  104. package/dist/chunk-VYOJP4TV-PBsHe2md.mjs +14 -0
  105. package/dist/chunk-WKFATFPP-KO2zkfs2.mjs +5 -0
  106. package/dist/chunk-X2AJGDEF-D5w6wtaX.mjs +2 -0
  107. package/dist/chunk-XHM67O4N-akBjDPaR.mjs +2 -0
  108. package/dist/chunk-XKQRETAK-RHzVmuiF.mjs +2 -0
  109. package/dist/chunk-XORM457F-wr_DBBnV.mjs +288 -0
  110. package/dist/chunk-XVDPCNWR-DxaG1FfA.mjs +12 -0
  111. package/dist/chunk-YCFVLTST-Dzwevuc3.mjs +13 -0
  112. package/dist/chunk-YFG2CMIF-BoZQym0L.mjs +5 -0
  113. package/dist/chunk-YNYSPYQ5-DesxOVHh.mjs +34 -0
  114. package/dist/chunk-YS3AZT3J-CBc9LHIy.mjs +9 -0
  115. package/dist/chunk-YTNYSM6T-WMIf3AF8.mjs +12 -0
  116. package/dist/chunk-Z6LRHWXI-DGTVoTuf.mjs +14 -0
  117. package/dist/chunk-Z7JVV2SM-Cb4YKOCM.mjs +12 -0
  118. package/dist/clear-5CZ5X4YR-CadVxKrq.mjs +1 -0
  119. package/dist/cli.mjs +61 -593
  120. package/dist/colors-BNufdynn.mjs +2 -0
  121. package/dist/colors-T3xmlXQT.mjs +1 -0
  122. package/dist/column-WLPMMSTS-6o4DDsDk.mjs +1 -0
  123. package/dist/comm-5SLSESQG-C2GatHU6.mjs +1 -0
  124. package/dist/config-schema.json +87 -0
  125. package/dist/config.project-local.schema.json +30 -0
  126. package/dist/config.project.schema.json +59 -0
  127. package/dist/config.user.schema.json +58 -0
  128. package/dist/constants-Dc6GZ6j9.mjs +2 -0
  129. package/dist/cp-XOYR4ABJ-DmS6dER-.mjs +1 -0
  130. package/dist/curl-47BFPSFW-C2kRcGkX.mjs +26 -0
  131. package/dist/cut-OPC3VAGB-s4tQWhL5.mjs +1 -0
  132. package/dist/date-DD7FVA2V-Dubgjr6a.mjs +1 -0
  133. package/dist/diff-HJF2MPDN-DjGBLQph.mjs +1 -0
  134. package/dist/dirname-LEMTZZFS-B477CImE.mjs +1 -0
  135. package/dist/dist-B6pNPboH.mjs +1609 -0
  136. package/dist/dist-DVM7wH81.mjs +359 -0
  137. package/dist/dist-DXLSMgBY.mjs +1 -0
  138. package/dist/dist-bundle-BSdjl7Rj.mjs +2 -0
  139. package/dist/dist-bundle-BmF5_Mcp.mjs +1 -0
  140. package/dist/du-WO2ENHXQ-C4c5wweW.mjs +1 -0
  141. package/dist/echo-O45JWWI2-TudodhHR.mjs +1 -0
  142. package/dist/env-5EPCWSXR-CTcNEMpy.mjs +1 -0
  143. package/dist/esm-BbkJd7ro.mjs +2 -0
  144. package/dist/esm-CEs3LWY3.mjs +20 -0
  145. package/dist/execAsync-CulVJBMN.mjs +2 -0
  146. package/dist/execAsync-CzW9fUYQ.mjs +2 -0
  147. package/dist/execAsync-DuQoqWaW.mjs +2 -0
  148. package/dist/expand-DTNXU4LQ-BT6M2Tdc.mjs +1 -0
  149. package/dist/expansion-ENLSRCXJ-Cy7j--Iy.mjs +1 -0
  150. package/dist/expr-5T3UU5KE-D2Kr5nuJ.mjs +1 -0
  151. package/dist/file-ZIGAJ4YS-BH3jYcuM.mjs +1 -0
  152. package/dist/find-TPUOAIUQ-RFxkUcGN.mjs +1 -0
  153. package/dist/flag-coverage-QT4N2Z44--nNG-HLV.mjs +2 -0
  154. package/dist/fold-LDSORVYE-CfKQmrJ1.mjs +1 -0
  155. package/dist/getMachineId-bsd-DAmB-Ym0.mjs +2 -0
  156. package/dist/getMachineId-bsd-FYDP9w5Q.mjs +2 -0
  157. package/dist/getMachineId-bsd-mPrX3ckm.mjs +2 -0
  158. package/dist/getMachineId-darwin-B0Qw-MTj.mjs +3 -0
  159. package/dist/getMachineId-darwin-C79HtyON.mjs +3 -0
  160. package/dist/getMachineId-darwin-Co8Jnu5v.mjs +3 -0
  161. package/dist/getMachineId-linux-BBORs2cS.mjs +2 -0
  162. package/dist/getMachineId-linux-BizmCjYq.mjs +2 -0
  163. package/dist/getMachineId-linux-BvLCCmKQ.mjs +2 -0
  164. package/dist/getMachineId-unsupported-Bgp-Es9j.mjs +2 -0
  165. package/dist/getMachineId-unsupported-CbR45h2D.mjs +2 -0
  166. package/dist/getMachineId-unsupported-DbGFOAw1.mjs +2 -0
  167. package/dist/getMachineId-win-CT_Y5i_4.mjs +2 -0
  168. package/dist/getMachineId-win-Cy0XHq4X.mjs +2 -0
  169. package/dist/getMachineId-win-D5gDnBHa.mjs +2 -0
  170. package/dist/git-handle-DwfYp_z--CfyPz4Dz.mjs +10 -0
  171. package/dist/git-handle-DwfYp_z--DreW3fNC.mjs +1 -0
  172. package/dist/grep-3AIAIJVR-DgQJLmW0.mjs +1 -0
  173. package/dist/gzip-AQXSGOVS-yXjpnIVd.mjs +1 -0
  174. package/dist/head-HT2B6D2J-BR4RHRTk.mjs +1 -0
  175. package/dist/help-VVWX7SA5-M6C6klSC.mjs +1 -0
  176. package/dist/history-J4QRNGRO-C1r7-kvT.mjs +1 -0
  177. package/dist/hostname-BK6HG2DE-BBBcRrtV.mjs +1 -0
  178. package/dist/html-to-markdown-TFCECAGV-B9oYuMVf.mjs +1 -0
  179. package/dist/index.d.mts +52 -76
  180. package/dist/index.mjs +1 -1
  181. package/dist/init-B7qJnXKB.mjs +397 -0
  182. package/dist/init-DiH9oQ6_.mjs +1 -0
  183. package/dist/{is-object-WgQ3abDo.mjs → is-object-DF0ZeuvD.mjs} +1 -1
  184. package/dist/join-GG2LDHE5-xeTE0Mi4.mjs +1 -0
  185. package/dist/jq-ODXZBPLY-C5v6qNu_.mjs +1 -0
  186. package/dist/js-exec-M6UR76J5-IyD-lpzv.mjs +97 -0
  187. package/dist/lib-BOCdCkg7.mjs +2 -0
  188. package/dist/libesm-YL3Bqolr.mjs +14 -0
  189. package/dist/ln-4TRFBYAT-4XMTO1OQ.mjs +1 -0
  190. package/dist/loader-BQf8AJXb.mjs +4 -0
  191. package/dist/loader-C8lkPKn8.mjs +1 -0
  192. package/dist/ls-KSXFZCWH-Bw_Cf-VY.mjs +1 -0
  193. package/dist/lzma-vr8hBkhz.mjs +2 -0
  194. package/dist/md5sum-INMIK4DX-CAIH4ZVI.mjs +1 -0
  195. package/dist/mkdir-TDEMSB6C-D1oUG8Jf.mjs +1 -0
  196. package/dist/mrmime-C2W7cgq2.mjs +2 -0
  197. package/dist/mv-Z6MORUFL-CN471qcL.mjs +1 -0
  198. package/dist/nl-U5YJDM32-CFzXKze3.mjs +1 -0
  199. package/dist/od-VJEF2UR5-C2R4Accu.mjs +1 -0
  200. package/dist/{open-browser-rbaiEzUy.mjs → open-browser-BZZK_gJj.mjs} +1 -1
  201. package/dist/paste-7N6AFSDS-bUl2Dwz3.mjs +1 -0
  202. package/dist/preview-CN1rHXBb.mjs +1 -0
  203. package/dist/preview-DUTos2Es.mjs +3 -0
  204. package/dist/printf-CX64KX2P-Ce--gWAq.mjs +1 -0
  205. package/dist/public/assets/ActivityModeContent-1ymqlcHI.js +2 -0
  206. package/dist/public/assets/ActivityPanelDiffView-DoHWP1ak.js +13 -0
  207. package/dist/public/assets/ActivityPanelDiffView-legcy4jI.css +1 -0
  208. package/dist/public/assets/DocumentContext-bvfr7pL2.js +37 -0
  209. package/dist/public/assets/GraphPanel-DdVygxYk.js +46 -0
  210. package/dist/public/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  211. package/dist/public/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  212. package/dist/public/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  213. package/dist/public/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  214. package/dist/public/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  215. package/dist/public/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  216. package/dist/public/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  217. package/dist/public/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  218. package/dist/public/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  219. package/dist/public/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  220. package/dist/public/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  221. package/dist/public/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  222. package/dist/public/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  223. package/dist/public/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  224. package/dist/public/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  225. package/dist/public/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  226. package/dist/public/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  227. package/dist/public/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  228. package/dist/public/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  229. package/dist/public/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  230. package/dist/public/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  231. package/dist/public/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  232. package/dist/public/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  233. package/dist/public/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  234. package/dist/public/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  235. package/dist/public/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  236. package/dist/public/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  237. package/dist/public/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  238. package/dist/public/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  239. package/dist/public/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  240. package/dist/public/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  241. package/dist/public/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  242. package/dist/public/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  243. package/dist/public/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  244. package/dist/public/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  245. package/dist/public/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  246. package/dist/public/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  247. package/dist/public/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  248. package/dist/public/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  249. package/dist/public/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  250. package/dist/public/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  251. package/dist/public/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  252. package/dist/public/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  253. package/dist/public/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  254. package/dist/public/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  255. package/dist/public/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  256. package/dist/public/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  257. package/dist/public/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  258. package/dist/public/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  259. package/dist/public/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  260. package/dist/public/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  261. package/dist/public/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  262. package/dist/public/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  263. package/dist/public/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  264. package/dist/public/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  265. package/dist/public/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  266. package/dist/public/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  267. package/dist/public/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  268. package/dist/public/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  269. package/dist/public/assets/McpConsentDialogBody-CJwPf_uv.js +1 -0
  270. package/dist/public/assets/OutlinePanel-dumodx-h.js +2 -0
  271. package/dist/public/assets/SettingsPane-CtgbQZxP.js +6 -0
  272. package/dist/public/assets/SourceEditor-CR_7DOAH.js +2 -0
  273. package/dist/public/assets/__vite-browser-external-FEGw1XPd.js +1 -0
  274. package/dist/public/assets/_baseFor-CX8dsZbW.js +1 -0
  275. package/dist/public/assets/agent-presence-Ds2n3U5P.js +1 -0
  276. package/dist/public/assets/arc-BL_OKZmE.js +1 -0
  277. package/dist/public/assets/architecture-YZFGNWBL-DVxNz-zn.js +1 -0
  278. package/dist/public/assets/architectureDiagram-Q4EWVU46-BKKtWWhU.js +36 -0
  279. package/dist/public/assets/array-X0JlPOfd.js +1 -0
  280. package/dist/public/assets/blockDiagram-DXYQGD6D-fzO4vZye.js +132 -0
  281. package/dist/public/assets/button-BsFpqlpT.js +1 -0
  282. package/dist/public/assets/c4Diagram-AHTNJAMY-BkXqEjiP.js +10 -0
  283. package/dist/public/assets/channel-CR-xJel6.js +1 -0
  284. package/dist/public/assets/chunk-2KRD3SAO-DQj0pw3H.js +1 -0
  285. package/dist/public/assets/chunk-336JU56O-CBajDulv.js +2 -0
  286. package/dist/public/assets/chunk-426QAEUC-BoBKbVmN.js +1 -0
  287. package/dist/public/assets/chunk-4BX2VUAB-D8pbSOlJ.js +1 -0
  288. package/dist/public/assets/chunk-4TB4RGXK-mA6CujZO.js +206 -0
  289. package/dist/public/assets/chunk-55IACEB6-CqVyNzhX.js +1 -0
  290. package/dist/public/assets/chunk-5FUZZQ4R-BVDLgFg2.js +62 -0
  291. package/dist/public/assets/chunk-5PVQY5BW-Cxi5d3lT.js +2 -0
  292. package/dist/public/assets/chunk-67CJDMHE-CdrAY8qZ.js +1 -0
  293. package/dist/public/assets/chunk-7N4EOEYR-CJ3HBg3c.js +1 -0
  294. package/dist/public/assets/chunk-AA7GKIK3-D0ckJAXt.js +1 -0
  295. package/dist/public/assets/chunk-BSJP7CBP-D4bNhKd7.js +1 -0
  296. package/dist/public/assets/chunk-CFjPhJqf.js +1 -0
  297. package/dist/public/assets/chunk-CIAEETIT-D1Fpp2md.js +1 -0
  298. package/dist/public/assets/chunk-EDXVE4YY-ChhT3Iyo.js +1 -0
  299. package/dist/public/assets/chunk-ENJZ2VHE-Bby39so4.js +10 -0
  300. package/dist/public/assets/chunk-FMBD7UC4-pRkDIOZn.js +15 -0
  301. package/dist/public/assets/chunk-FOC6F5B3-BsB4oTj4.js +1 -0
  302. package/dist/public/assets/chunk-ICPOFSXX-CrnuSfeJ.js +122 -0
  303. package/dist/public/assets/chunk-K5T4RW27-CtREah_n.js +94 -0
  304. package/dist/public/assets/chunk-KGLVRYIC-DtDxSfKu.js +1 -0
  305. package/dist/public/assets/chunk-LIHQZDEY-D63TRk6j.js +1 -0
  306. package/dist/public/assets/chunk-ORNJ4GCN-Dv2PvYVu.js +1 -0
  307. package/dist/public/assets/chunk-OYMX7WX6-BhfqKepC.js +231 -0
  308. package/dist/public/assets/chunk-QZHKN3VN-DBRWHtgj.js +1 -0
  309. package/dist/public/assets/chunk-U2HBQHQK-6BAKH95D.js +70 -0
  310. package/dist/public/assets/chunk-X2U36JSP-Cqpkx90-.js +1 -0
  311. package/dist/public/assets/chunk-XPW4576I-DSytTnq4.js +32 -0
  312. package/dist/public/assets/chunk-YZCP3GAM-Dt9awjVh.js +1 -0
  313. package/dist/public/assets/chunk-ZZ45TVLE-JGFITgiO.js +1 -0
  314. package/dist/public/assets/classDiagram-6PBFFD2Q-oopM_Z0m.js +1 -0
  315. package/dist/public/assets/classDiagram-v2-HSJHXN6E-ZAL74u9S.js +1 -0
  316. package/dist/public/assets/clone-C5y6xhRJ.js +1 -0
  317. package/dist/public/assets/colors-XIJoz9Bd.js +1 -0
  318. package/dist/public/assets/compiler-runtime-CVnuRdak.js +1 -0
  319. package/dist/public/assets/config-validation-events-BvuBj41U.js +1 -0
  320. package/dist/public/assets/cose-bilkent-S5V4N54A-B9nG-SHi.js +1 -0
  321. package/dist/public/assets/cytoscape.esm-BkjNfcSF.js +321 -0
  322. package/dist/public/assets/dagre-BEdPLXba.js +1 -0
  323. package/dist/public/assets/dagre-KV5264BT-DKn5nGCC.js +4 -0
  324. package/dist/public/assets/defaultLocale-ZxyFnXCb.js +1 -0
  325. package/dist/public/assets/diagram-5BDNPKRD-BQuwYEd0.js +10 -0
  326. package/dist/public/assets/diagram-G4DWMVQ6-BmzIMyV5.js +24 -0
  327. package/dist/public/assets/diagram-MMDJMWI5-CI5eJfgr.js +43 -0
  328. package/dist/public/assets/diagram-TYMM5635-Cc8TJ7v3.js +24 -0
  329. package/dist/public/assets/dialog-Cv1qneWl.js +45 -0
  330. package/dist/public/assets/dist-B4kUko7n.js +9 -0
  331. package/dist/public/assets/dist-BH1b1nWB.js +1 -0
  332. package/dist/public/assets/dist-BOapDt7N.js +1 -0
  333. package/dist/public/assets/dist-CIRuNcH5.js +1 -0
  334. package/dist/public/assets/dist-D08h1pJc.js +1 -0
  335. package/dist/public/assets/dist-S8LJmtzL.js +1 -0
  336. package/dist/public/assets/dist-VyzSEzD4.js +1 -0
  337. package/dist/public/assets/dist-nPpvoMNC.js +13 -0
  338. package/dist/public/assets/doc-hash-Q6dTjwu5.js +421 -0
  339. package/dist/public/assets/erDiagram-SMLLAGMA-BkrhGWMT.js +85 -0
  340. package/dist/public/assets/flatten-UmyAv3V9.js +1 -0
  341. package/dist/public/assets/flowDiagram-DWJPFMVM-qh62fanI.js +162 -0
  342. package/dist/public/assets/ganttDiagram-T4ZO3ILL-DXuCeCk6.js +292 -0
  343. package/dist/public/assets/gitGraph-7Q5UKJZL-CYhZlmk3.js +1 -0
  344. package/dist/public/assets/gitGraphDiagram-UUTBAWPF-BbcuenPj.js +106 -0
  345. package/dist/public/assets/graphlib-CasrTmMJ.js +1 -0
  346. package/dist/public/assets/image-preview-BJSGEOo4.png +0 -0
  347. package/dist/public/assets/index-B1y9QLHF.js +1858 -0
  348. package/dist/public/assets/index-DoXig4bf.css +1 -0
  349. package/dist/public/assets/info-OMHHGYJF-BslcKZhH.js +1 -0
  350. package/dist/public/assets/infoDiagram-42DDH7IO-WFAMbO2S.js +2 -0
  351. package/dist/public/assets/init-CBj3ecIW.js +1 -0
  352. package/dist/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  353. package/dist/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  354. package/dist/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  355. package/dist/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  356. package/dist/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  357. package/dist/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  358. package/dist/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  359. package/dist/public/assets/isEmpty-DWJlzxR1.js +1 -0
  360. package/dist/public/assets/isObjectLike-AdQZ65l0.js +1 -0
  361. package/dist/public/assets/isSymbol-BP7IOIqG.js +1 -0
  362. package/dist/public/assets/ishikawaDiagram-UXIWVN3A-BJBiReWg.js +70 -0
  363. package/dist/public/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  364. package/dist/public/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  365. package/dist/public/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  366. package/dist/public/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  367. package/dist/public/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  368. package/dist/public/assets/journeyDiagram-VCZTEJTY-Boq77pl6.js +139 -0
  369. package/dist/public/assets/kanban-definition-6JOO6SKY-DYMSr18F.js +89 -0
  370. package/dist/public/assets/katex-qwlL5fSd.js +257 -0
  371. package/dist/public/assets/line-_p5Px7MV.js +1 -0
  372. package/dist/public/assets/linear-DwuDS4qT.js +1 -0
  373. package/dist/public/assets/mcp-consent-store-BBTXqzE6.js +1 -0
  374. package/dist/public/assets/mermaid-parser.core-BcBb_Ows.js +4 -0
  375. package/dist/public/assets/mermaid.core-ZLTnLqVQ.js +11 -0
  376. package/dist/public/assets/min-HKuGSUqa.js +1 -0
  377. package/dist/public/assets/mindmap-definition-QFDTVHPH-BSxM4djR.js +96 -0
  378. package/dist/public/assets/now-BBH4UqDm.js +1 -0
  379. package/dist/public/assets/ordinal-CeOFUmRv.js +1 -0
  380. package/dist/public/assets/packet-4T2RLAQJ-QVnYA304.js +1 -0
  381. package/dist/public/assets/panel-BgMqDESF.js +1 -0
  382. package/dist/public/assets/path-rUlDLHdA.js +1 -0
  383. package/dist/public/assets/pdf-a35ddrIO.js +54 -0
  384. package/dist/public/assets/pdf.worker-B1D2UnXD.mjs +63133 -0
  385. package/dist/public/assets/pdf.worker-CM-zAFN-.js +1 -0
  386. package/dist/public/assets/pie-ZZUOXDRM-C61c5byc.js +1 -0
  387. package/dist/public/assets/pieDiagram-DEJITSTG-CHRE_Jie.js +30 -0
  388. package/dist/public/assets/preload-helper-2ej06EnG.js +1 -0
  389. package/dist/public/assets/propagation-api-qAYD7s-v.js +1 -0
  390. package/dist/public/assets/quadrantDiagram-34T5L4WZ-CQkE5TwH.js +7 -0
  391. package/dist/public/assets/radar-PYXPWWZC-CMxjRtd8.js +1 -0
  392. package/dist/public/assets/reduce-DotyoGA7.js +1 -0
  393. package/dist/public/assets/requirementDiagram-MS252O5E-DHK98tKS.js +84 -0
  394. package/dist/public/assets/rough.esm-BFJ-MgcB.js +1 -0
  395. package/dist/public/assets/sankeyDiagram-XADWPNL6-BIXaStZh.js +10 -0
  396. package/dist/public/assets/sequenceDiagram-FGHM5R23-BCNH3kJo.js +157 -0
  397. package/dist/public/assets/src-C9jsS3p4.js +1 -0
  398. package/dist/public/assets/src-zyMpT2LE.js +1 -0
  399. package/dist/public/assets/stateDiagram-FHFEXIEX-BC5mjB6x.js +1 -0
  400. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-B8L3BBt1.js +1 -0
  401. package/dist/public/assets/stex-BKMR5xQj.js +1 -0
  402. package/dist/public/assets/target-navigation-intent-BfGOumP6.js +1 -0
  403. package/dist/public/assets/telemetry-impl-CMeDUVKn.js +2 -0
  404. package/dist/public/assets/timeline-definition-GMOUNBTQ-VNxUGgXp.js +120 -0
  405. package/dist/public/assets/tooltip-CBGDOTMI.js +1 -0
  406. package/dist/public/assets/trace-api-DPMyR1_m.js +1 -0
  407. package/dist/public/assets/treeView-SZITEDCU-DfSa_Oiv.js +1 -0
  408. package/dist/public/assets/treemap-W4RFUUIX-Cp0s5wEq.js +1 -0
  409. package/dist/public/assets/vennDiagram-DHZGUBPP-DV2Y2j0r.js +34 -0
  410. package/dist/public/assets/video-preview-vLovc_Vy.png +0 -0
  411. package/dist/public/assets/w3c-keyname-Dfj2imOv.js +1 -0
  412. package/dist/public/assets/wardley-RL74JXVD-CXcBKCuj.js +1 -0
  413. package/dist/public/assets/wardleyDiagram-NUSXRM2D-C1mMZ3kx.js +20 -0
  414. package/dist/public/assets/xychartDiagram-5P7HB3ND-CxFcwN2X.js +7 -0
  415. package/dist/public/favicon.svg +19 -4
  416. package/dist/public/index.html +57 -4
  417. package/dist/pwd-D4OZ7N27-C18XewhV.mjs +1 -0
  418. package/dist/python3-AUFTPCU6-BaJugIdp.mjs +12 -0
  419. package/dist/readlink-MI4GCHJF-CHvs7DDT.mjs +1 -0
  420. package/dist/rev-XOSYPP45-2mnFFZWW.mjs +1 -0
  421. package/dist/rg-FOQSCCX3-BJahNfSe.mjs +1 -0
  422. package/dist/rm-RTZG23RL-D9-0WGRY.mjs +1 -0
  423. package/dist/rmdir-XTQXT7RK-Br7eH9kL.mjs +1 -0
  424. package/dist/rolldown-runtime-twds-ZHy-Dxr-RWJs.mjs +2 -0
  425. package/dist/schemas/v0/config.project-local.schema.json +30 -0
  426. package/dist/schemas/v0/config.project.schema.json +59 -0
  427. package/dist/schemas/v0/config.user.schema.json +58 -0
  428. package/dist/sed-VFTTATXJ-mYhAmixc.mjs +1 -0
  429. package/dist/seq-RN5ZUASB-CKf5MNNO.mjs +1 -0
  430. package/dist/server-lock-D7DXNVql-B5nINglj.mjs +1 -0
  431. package/dist/server-lock-D7DXNVql-BRVVzA6T.mjs +2 -0
  432. package/dist/sha1sum-VJPNLNU6-DuOHap1X.mjs +1 -0
  433. package/dist/sha256sum-PI32XWXY-D9fEipQ7.mjs +1 -0
  434. package/dist/sleep-VZFPZFWA-B1fSoYuO.mjs +1 -0
  435. package/dist/sort-DCNRDA7U-DDCY4JZu.mjs +1 -0
  436. package/dist/split-SITCSYCZ-b9hfEJw7.mjs +1 -0
  437. package/dist/sqlite3-56UMWEY3-BQEx5i3P.mjs +1 -0
  438. package/dist/src-Cak39c0B.mjs +1 -0
  439. package/dist/start-BXk7J0Kh.mjs +1 -0
  440. package/dist/start-D6Ip3u6P.mjs +3 -0
  441. package/dist/stat-BT5A227F-Dzp4sgau.mjs +1 -0
  442. package/dist/strings-7PLOGTPD-DT41jX9d.mjs +1 -0
  443. package/dist/tac-SJGXQ4T2-BpdVoP8b.mjs +1 -0
  444. package/dist/tail-S5ULNTJU-0-sYrYik.mjs +1 -0
  445. package/dist/tar-ANUBEFJY-Wh3na_NU.mjs +1 -0
  446. package/dist/tee-O7VXZDCO-CwnGG0go.mjs +1 -0
  447. package/dist/time-DEUO3QV2-DzkqaQ1k.mjs +1 -0
  448. package/dist/timeout-VRKMCG72-BtPBpIRq.mjs +1 -0
  449. package/dist/touch-DX2IJOQ4-KW0Ui-lB.mjs +1 -0
  450. package/dist/tr-2HXZRDSW-C6Kf0M8T.mjs +1 -0
  451. package/dist/tree-LYXBS7DC-BN1FBqvM.mjs +1 -0
  452. package/dist/true-WHJNXCHG-DxCMVdqj.mjs +1 -0
  453. package/dist/unexpand-RGTMIGZM-DZ4Kf6Xq.mjs +1 -0
  454. package/dist/uniq-SUNANL47-Ceg51JdA.mjs +1 -0
  455. package/dist/wc-TQB3VNOX-BzWNq0MY.mjs +1 -0
  456. package/dist/which-XZHEH76L-DH_U2-Cj.mjs +1 -0
  457. package/dist/whoami-DGKU3D2X-BholYNPM.mjs +1 -0
  458. package/dist/xan-BXDXYEIB-b1eAtgch.mjs +1 -0
  459. package/dist/xan-view-ECQUO7AJ-DWDC57b_.mjs +1 -0
  460. package/dist/xargs-I6EZUCYF-Cov-i7kW.mjs +1 -0
  461. package/dist/yq-MJMAR36V-1r29nH4p.mjs +1 -0
  462. package/package.json +25 -19
  463. package/scripts/build-config-schema.mjs +69 -0
  464. package/scripts/postinstall.mjs +33 -0
  465. package/scripts/probe-exec.ts +98 -0
  466. package/scripts/probe-read-document.ts +100 -0
  467. package/dist/banner-De2a4ivv.mjs +0 -3
  468. package/dist/colors-C2vrt_OY.mjs +0 -1
  469. package/dist/colors-CshxhXdR.mjs +0 -2
  470. package/dist/constants-yNFhYMHH.mjs +0 -2
  471. package/dist/git-handle-B5vQdmjQ.mjs +0 -2
  472. package/dist/git-handle-DGTzeK-H.mjs +0 -1
  473. package/dist/init-BFZ4vnnX.mjs +0 -1
  474. package/dist/init-BH38QtfV.mjs +0 -6
  475. package/dist/init-BzEVODBI.mjs +0 -230
  476. package/dist/init-DCZhpKSO.mjs +0 -1
  477. package/dist/keepalive-Bp0nJiwT.mjs +0 -2
  478. package/dist/loader-CoGCjTcI.mjs +0 -3
  479. package/dist/loader-D8pf7fi6.mjs +0 -1
  480. package/dist/paths-C7TuvND0.mjs +0 -2
  481. package/dist/paths-CWTmBbr0.mjs +0 -1
  482. package/dist/preview-C-NvAf2r.mjs +0 -1
  483. package/dist/preview-Cmt2vdUG.mjs +0 -3
  484. package/dist/public/assets/dist-BDfJLgAe.js +0 -1
  485. package/dist/public/assets/dist-BSbGs59J.js +0 -1
  486. package/dist/public/assets/dist-BXK-5ZOh.js +0 -1
  487. package/dist/public/assets/dist-BipKfxqO.js +0 -15
  488. package/dist/public/assets/dist-C9Jm0v8G.js +0 -1
  489. package/dist/public/assets/dist-CDCPrjhY.js +0 -1
  490. package/dist/public/assets/dist-CHAniM6T.js +0 -9
  491. package/dist/public/assets/dist-CYsaeLzc.js +0 -1
  492. package/dist/public/assets/dist-Cq9Fm8Xi.js +0 -1
  493. package/dist/public/assets/dist-Ct0eqVZy.js +0 -1
  494. package/dist/public/assets/dist-PgXBewk9.js +0 -23
  495. package/dist/public/assets/index-BbLzex1v.css +0 -2
  496. package/dist/public/assets/index-gSm49umN.js +0 -409
  497. package/dist/src-B7snRveE.mjs +0 -1
  498. package/dist/src-CEP6NuWY.mjs +0 -1
  499. package/dist/src-EGbU552u.mjs +0 -278
  500. package/dist/start-BYXBgVJW.mjs +0 -1
  501. package/dist/start-DqcFf-BT.mjs +0 -2
  502. /package/dist/public/assets/{go-IODVg4Ok.js → go-a33xvodr.js} +0 -0
  503. /package/dist/public/assets/{shell-COsTRxlr.js → shell-40VLet8r.js} +0 -0
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-DIKSLkPq.mjs";import{r as e,t}from"./chunk-VOBGTVA6-Bfa1NTzt.mjs";export{e as aliasCommand,t as unaliasCommand};
@@ -0,0 +1,347 @@
1
+ ---
2
+ name: open-knowledge
3
+ description: "MUST invoke when the project contains a .ok/ directory — before any read or edit of .md / .mdx files, any mcp__open-knowledge__ tool call, and any write_document / edit_document. Skip if no .ok/ — not an Open Knowledge project. Carries preview-attach (open preview browser at session start; one-shot on `action: attach-preview-once`), STOP rules for native Read/Grep/Edit on in-scope markdown, grounding rules (every factual claim needs a source), standard markdown linking with get_dead_links verification, image sourcing + alt-text + source-citation rules, folder-first organization with opt-in nested .ok/ frontmatter + templates, and the anti-pattern table. Authoritative — MCP server instructions and AGENTS.md overlap but do not substitute for the full attach rule, grounding rule, media rules, dead-link verification, and failure-mode guidance carried only here."
4
+ compatibility: "Claude Code, Claude Desktop, Claude Cowork, Claude.ai web. Requires Open Knowledge MCP server + code execution."
5
+ metadata:
6
+ version: "0.4.0-beta.6"
7
+ author: "Inkeep"
8
+ repository: "https://github.com/inkeep/open-knowledge"
9
+ ---
10
+ # Open Knowledge — agent guidance
11
+
12
+ Open Knowledge (OK) is a markdown-CRDT collaboration platform exposed via MCP. This skill carries the behavioral rules agents need to use it fluently. Every section is a MUST unless marked otherwise.
13
+
14
+ > Skill version: tracks `@inkeep/open-knowledge-server` package version. Check `cat ~/.ok/skill-state.yml` to see what's installed locally.
15
+
16
+ ## STOP — native tools on in-scope `.md` / `.mdx`
17
+
18
+ When this workspace has Open Knowledge MCP configured, do **not** use your host's native file tools on markdown paths inside the content directory. The ban covers every common rationalization:
19
+
20
+ - **Native `Read` / `Grep` / `Glob` on in-scope `.md` / `.mdx`** — the original case.
21
+ - **`Bash ls` / `Bash find` / `Bash cat` on dirs containing in-scope markdown** — use `exec("ls …")` / `exec("find … -name '*.md'")` / `exec("cat …")` instead. Native returns bare names; `exec` returns frontmatter, backlink counts, and recent activity per child.
22
+ - **Glob patterns that target markdown** (`**/*.md`, any dir known to be markdown-heavy like `specs/**`, `reports/**`, `docs/**`) — use `exec` with `find`, or `list_documents({ dir })`.
23
+ - **Dispatching the Explore / general-purpose subagent for markdown-heavy exploration** — subagents use native `Read` / `Grep` / `Glob` internally and bypass Open Knowledge entirely. Do markdown exploration yourself via `exec` / `search` / `grep`. Subagents remain appropriate for **source-code** exploration.
24
+ - **Reading `.ok/AGENTS.md` via native `Read`** — observed failure mode during M1 testing. The `.ok/` directory is in-scope; treat its contents the same as any other knowledge-base file.
25
+
26
+ Why: native tools skip frontmatter, backlinks, shadow-repo activity, and project git history that OK's tools return for every matched knowledge-base file. `exec` is the primary read surface; it runs read-only bash (`cat`, `ls`, `grep`, `find`, `head`, `tail`, `wc`, `sort`, `uniq`, `cut` — pipes OK) and returns raw stdout plus enriched metadata per file.
27
+
28
+ **MCP tool visibility — not seeing `exec` is NOT the escape hatch.** MCP wiring varies by client. Claude Code, Cursor, Codex, Windsurf, VS Code — each surfaces MCP differently. Server labels are user-defined; tools may not appear as top-level symbols named `exec` in your specific UI. If Open Knowledge is registered as an MCP server in this workspace, route markdown reads through its `exec` / `search` / `grep` / `read_document` via your client's documented MCP invocation (including any generic "call MCP tool" flow). Registration is the test, not top-level-symbol visibility.
29
+
30
+ **Escape hatch.** Native `Read` / `Grep` / `Glob` on `.md` / `.mdx` is allowed **only** when no Open Knowledge MCP server is registered for this project, **or** immediately after you tried an MCP call and it failed — then begin a user-visible sentence with `Open Knowledge MCP unavailable:`. Never use the hatch because you skipped your client's MCP path, didn't see `exec` as a top-level tool, or rationalized the skill wasn't necessary.
31
+
32
+ **Source code and non-markdown files** (`.ts`, `.py`, `package.json`, …): native `Read` / `Grep` / `Glob` always.
33
+
34
+ ## Reads — examples
35
+
36
+ - Read a file: `exec("cat <path>.md")` — contents + full rich enrichment
37
+ - List a directory: `exec("ls <dir>")` — per-child frontmatter, recursive markdown counts, most-recently-updated doc per subdir
38
+ - Search: `exec("grep -rn <term> <dir> | head -5")` — matches + enrichment on matched files
39
+ - Typed tools (`read_document`, `search`, `grep`, `list_documents`) remain available — prefer them when a structured `structuredContent` shape is useful (e.g., passing results to another tool). For interactive reads, `exec` is lighter. **Pick the right search:** `search` for ranked retrieval (cmd-K parity — title boost + body BM25 + recency); `grep` for every literal-string occurrence grouped by file with frontmatter enrichment.
40
+
41
+ ## Preview — open the browser at session start
42
+
43
+ **Open the preview browser as your first OK action of the session, if it is not already open.** The user watches edits land live in that pane; if it isn't open, your work is invisible and the whole CRDT pipeline is wasted. Treat this as step zero — before your first read, before your first write.
44
+
45
+ - Claude Code Desktop: `preview_start("open-knowledge-ui")`.
46
+ - Cursor: use the host's open-URL tool with a `previewUrl` from any write response.
47
+ - Other hosts: use whatever command opens a URL (macOS: `open <url>`). On hosts with no preview tool (Codex, generic stdio), surface the URL in chat for the user to click.
48
+
49
+ **How to know if it's already open.** You usually can't pre-check from the agent side — rely on these signals:
50
+
51
+ 1. You already opened it earlier in this session → don't reopen.
52
+ 2. A `write_document` / `edit_document` response returns `previewUrl` but NO `warning: { action: "attach-preview-once" }` → a browser is attached somewhere; do nothing.
53
+ 3. A response DOES include `warning: { action: "attach-preview-once", previewUrl, message }` → no browser is attached; open immediately, one-shot. The hint fires only when needed (server tracks `__system__` subscribers) and at most once per session in the normal fresh-start case.
54
+
55
+ If the server isn't running, you'll see a `"Hocuspocus server is not running"` error or `previewUrl: null`. Start the UI (`open-knowledge ui` from a terminal, or `preview_start("open-knowledge-ui")` in Claude Code), then retry. NEVER construct preview URLs by hand — always use the `previewUrl` returned in tool responses.
56
+
57
+ **No screenshots after edits.** Do NOT take `preview_screenshot` after every `edit_document` / `write_document`. Trust the CRDT tool response as confirmation the edit landed. Only screenshot when debugging a visual issue or when explicitly asked.
58
+
59
+ ## Writing
60
+
61
+ Call `write_document` / `edit_document` as soon as you have content. Native `Edit` / `sed` / direct `Write` on in-scope markdown is forbidden — it bypasses the CRDT and loses agent attribution in the shadow repo.
62
+
63
+ To delete a doc, call `delete_document` — never `rm` / `unlink` / native `Bash` removal on in-scope markdown. The MCP path closes open agent sessions and unloads the doc from Hocuspocus before unlinking; native `rm` desynchronizes those. Deletion is irreversible from this tool — call `save_version` first if you may need to roll back, and `get_backlinks` first if you want to fix the referrers that will become redlinks.
64
+
65
+ ## Grounding — every factual claim needs a source (MUST)
66
+
67
+ Knowledge-base docs are factual artifacts — whether the project is a wiki, an LLM brain, a spec collection, a research log, or anything else markdown-shaped. Every claim must be traceable, and **the source has to live inside the knowledge base**, not float on the public web.
68
+
69
+ - **The knowledge base is source-of-truth — closed loop.** External sources don't get *cited out* to the live web; they get *pulled in* via `ingest`, then cited locally. A bare `[source](https://...)` URL inside a knowledge-base doc is **not** a finished citation — it's a TODO that says "this source still needs to be ingested." The chain only works if every leaf is a local doc.
70
+ - **Every factual claim MUST cite its source at the point of claim.** No unsourced speculation.
71
+ - **Web sources for knowledge-base docs** → fetch the page (your host's `WebFetch` / `WebSearch` / equivalent), then `ingest` it as a local doc, then cite the local path: `[source name](./path/to/source.md)`. The local doc carries the original URL in its frontmatter `source_url:`. **Inline `[source](URL)` is a chat affordance, not a knowledge-base one.**
72
+ - **Self-fetched counts.** When YOU fetched a URL to ground a claim that's about to land in the knowledge base, that fetch triggers `ingest` exactly like a user share does. Don't downgrade to inline-URL citation because the fetch was agent-initiated — same KB, same closed-loop contract.
73
+ - **Internal cross-refs** → standard markdown link to the OK doc that contains the authoritative claim: `[text](./path/to/doc.md)`. The linked doc itself must cite its sources — chains should terminate in preserved local docs. Where ingested sources live is project-specific (an `external-sources/` folder if the project uses Karpathy's layout; wherever the project's existing layout puts raw references otherwise).
74
+ - **If you don't have evidence:**
75
+ 1. Run a web search and `ingest` the result, OR
76
+ 2. Mark inline `(TODO: needs source)` so a human can verify, OR
77
+ 3. Don't write the claim. Do NOT fabricate.
78
+ - Unsourced speculation looks authoritative but rots into tribal knowledge that can't be audited. The knowledge base loses its value if readers can't trust it.
79
+ - If a fact is in the knowledge base, a reader must be able to trace it to its origin via local docs only — no dead-link-on-the-public-web exposure.
80
+
81
+ ## Linking — use standard markdown links
82
+
83
+ - **Every noun-phrase that names another document should be linked** using standard markdown link syntax: `[text](./relative/path.md)` or `[text](/absolute/from/content-root.md)`.
84
+ - **External web sources are NOT inline body links.** Per the Grounding rule above, web URLs live in the `source_url:` frontmatter of an ingested doc under `external-sources/` (or the project's equivalent raw-sources folder); the body cites the local path: `[source name](./external-sources/source-slug.md)`. A raw `[source](https://...)` inline in the body is a TODO, not a citation — see Grounding for the closed-loop contract.
85
+ - **Internal cross-refs between OK docs** → `[text](./other-doc.md)` — link liberally to aid navigation.
86
+ - **Never wrap a link in backticks.** `` `[text](./foo.md)` `` is a bug — the backticks make it render as literal code rather than a link.
87
+ - **Never use HTML anchors** (`<a href="...">`). Markdown link syntax only.
88
+ - **Verify before walking away.** After writing a doc, call `get_dead_links({ sourceDocNames: ['your/doc'] })` to find broken references. Fix each redlink or explicitly accept it.
89
+ - **The editor's red-underline visual lies.** Its dead-link detection tolerates slug-fallback (e.g., `foo` may appear resolved because `foo.md` exists at root). `get_dead_links` is strict-exact — trust the tool, not the visual.
90
+
91
+ **Note on wiki-link syntax (`[[Page]]`):** the parser still handles it for legacy content, but it's NO LONGER the recommended default. Write new content with standard markdown links per above.
92
+
93
+ ## Media — images and attachments
94
+
95
+ ### 1. Markdown syntax only
96
+
97
+ - Use markdown image syntax: `![alt text](./path/to/image.png)`.
98
+ - Do NOT emit HTML `<img src="...">` tags. They get preserved in the CRDT but don't participate in OK's content graph and don't render consistently across Fumadocs / preview surfaces.
99
+ - Paths resolve relative to the doc's own path (standard CommonMark).
100
+
101
+ ### 2. Image sourcing — save locally, don't hot-link
102
+
103
+ - Agents MUST NOT embed external image URLs directly (e.g., `![pic](https://somesite.com/pic.png)`). Hot-linked images rot when the source disappears, leak referrers, and don't travel if content is exported or archived.
104
+ - To use an image from an external source:
105
+ 1. Fetch it (`WebFetch` / `curl` / your host's equivalent) and save to a local path.
106
+ 2. Reference with a relative markdown image link.
107
+ 3. Cite the source in a caption (see §4 below).
108
+ - **Conventional location:** `assets/images/<topic>/<filename>` under the content root. If the project already has a different convention, follow it — check via `exec("ls assets/")` or `exec("find . -type d -name images")` first.
109
+ - If you cannot fetch (no network, paywalled source, etc.): DON'T invent a local path. Either omit the image or mark inline `(TODO: image needs sourcing from <URL>)` for a human.
110
+
111
+ ### 3. Alt-text discipline
112
+
113
+ - Every image needs **meaningful alt text** describing what the image shows, not what it is.
114
+ - Bad: `![](./aang.png)` (empty — invisible to assistive tech, zero searchability)
115
+ - Bad: `![image](./aang.png)` (generic — same problem)
116
+ - Bad: `![aang.png](./aang.png)` (filename as alt — still generic)
117
+ - Good: `![Aang using the Avatar State to defeat Ozai](./aang.png)`
118
+ - Alt text is both an accessibility requirement AND a searchability signal — OK indexes alt text.
119
+
120
+ ### 4. Cite image sources (Grounding rule applies)
121
+
122
+ - Every image pulled from the web needs a source caption right below it, per the Grounding rule:
123
+ ```markdown
124
+ ![Aang using the Avatar State to defeat Ozai](./assets/images/aang/avatar-state.png)
125
+ *Source: [Avatar Wiki — Aang](https://avatar.fandom.com/wiki/Aang#Avatar_State)*
126
+ ```
127
+ - Original images (your own diagrams, screenshots of your own tool, etc.) may caption `*Original*` or omit the caption.
128
+ - Unattributed web images are a failure mode equivalent to unsourced factual claims.
129
+
130
+ ## Frontmatter conventions
131
+
132
+ Every `.md` / `.mdx` file in the knowledge base needs YAML frontmatter — `title` and `description` required, `tags` recommended:
133
+
134
+ ```yaml
135
+ ---
136
+ title: Article Title
137
+ description: Brief summary
138
+ tags:
139
+ - relevant
140
+ - tags
141
+ ---
142
+ ```
143
+
144
+ Folder-level defaults that any new doc here inherits live in opt-in nested `<folder>/.ok/frontmatter.yml` and merge at read time — see *Folder structure + metadata* below.
145
+
146
+ ## Follow project conventions — read folder defaults before writing (MUST)
147
+
148
+ Before creating or editing docs in a folder, **always** call `list_documents(<folder>)` (or `exec("ls <folder>")`) once and act on what it returns. Skipping this step is how agents land docs that violate the folder's discipline (wrong tags, no template, missing frontmatter shape) and force a follow-up cleanup pass.
149
+
150
+ Pre-write checklist:
151
+
152
+ 1. **Read `frontmatter_defaults`** — the merged folder defaults (title shape, description, tags) that any new doc here will inherit. Surfaces nested `<folder>/.ok/frontmatter.yml` cascade walked root → leaf, leaf wins per-key. **Don't redeclare** keys the cascade already provides — let inheritance carry them. Override per-file only when the file truly differs.
153
+ 2. **Read `templates_available`** — the menu of starter shapes for `write_document({ template })`. Each entry has `name`, `title`, `description`, and `scope` (`local` / `inherited`). If an entry matches, prefer it over free-form markdown — see "When to use a template" and "When to create a template" below.
154
+ 3. **Read recent siblings** — `list_documents` enrichment shows recent edits and per-child frontmatter. New docs should match the shape of existing ones (filename pattern, frontmatter keys, body structure). Inconsistency is the enemy.
155
+ 4. **Confirm content scope** — `content.dir` (in `.ok/config.yml`) defines the content root. `.gitignore` and `.okignore` files (gitignore syntax, nested at any depth) define which paths are excluded from the document index. Anything excluded is regular source code, not a knowledge-base doc.
156
+
157
+ If a project uses `ok seed` to scaffold the Karpathy three-layer layout (`external-sources/` → `research/` → `articles/`), the seed encodes layer rules in the project config so each layer's defaults show up in `list_documents` enrichment for that folder. Projects with custom layouts put their own discipline in their own folder defaults. Either way: **read the folder before writing**.
158
+
159
+ **Once per folder per session.** If you already ran the checklist for a folder earlier in the session, you can skip re-running it for subsequent docs in the same folder — unless you (or the user) changed a folder rule or template since.
160
+
161
+ ### When to use a template (MUST when one fits)
162
+
163
+ If `templates_available` lists a template whose `title` / `description` matches what you're about to write, instantiate it via `write_document({ template, docName, position: "replace" })` instead of free-form `markdown:`. This is not a stylistic preference — it's the folder's contract:
164
+
165
+ - Templates carry frontmatter (title shape, tags, status) that hand-authored docs routinely miss.
166
+ - Templates encode body structure (required sections, attendee/agenda blocks, status fields) that downstream tooling and humans rely on.
167
+ - Inherited templates (`scope: "inherited"`) are equally valid — when you write a doc in a subfolder, a template defined on an ancestor folder still surfaces in `templates_available` and is the right tool. Don't dismiss inherited entries because they don't live in the leaf folder's `.ok/`.
168
+
169
+ Skip the template only when (a) `templates_available` is empty, (b) no entry matches the doc's purpose, OR (c) the user explicitly asked for free-form content. If you skip, briefly note why in chat so the user can correct course (e.g. "no template matched — writing free-form").
170
+
171
+ ### When to create a template (encouraged — don't wait to be asked)
172
+
173
+ Templates are how a folder's structure becomes durable. Create them proactively, not just when asked:
174
+
175
+ - **You're about to write a doc in a folder where no template fits, AND the shape you're about to use is reusable.** Save it as a template the same turn (`write_template` with the body you'd have hand-authored), then instantiate via `template:`. The first doc carries the same body either way; the difference is whether the next agent gets a menu entry or re-derives it from a sibling.
176
+ - **You spot a sibling pattern in a folder that has no template.** Two or more docs sharing the same body skeleton (heading order, required sections, frontmatter shape) is enough — extract the skeleton via `write_template` so subsequent docs pick from `templates_available` instead of copying a sibling.
177
+ - **You're scaffolding a new folder for a doc category.** Pair the folder rule (`set_folder_rule` for tags/title shape) with a template (`write_template` for body structure) in the same turn. Don't ship a folder-with-discipline-but-no-template — it leaves the next agent to invent the body each time.
178
+ - **The user describes a recurring doc shape.** "We always log meetings with attendees, agenda, action items" → that's a template request whether or not the word "template" was used. Author it once.
179
+
180
+ Authoring API (frontmatter requirements, substitution allowlist, `{shape}` semantics): see "Creating templates" below. When you create a template, briefly note it in chat ("saved this as a template at `meetings/.ok/templates/prep-notes.md` for next time") so the user understands the folder's discipline grew.
181
+
182
+ ### When to declare folder defaults (MUST when a pattern emerges)
183
+
184
+ If you find yourself writing the **same** frontmatter (tags, title prefix, description shape) on multiple sibling docs by hand, that's the signal to call `set_folder_rule` once and let the cascade do it. Pair it with a template (above) when the body skeleton repeats too — folder rules cover frontmatter; templates cover body shape.
185
+
186
+ Repetition is the smell; folder rules and templates are the fix. Don't accumulate ad-hoc per-file frontmatter when one folder rule would carry it.
187
+
188
+ ## Folder structure + metadata — nested `<folder>/.ok/`
189
+
190
+ Folder defaults and templates live in opt-in nested `.ok/` directories — sparse, lazy-create, auto-clean. **Most folders have NO `.ok/`**. A folder gets one only when it declares its own frontmatter defaults or carries templates.
191
+
192
+ ```
193
+ content-root/
194
+ ├── .ok/ ← project root .ok/ (config.yml, cache, etc.)
195
+ ├── meetings/
196
+ │ ├── .ok/ ← opt-in: this folder declares defaults + templates
197
+ │ │ ├── frontmatter.yml
198
+ │ │ └── templates/
199
+ │ │ ├── prep-notes.md
200
+ │ │ └── post-notes.md
201
+ │ └── 2026-05-01.md
202
+ └── research/ ← no .ok/ — declares nothing, inherits root cascade
203
+ └── auth-providers.md
204
+ ```
205
+
206
+ ### Editing folder defaults
207
+
208
+ Use the `set_folder_rule` MCP tool. It writes nested `<folder>/.ok/frontmatter.yml`:
209
+
210
+ ```ts
211
+ set_folder_rule({
212
+ rules: [
213
+ { match: "meetings/**", frontmatter: { title: "Meetings", tags: ["meeting"] } },
214
+ { match: "meetings/prep-notes/**", frontmatter: { tags: ["meeting", "prep"] } },
215
+ ],
216
+ })
217
+ ```
218
+
219
+ Each `match` glob must resolve to a SINGLE target folder (leading literal segments + trailing `*`/`**`). Multi-folder globs like `specs/*/evidence/**` are rejected with `MULTI_FOLDER_GLOB` — split into one rule per folder.
220
+
221
+ To remove a folder rule, pass an empty `frontmatter: {}` — the file is deleted and `.ok/` is auto-cleaned if no other tenant remains.
222
+
223
+ Cascade rules (D6 — asymmetric per scalar vs list semantics):
224
+
225
+ - **Scalars** (`title`, `description`): walk root → leaf, last-wins per key (leaf replaces ancestor).
226
+ - **Tags**: union-and-dedup along the chain, first-occurrence preserved. Root `tags: [kb]` plus a leaf `tags: [spec]` produces `[kb, spec]` at the leaf — tags accumulate naturally; you don't need to redeclare ancestor tags at each level.
227
+ - **File frontmatter** wins per-scalar over folder defaults; file tags union with the cascade.
228
+
229
+ ### Creating templates
230
+
231
+ Templates are markdown starter shapes. Use `write_template`:
232
+
233
+ ```ts
234
+ write_template({
235
+ folder: "meetings/",
236
+ name: "prep-notes",
237
+ body: "# {Meeting Title}\n\n**Attendees:** \n**Date:** \n\n## Agenda\n- \n",
238
+ frontmatter: {
239
+ title: "Meeting Prep Notes", // MUST be present (D14 — hard error if missing)
240
+ description: "Use before a meeting.", // SHOULD be present (D14 — soft warning)
241
+ tags: ["meeting", "prep"],
242
+ },
243
+ })
244
+ ```
245
+
246
+ `title` is the menu surface — agents pick by title, so it's required at write time (`TEMPLATE_TITLE_REQUIRED` if missing). `description` is recommended for menu disambiguation but produces only a warning when absent.
247
+
248
+ **Substitution allowlist (D5).** Template bodies MAY use exactly two server-side substitutions: `{{date}}` (today's ISO-8601 date) and `{{user}}` (calling principal display name). Any other `{{...}}` token is rejected at write time with `TEMPLATE_UNKNOWN_VARIABLE`. Plain placeholder text in `{shape}` form (e.g., `{Meeting Title}`) is LITERAL — agents fill those in via subsequent `edit_document` calls. Substitution happens at instantiation time only; templates on disk show the raw `{{date}}` token.
249
+
250
+ To delete a template: `delete_template({ folder, name })` — auto-cleans empty `.ok/templates/` and `.ok/`.
251
+
252
+ ### Creating a doc from a template
253
+
254
+ This is the default path when `templates_available` (from the pre-write checklist) shows a matching entry. Three steps:
255
+
256
+ ```ts
257
+ // 1. Inspect the menu (same call you already made in the pre-write checklist).
258
+ list_documents("meetings/", { depth: 1 })
259
+ // → templates_available: [{ name: "prep-notes", title: "Meeting Prep Notes", scope: "local" }, ...]
260
+
261
+ // 2. Instantiate. `template` and `markdown` are mutually exclusive — pass `template`.
262
+ write_document({
263
+ docName: "meetings/2026-05-02-roadmap-sync",
264
+ template: "prep-notes",
265
+ position: "replace",
266
+ })
267
+
268
+ // 3. Fill the literal `{shape}` placeholders the template body declares
269
+ // (e.g. "{Meeting Title}", "{Attendees}") via follow-up `edit_document`
270
+ // calls — those are author-fill markers, not server-side substitutions.
271
+ ```
272
+
273
+ Templates resolve via leaf → root walk-up at the target's parent folder, with closest-wins on filename collision (D7). The `scope` field has two values: `"local"` (template lives in this folder's `.ok/templates/`) and `"inherited"` (template lives in an ancestor's) — both are first-class menu entries. Descendant templates do NOT appear in the parent's array — they surface only inside `subfolders[].templates_available` when `list_documents` is called with `depth > 1`.
274
+
275
+ **`template` and `markdown` are mutually exclusive** (D21). Passing both errors with `TEMPLATE_AND_MARKDOWN_BOTH_SET`. The template body becomes the new doc's body verbatim (after `{{date}}`/`{{user}}` substitution); fill `{shape}`-style placeholders via subsequent `edit_document` calls.
276
+
277
+ ## Cadence
278
+
279
+ When you make a multi-step change (batch of new docs, folder restructure), pause between steps to let the browser preview catch up. The CRDT edit streams live; the preview follows your edit cadence. Don't batch 10 writes in a row — interleave the writes so the user watching the browser sees the narrative progress.
280
+
281
+ This is primarily a human-watchability concern — the user watches edits land in the preview; interleaved cadence makes the narrative legible.
282
+
283
+ **Hub docs.** Don't *create* `INDEX.md` / `README.md` hub files solely to catalog children — `exec("ls <folder>")` returns the same view live, with per-file frontmatter + backlink counts. But if a hub doc *already exists* from prior work, keep it updated as children change — interleave: write child → update hub → write next child, rather than batching five child edits and a single trailing hub update.
284
+
285
+ ## Log discipline — check for a project log when KB content changes
286
+
287
+ Some projects keep an append-only project log to make agent activity auditable. **After any turn that creates, edits, or restructures docs in the knowledge base, check for a project log:** look for a `log.md` at the project root (or at the seed `rootDir` if `ok seed --root <dir>` was used). If one exists, follow whatever its frontmatter `description:` and in-file comment say — they carry the project-specific contract (entry shape, cadence, categories). Different projects log differently — some treat the log as a wiki audit trail, others as an LLM-brain history, others as a spec changelog. If no `log.md` exists, no log discipline applies; don't fabricate one.
288
+
289
+ The skill carries the trigger ("KB content changed this turn — go look"). The file owns the policy.
290
+
291
+ ## Anti-patterns — at a glance
292
+
293
+ | Task | Don't | Do |
294
+ | ----------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
295
+ | List a markdown-heavy dir | `Bash: ls specs/` | `exec("ls specs/")` |
296
+ | Find all SPEC.md files | `Glob: **/SPEC.md` | `exec("find specs -name SPEC.md")` |
297
+ | Find the most relevant page for a query | `Grep: "pattern" *.md` then read three files | `search({ query: "pattern" })` (ranked: title + body BM25 + recency) |
298
+ | Find every literal occurrence of a phrase | `Grep: "pattern" *.md` | `grep({ query: "pattern" })` (literal, grouped by file, with frontmatter) |
299
+ | Read an individual doc | `Read: specs/foo/SPEC.md` | `exec("cat specs/foo/SPEC.md")` or `read_document(...)` |
300
+ | Explore a markdown-heavy dir | `Agent(Explore): "..."` | Do `exec`-based exploration yourself |
301
+ | Wait for the server to tell you to open preview | Skip the session-start preview open and wait for the `attach-preview-once` hint | Open the preview browser at session start; the hint is a fallback when you didn't |
302
+ | Ignore the attach hint | Skip the `warning: { action: "attach-preview-once" }` hint in write-tool responses | Open the `previewUrl` when the hint fires; otherwise do nothing |
303
+ | Reference another doc | `` `[text](./page.md)` `` (backticked) or HTML `<a>` | `[text](./page.md)` (raw markdown) |
304
+ | Embed an image | `<img src="...">` (HTML) or hot-linked external URL | Fetch + save locally + `![meaningful alt](./assets/images/path)` |
305
+ | Write a factual claim in a KB doc | plausible prose without citation, OR inline `[source](https://URL)` | `ingest` the source first, then cite the local path per Grounding |
306
+ | Cite a web source you just fetched | inline `[source](https://...)` because YOU did the fetch (not the user) | `ingest` it — agent-initiated fetches are not exempt from the closed-loop rule |
307
+ | Finish a turn that changed KB content | move on without checking for a log | check for a `log.md` and follow its contract per Log discipline |
308
+ | Add an image | empty alt `![](./x.png)` or generic alt `![image](./x)` | meaningful alt + source caption below |
309
+ | Catalog folder contents | create `INDEX.md` hub file | `set_folder_rule({ rules: [{ match, frontmatter }] })` writes `<folder>/.ok/frontmatter.yml` |
310
+ | Write a doc in an unfamiliar folder | go straight to `write_document` with hand-authored markdown | `list_documents(<folder>)` first — read `frontmatter_defaults` + `templates_available` before writing |
311
+ | Author a doc when a matching template exists | `write_document({ markdown: "..." })` from scratch | `write_document({ template, position: "replace" })` — templates carry the folder's frontmatter + body discipline |
312
+ | Repeat the same frontmatter on sibling docs | hand-set identical `tags` / `title` prefix on every new file | `set_folder_rule(...)` once — the cascade carries it to every child |
313
+ | Re-derive the same body skeleton repeatedly | copy-paste the structure from a sibling each time | `write_template(...)` once, then pick from `templates_available` thereafter |
314
+ | Scaffold a new folder for a doc category | `set_folder_rule` for frontmatter and stop there | pair `set_folder_rule` with `write_template` in the same turn — discipline + body shape |
315
+ | Author a reusable doc shape "just this once" | hand-author the body and move on | `write_template(...)` first, then instantiate — slightly more setup, but durable for every subsequent doc |
316
+ | Delete a markdown doc | `Bash: rm` / `unlink` / native deletion on in-scope `.md` | `delete_document` — `save_version` first if rollback may be needed |
317
+ | Fork a skill and expect no stomp | Edit installed SKILL.md | `npx skills remove` before CLI upgrade |
318
+
319
+ ## Workflow tools — when to invoke them
320
+
321
+ Three MCP tools build on the primitives above and correspond to [Karpathy's three-layer knowledge-base pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f):
322
+
323
+ | Tool | Layer | When to invoke |
324
+ | ------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
325
+ | `ingest` | Raw sources (immutable) | User shares a URL/PDF/file to preserve verbatim, **OR you fetched a URL** (`WebFetch` / `WebSearch` / equivalent) to ground a claim that's about to land in the knowledge base. The KB is closed-loop — agent-initiated fetches are not exempt. No analysis in the file itself — takeaways go back to the user in chat. |
326
+ | `research` | KB, provisional | User asks you to investigate, compare alternatives, or synthesize multiple sources. Produces a `status: provisional` article with a `sources:` list. Follows scan-first routing, a STOP scoping gate, 3P-external framing, and a validate checklist — the tool body enforces each step. |
327
+ | `consolidate` | KB, canonical | Team has actually decided after research and wants the outcome committed as source-of-truth. Starts with a STOP gate confirming the decision exists; writes a `status: canonical` article with a `supersedes:` chain. |
328
+
329
+ Each tool returns a multi-step instructional body when invoked. The bodies enforce their own gates — follow the numbered steps in order, don't skip the STOP gates.
330
+
331
+ **These tools are your default move, not `write_document`.** When the work fits one of the three layers — preserving an external source, investigating/synthesizing, committing a decided outcome — invoke the corresponding tool instead of going straight to `write_document` / `edit_document`. The tool bodies enforce framing (sources, status, supersedes chains) that hand-written articles routinely miss. `write_document` is correct for everything that does **not** fit the three layers (specs, runbooks, scratch notes, project pages); for the three that do, lead with the tool. This is doubly true in projects that ran `ok seed` — a doc landing in `external-sources/` / `research/` / `articles/` should have come out of `ingest` / `research` / `consolidate`.
332
+
333
+ Typical day-2 flow: user shares a URL → `ingest` (preserve) → user asks "now research this" → `research` (provisional article + `ingest`s more sources as needed) → decision lands → `consolidate` (canonical article, supersedes the research).
334
+
335
+ **Do not chain silently.** After `ingest`, ask the user whether to proceed to `research`. After `research`, let the user decide whether the findings are ready to `consolidate`. Each tool completes on its own terms — the user drives the transitions.
336
+
337
+ **Project scaffolding is a CLI operation (optional).** Users who want the Karpathy three-layer layout as their folder structure can run `ok seed` once from a terminal. That command scaffolds `external-sources/` + `research/` + `articles/`, seeds an append-only `log.md` at the project root, and registers per-layer folder defaults so agents see layer descriptions at every `list_documents(<folder>)` / `exec("ls <folder>")` call. It is **not required**: the three workflow tools above work against any folder structure the project already uses (`specs/`, `docs/`, `reports/`, or anything else). Only mention `ok seed` if the user explicitly asks for a starter layout or wants the Karpathy pattern specifically.
338
+
339
+ ## Server lifecycle
340
+
341
+ If `write_document` or `edit_document` returns a "Hocuspocus server is not running" error, start it with `ok start` (via Bash) and retry. Never fall back to native `Edit` / `Write` for in-scope markdown — always route through the MCP write tools so edits go through the CRDT with proper attribution.
342
+
343
+ ## Scope recap
344
+
345
+ When MCP is connected, the server's `instructions` echo the **resolved** `content.dir` for this session — that's where Open Knowledge looks for documents. `.gitignore` and `.okignore` (at the project root and at any folder depth) define exclusions. Folder defaults + templates live in nested `<folder>/.ok/frontmatter.yml` + `<folder>/.ok/templates/` files — NOT in `.ok/config.yml`.
346
+
347
+ Default mental model (no jargon): **every `.md` and `.mdx` under `content.dir`** not excluded by `.gitignore` or `.okignore` is an Open Knowledge document — including under `specs/`, `reports/`, `docs/`, etc. Read `.okignore` (and any nested `.okignore` files) once per turn to know what's excluded.
@@ -0,0 +1 @@
1
+ import"./chunk-YNYSPYQ5-DesxOVHh.mjs";import"./chunk-DXB73IDG-DIKSLkPq.mjs";import"./chunk-5QMZ5MUS-CAp625aG.mjs";import"./chunk-24IMIIXA-B6yIPkk2.mjs";import{n as e}from"./chunk-OARHFVLG-Cr0x3Si_.mjs";export{e as awkCommand2};
@@ -0,0 +1,3 @@
1
+ import{a as e,i as t,n,t as r}from"./colors-BNufdynn.mjs";const i={single:{topLeft:`┌`,top:`─`,topRight:`┐`,right:`│`,bottomRight:`┘`,bottom:`─`,bottomLeft:`└`,left:`│`},double:{topLeft:`╔`,top:`═`,topRight:`╗`,right:`║`,bottomRight:`╝`,bottom:`═`,bottomLeft:`╚`,left:`║`},round:{topLeft:`╭`,top:`─`,topRight:`╮`,right:`│`,bottomRight:`╯`,bottom:`─`,bottomLeft:`╰`,left:`│`},bold:{topLeft:`┏`,top:`━`,topRight:`┓`,right:`┃`,bottomRight:`┛`,bottom:`━`,bottomLeft:`┗`,left:`┃`},singleDouble:{topLeft:`╓`,top:`─`,topRight:`╖`,right:`║`,bottomRight:`╜`,bottom:`─`,bottomLeft:`╙`,left:`║`},doubleSingle:{topLeft:`╒`,top:`═`,topRight:`╕`,right:`│`,bottomRight:`╛`,bottom:`═`,bottomLeft:`╘`,left:`│`},classic:{topLeft:`+`,top:`-`,topRight:`+`,right:`|`,bottomRight:`+`,bottom:`-`,bottomLeft:`+`,left:`|`},arrow:{topLeft:`↘`,top:`↓`,topRight:`↙`,right:`←`,bottomRight:`↖`,bottom:`↑`,bottomLeft:`↗`,left:`→`}}.round;function a(a){let o=[],s=`${a.name} v${a.version}`;o.push({plain:s,colored:r(s)}),o.push({plain:``,colored:``});let c=a.apiUrl?`Editor: `:`Local: `;if(o.push({plain:`${c}${a.localUrl}`,colored:`${c}${e(t(a.localUrl),a.localUrl)}`}),a.apiUrl){let t=`API: `;o.push({plain:`${t}${a.apiUrl}`,colored:`${t}${n(e(a.apiUrl,a.apiUrl))}`})}if(a.networkUrl){let n=`Network: `;o.push({plain:`${n}${a.networkUrl}`,colored:`${n}${e(t(a.networkUrl),a.networkUrl)}`})}o.push({plain:``,colored:``});let l=`Press Ctrl+C to stop`;o.push({plain:l,colored:n(l)});let u=Math.max(...o.map(e=>e.plain.length)),d=u+4,f=` ${i.topLeft}${i.top.repeat(d)}${i.topRight}`,p=` ${i.bottomLeft}${i.bottom.repeat(d)}${i.bottomRight}`;return[``,f,...o.map(e=>{let t=u-e.plain.length;return` ${i.left}${` `.repeat(2)}${e.colored}${` `.repeat(t+2)}${i.right}`}),p,``].join(`
2
+ `)}export{a as renderBanner};
3
+ //# sourceMappingURL=banner-DdbR6AZr.mjs.map
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-DIKSLkPq.mjs";import{t as e}from"./chunk-QJ7O6ZN3-F0_rcDPM.mjs";export{e as base64Command};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-DIKSLkPq.mjs";import{t as e}from"./chunk-ALLTKNUZ-Cu6JFoC4.mjs";export{e as basenameCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-DIKSLkPq.mjs";import{i as e,t}from"./chunk-D6CWQ5DW-7lvT8dGP.mjs";export{e as bashCommand,t as shCommand};
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./mrmime-C2W7cgq2.mjs";import{join as t,normalize as n,resolve as r,sep as i}from"node:path";import*as a from"node:fs";import{readdirSync as o,statSync as s}from"fs";import{join as c,resolve as l}from"path";import*as u from"node:querystring";function d(e,t,n=``){e=l(`.`,e);let r=o(e),i=0,a,u;for(;i<r.length;i++)a=c(e,r[i]),u=s(a),u.isDirectory()?d(a,t,c(n,r[i])):t(c(n,r[i]),a,u)}function f(e){let t=e.url;if(t==null)return;let n=e._parsedUrl;if(n&&n.raw===t)return n;let r=t,i=``,a,o;if(t.length>1){let e=t.indexOf(`#`,1);e!==-1&&(o=t.substring(e),r=t.substring(0,e)),e=r.indexOf(`?`,1),e!==-1&&(i=r.substring(e),r=r.substring(0,e),i.length>1&&(a=u.parse(i.substring(1))))}return e._parsedUrl={pathname:r,search:i,query:a,hash:o,raw:t}}const p=()=>{};function m(e,t){for(let n=0;n<t.length;n++)if(t[n].test(e))return!0}function h(e,t){let n=0,r,i=e.length-1;e.charCodeAt(i)===47&&(e=e.substring(0,i));let a=[],o=`${e}/index`;for(;n<t.length;n++)r=t[n]?`.${t[n]}`:``,e&&a.push(e+r),a.push(o+r);return a}function g(e,t,n){let r=0,i,a=h(t,n);for(;r<a.length;r++)if(i=e[a[r]])return i}function _(e,r,i,o){let s=0,c=h(i,o),l,u,d,f;for(;s<c.length;s++)if(l=n(t(e,d=c[s])),l.startsWith(e)&&a.existsSync(l)){if(u=a.statSync(l),u.isDirectory())continue;return f=x(d,u,r),f[`Cache-Control`]=r?`no-cache`:`no-store`,{abs:l,stats:u,headers:f}}}function v(e,t){return t.statusCode=404,t.end()}function y(e,t,n,r,i){let o=200,s,c={};i={...i};for(let e in i)s=t.getHeader(e),s&&(i[e]=s);if((s=t.getHeader(`content-type`))&&(i[`Content-Type`]=s),e.headers.range){o=206;let[n,a]=e.headers.range.replace(`bytes=`,``).split(`-`),s=c.end=parseInt(a,10)||r.size-1,l=c.start=parseInt(n,10)||0;if(s>=r.size&&(s=r.size-1),l>=r.size)return t.setHeader(`Content-Range`,`bytes */${r.size}`),t.statusCode=416,t.end();i[`Content-Range`]=`bytes ${l}-${s}/${r.size}`,i[`Content-Length`]=s-l+1,i[`Accept-Ranges`]=`bytes`}t.writeHead(o,i),a.createReadStream(n,c).pipe(t)}const b={".br":`br`,".gz":`gzip`};function x(t,n,r){let i=b[t.slice(-3)],a=e(t.slice(0,i&&-3))||``;a===`text/html`&&(a+=`;charset=utf-8`);let o={"Content-Length":n.size,"Content-Type":a,"Last-Modified":n.mtime.toUTCString()};return i&&(o[`Content-Encoding`]=i),r&&(o.ETag=`W/"${n.size}-${n.mtime.getTime()}"`),o}function S(e,t={}){e=r(e||`.`);let n=t.onNoMatch||v,a=t.setHeaders||p,o=t.extensions||[`html`,`htm`],s=t.gzip&&o.map(e=>`${e}.gz`).concat(`gz`),c=t.brotli&&o.map(e=>`${e}.br`).concat(`br`),l={},u=`/`,h=!!t.etag,b=!!t.single;if(typeof t.single==`string`){let e=t.single.lastIndexOf(`.`);u+=~e?t.single.substring(0,e):t.single}let S=[];t.ignores!==!1&&(S.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/),t.dotfiles?S.push(/\/\.\w/):S.push(/\/\.well-known/),[].concat(t.ignores||[]).forEach(e=>{S.push(new RegExp(e,`i`))}));let C=t.maxAge!=null&&`public,max-age=${t.maxAge}`;C&&t.immutable?C+=`,immutable`:C&&t.maxAge===0&&(C+=`,must-revalidate`),t.dev||d(e,(e,n,r)=>{if(!/\.well-known[\\+\/]/.test(e)&&!t.dotfiles&&/(^\.|[\\+|\/+]\.)/.test(e))return;let i=x(e,r,h);C&&(i[`Cache-Control`]=C),l[`/`+e.normalize().replace(/\\+/g,`/`)]={abs:n,stats:r,headers:i}});let w=t.dev?_.bind(0,e+i,h):g.bind(0,l);return function(e,t,r){let i=[``],l=f(e).pathname,d=e.headers[`accept-encoding`]||``;if(s&&d.includes(`gzip`)&&i.unshift(...s),c&&/(br|brotli)/i.test(d)&&i.unshift(...c),i.push(...o),l.indexOf(`%`)!==-1)try{l=decodeURI(l)}catch{}let p=w(l,i)||b&&!m(l,S)&&w(u,i);if(!p)return r?r():n(e,t);if(h&&e.headers[`if-none-match`]===p.headers.ETag)return t.writeHead(304),t.end();(s||c)&&t.setHeader(`Vary`,`Accept-Encoding`),a(t,l,p.stats),y(e,t,p.abs,p.stats,p.headers)}}export{S as default};
2
+ //# sourceMappingURL=build-B6buVrsB.mjs.map
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-DIKSLkPq.mjs";import{t as e}from"./chunk-TXBZCHCQ-WeVWfqYv.mjs";export{e as catCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-DIKSLkPq.mjs";import{t as e}from"./chunk-4GTNDTRF-PuLVuVJW.mjs";export{e as chmodCommand};
@@ -0,0 +1,4 @@
1
+ import{EventEmitter as e}from"node:events";import*as t from"node:path";import{join as n,relative as r,resolve as i,sep as a}from"node:path";import{stat as o,unwatchFile as s,watch as c,watchFile as l}from"node:fs";import{type as u}from"node:os";import{Readable as d}from"node:stream";import{lstat as f,open as ee,readdir as p,realpath as m,stat as h}from"node:fs/promises";const g={FILE_TYPE:`files`,DIR_TYPE:`directories`,FILE_DIR_TYPE:`files_directories`,EVERYTHING_TYPE:`all`},_={root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:g.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(_);const v=`READDIRP_RECURSIVE_ERROR`,y=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,v]),b=[g.DIR_TYPE,g.EVERYTHING_TYPE,g.FILE_DIR_TYPE,g.FILE_TYPE],te=new Set([g.DIR_TYPE,g.EVERYTHING_TYPE,g.FILE_DIR_TYPE]),ne=new Set([g.EVERYTHING_TYPE,g.FILE_DIR_TYPE,g.FILE_TYPE]),re=e=>y.has(e.code),ie=process.platform===`win32`,x=e=>!0,S=e=>{if(e===void 0)return x;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return x};var C=class extends d{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={..._,...e},{root:n,type:r}=t;this._fileFilter=S(t.fileFilter),this._directoryFilter=S(t.directoryFilter);let a=t.lstat?f:h;ie?this._stat=e=>a(e,{bigint:!0}):this._stat=a,this._maxDepth=t.depth!=null&&Number.isSafeInteger(t.depth)?t.depth:_.depth,this._wantsDir=r?te.has(r):!1,this._wantsFile=r?ne.has(r):!1,this._wantsEverything=r===g.EVERYTHING_TYPE,this._root=i(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r)),o=await Promise.all(a);for(let t of o){if(!t)continue;if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await p(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let a,o=this._isDirent?e.name:e;try{let s=i(n(t,o));a={path:r(this._root,s),fullPath:s,basename:o},a[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(e){this._onError(e);return}return a}_onError(e){re(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await m(t),n=await f(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===a){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=v,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}};function ae(e,t={}){let n=t.entryType||t.type;if(n===`both`&&(n=g.FILE_DIR_TYPE),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!b.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${b.join(`, `)}`);return t.root=e,new C(t)}const w=()=>{},T=process.platform,E=T===`win32`,D=T===`darwin`,O=T===`linux`,k=T===`freebsd`,A=u()===`OS400`,j={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},M=j,N={lstat:f,stat:h},P=`listeners`,F=`errHandlers`,I=`rawEmitters`,oe=[P,F,I],se=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),ce=e=>se.has(t.extname(e).slice(1).toLowerCase()),L=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},R=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},z=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},B=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},V=e=>e instanceof Set?e.size===0:!e,H=new Map;function U(e,n,r,i,a){let o=(n,i)=>{r(e),a(n,i,{watchedPath:e}),i&&e!==i&&W(t.resolve(e,i),P,t.join(e,i))};try{return c(e,{persistent:n.persistent},o)}catch(e){i(e);return}}const W=(e,t,n,r,i)=>{let a=H.get(e);a&&L(a[t],e=>{e(n,r,i)})},le=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=H.get(t),c;if(!n.persistent)return c=U(e,n,i,a,o),c?c.close.bind(c):void 0;if(s)R(s,P,i),R(s,F,a),R(s,I,o);else{if(c=U(e,n,W.bind(null,t,P),a,W.bind(null,t,I)),!c)return;c.on(M.ERROR,async n=>{let r=W.bind(null,t,F);if(s&&(s.watcherUnusable=!0),E&&n.code===`EPERM`)try{await(await ee(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:c},H.set(t,s)}return()=>{B(s,P,i),B(s,F,a),B(s,I,o),V(s.listeners)&&(s.watcher.close(),H.delete(t),oe.forEach(z(s)),s.watcher=void 0,Object.freeze(s))}},G=new Map,ue=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=G.get(t),c=o&&o.options;return c&&(c.persistent<n.persistent||c.interval>n.interval)&&(s(t),o=void 0),o?(R(o,P,i),R(o,I,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:l(t,n,(n,r)=>{L(o.rawEmitters,e=>{e(M.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&L(o.listeners,t=>t(e,n))})},G.set(t,o)),()=>{B(o,P,i),B(o,I,a),V(o.listeners)&&(G.delete(t),s(t),o.options=o.watcher=void 0,Object.freeze(o))}};var de=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,n){let r=this.fsw.options,i=t.dirname(e),a=t.basename(e);this.fsw._getWatchedDir(i).add(a);let o=t.resolve(e),s={persistent:r.persistent};n||=w;let c;return r.usePolling?(s.interval=r.interval!==r.binaryInterval&&ce(a)?r.binaryInterval:r.interval,c=ue(e,o,s,{listener:n,rawEmitter:this.fsw._emitRaw})):c=le(e,o,s,{listener:n,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),c}_handleFile(e,n,r){if(this.fsw.closed)return;let i=t.dirname(e),a=t.basename(e),o=this.fsw._getWatchedDir(i),s=n;if(o.has(a))return;let c=async(t,n)=>{if(this.fsw._throttle(`watch`,e,5)){if(!n||n.mtimeMs===0)try{let n=await h(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==s.mtimeMs)&&this.fsw._emit(M.CHANGE,e,n),(D||O||k)&&s.ino!==n.ino){this.fsw._closeFile(t),s=n;let r=this._watchWithNodeFs(e,c);r&&this.fsw._addPathCloser(t,r)}else s=n}catch{this.fsw._remove(i,a)}else if(o.has(a)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==s.mtimeMs)&&this.fsw._emit(M.CHANGE,e,n),s=n}}},l=this._watchWithNodeFs(e,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(M.ADD,e,0))return;this.fsw._emit(M.ADD,e,n)}return l}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await m(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(M.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(M.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,n,r,i,a,o,s){e=t.join(e,``);let c=i?`${e}:${i}`:e;if(s=this.fsw._throttle(`readdir`,c,1e3),!s)return;let l=this.fsw._getWatchedDir(r.path),u=new Set,d=this.fsw._readdirp(e,{fileFilter:e=>r.filterPath(e),directoryFilter:e=>r.filterDir(e)});if(d)return d.on(`data`,async s=>{if(this.fsw.closed){d=void 0;return}let c=s.path,f=t.join(e,c);if(u.add(c),!(s.stats.isSymbolicLink()&&await this._handleSymlink(s,e,f,c))){if(this.fsw.closed){d=void 0;return}(c===i||!i&&!l.has(c))&&(this.fsw._incrReadyCount(),f=t.join(a,t.relative(a,f)),this._addToNodeFs(f,n,r,o+1))}}).on(M.ERROR,this._boundHandleError),new Promise((t,n)=>{if(!d)return n();d.once(`end`,()=>{if(this.fsw.closed){d=void 0;return}let n=s?s.clear():!1;t(void 0),l.getChildren().filter(t=>t!==e&&!u.has(t)).forEach(t=>{this.fsw._remove(e,t)}),d=void 0,n&&this._handleRead(e,!1,r,i,a,o,s)})})}async _handleDir(e,n,r,i,a,o,s){let c=this.fsw._getWatchedDir(t.dirname(e)),l=c.has(t.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!a&&!l&&this.fsw._emit(M.ADD_DIR,e,n),c.add(t.basename(e)),this.fsw._getWatchedDir(e);let u,d=this.fsw.options.depth;if((d==null||i<=d)&&!this.fsw._symlinkPaths.has(s)){if(!a&&(await this._handleRead(e,r,o,a,e,i,void 0),this.fsw.closed))return;u=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,o,a,e,i,void 0)})}return u}async _addToNodeFs(e,n,r,i,a){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let s=this.fsw._getWatchHelpers(e);r&&(s.filterPath=e=>r.filterPath(e),s.filterDir=e=>r.filterDir(e));try{let r=await N[s.statMethod](s.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(s.watchPath,r))return o(),!1;let c=this.fsw.options.followSymlinks,l;if(r.isDirectory()){let o=t.resolve(e),u=c?await m(e):e;if(this.fsw.closed||(l=await this._handleDir(s.watchPath,r,n,i,a,s,u),this.fsw.closed))return;o!==u&&u!==void 0&&this.fsw._symlinkPaths.set(o,u)}else if(r.isSymbolicLink()){let a=c?await m(e):e;if(this.fsw.closed)return;let o=t.dirname(s.watchPath);if(this.fsw._getWatchedDir(o).add(s.watchPath),this.fsw._emit(M.ADD,s.watchPath,r),l=await this._handleDir(o,r,n,i,e,s,a),this.fsw.closed)return;a!==void 0&&this.fsw._symlinkPaths.set(t.resolve(e),a)}else l=this._handleFile(s.watchPath,r,n);return o(),l&&this.fsw._addPathCloser(e,l),!1}catch(t){if(this.fsw._handleError(t))return o(),e}}};
2
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
3
+ const fe=/\\/g,K=/\/\//g,pe=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,me=/^\.[/\\]/;function q(e){return Array.isArray(e)?e:[e]}const J=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp);function he(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?n=>{if(e.path===n)return!0;if(e.recursive){let r=t.relative(e.path,n);return r?!r.startsWith(`..`)&&!t.isAbsolute(r):!1}return!1}:()=>!1}function ge(e){if(typeof e!=`string`)throw Error(`string expected`);e=t.normalize(e),e=e.replace(/\\/g,`/`);let n=!1;return e.startsWith(`//`)&&(n=!0),e=e.replace(K,`/`),n&&(e=`/`+e),e}function Y(e,t,n){let r=ge(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function _e(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=q(e).map(e=>he(e));return t==null?(e,t)=>Y(n,e,t):Y(n,t)}const X=e=>{let t=q(e).flat();if(!t.every(e=>typeof e==`string`))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(Q)},Z=e=>{let t=e.replace(fe,`/`),n=!1;return t.startsWith(`//`)&&(n=!0),t=t.replace(K,`/`),n&&(t=`/`+t),t},Q=e=>Z(t.normalize(Z(e))),$=(e=``)=>n=>typeof n==`string`?Q(t.isAbsolute(n)?n:t.join(e,n)):n,ve=(e,n)=>t.isAbsolute(e)?e:t.join(n,e),ye=Object.freeze(new Set);var be=class{path;_removeWatcher;items;constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==`.`&&e!==`..`&&t.add(e)}async remove(e){let{items:n}=this;if(!n||(n.delete(e),n.size>0))return;let r=this.path;try{await p(r)}catch{this._removeWatcher&&this._removeWatcher(t.dirname(r),t.basename(r))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=w,this.items=ye,Object.freeze(this)}},xe=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,n,r){this.fsw=r;let i=e;this.path=e=e.replace(me,``),this.watchPath=i,this.fullWatchPath=t.resolve(i),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=n,this.statMethod=n?`stat`:`lstat`}entryPath(e){return t.join(this.watchPath,t.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Se=class extends e{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?q(e.ignored):q([]),awaitWriteFinish:t===!0?n:typeof t==`object`?{...n,...t}:!1};A&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let e=i.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=w,this._readyEmitted=!0,process.nextTick(()=>this.emit(j.READY)))},this._emitRaw=(...e)=>this.emit(j.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new de(this),Object.freeze(r)}_addIgnoredPath(e){if(J(e)){for(let t of this._ignoredPaths)if(J(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)J(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,n,r){let{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let a=X(e);return i&&(a=a.map(e=>ve(e,i))),a.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||=0,this._readyCount+=a.length,Promise.all(a.map(async e=>{let t=await this._nodeFsHandler._addToNodeFs(e,!r,void 0,0,n);return t&&this._emitReady(),t})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(t.dirname(e),t.basename(n||e))})}),this}unwatch(e){if(this.closed)return this;let n=X(e),{cwd:r}=this.options;return n.forEach(e=>{!t.isAbsolute(e)&&!this._closers.has(e)&&(r&&(e=t.join(r,e)),e=t.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((n,r)=>{let i=(this.options.cwd?t.relative(this.options.cwd,r):r)||`.`;e[i]=n.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==j.ERROR&&this.emit(j.ALL,e,...t)}async _emit(e,n,r){if(this.closed)return;let i=this.options;E&&(n=t.normalize(n)),i.cwd&&(n=t.relative(i.cwd,n));let a=[n];r!=null&&a.push(r);let o=i.awaitWriteFinish,s;if(o&&(s=this._pendingWrites.get(n)))return s.lastChange=new Date,this;if(i.atomic){if(e===j.UNLINK)return this._pendingUnlinks.set(n,[e,...a]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(j.ALL,...e),this._pendingUnlinks.delete(t)})},typeof i.atomic==`number`?i.atomic:100),this;e===j.ADD&&this._pendingUnlinks.has(n)&&(e=j.CHANGE,this._pendingUnlinks.delete(n))}if(o&&(e===j.ADD||e===j.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(n,o.stabilityThreshold,e,(t,n)=>{t?(e=j.ERROR,a[0]=t,this.emitWithAll(e,a)):n&&(a.length>1?a[1]=n:a.push(n),this.emitWithAll(e,a))}),this;if(e===j.CHANGE&&!this._throttle(j.CHANGE,n,50))return this;if(i.alwaysStat&&r===void 0&&(e===j.ADD||e===j.ADD_DIR||e===j.CHANGE)){let e=i.cwd?t.join(i.cwd,n):n,r;try{r=await h(e)}catch{}if(!r||this.closed)return;a.push(r)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(j.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,o=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(o,n);let s={timeoutObject:a,clear:o,count:0};return r.set(t,s),s}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,n,r,i){let a=this.options.awaitWriteFinish;if(typeof a!=`object`)return;let s=a.pollInterval,c,l=e;this.options.cwd&&!t.isAbsolute(e)&&(l=t.join(this.options.cwd,e));let u=new Date,d=this._pendingWrites;function f(t){o(l,(r,a)=>{if(r||!d.has(e)){r&&r.code!==`ENOENT`&&i(r);return}let o=Number(new Date);t&&a.size!==t.size&&(d.get(e).lastChange=o),o-d.get(e).lastChange>=n?(d.delete(e),i(void 0,a)):c=setTimeout(f,s,a)})}d.has(e)||(d.set(e,{lastChange:u,cancelWait:()=>(d.delete(e),clearTimeout(c),r)}),c=setTimeout(f,s))}_isIgnored(e,t){if(this.options.atomic&&pe.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map($(e));this._userIgnored=_e([...[...this._ignoredPaths].map($(e)),...t],void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new xe(e,this.options.followSymlinks,this)}_getWatchedDir(e){let n=t.resolve(e);return this._watched.has(n)||this._watched.set(n,new be(n,this._boundRemove)),this._watched.get(n)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,n,r){let i=t.join(e,n),a=t.resolve(i);if(r??=this._watched.has(i)||this._watched.has(a),!this._throttle(`remove`,i,100))return;!r&&this._watched.size===1&&this.add(e,n,!0),this._getWatchedDir(i).getChildren().forEach(e=>this._remove(i,e));let o=this._getWatchedDir(e),s=o.has(n);o.remove(n),this._symlinkPaths.has(a)&&this._symlinkPaths.delete(a);let c=i;if(this.options.cwd&&(c=t.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===j.ADD)return;this._watched.delete(i),this._watched.delete(a);let l=r?j.UNLINK_DIR:j.UNLINK;s&&!this._isIgnored(i)&&this._emit(l,i),this._closePath(i)}_closePath(e){this._closeFile(e);let n=t.dirname(e);this._getWatchedDir(n).remove(t.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=ae(e,{type:j.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(`close`,()=>{n=void 0}),n.once(`end`,()=>{n&&=(this._streams.delete(n),void 0)}),n}};function Ce(e,t={}){let n=new Se(t);return n.add(e),n}export{Ce as watch};
4
+ //# sourceMappingURL=chokidar-CxU7f6JW.mjs.map
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./chunk-5QMZ5MUS-CAp625aG.mjs";function n(n,r,i){if(!n||t.isInSandboxedContext())return;let a=`${r} ${i} attempted outside defense context`;throw new e(a,{timestamp:Date.now(),type:`missing_defense_context`,message:a,path:`DefenseInDepthBox.context`,stack:Error().stack,executionId:t.getCurrentExecutionId()})}async function r(e,t,r,i){n(e,t,`${r} (pre-await)`);let a=await i();return n(e,t,`${r} (post-await)`),a}function i(e,r,i,a){let o=((...t)=>(n(e,r,i),a(...t)));return e?t.bindCurrentContext(o):o}export{i as n,r,n as t};
2
+ //# sourceMappingURL=chunk-24IMIIXA-B6yIPkk2.mjs.map
@@ -0,0 +1,2 @@
1
+ function e(e,t,n){if(!e)return e;let r=e.replace(/\n\s+at\s.*/g,``);return n&&(r=r.replace(/\bfile:\/\/\/?[^\s'",)}\]:]+/g,`<path>`)),r=r.replace(t?/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap|workspace|root|srv|mnt|app))\b[^\s'",)}\]:]*/g:/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,`<path>`),r=r.replace(/node:internal\/[^\s'",)}\]:]+/g,`<internal>`),r=r.replace(/[A-Z]:\\[^\s'",)}\]:]+/g,`<path>`),n&&(r=r.replace(/\\\\[^\s\\]+\\[^\s'",)}\]:]+/g,`<path>`)),r}function t(t){return e(t,!1,!1)}function n(t){return e(t,!0,!0)}export{t as n,n as t};
2
+ //# sourceMappingURL=chunk-3THT3N7L-DztAF386.mjs.map
@@ -0,0 +1,2 @@
1
+ function e(e){let t=e.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!t)return null;let n=parseFloat(t[1]);switch(t[2]||`s`){case`s`:return n*1e3;case`m`:return n*60*1e3;case`h`:return n*60*60*1e3;case`d`:return n*24*60*60*1e3;default:return null}}export{e as t};
2
+ //# sourceMappingURL=chunk-3ZUFRYJ4-qsYuZX7b.mjs.map
@@ -0,0 +1,2 @@
1
+ function e(e){return e instanceof Error?e.message:String(e)}export{e as t};
2
+ //# sourceMappingURL=chunk-44UOCSGV-CaFxJDHm.mjs.map
@@ -0,0 +1,8 @@
1
+ import{n as e,r as t,t as n}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var r={name:`chmod`,summary:`change file mode bits`,usage:`chmod [OPTIONS] MODE FILE...`,options:[`-R change files recursively`,`-v output a diagnostic for every file processed`,` --help display this help and exit`]},i={name:`chmod`,async execute(i,s){if(n(i))return t(r);if(i.length<2)return{stdout:``,stderr:`chmod: missing operand
2
+ `,exitCode:1};let c=!1,l=!1,u=0;for(;u<i.length&&i[u].startsWith(`-`);){let t=i[u];if(t===`-R`||t===`--recursive`)c=!0,u++;else if(t===`-v`||t===`--verbose`)l=!0,u++;else if(t===`--`){u++;break}else{if(/^[+-]?[rwxugo]+/.test(t)||/^\d+$/.test(t))break;if(/^-[Rv]+$/.test(t)){t.includes(`R`)&&(c=!0),t.includes(`v`)&&(l=!0),u++;continue}return e(`chmod`,t)}}if(i.length-u<2)return{stdout:``,stderr:`chmod: missing operand
3
+ `,exitCode:1};let d=i[u],f=i.slice(u+1),p=/^[0-7]+$/.test(d),m;if(p)m=parseInt(d,8);else try{o(d,420)}catch{return{stdout:``,stderr:`chmod: invalid mode: '${d}'
4
+ `,exitCode:1}}let h=``,g=``,_=!1;for(let e of f){let t=s.fs.resolvePath(s.cwd,e);try{let n;if(n=p&&m!==void 0?m:o(d,(await s.fs.stat(t)).mode),await s.fs.chmod(t,n),l&&(h+=`mode of '${e}' changed to ${n.toString(8).padStart(4,`0`)}
5
+ `),c&&(await s.fs.stat(t)).isDirectory){let e=await a(s,t,p?m:void 0,p?void 0:d,l);h+=e}}catch{g+=`chmod: cannot access '${e}': No such file or directory
6
+ `,_=!0}}return{stdout:h,stderr:g,exitCode:_?1:0}}};async function a(e,t,n,r,i){let s=``,c=await e.fs.readdir(t);for(let l of c){let c=t===`/`?`/${l}`:`${t}/${l}`,u;u=n===void 0?r===void 0?420:o(r,(await e.fs.stat(c)).mode):n,await e.fs.chmod(c,u),i&&(s+=`mode of '${c}' changed to ${u.toString(8).padStart(4,`0`)}
7
+ `),(await e.fs.stat(c)).isDirectory&&(s+=await a(e,c,n,r,i))}return s}function o(e,t=420){if(/^[0-7]+$/.test(e))return parseInt(e,8);let n=t&4095,r=e.split(`,`);for(let t of r){let r=t.match(/^([ugoa]*)([+\-=])([rwxXst]*)$/);if(!r)throw Error(`Invalid mode: ${e}`);let i=r[1]||`a`,a=r[2],o=r[3];(i===`a`||i===``)&&(i=`ugo`);let s=0;o.includes(`r`)&&(s|=4),o.includes(`w`)&&(s|=2),(o.includes(`x`)||o.includes(`X`))&&(s|=1);let c=0;o.includes(`s`)&&(i.includes(`u`)&&(c|=2048),i.includes(`g`)&&(c|=1024)),o.includes(`t`)&&(c|=512);for(let e of i){let t=0;e===`u`?t=6:e===`g`?t=3:e===`o`&&(t=0);let r=s<<t;a===`+`?n|=r:a===`-`?n&=~r:a===`=`&&(n&=~(7<<t),n|=r)}a===`+`?n|=c:a===`-`?n&=~c:a===`=`&&(o.includes(`s`)&&(i.includes(`u`)&&(n&=-2049,n|=c&2048),i.includes(`g`)&&(n&=-1025,n|=c&1024)),o.includes(`t`)&&(n&=-513,n|=c&512))}return n}var s={name:`chmod`,flags:[{flag:`-R`,type:`boolean`},{flag:`-v`,type:`boolean`}],needsArgs:!0,minArgs:2};export{s as n,i as t};
8
+ //# sourceMappingURL=chunk-4GTNDTRF-PuLVuVJW.mjs.map
@@ -0,0 +1,3 @@
1
+ async function e(e,t){return{stdout:`localhost
2
+ `,stderr:``,exitCode:0}}var t={name:`hostname`,execute:e},n={name:`hostname`,flags:[]};export{n,t};
3
+ //# sourceMappingURL=chunk-4HHKTUW3-CQ53AiA_.mjs.map
@@ -0,0 +1,5 @@
1
+ import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var n={name:`dirname`,summary:`strip last component from file name`,usage:`dirname [OPTION] NAME...`,options:[` --help display this help and exit`]},r={name:`dirname`,async execute(r,i){if(t(r))return e(n);let a=r.filter(e=>!e.startsWith(`-`));if(a.length===0)return{stdout:``,stderr:`dirname: missing operand
2
+ `,exitCode:1};let o=[];for(let e of a){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);n===-1?o.push(`.`):n===0?o.push(`/`):o.push(t.slice(0,n))}return{stdout:`${o.join(`
3
+ `)}
4
+ `,stderr:``,exitCode:0}}},i={name:`dirname`,flags:[],needsArgs:!0};export{r as n,i as t};
5
+ //# sourceMappingURL=chunk-4Q4SM6WR-BlQvqCag.mjs.map
@@ -0,0 +1,3 @@
1
+ import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var r={name:`tee`,summary:`read from stdin and write to stdout and files`,usage:`tee [OPTION]... [FILE]...`,options:[`-a, --append append to the given FILEs, do not overwrite`,` --help display this help and exit`]},i={append:{short:`a`,long:`append`,type:`boolean`}},a={name:`tee`,async execute(a,o){if(t(a))return e(r);let s=n(`tee`,a,i);if(!s.ok)return s.error;let{append:c}=s.result.flags,l=s.result.positional,u=o.stdin,d=``,f=0;for(let e of l)try{let t=o.fs.resolvePath(o.cwd,e);c?await o.fs.appendFile(t,u):await o.fs.writeFile(t,u)}catch{d+=`tee: ${e}: No such file or directory
2
+ `,f=1}return{stdout:u,stderr:d,exitCode:f}}},o={name:`tee`,flags:[{flag:`-a`,type:`boolean`}],stdinType:`text`,needsArgs:!0};export{a as n,o as t};
3
+ //# sourceMappingURL=chunk-55VFSPNA-DLwfww5b.mjs.map
@@ -0,0 +1,5 @@
1
+ import{t as e}from"./chunk-DXB73IDG-DIKSLkPq.mjs";function t(){let e=[{prop:`Function`,target:globalThis,violationType:`function_constructor`,strategy:`throw`,reason:`Function constructor allows arbitrary code execution`},{prop:`eval`,target:globalThis,violationType:`eval`,strategy:`throw`,reason:`eval() allows arbitrary code execution`},{prop:`setTimeout`,target:globalThis,violationType:`setTimeout`,strategy:`throw`,reason:`setTimeout with string argument allows code execution`},{prop:`setInterval`,target:globalThis,violationType:`setInterval`,strategy:`throw`,reason:`setInterval with string argument allows code execution`},{prop:`setImmediate`,target:globalThis,violationType:`setImmediate`,strategy:`throw`,reason:`setImmediate could be used to escape sandbox context`},{prop:`env`,target:process,violationType:`process_env`,strategy:`throw`,reason:`process.env could leak sensitive environment variables`,allowedKeys:new Set([`NODE_V8_COVERAGE`,`NODE_DEBUG`,`NODE_DEBUG_NATIVE`,`NODE_COMPILE_CACHE`,`WATCH_REPORT_DEPENDENCIES`,`FORCE_COLOR`,`DEBUG`,`UNDICI_NO_FG`,`JEST_WORKER_ID`,`__MINIMATCH_TESTING_PLATFORM__`,`LOG_TOKENS`,`LOG_STREAM`])},{prop:`binding`,target:process,violationType:`process_binding`,strategy:`throw`,reason:`process.binding provides access to native Node.js modules`},{prop:`_linkedBinding`,target:process,violationType:`process_binding`,strategy:`throw`,reason:`process._linkedBinding provides access to native Node.js modules`},{prop:`dlopen`,target:process,violationType:`process_dlopen`,strategy:`throw`,reason:`process.dlopen allows loading native addons`},{prop:`getBuiltinModule`,target:process,violationType:`process_get_builtin_module`,strategy:`throw`,reason:`process.getBuiltinModule allows loading native Node.js modules (fs, child_process, vm)`},{prop:`exit`,target:process,violationType:`process_exit`,strategy:`throw`,reason:`process.exit could terminate the interpreter`},{prop:`abort`,target:process,violationType:`process_exit`,strategy:`throw`,reason:`process.abort could crash the interpreter`},{prop:`kill`,target:process,violationType:`process_kill`,strategy:`throw`,reason:`process.kill could signal other processes`},{prop:`setuid`,target:process,violationType:`process_setuid`,strategy:`throw`,reason:`process.setuid could escalate privileges`},{prop:`setgid`,target:process,violationType:`process_setuid`,strategy:`throw`,reason:`process.setgid could escalate privileges`},{prop:`seteuid`,target:process,violationType:`process_setuid`,strategy:`throw`,reason:`process.seteuid could escalate effective user privileges`},{prop:`setegid`,target:process,violationType:`process_setuid`,strategy:`throw`,reason:`process.setegid could escalate effective group privileges`},{prop:`initgroups`,target:process,violationType:`process_setuid`,strategy:`throw`,reason:`process.initgroups could modify supplementary group IDs`},{prop:`setgroups`,target:process,violationType:`process_setuid`,strategy:`throw`,reason:`process.setgroups could modify supplementary group IDs`},{prop:`umask`,target:process,violationType:`process_umask`,strategy:`throw`,reason:`process.umask could modify file creation permissions`},{prop:`argv`,target:process,violationType:`process_argv`,strategy:`throw`,reason:`process.argv may contain secrets in CLI arguments`},{prop:`cwd`,target:process,violationType:`process_chdir`,strategy:`throw`,reason:`process.cwd could disclose real host working directory path`},{prop:`chdir`,target:process,violationType:`process_chdir`,strategy:`throw`,reason:`process.chdir could confuse the interpreter's CWD tracking`},{prop:`report`,target:process,violationType:`process_report`,strategy:`throw`,reason:`process.report could disclose full environment, host paths, and system info`},{prop:`loadEnvFile`,target:process,violationType:`process_env`,strategy:`throw`,reason:`process.loadEnvFile could load env files bypassing env proxy`},{prop:`setUncaughtExceptionCaptureCallback`,target:process,violationType:`process_exception_handler`,strategy:`throw`,reason:`setUncaughtExceptionCaptureCallback could intercept security errors`},{prop:`send`,target:process,violationType:`process_send`,strategy:`throw`,reason:`process.send could communicate with parent process in IPC contexts`},{prop:`channel`,target:process,violationType:`process_channel`,strategy:`throw`,reason:`process.channel could access IPC channel to parent process`},{prop:`cpuUsage`,target:process,violationType:`process_timing`,strategy:`throw`,reason:`process.cpuUsage could enable timing side-channel attacks`},{prop:`memoryUsage`,target:process,violationType:`process_timing`,strategy:`throw`,reason:`process.memoryUsage could enable timing side-channel attacks`},{prop:`hrtime`,target:process,violationType:`process_timing`,strategy:`throw`,reason:`process.hrtime could enable timing side-channel attacks`},{prop:`WeakRef`,target:globalThis,violationType:`weak_ref`,strategy:`throw`,reason:`WeakRef could be used to leak references outside sandbox`},{prop:`FinalizationRegistry`,target:globalThis,violationType:`finalization_registry`,strategy:`throw`,reason:`FinalizationRegistry could be used to leak references outside sandbox`},{prop:`Reflect`,target:globalThis,violationType:`reflect`,strategy:`freeze`,reason:`Reflect provides introspection capabilities`},{prop:`Proxy`,target:globalThis,violationType:`proxy`,strategy:`throw`,reason:`Proxy allows intercepting and modifying object behavior`},{prop:`WebAssembly`,target:globalThis,violationType:`webassembly`,strategy:`throw`,reason:`WebAssembly allows executing arbitrary compiled code`},{prop:`SharedArrayBuffer`,target:globalThis,violationType:`shared_array_buffer`,strategy:`throw`,reason:`SharedArrayBuffer could enable side-channel communication or timing attacks`},{prop:`Atomics`,target:globalThis,violationType:`atomics`,strategy:`throw`,reason:`Atomics could enable side-channel communication or timing attacks`},{prop:`performance`,target:globalThis,violationType:`performance_timing`,strategy:`throw`,reason:`performance.now() provides sub-millisecond timing for side-channel attacks`},{prop:`stdout`,target:process,violationType:`process_stdout`,strategy:`throw`,reason:`process.stdout could bypass interpreter output to write to host stdout`},{prop:`stderr`,target:process,violationType:`process_stderr`,strategy:`throw`,reason:`process.stderr could bypass interpreter output to write to host stderr`},{prop:`__defineGetter__`,target:Object.prototype,violationType:`prototype_mutation`,strategy:`throw`,reason:`__defineGetter__ allows prototype pollution via getter injection`},{prop:`__defineSetter__`,target:Object.prototype,violationType:`prototype_mutation`,strategy:`throw`,reason:`__defineSetter__ allows prototype pollution via setter injection`},{prop:`__lookupGetter__`,target:Object.prototype,violationType:`prototype_mutation`,strategy:`throw`,reason:`__lookupGetter__ enables introspection for prototype pollution attacks`},{prop:`__lookupSetter__`,target:Object.prototype,violationType:`prototype_mutation`,strategy:`throw`,reason:`__lookupSetter__ enables introspection for prototype pollution attacks`},{prop:`JSON`,target:globalThis,violationType:`json_mutation`,strategy:`freeze`,reason:`Freeze JSON to prevent mutation of parsing/serialization`},{prop:`Math`,target:globalThis,violationType:`math_mutation`,strategy:`freeze`,reason:`Freeze Math to prevent mutation of math utilities`}];try{let t=Object.getPrototypeOf(async()=>{}).constructor;t&&t!==Function&&e.push({prop:`constructor`,target:Object.getPrototypeOf(async()=>{}),violationType:`async_function_constructor`,strategy:`throw`,reason:`AsyncFunction constructor allows arbitrary async code execution`})}catch{}try{let t=Object.getPrototypeOf(function*(){}).constructor;t&&t!==Function&&e.push({prop:`constructor`,target:Object.getPrototypeOf(function*(){}),violationType:`generator_function_constructor`,strategy:`throw`,reason:`GeneratorFunction constructor allows arbitrary generator code execution`})}catch{}try{let t=Object.getPrototypeOf(async function*(){}).constructor;t&&t!==Function&&t!==Object.getPrototypeOf(async()=>{}).constructor&&e.push({prop:`constructor`,target:Object.getPrototypeOf(async function*(){}),violationType:`async_generator_function_constructor`,strategy:`throw`,reason:`AsyncGeneratorFunction constructor allows arbitrary async generator code execution`})}catch{}return e.filter(e=>{try{return e.target[e.prop]!==void 0}catch{return!1}})}var n=typeof __BROWSER__<`u`&&__BROWSER__;function r(){return typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var i=null;if(!n)try{let{AsyncLocalStorage:t}=e(`node:async_hooks`);i=t}catch{}var a=`
2
+
3
+ This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`,o=class extends Error{violation;constructor(e,t){super(e+a),this.violation=t,this.name=`SecurityViolationError`}},s=!n&&i?new i:null,c=1e3;function l(e,t,...n){return s.run(e,()=>t(...n))}var u={enabled:!0,auditMode:!1};function d(e){return e===void 0?{...u,enabled:!1}:typeof e==`boolean`?{...u,enabled:e}:{...u,...e}}var f=class i{static instance=null;static importHooksRegistered=!1;static trustedExecutionDepth=new Map;config;refCount=0;patchFailures=[];activeExecutionIds=new Set;contextCache=new Map;originalDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(e){this.config=e}static getInstance(e){let t=d(e);if(!i.instance)i.instance=new i(t);else{let e=i.instance.config;if(t.enabled!==e.enabled||t.auditMode!==e.auditMode)throw Error(`DefenseInDepthBox config conflict: requested {enabled: ${t.enabled}, auditMode: ${t.auditMode}} but singleton already has {enabled: ${e.enabled}, auditMode: ${e.auditMode}}. All Bash instances must use the same defense-in-depth security settings, or call DefenseInDepthBox.resetInstance() between incompatible configurations.`)}return i.instance}static resetInstance(){i.instance&&=(i.instance.forceDeactivate(),null),i.trustedExecutionDepth.clear()}static isInSandboxedContext(){return s?s?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(s)return s?.getStore()?.executionId}static enterTrustedScope(e){let t=i.trustedExecutionDepth.get(e)??0;i.trustedExecutionDepth.set(e,t+1)}static leaveTrustedScope(e){let t=i.trustedExecutionDepth.get(e);if(t){if(t===1){i.trustedExecutionDepth.delete(e);return}i.trustedExecutionDepth.set(e,t-1)}}static isTrustedScopeActive(e){return e?(i.trustedExecutionDepth.get(e)??0)>0:!1}isExecutionIdActive(e){return this.activeExecutionIds.has(e)}getCachedContext(e){let t=this.contextCache.get(e);return t||(t={sandboxActive:!0,executionId:e},this.contextCache.set(e,t)),t}getPreferredActiveExecutionId(){if(this.activeExecutionIds.size!==0)for(let e of this.activeExecutionIds)return e}static bindCurrentContext(e){if(!s)return e;let t=i.instance,n=s.getStore(),r=n?.sandboxActive===!0?n.executionId:t?.getPreferredActiveExecutionId();if(!r)return e;let a=t?.getCachedContext(r)??{sandboxActive:!0,executionId:r};return((...t)=>{let n=i.instance;if(!(n&&!n.isExecutionIdActive(r)&&(n.recordViolation(`bound_callback_after_deactivate`,`bound callback`,`Bound callback blocked after originating execution was deactivated`),!n.config.auditMode)))return l(a,e,...t)})}isEnabled(){return this.config.enabled===!0&&s!==null&&!n}updateConfig(e){this.config={...this.config,...e}}activate(){if(n||!this.config.enabled||!s){let e=r(),t=!1;return{run:e=>t?Promise.reject(Error(`DefenseInDepthBox handle is deactivated and cannot run new work`)):e(),deactivate:()=>{t=!0},executionId:e}}this.refCount++,this.refCount===1&&(this.applyPatches(),this.activationTime=Date.now());let e=r(),t=!1;return{run:n=>t?Promise.reject(Error(`DefenseInDepthBox handle is deactivated and cannot run new work`)):(this.activeExecutionIds.add(e),s.run({sandboxActive:!0,executionId:e},n)),deactivate:()=>{t||(t=!0,this.activeExecutionIds.delete(e),this.contextCache.delete(e),this.refCount--,this.refCount===0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount<0&&(this.refCount=0))},executionId:e}}forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0}isActive(){return this.refCount>0}getStats(){return{violationsBlocked:this.violations.length,violations:[...this.violations],activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}getPatchFailures(){return[...this.patchFailures]}clearViolations(){this.violations=[]}getPathForTarget(e,t){return e===globalThis?`globalThis.${t}`:e===process?`process.${t}`:e===Error?`Error.${t}`:e===Function.prototype?`Function.prototype.${t}`:e===Object.prototype?`Object.prototype.${t}`:`<object>.${t}`}static runTrusted(e){if(!s)return e();let t=s.getStore();if(!t)return e();let{executionId:n}=t;return s.run({...t,trusted:!0},()=>{i.enterTrustedScope(n);try{let t=e();return typeof t==`object`&&t&&`finally`in t&&typeof t.finally==`function`?t.finally(()=>{i.leaveTrustedScope(n)}):(i.leaveTrustedScope(n),t)}catch(e){throw i.leaveTrustedScope(n),e}})}static async runTrustedAsync(e){if(!s)return e();let t=s.getStore();if(!t)return e();let{executionId:n}=t;return s.run({...t,trusted:!0},async()=>{i.enterTrustedScope(n);try{return await e()}finally{i.leaveTrustedScope(n)}})}shouldBlock(){if(n||this.config.auditMode||!s)return!1;let e=s?.getStore();return!(e?.sandboxActive!==!0||e.trusted||i.isTrustedScopeActive(e.executionId))}recordViolation(e,t,n){let r={timestamp:Date.now(),type:e,message:n,path:t,stack:Error().stack,executionId:s?.getStore()?.executionId};if(this.violations.length<c&&this.violations.push(r),this.config.onViolation)try{this.config.onViolation(r)}catch(e){console.debug(`[DefenseInDepthBox] onViolation callback threw:`,e instanceof Error?e.message:e)}return r}createBlockingProxy(e,t,n){let r=this;return new Proxy(e,{apply(e,i,a){if(r.shouldBlock()){let e=`${t} is blocked during script execution`;throw new o(e,r.recordViolation(n,t,e))}return r.config.auditMode&&s?.getStore()?.sandboxActive===!0&&r.recordViolation(n,t,`${t} called (audit mode)`),Reflect.apply(e,i,a)},construct(e,i,a){if(r.shouldBlock()){let e=`${t} constructor is blocked during script execution`;throw new o(e,r.recordViolation(n,t,e))}return r.config.auditMode&&s?.getStore()?.sandboxActive===!0&&r.recordViolation(n,t,`${t} constructor called (audit mode)`),Reflect.construct(e,i,a)}})}createBlockingObjectProxy(e,t,n,r){let i=this;return new Proxy(e,{get(e,a,c){if(i.shouldBlock()){if(r&&typeof a==`string`&&r.has(a))return Reflect.get(e,a,c);let s=`${t}.${String(a)}`,l=`${s} is blocked during script execution`;throw new o(l,i.recordViolation(n,s,l))}if(i.config.auditMode&&s?.getStore()?.sandboxActive===!0){let e=`${t}.${String(a)}`;i.recordViolation(n,e,`${e} accessed (audit mode)`)}return Reflect.get(e,a,c)},set(e,r,a,s){if(i.shouldBlock()){let e=`${t}.${String(r)}`,a=`${e} modification is blocked during script execution`;throw new o(a,i.recordViolation(n,e,a))}return Reflect.set(e,r,a,s)},ownKeys(e){if(i.shouldBlock()){let e=`${t} enumeration is blocked during script execution`;throw new o(e,i.recordViolation(n,t,e))}return Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,r){if(i.shouldBlock()){let e=`${t}.${String(r)}`,a=`${e} descriptor access is blocked during script execution`;throw new o(a,i.recordViolation(n,e,a))}return Reflect.getOwnPropertyDescriptor(e,r)},has(e,r){if(i.shouldBlock()){let e=`${t}.${String(r)}`,a=`${e} existence check is blocked during script execution`;throw new o(a,i.recordViolation(n,e,a))}return Reflect.has(e,r)},deleteProperty(e,r){if(i.shouldBlock()){let e=`${t}.${String(r)}`,a=`${e} deletion is blocked during script execution`;throw new o(a,i.recordViolation(n,e,a))}return Reflect.deleteProperty(e,r)},setPrototypeOf(e,r){if(i.shouldBlock()){let e=`${t} setPrototypeOf is blocked during script execution`;throw new o(e,i.recordViolation(n,t,e))}return Reflect.setPrototypeOf(e,r)},defineProperty(e,r,a){if(i.shouldBlock()){let e=`${t}.${String(r)}`,a=`${e} defineProperty is blocked during script execution`;throw new o(a,i.recordViolation(n,e,a))}return Reflect.defineProperty(e,r,a)}})}applyPatches(){this.patchFailures=[];let e=t(),n=new Set([`process_send`,`process_channel`,`process_stdout`,`process_stderr`]);for(let t of e)n.has(t.violationType)||this.applyPatch(t);this.protectConstructorChain(),this.protectErrorPrepareStackTrace(),this.protectPromiseThen(),this.protectDynamicImport(),this.protectModuleLoad(),this.protectModuleResolveFilename(),this.protectProcessMainModule(),this.protectProcessExecPath(),this.lockWellKnownSymbols(),this.protectProxyRevocable();let r=[`Function.prototype.constructor`,`Module._load`],i=this.patchFailures.filter(e=>r.includes(e));if(i.length>0)throw this.restorePatches(),Error(`DefenseInDepthBox: critical patches failed: ${i.join(`, `)}`)}protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,`Function.prototype.constructor`,`function_constructor`);try{let e=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,`AsyncFunction.prototype.constructor`,`async_function_constructor`)}catch(e){this.patchFailures.push(`AsyncFunction.prototype.constructor`),console.debug(`[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:`,e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,`GeneratorFunction.prototype.constructor`,`generator_function_constructor`)}catch(e){this.patchFailures.push(`GeneratorFunction.prototype.constructor`),console.debug(`[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:`,e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(async function*(){}).constructor,t=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&e!==t&&this.patchPrototypeConstructor(e.prototype,`AsyncGeneratorFunction.prototype.constructor`,`async_generator_function_constructor`)}catch(e){this.patchFailures.push(`AsyncGeneratorFunction.prototype.constructor`),console.debug(`[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:`,e instanceof Error?e.message:e)}}protectErrorPrepareStackTrace(){let e=this;try{let t=Object.getOwnPropertyDescriptor(Error,`prepareStackTrace`);this.originalDescriptors.push({target:Error,prop:`prepareStackTrace`,descriptor:t});let n=t?.value;Object.defineProperty(Error,`prepareStackTrace`,{get(){return n},set(t){if(e.shouldBlock()){let t=`Error.prepareStackTrace modification is blocked during script execution`;throw new o(t,e.recordViolation(`error_prepare_stack_trace`,`Error.prepareStackTrace`,t))}e.config.auditMode&&s?.getStore()?.sandboxActive===!0&&e.recordViolation(`error_prepare_stack_trace`,`Error.prepareStackTrace`,`Error.prepareStackTrace set (audit mode)`),n=t},configurable:!0})}catch(e){this.patchFailures.push(`Error.prepareStackTrace`),console.debug(`[DefenseInDepthBox] Could not protect Error.prepareStackTrace:`,e instanceof Error?e.message:e)}}protectPromiseThen(){let e=this;try{let t=function(...e){return s.run(this.captured,()=>{if(!this.box.isExecutionIdActive(this.executionId)){if(this.box.recordViolation(`promise_then_after_deactivate`,`Promise.then`,`Promise.then callback is blocked after defense deactivation`),this.box.config.auditMode)return Reflect.apply(this.cb,void 0,e);if(this.kind===`fulfilled`)return e[0];throw e[0]}return Reflect.apply(this.cb,void 0,e)})},n=Object.getOwnPropertyDescriptor(Promise.prototype,`then`);this.originalDescriptors.push({target:Promise.prototype,prop:`then`,descriptor:n});let r=n?.value;if(typeof r!=`function`)return;Object.defineProperty(Promise.prototype,`then`,{value:function(n,i){if(!s)return Reflect.apply(r,this,[n,i]);let a=s.getStore(),o=a?.sandboxActive===!0&&a.trusted!==!0?a.executionId:void 0;if(!o)return Reflect.apply(r,this,[n,i]);let c=e.getCachedContext(o),l=(n,r)=>typeof n==`function`?t.bind({box:e,executionId:o,captured:c,cb:n,kind:r}):n;return Reflect.apply(r,this,[l(n,`fulfilled`),l(i,`rejected`)])},writable:!0,configurable:!0})}catch(e){this.patchFailures.push(`Promise.prototype.then`),console.debug(`[DefenseInDepthBox] Could not protect Promise.prototype.then:`,e instanceof Error?e.message:e)}}patchPrototypeConstructor(e,t,n){let r=this;try{let i=Object.getOwnPropertyDescriptor(e,`constructor`);this.originalDescriptors.push({target:e,prop:`constructor`,descriptor:i});let a=i?.value;Object.defineProperty(e,`constructor`,{get(){if(r.shouldBlock()){let e=`${t} access is blocked during script execution`;throw new o(e,r.recordViolation(n,t,e))}return r.config.auditMode&&s?.getStore()?.sandboxActive===!0&&r.recordViolation(n,t,`${t} accessed (audit mode)`),a},set(e){if(r.shouldBlock()){let e=`${t} modification is blocked during script execution`;throw new o(e,r.recordViolation(n,t,e))}Object.defineProperty(this,`constructor`,{value:e,writable:!0,configurable:!0})},configurable:!0})}catch(e){this.patchFailures.push(t),console.debug(`[DefenseInDepthBox] Could not patch ${t}:`,e instanceof Error?e.message:e)}}protectProcessMainModule(){if(typeof process>`u`)return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,`mainModule`);this.originalDescriptors.push({target:process,prop:`mainModule`,descriptor:t});let n=t?.value;n!==void 0&&Object.defineProperty(process,`mainModule`,{get(){if(e.shouldBlock()){let t=`process.mainModule access is blocked during script execution`;throw new o(t,e.recordViolation(`process_main_module`,`process.mainModule`,t))}return e.config.auditMode&&s?.getStore()?.sandboxActive===!0&&e.recordViolation(`process_main_module`,`process.mainModule`,`process.mainModule accessed (audit mode)`),n},set(t){if(e.shouldBlock()){let t=`process.mainModule modification is blocked during script execution`;throw new o(t,e.recordViolation(`process_main_module`,`process.mainModule`,t))}Object.defineProperty(process,`mainModule`,{value:t,writable:!0,configurable:!0})},configurable:!0})}catch(e){this.patchFailures.push(`process.mainModule`),console.debug(`[DefenseInDepthBox] Could not protect process.mainModule:`,e instanceof Error?e.message:e)}}protectProcessExecPath(){if(typeof process>`u`)return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,`execPath`);this.originalDescriptors.push({target:process,prop:`execPath`,descriptor:t});let n=t?.value??process.execPath;Object.defineProperty(process,`execPath`,{get(){if(e.shouldBlock()){let t=`process.execPath access is blocked during script execution`;throw new o(t,e.recordViolation(`process_exec_path`,`process.execPath`,t))}return e.config.auditMode&&s?.getStore()?.sandboxActive===!0&&e.recordViolation(`process_exec_path`,`process.execPath`,`process.execPath accessed (audit mode)`),n},set(t){if(e.shouldBlock()){let t=`process.execPath modification is blocked during script execution`;throw new o(t,e.recordViolation(`process_exec_path`,`process.execPath`,t))}Object.defineProperty(process,`execPath`,{value:t,writable:!0,configurable:!0})},configurable:!0})}catch(e){this.patchFailures.push(`process.execPath`),console.debug(`[DefenseInDepthBox] Could not protect process.execPath:`,e instanceof Error?e.message:e)}}lockWellKnownSymbols(){let e=(e,t)=>{try{let n=Object.getOwnPropertyDescriptor(e,t);if(n?.configurable){if(`value`in n){Object.defineProperty(e,t,{...n,configurable:!1,writable:!1});return}Object.defineProperty(e,t,{...n,configurable:!1})}}catch{}};for(let t of[Array,Map,Set,RegExp,Promise])e(t,Symbol.species);for(let t of[Array.prototype,String.prototype,Map.prototype,Set.prototype])e(t,Symbol.iterator);e(Symbol.prototype,Symbol.toPrimitive),e(Date.prototype,Symbol.toPrimitive);for(let t of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])e(RegExp.prototype,t);e(Function.prototype,Symbol.hasInstance),e(Array.prototype,Symbol.unscopables);for(let t of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])e(t,Symbol.toStringTag);try{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);this.originalDescriptors.push({target:Error,prop:`stackTraceLimit`,descriptor:e}),Object.defineProperty(Error,`stackTraceLimit`,{value:Error.stackTraceLimit,writable:!1,configurable:!0})}catch{}}protectProxyRevocable(){let e=this;try{let t=Proxy.revocable;if(typeof t!=`function`)return;let n=Object.getOwnPropertyDescriptor(Proxy,`revocable`);this.originalDescriptors.push({target:Proxy,prop:`revocable`,descriptor:n}),Object.defineProperty(Proxy,`revocable`,{value:function(n,r){if(e.shouldBlock()){let t=`Proxy.revocable is blocked during script execution`;throw new o(t,e.recordViolation(`proxy`,`Proxy.revocable`,t))}return e.config.auditMode&&s?.getStore()?.sandboxActive===!0&&e.recordViolation(`proxy`,`Proxy.revocable`,`Proxy.revocable called (audit mode)`),t(n,r)},writable:!1,configurable:!0})}catch(e){this.patchFailures.push(`Proxy.revocable`),console.debug(`[DefenseInDepthBox] Could not protect Proxy.revocable:`,e instanceof Error?e.message:e)}}protectDynamicImport(){if(!(n||i.importHooksRegistered))try{let t=this,n=e(`node:module`),r=new Set;for(let e of n.builtinModules??[]){let t=e.startsWith(`node:`)?e.slice(5):e;r.add(t);let n=t.indexOf(`/`);n>0&&r.add(t.slice(0,n))}let a=e=>{if(e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`/`)||e.startsWith(`file:`)||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`http:`)||e.startsWith(`https:`))return!1;let t=e.startsWith(`node:`)?e.slice(5):e;if(!t)return!1;if(typeof n.isBuiltin==`function`&&n.isBuiltin(t)||r.has(t))return!0;let i=t.indexOf(`/`);return i>0&&r.has(t.slice(0,i))},c=()=>{let e=s?.getStore();return t.config.auditMode===!0&&e?.sandboxActive===!0&&e.trusted!==!0&&!i.isTrustedScopeActive(e.executionId)};if(typeof n.registerHooks==`function`){n.registerHooks({resolve(e,n,r){if(e.startsWith(`data:`)||e.startsWith(`blob:`))throw Error(`dynamic import of ${e.startsWith(`data:`)?`data:`:`blob:`} URLs is blocked by defense-in-depth`);if(a(e)){let n=`import(${e})`,r=`dynamic import of Node.js builtin '${e}' is blocked during script execution`;if(t.shouldBlock())throw new o(r,t.recordViolation(`dynamic_import_builtin`,n,r));c()&&t.recordViolation(`dynamic_import_builtin`,n,`dynamic import of Node.js builtin '${e}' called (audit mode)`)}return r(e,n)}}),i.importHooksRegistered=!0;return}if(typeof n.register==`function`){let e=[`export async function resolve(specifier, context, nextResolve) {`,` if (specifier.startsWith("data:") || specifier.startsWith("blob:")) {`,` throw new Error("dynamic import of " + (specifier.startsWith("data:") ? "data:" : "blob:") + " URLs is blocked by defense-in-depth");`,` }`,` return nextResolve(specifier, context);`,`}`].join(`
4
+ `);n.register(`data:text/javascript,${encodeURIComponent(e)}`),i.importHooksRegistered=!0}}catch(e){console.debug(`[DefenseInDepthBox] Could not register import() hooks:`,e instanceof Error?e.message:e)}}protectModuleLoad(){if(!n)try{let t=null;if(typeof process<`u`){let e=process.mainModule;e&&typeof e==`object`&&(t=e.constructor)}if(!t&&typeof e<`u`&&typeof e.main<`u`&&(t=e.main.constructor),!t||typeof t._load!=`function`)return;let n=t._load,r=Object.getOwnPropertyDescriptor(t,`_load`);this.originalDescriptors.push({target:t,prop:`_load`,descriptor:r});let i=this.createBlockingProxy(n,`Module._load`,`module_load`);Object.defineProperty(t,`_load`,{value:i,writable:!0,configurable:!0})}catch(e){this.patchFailures.push(`Module._load`),console.debug(`[DefenseInDepthBox] Could not protect Module._load:`,e instanceof Error?e.message:e)}}protectModuleResolveFilename(){if(!n)try{let t=null;if(typeof process<`u`){let e=process.mainModule;e&&typeof e==`object`&&(t=e.constructor)}if(!t&&typeof e<`u`&&typeof e.main<`u`&&(t=e.main.constructor),!t||typeof t._resolveFilename!=`function`)return;let n=t._resolveFilename,r=Object.getOwnPropertyDescriptor(t,`_resolveFilename`);this.originalDescriptors.push({target:t,prop:`_resolveFilename`,descriptor:r});let i=this.createBlockingProxy(n,`Module._resolveFilename`,`module_resolve_filename`);Object.defineProperty(t,`_resolveFilename`,{value:i,writable:!0,configurable:!0})}catch(e){this.patchFailures.push(`Module._resolveFilename`),console.debug(`[DefenseInDepthBox] Could not protect Module._resolveFilename:`,e instanceof Error?e.message:e)}}applyPatch(e){let{target:t,prop:n,violationType:r,strategy:i}=e;try{let a=t[n];if(a===void 0)return;let o=Object.getOwnPropertyDescriptor(t,n);if(this.originalDescriptors.push({target:t,prop:n,descriptor:o}),i===`freeze`)typeof a==`object`&&a&&Object.freeze(a);else{let i=this.getPathForTarget(t,n),o=typeof a==`function`?this.createBlockingProxy(a,i,r):this.createBlockingObjectProxy(a,i,r,e.allowedKeys);Object.defineProperty(t,n,{value:o,writable:!0,configurable:!0})}}catch(e){let r=this.getPathForTarget(t,n);this.patchFailures.push(r),console.debug(`[DefenseInDepthBox] Could not patch ${r}:`,e instanceof Error?e.message:e)}}restorePatches(){for(let e=this.originalDescriptors.length-1;e>=0;e--){let{target:t,prop:n,descriptor:r}=this.originalDescriptors[e];try{r?Object.defineProperty(t,n,r):delete t[n]}catch(e){let r=this.getPathForTarget(t,n);console.debug(`[DefenseInDepthBox] Could not restore ${r}:`,e instanceof Error?e.message:e)}}this.originalDescriptors=[]}};export{o as n,f as t};
5
+ //# sourceMappingURL=chunk-5QMZ5MUS-CAp625aG.mjs.map