@inkeep/open-knowledge 0.35.1 → 0.35.3

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 (295) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +21 -0
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/assets/skills/write-skill/SKILL.md +1 -1
  5. package/dist/cli.mjs +7 -7
  6. package/dist/constants-pfoTSanN.mjs +2 -0
  7. package/dist/{gh-detect-93wtg_nV.mjs → gh-detect-dM8nUKzs.mjs} +2 -2
  8. package/dist/git-handle-BAtE8N7I.mjs +1 -0
  9. package/dist/{git-handle-DPCY4VMM.mjs → git-handle-CPWu4DPI.mjs} +2 -2
  10. package/dist/index.mjs +1 -1
  11. package/dist/{init-CINP1v0y.mjs → init-Ci1MYYU2.mjs} +3 -3
  12. package/dist/init-PN8n4tJD.mjs +1 -0
  13. package/dist/{launch-json-removal-Cp88-Nri.mjs → launch-json-removal-le0ejDHK.mjs} +2 -2
  14. package/dist/{loader-a2k4G6Yz.mjs → loader-CAkdpGQG.mjs} +2 -2
  15. package/dist/loader-ugRbKzS7.mjs +1 -0
  16. package/dist/{open-browser-CP3YN1jA.mjs → open-browser-DLXd14zy.mjs} +2 -2
  17. package/dist/{preview-CvyqQIIL.mjs → preview-DJCHpjjT.mjs} +2 -2
  18. package/dist/preview-DkZFP4bz.mjs +1 -0
  19. package/dist/public/assets/ActivityModeContent-XJSnDzK_.js +1 -0
  20. package/dist/public/assets/AgentDiffPane-BAnfH-YN.js +2 -0
  21. package/dist/public/assets/{CodeMirrorPropInput-BaaMh183.js → CodeMirrorPropInput-D7LKYsQT.js} +3 -3
  22. package/dist/public/assets/{ConsentDialogBody-Dac-eNHp.js → ConsentDialogBody-CFh9gVKe.js} +1 -1
  23. package/dist/public/assets/{DocumentContext-DVJ7yEqv.js → DocumentContext-CU9xlvuo.js} +11 -11
  24. package/dist/public/assets/{EnableSyncConfirmDialog-pUJ0-0Xd.js → EnableSyncConfirmDialog-BsDontPj.js} +1 -1
  25. package/dist/public/assets/{GraphPanel-CLbL3_7S.js → GraphPanel-D-LFOZKp.js} +1 -1
  26. package/dist/public/assets/{ManagedArtifactProperties-BbvAZvc9.js → ManagedArtifactProperties-D9h21IK6.js} +1 -1
  27. package/dist/public/assets/{McpConsentDialogBody-D_ALgiPf.js → McpConsentDialogBody-DIH6Ms1u.js} +1 -1
  28. package/dist/public/assets/{MermaidDocEditor-C4zrJQLq.js → MermaidDocEditor-Dtd-8jJV.js} +1 -1
  29. package/dist/public/assets/PropertyPanel-DEP9ZoSf.js +2 -0
  30. package/dist/public/assets/{ReportBugDialogBody-By8lUyez.js → ReportBugDialogBody-BCRLTK8_.js} +1 -1
  31. package/dist/public/assets/SettingsDialogBody-L_0jcH_T.js +7 -0
  32. package/dist/public/assets/{ShareBranchSwitchDialog-COA225Wh.js → ShareBranchSwitchDialog-BU6DMxX1.js} +1 -1
  33. package/dist/public/assets/{ShareReceiveDialog-CGeUbVX5.js → ShareReceiveDialog-BbWq-gzG.js} +1 -1
  34. package/dist/public/assets/{ShareReceiveMissDialog-BiFbvWX1.js → ShareReceiveMissDialog-yXLs8-wZ.js} +1 -1
  35. package/dist/public/assets/{SkillEditorActions-HOX1vQzN.js → SkillEditorActions-BSrcCPDd.js} +1 -1
  36. package/dist/public/assets/{SourceEditor-BbNBxNCg.js → SourceEditor-Cd_-pUX1.js} +1 -1
  37. package/dist/public/assets/{TerminalPanel-CJcXd9VC.js → TerminalPanel-Mz8BwF5T.js} +1 -1
  38. package/dist/public/assets/TimelineDiffPane-B_bWook5.js +2 -0
  39. package/dist/public/assets/{abnfDiagram-VRR7QNED-s07JwBrQ.js → abnfDiagram-VRR7QNED-DxPP95nn.js} +1 -1
  40. package/dist/public/assets/agent-presence-C7KW4GFN.js +1 -0
  41. package/dist/public/assets/{arc-C2sMPVKm.js → arc-B-QPMw-K.js} +1 -1
  42. package/dist/public/assets/architecture-TIHT7OUA-CltUrdi_.js +1 -0
  43. package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-DQ9Uvn9z.js → architectureDiagram-ZJ3FMSHR-DI2cSyhR.js} +1 -1
  44. package/dist/public/assets/{auth-state-cache-Di7tO3rZ.js → auth-state-cache-DnhmcXiD.js} +8 -8
  45. package/dist/public/assets/{blockDiagram-677ZJIJ3-DSk8Ogpy.js → blockDiagram-677ZJIJ3-h5oSMPKD.js} +1 -1
  46. package/dist/public/assets/{c4Diagram-LMCZKHZV-Bz59H0KA.js → c4Diagram-LMCZKHZV-CK2iEE3c.js} +1 -1
  47. package/dist/public/assets/{calendar-BxfDpUWv.js → calendar-BWOC8yrW.js} +1 -1
  48. package/dist/public/assets/channel-u6IlPa4M.js +1 -0
  49. package/dist/public/assets/chunk-2Q5K7J3B-Dp_z4y0p.js +1 -0
  50. package/dist/public/assets/{chunk-32BRIVSS-CrIqwJxq.js → chunk-32BRIVSS-DSjkImiO.js} +1 -1
  51. package/dist/public/assets/{chunk-52WLFC77-mgHjwXy8.js → chunk-52WLFC77-Dcxgn7aY.js} +1 -1
  52. package/dist/public/assets/{chunk-5FCAYU7R-DsN08wYr.js → chunk-5FCAYU7R-BfGI-oMu.js} +1 -1
  53. package/dist/public/assets/{chunk-5HE753X5-DR9Xb784.js → chunk-5HE753X5-weABv-wL.js} +1 -1
  54. package/dist/public/assets/{chunk-5JV3BV7I-DUGJruxJ.js → chunk-5JV3BV7I-DEhUP77q.js} +1 -1
  55. package/dist/public/assets/{chunk-5TONJI2A-DGpS165P.js → chunk-5TONJI2A-D8ryhTto.js} +1 -1
  56. package/dist/public/assets/{chunk-5VM5RSS4-Y6UOitXa.js → chunk-5VM5RSS4-BlyT0CoP.js} +1 -1
  57. package/dist/public/assets/{chunk-7BUUIJ7U-kgbsT0Ie.js → chunk-7BUUIJ7U-D9n2zFWa.js} +1 -1
  58. package/dist/public/assets/{chunk-BIQX33UG-ir0YjVc1.js → chunk-BIQX33UG-CZyszYrJ.js} +1 -1
  59. package/dist/public/assets/{chunk-C7G6YPKG-C4mkeqaG.js → chunk-C7G6YPKG-DA4AzgS1.js} +1 -1
  60. package/dist/public/assets/{chunk-CQNSW5MT-cO-NnCqU.js → chunk-CQNSW5MT-ClwiAtII.js} +1 -1
  61. package/dist/public/assets/{chunk-CYSBUYHQ-DOHROXyM.js → chunk-CYSBUYHQ-CGwDjQlh.js} +1 -1
  62. package/dist/public/assets/{chunk-EMLP6XTP-D4HTBqLV.js → chunk-EMLP6XTP-DjxQVp6i.js} +1 -1
  63. package/dist/public/assets/{chunk-EX3LRPZG-Do_cb0BC.js → chunk-EX3LRPZG-BcSqmSt4.js} +1 -1
  64. package/dist/public/assets/{chunk-FWX5IMBZ-CKeYA6zq.js → chunk-FWX5IMBZ-BTxv6yrt.js} +2 -2
  65. package/dist/public/assets/{chunk-HOUHSVGY-DLoarw7-.js → chunk-HOUHSVGY-3n2-KijJ.js} +1 -1
  66. package/dist/public/assets/{chunk-ICXQ74PX-MBl6EECh.js → chunk-ICXQ74PX-DWIJquJc.js} +1 -1
  67. package/dist/public/assets/{chunk-JG7HCLWE-CUeTjaY5.js → chunk-JG7HCLWE-BZZpuOy0.js} +1 -1
  68. package/dist/public/assets/{chunk-JWPE2WC7-CHGGBN9h.js → chunk-JWPE2WC7-DdwvzMEp.js} +1 -1
  69. package/dist/public/assets/{chunk-MOJQB5TN-CcZUk23X.js → chunk-MOJQB5TN-CmK9Iu27.js} +1 -1
  70. package/dist/public/assets/{chunk-MOZMSUNE-5QQVj3ss.js → chunk-MOZMSUNE-LyrnwAsU.js} +1 -1
  71. package/dist/public/assets/{chunk-OGEWGWER-BkptVqQ1.js → chunk-OGEWGWER-CeOp0xbH.js} +1 -1
  72. package/dist/public/assets/{chunk-OSBZ3O6U-ONf5Rxuf.js → chunk-OSBZ3O6U-DFiAaUHT.js} +1 -1
  73. package/dist/public/assets/{chunk-PUDLZKDR-DXTd_WWd.js → chunk-PUDLZKDR-BdJDvOQD.js} +1 -1
  74. package/dist/public/assets/{chunk-Q4XR5HBZ-QUWmwLf-.js → chunk-Q4XR5HBZ-C3mWTH_s.js} +1 -1
  75. package/dist/public/assets/{chunk-QBLGF6JB-DAW-PjRz.js → chunk-QBLGF6JB-Cip_ZYPa.js} +1 -1
  76. package/dist/public/assets/{chunk-R7FJI6CG-e7KlR5WR.js → chunk-R7FJI6CG-DLyapyIO.js} +1 -1
  77. package/dist/public/assets/{chunk-RYQCIY6F-DKYUXbW_.js → chunk-RYQCIY6F-C20EyDLP.js} +1 -1
  78. package/dist/public/assets/{chunk-U6XO7XAA-zuSavVpE.js → chunk-U6XO7XAA-DN2BTHsF.js} +1 -1
  79. package/dist/public/assets/{chunk-V7JOEXUC-BDcL_HF2.js → chunk-V7JOEXUC-BkdbQSd6.js} +1 -1
  80. package/dist/public/assets/chunk-VAUOI2AC-ql8j5-ta.js +1 -0
  81. package/dist/public/assets/{chunk-VR4S4FIN-CoKaVJob.js → chunk-VR4S4FIN-BXKGzdjR.js} +1 -1
  82. package/dist/public/assets/{chunk-WYO6CB5R-CPK-Z4Zn.js → chunk-WYO6CB5R-DDA9TMxs.js} +1 -1
  83. package/dist/public/assets/chunk-XXDRQBXY-BGFIrdGe.js +1 -0
  84. package/dist/public/assets/{chunk-YOTPTUD7-ZJ64LPBH.js → chunk-YOTPTUD7-CAY_zY8l.js} +1 -1
  85. package/dist/public/assets/{chunk-ZGVPDNZ5-D8S_HhHE.js → chunk-ZGVPDNZ5-gtD66mSa.js} +1 -1
  86. package/dist/public/assets/{chunk-ZIRB5QZD-CBAmXOZf.js → chunk-ZIRB5QZD-Bh7823OJ.js} +1 -1
  87. package/dist/public/assets/classDiagram-OUVF2IWQ-f__yrCN3.js +1 -0
  88. package/dist/public/assets/classDiagram-v2-EOCWNBFH-De7msUum.js +1 -0
  89. package/dist/public/assets/{config-provider-DGMqQCfP.js → config-provider-CKgTRKRt.js} +2 -2
  90. package/dist/public/assets/{cose-bilkent-JH36ORCC-BhCfvPJo.js → cose-bilkent-JH36ORCC-pqj5AHZx.js} +1 -1
  91. package/dist/public/assets/cynefin-VYW2F7L2-BaabRBtQ.js +1 -0
  92. package/dist/public/assets/{cynefinDiagram-TSTJHNR4-DZZpsQlh.js → cynefinDiagram-TSTJHNR4-BCdPoMcA.js} +1 -1
  93. package/dist/public/assets/{dagre-BCcof4fp.js → dagre-DK7PvNVd.js} +1 -1
  94. package/dist/public/assets/{dagre-VKFMJZFB-BVGAKvzT.js → dagre-VKFMJZFB-BMhbjrXq.js} +1 -1
  95. package/dist/public/assets/{diagram-FQU43EPY-BEAcnoVT.js → diagram-FQU43EPY-CI-dlZCc.js} +1 -1
  96. package/dist/public/assets/{diagram-G47NLZAW-B5YwZccl.js → diagram-G47NLZAW-7OA_hqYO.js} +1 -1
  97. package/dist/public/assets/{diagram-NH7WQ7WH-DJ729xkg.js → diagram-NH7WQ7WH-DGZoq1pS.js} +1 -1
  98. package/dist/public/assets/{diagram-OA4YK3LP-ComZLTwZ.js → diagram-OA4YK3LP-BgAzAKhY.js} +1 -1
  99. package/dist/public/assets/{diagram-WEI45ONY-DUpwGJzG.js → diagram-WEI45ONY-DWkPIxW4.js} +1 -1
  100. package/dist/public/assets/{dialog-D9fMUB3u.js → dialog-492Ff7fG.js} +1 -1
  101. package/dist/public/assets/{dist-CiO2pCFe.js → dist-B768eFXg.js} +1 -1
  102. package/dist/public/assets/{dist-Ddrqoe4c.js → dist-B76xtaAd.js} +1 -1
  103. package/dist/public/assets/{dist-TIByzzIF.js → dist-BZciNIwH.js} +1 -1
  104. package/dist/public/assets/{dist-CSbnaLam.js → dist-BiVF6Gdz.js} +1 -1
  105. package/dist/public/assets/{dist-D6P0HEvG.js → dist-BjlQpfm2.js} +1 -1
  106. package/dist/public/assets/{dist-Uf9Tc8KS.js → dist-BuhX1ZiW.js} +1 -1
  107. package/dist/public/assets/{dist-C6B3IZlW.js → dist-Bvng05Ux.js} +1 -1
  108. package/dist/public/assets/{dist-CN1nOe9M.js → dist-Byo4jhAQ.js} +1 -1
  109. package/dist/public/assets/{dist-RKGXlTOn.js → dist-CCfVhAvJ.js} +1 -1
  110. package/dist/public/assets/{dist-DQ98O3oW.js → dist-CML_8CPx.js} +1 -1
  111. package/dist/public/assets/{dist-Cid07B-b.js → dist-D1KI0nTz.js} +1 -1
  112. package/dist/public/assets/{dist-DLiIchlL.js → dist-DXywpqg-.js} +1 -1
  113. package/dist/public/assets/{dist-Cf-rDWvg.js → dist-z6xoO_FO.js} +2 -2
  114. package/dist/public/assets/{doc-hash-vKFY-V-Y.js → doc-hash-CR_v-pVy.js} +1 -1
  115. package/dist/public/assets/{documents-events-BzjmhSSx.js → documents-events-WLCQAftW.js} +1 -1
  116. package/dist/public/assets/{ebnfDiagram-CCIWWBDH-C0qN5Z1L.js → ebnfDiagram-CCIWWBDH-BRvvZw_B.js} +1 -1
  117. package/dist/public/assets/{erDiagram-Q63AITRT-B2y03i9k.js → erDiagram-Q63AITRT-DVXRJxAV.js} +1 -1
  118. package/dist/public/assets/eventmodeling-45OFAUF4-CpX_MdG2.js +1 -0
  119. package/dist/public/assets/{file-tree-adapter-DNsVn4SH.js → file-tree-adapter-BrNRZNNL.js} +1 -1
  120. package/dist/public/assets/flowDiagram-23GEKE2U-qBrVAQAs.js +1 -0
  121. package/dist/public/assets/{ganttDiagram-NO4QXBWP-CbAMuscB.js → ganttDiagram-NO4QXBWP-DfilZK9a.js} +1 -1
  122. package/dist/public/assets/gitGraph-TEB2WS4Q-Cl_Wohm-.js +1 -0
  123. package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-BDtmrkrv.js → gitGraphDiagram-IHSO6WYX-CzPu78YW.js} +1 -1
  124. package/dist/public/assets/{graphlib-T74nenG1.js → graphlib-DcRmeD3e.js} +1 -1
  125. package/dist/public/assets/index-BlzqKiBJ.js +1995 -0
  126. package/dist/public/assets/index-C3iemlkC.css +1 -0
  127. package/dist/public/assets/info-DKCQHKI2-Df0PBh-0.js +1 -0
  128. package/dist/public/assets/{infoDiagram-FWYZ7A6U-BgSrBQZn.js → infoDiagram-FWYZ7A6U-C6-KcSYK.js} +1 -1
  129. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-B58n1EAe.js → ishikawaDiagram-FXEZZL3T-BjawhLso.js} +1 -1
  130. package/dist/public/assets/{journeyDiagram-5HDEW3XC-CtbbmL9o.js → journeyDiagram-5HDEW3XC-CKJ88ogB.js} +1 -1
  131. package/dist/public/assets/{kanban-definition-HUTT4EX6-PYnVKIRv.js → kanban-definition-HUTT4EX6-BGwYHT7Q.js} +1 -1
  132. package/dist/public/assets/{line-Bn4tqKip.js → line-BSndhJaA.js} +1 -1
  133. package/dist/public/assets/{linear-B7qown3H.js → linear-CWEI_5Iw.js} +1 -1
  134. package/dist/public/assets/{lint-config-client-C1xGkxTP.js → lint-config-client-DrncMKpi.js} +1 -1
  135. package/dist/public/assets/lru-string-cache-WgNrdYaR.js +1 -0
  136. package/dist/public/assets/{map-CAMtT7C7.js → map-CjcUXw9E.js} +1 -1
  137. package/dist/public/assets/{mermaid-parser.core-B1wAzOcl.js → mermaid-parser.core-Dd1-Tdhf.js} +2 -2
  138. package/dist/public/assets/{mermaid.core-CPVA3QHQ.js → mermaid.core-C3NRxXYk.js} +3 -3
  139. package/dist/public/assets/{mindmap-definition-LN4V7U3C-dzrg2t0C.js → mindmap-definition-LN4V7U3C-CMjs8uw1.js} +1 -1
  140. package/dist/public/assets/{navigation-targets-nvGLJ1po.js → navigation-targets-BW-vH_E0.js} +1 -1
  141. package/dist/public/assets/{now-7lIApcFa.js → now-DuonpS3w.js} +1 -1
  142. package/dist/public/assets/{open-managed-artifact-tab-CUhx9b-j.js → open-managed-artifact-tab-Mlt2_LRl.js} +1 -1
  143. package/dist/public/assets/{ordinal-RCdkn_04.js → ordinal-DqdsPg4w.js} +1 -1
  144. package/dist/public/assets/packet-7NZHBO7P-BzSOWp_y.js +1 -0
  145. package/dist/public/assets/panel-right-open-CBQxOUPX.js +1 -0
  146. package/dist/public/assets/{pegDiagram-2B236MQR-BSfr2juy.js → pegDiagram-2B236MQR-DbZNXK4F.js} +1 -1
  147. package/dist/public/assets/{pending-receive-nav-store-HxClZpU_.js → pending-receive-nav-store-VIiKipN9.js} +1 -1
  148. package/dist/public/assets/pie-RZYD4A2V-DQMer8ON.js +1 -0
  149. package/dist/public/assets/{pieDiagram-ENE6RG2P-BZpnpN-F.js → pieDiagram-ENE6RG2P-Cl1aNURz.js} +1 -1
  150. package/dist/public/assets/{prop-types-y7w6_eIH.js → prop-types-D0GhY5_m.js} +1 -1
  151. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-DbLxt4AH.js → quadrantDiagram-ABIIQ3AL-O0r_liGM.js} +1 -1
  152. package/dist/public/assets/radar-I7S5WNFK-BcSNWNdo.js +1 -0
  153. package/dist/public/assets/railroad-3IZDKUUU-Bki7TUdv.js +1 -0
  154. package/dist/public/assets/railroad-abnf-AHOZXSZD-TNcYa0Mz.js +1 -0
  155. package/dist/public/assets/railroad-ebnf-EBAXGLYW-BkoUFicN.js +1 -0
  156. package/dist/public/assets/railroad-peg-LSFZ7HO6-CPN1xC04.js +1 -0
  157. package/dist/public/assets/{railroadDiagram-RFXS5EU6-C848pWoS.js → railroadDiagram-RFXS5EU6-5qWlaSRR.js} +1 -1
  158. package/dist/public/assets/{receive-store-BBpK7Or2.js → receive-store-C5i5j6PY.js} +1 -1
  159. package/dist/public/assets/{requirementDiagram-TGXJPOKE-BYghLNMR.js → requirementDiagram-TGXJPOKE-P9qf5Z4Z.js} +1 -1
  160. package/dist/public/assets/{sankeyDiagram-HTMAVEWB-D4YIknL1.js → sankeyDiagram-HTMAVEWB-BWtC9T4g.js} +1 -1
  161. package/dist/public/assets/{selection-context-iozWEaD1.js → selection-context-V0U6XHHo.js} +1 -1
  162. package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-TyOsGnRM.js → sequenceDiagram-DBY2YBRQ-B8Hbf_bB.js} +1 -1
  163. package/dist/public/assets/{sizeCapture-X5ZJPWSS-BM5e48hL.js → sizeCapture-X5ZJPWSS-B93fpSFm.js} +1 -1
  164. package/dist/public/assets/{skill-actions-DL-yNOVR.js → skill-actions-MlZySxOC.js} +1 -1
  165. package/dist/public/assets/{skills-api-T6KNnXbb.js → skills-api-ej5KW5dn.js} +1 -1
  166. package/dist/public/assets/{src-DU4IiWLl.js → src-Bejbc0T8.js} +1 -1
  167. package/dist/public/assets/{src-DL3Zlx5X.js → src-qvqzPkMT.js} +1 -1
  168. package/dist/public/assets/{stateDiagram-2N3HPSRC-1BTIo0Qo.js → stateDiagram-2N3HPSRC-CCyXUsZO.js} +1 -1
  169. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-D5lbOImg.js +1 -0
  170. package/dist/public/assets/{swimlanes-5IMT3BWC-DN05P38q.js → swimlanes-5IMT3BWC-B-sLEl82.js} +2 -2
  171. package/dist/public/assets/swimlanesDiagram-G3AALYLV-BI78kzuy.js +8 -0
  172. package/dist/public/assets/{target-navigation-intent-JPOSvf1i.js → target-navigation-intent-CmDfj84r.js} +1 -1
  173. package/dist/public/assets/{telemetry-impl-jUMr-Cv1.js → telemetry-impl-BWgeQHlt.js} +2 -2
  174. package/dist/public/assets/{telemetry-startup-jMwHqIQ4.js → telemetry-startup-kV7RyeHQ.js} +1 -1
  175. package/dist/public/assets/{timeline-definition-FHXFAJF6-m9Ty-Kvs.js → timeline-definition-FHXFAJF6-B4-HCQ_I.js} +1 -1
  176. package/dist/public/assets/timeline-diff-store-HBj2AFCu.js +1 -0
  177. package/dist/public/assets/treeView-QDETBFTQ-CT2knITr.js +1 -0
  178. package/dist/public/assets/treemap-6X3UGDF4-BWe4kQzY.js +1 -0
  179. package/dist/public/assets/{typing-burst-detector-50DGt0NB.js → typing-burst-detector-SjZ7M77f.js} +1 -1
  180. package/dist/public/assets/use-activity-panel-BLjB8pfD.js +1 -0
  181. package/dist/public/assets/{use-apply-config-color-theme-C4-L1m1x.js → use-apply-config-color-theme-BHcKd5uB.js} +1 -1
  182. package/dist/public/assets/use-timeline-entry-diff-q1bUunHz.js +18 -0
  183. package/dist/public/assets/{vennDiagram-L72KCM5P-CeGSzDp-.js → vennDiagram-L72KCM5P-DIXJ-f9A.js} +1 -1
  184. package/dist/public/assets/wardley-OPB4EBWU-BjTiRqi1.js +1 -0
  185. package/dist/public/assets/{wardleyDiagram-EHGQE667-CEiEgHEP.js → wardleyDiagram-EHGQE667-DuaGh-EA.js} +1 -1
  186. package/dist/public/assets/{workspace-paths-BzYkZqjr.js → workspace-paths-DTMEcAKi.js} +1 -1
  187. package/dist/public/assets/{xychartDiagram-FW5EYKEG-D2AGvwUv.js → xychartDiagram-FW5EYKEG-BGEm2ArJ.js} +1 -1
  188. package/dist/public/index.html +60 -58
  189. package/dist/{repair-launch-json-xDbECVti.mjs → repair-launch-json-B-EKp6h6.mjs} +2 -2
  190. package/dist/{repair-mcp-configs-BPCRXAai.mjs → repair-mcp-configs-BozgAcET.mjs} +2 -2
  191. package/dist/repair-skills-B95d0UWj.mjs +1 -0
  192. package/dist/{repair-skills-CZbrTVch.mjs → repair-skills-CjpripUK.mjs} +2 -2
  193. package/dist/{server-lock-wMKEjgnN.mjs → server-lock-Cn2-KrjV.mjs} +2 -2
  194. package/dist/server-lock-kLJ8OVOq.mjs +1 -0
  195. package/dist/{src-BU7I7py6.mjs → src-BgrRg-nl.mjs} +2 -2
  196. package/dist/{src-cvLOShuL.mjs → src-BrhuhPOn.mjs} +2 -2
  197. package/dist/{src-FMIoftZv.mjs → src-D3RAM6vg.mjs} +1 -1
  198. package/dist/{src-C0CgVA8i.mjs → src-D87GkAFF.mjs} +312 -308
  199. package/dist/{start-DcF59Yvb.mjs → start-B03PyxeV.mjs} +2 -2
  200. package/dist/start-CINZfUZl.mjs +1 -0
  201. package/dist/{write-project-skill-DkTM_Oeh.mjs → write-project-skill-CLggzjLg.mjs} +2 -2
  202. package/package.json +5 -5
  203. package/dist/constants-B51-MH_i.mjs +0 -2
  204. package/dist/git-handle-CeejIzW4.mjs +0 -1
  205. package/dist/init-EO9D9f7g.mjs +0 -1
  206. package/dist/loader-DrTu23Tp.mjs +0 -1
  207. package/dist/preview-Un26Rvbh.mjs +0 -1
  208. package/dist/public/assets/ActivityModeContent-BzCteFud.js +0 -2
  209. package/dist/public/assets/PropertyPanel-D2cHpPyn.js +0 -2
  210. package/dist/public/assets/SettingsDialogBody-Ivdm3ToR.js +0 -7
  211. package/dist/public/assets/agent-presence-DWEqGNHh.js +0 -1
  212. package/dist/public/assets/architecture-TIHT7OUA-CT1tXplN.js +0 -1
  213. package/dist/public/assets/channel-CSqODHBX.js +0 -1
  214. package/dist/public/assets/chunk-2Q5K7J3B-6231eKaz.js +0 -1
  215. package/dist/public/assets/chunk-VAUOI2AC-D5KfNXdk.js +0 -1
  216. package/dist/public/assets/chunk-XXDRQBXY-z12okRSH.js +0 -1
  217. package/dist/public/assets/classDiagram-OUVF2IWQ-3k_vKgMb.js +0 -1
  218. package/dist/public/assets/classDiagram-v2-EOCWNBFH-BWUMDcI-.js +0 -1
  219. package/dist/public/assets/cynefin-VYW2F7L2-CCaQNOor.js +0 -1
  220. package/dist/public/assets/eventmodeling-45OFAUF4-Dv2dElMn.js +0 -1
  221. package/dist/public/assets/flowDiagram-23GEKE2U-Cj2cm6wb.js +0 -1
  222. package/dist/public/assets/gitGraph-TEB2WS4Q-B_v5HTd2.js +0 -1
  223. package/dist/public/assets/index-BFfvrj_R.js +0 -2007
  224. package/dist/public/assets/index-Zwl7lo8a.css +0 -1
  225. package/dist/public/assets/info-DKCQHKI2-ChXVyprm.js +0 -1
  226. package/dist/public/assets/packet-7NZHBO7P--nGkFp-F.js +0 -1
  227. package/dist/public/assets/pie-RZYD4A2V-jLTQTVR2.js +0 -1
  228. package/dist/public/assets/radar-I7S5WNFK-C3lNKZB3.js +0 -1
  229. package/dist/public/assets/railroad-3IZDKUUU-zkTIyGxU.js +0 -1
  230. package/dist/public/assets/railroad-abnf-AHOZXSZD-CGyrnBSJ.js +0 -1
  231. package/dist/public/assets/railroad-ebnf-EBAXGLYW-BllS7VWZ.js +0 -1
  232. package/dist/public/assets/railroad-peg-LSFZ7HO6-C1CM3IeV.js +0 -1
  233. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-C-nM9igb.js +0 -1
  234. package/dist/public/assets/swimlanesDiagram-G3AALYLV-DOdX5jTT.js +0 -8
  235. package/dist/public/assets/treeView-QDETBFTQ-CQFmlWUc.js +0 -1
  236. package/dist/public/assets/treemap-6X3UGDF4-BrZNJeo7.js +0 -1
  237. package/dist/public/assets/wardley-OPB4EBWU-KBVce8aR.js +0 -1
  238. package/dist/repair-skills-CyhWReZX.mjs +0 -1
  239. package/dist/server-lock-DGqK-4av.mjs +0 -1
  240. package/dist/start-D7QSP49B.mjs +0 -1
  241. /package/dist/public/assets/{ActivityPanelDiffView-COM6jgM6.js → ActivityPanelDiffView-CojvWN5u.js} +0 -0
  242. /package/dist/public/assets/{__vite-browser-external-B-733T4c.js → __vite-browser-external-W0BYeUy6.js} +0 -0
  243. /package/dist/public/assets/{array-Dz4vndSy.js → array-DZrUSYBX.js} +0 -0
  244. /package/dist/public/assets/{chunk-KEIR6QF5-YxiaonDF.js → chunk-KEIR6QF5-kMpbALDh.js} +0 -0
  245. /package/dist/public/assets/{chunk-Y2CYZVJY-B5uX60M6.js → chunk-Y2CYZVJY-C7afl5rZ.js} +0 -0
  246. /package/dist/public/assets/{clike-DrU-cR_S.js → clike-BgMHoZVb.js} +0 -0
  247. /package/dist/public/assets/{clipboard-adapter-BHfhAZ-n.js → clipboard-adapter-CfjsRFpv.js} +0 -0
  248. /package/dist/public/assets/{colors-yCcn8znj.js → colors-BtGPfaz7.js} +0 -0
  249. /package/dist/public/assets/{config-context-BbS_JaHs.js → config-context-BaIZpYSb.js} +0 -0
  250. /package/dist/public/assets/{cursor-Rw-XIAht.js → cursor-jdIvZ4dc.js} +0 -0
  251. /package/dist/public/assets/{cytoscape.esm-D6meekAa.js → cytoscape.esm-wfVGet9g.js} +0 -0
  252. /package/dist/public/assets/{defaultLocale-CKlKs72A.js → defaultLocale-CCuQb4WR.js} +0 -0
  253. /package/dist/public/assets/{desktop-bridge-types-_D7JSBL8.js → desktop-bridge-types-4c7gjz59.js} +0 -0
  254. /package/dist/public/assets/{diff-BVcHwfdB.js → diff-B7WgJJz8.js} +0 -0
  255. /package/dist/public/assets/{dist-DOee8t3p.js → dist-BQhSFgYM.js} +0 -0
  256. /package/dist/public/assets/{dist-Qabe7wDM.js → dist-CAIcun02.js} +0 -0
  257. /package/dist/public/assets/{dist-DMFtCzYE.js → dist-DN9vrt63.js} +0 -0
  258. /package/dist/public/assets/{dist-7hPoK5kq.js → dist-SUVx2c2e.js} +0 -0
  259. /package/dist/public/assets/{dist-C87Ou6G5.js → dist-o9cVHl8Q.js} +0 -0
  260. /package/dist/public/assets/{documents-fetch-CD85Qoe6.js → documents-fetch-BzTSsuPI.js} +0 -0
  261. /package/dist/public/assets/{external-link-BfiFPJEx.js → external-link-BUoZ56id.js} +0 -0
  262. /package/dist/public/assets/{file-tree-rename-validation-BBSv40Qz.js → file-tree-rename-validation-GUkltgNP.js} +0 -0
  263. /package/dist/public/assets/{format-DJS8_tfZ.js → format-ClWHbKHd.js} +0 -0
  264. /package/dist/public/assets/{go-Ceq0cEZq.js → go-DTLWKePr.js} +0 -0
  265. /package/dist/public/assets/{init-DSak-Kkw.js → init-B2r4ykR3.js} +0 -0
  266. /package/dist/public/assets/{input-BX4UDDMJ.js → input-b4FSCbA5.js} +0 -0
  267. /package/dist/public/assets/{isObject-qQeVObYJ.js → isObject-Bj-0X2GB.js} +0 -0
  268. /package/dist/public/assets/{lua-DM28D-6o.js → lua-B3utixrX.js} +0 -0
  269. /package/dist/public/assets/{mcp-consent-store-O7e02Mi1.js → mcp-consent-store-DL93ger0.js} +0 -0
  270. /package/dist/public/assets/{min-wGNVvSoq.js → min-B7KH7bOg.js} +0 -0
  271. /package/dist/public/assets/{panzoom.es-DeqEaiMH.js → panzoom.es-Cs7b857v.js} +0 -0
  272. /package/dist/public/assets/{parse-api-error-Mgtc4OJu.js → parse-api-error-DfesE4Y7.js} +0 -0
  273. /package/dist/public/assets/{path-B3Wp5BLm.js → path-BQp9Hq4z.js} +0 -0
  274. /package/dist/public/assets/{pdf-CSS8JMnh.js → pdf-BHHpPt0J.js} +0 -0
  275. /package/dist/public/assets/{pdf.worker-BojfP6R3.js → pdf.worker-BZYXl7oP.js} +0 -0
  276. /package/dist/public/assets/{perl-D5vgbj2Y.js → perl-CZ2U9dfT.js} +0 -0
  277. /package/dist/public/assets/{project-paths-DJDWBB-8.js → project-paths-CSBBkRS0.js} +0 -0
  278. /package/dist/public/assets/{properties-C7p4lNrk.js → properties-CwLn0BUZ.js} +0 -0
  279. /package/dist/public/assets/{r-BcyApZ2Y.js → r-Crnq5PtH.js} +0 -0
  280. /package/dist/public/assets/{refresh-cw-FMnveNBD.js → refresh-cw-DgVrChIu.js} +0 -0
  281. /package/dist/public/assets/{rough.esm-CIwjGUJO.js → rough.esm-B1TTUqnd.js} +0 -0
  282. /package/dist/public/assets/{ruby-DxabsNt7.js → ruby-nTEDjg1w.js} +0 -0
  283. /package/dist/public/assets/{share-metadata-rows-CVWX1vOJ.js → share-metadata-rows-DTrx2e2E.js} +0 -0
  284. /package/dist/public/assets/{shell-B2Oc-2BR.js → shell-CJ7sRXEH.js} +0 -0
  285. /package/dist/public/assets/{sql-DWXp9JcL.js → sql-B7jXn3j6.js} +0 -0
  286. /package/dist/public/assets/{src-DyReJWGm.js → src-CvdYkko8.js} +0 -0
  287. /package/dist/public/assets/{startup-marks-BJwpvHMe.js → startup-marks-2VTPXUbb.js} +0 -0
  288. /package/dist/public/assets/{stex-lDOZN-ZW.js → stex-CLng_sPo.js} +0 -0
  289. /package/dist/public/assets/{swift-BlyE8smW.js → swift-DKG9kMYe.js} +0 -0
  290. /package/dist/public/assets/{textarea--26Ac0EI.js → textarea-D45cTFgp.js} +0 -0
  291. /package/dist/public/assets/{toml-Bg2104qZ.js → toml-ClZMF6Q0.js} +0 -0
  292. /package/dist/public/assets/{trash-2-Cgf308yS.js → trash-2-U9wpS1zc.js} +0 -0
  293. /package/dist/public/assets/{triangle-alert-VZ_Cki-r.js → triangle-alert-BaZPlVka.js} +0 -0
  294. /package/dist/public/assets/{worktree-store-DFmh2OE1.js → worktree-store-Dwj7qwtV.js} +0 -0
  295. /package/dist/public/assets/{x-BUBUnCd-.js → x-_C6KOlzX.js} +0 -0
@@ -1,3 +1,3 @@
1
- import{S as e}from"./src-BU7I7py6.mjs";import{An as t,Bn as n,Dn as r,En as i,In as a,Mn as o,Pn as s,Vn as c,jn as l}from"./src-C0CgVA8i.mjs";import{t as u}from"./esm-EvSEzE_V.mjs";import{a as d,d as f,f as p,t as m}from"./write-project-skill-DkTM_Oeh.mjs";import{dirname as h,join as g,resolve as _}from"node:path";import{existsSync as v,mkdirSync as y,readFileSync as b,readdirSync as x,rmSync as S,statSync as C,writeFileSync as w}from"node:fs";import{homedir as T}from"node:os";const E={existsSync:e=>v(e),isDirectory:e=>{try{return C(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>x(e),readFileSync:e=>b(e),writeFileSync:(e,t)=>{w(e,t)},mkdirSync:(e,t)=>{y(e,t)},rmSync:(e,t)=>{S(e,t)}},D={resolveProjectBundledSkillDir:()=>a(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>a(e,{checkDesktop:!1}),readBundledVersion:()=>r(),readRecordedVersion:e=>t(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>s(e),readBundleDecision:(e,t)=>i(e,t),writeBundleDecision:(e,t,n)=>l(e,t,n),removeBundleFromDisk:(e,t)=>d(e,t)};function O(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function k(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(h(t),{recursive:!0}),A(e,t,n)}function A(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=g(e,r),a=g(t,r);n.isDirectory(i)?A(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function j(e,t,n,r,i,a){let o=[],s=g(e,`.agents`,`skills`,t),c=r.existsSync(s),l=!1;try{k(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=g(e,c.hostDir),u=g(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}let d=r.existsSync(u);try{k(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:l}}function M(e,t){if(!e)return!1;try{if(!t.existsSync(e))return!1;let n=t.readFileSync(e).toString(`utf8`);return n.includes(`# ok-mcp-v1`)||n.includes(`# ok-mcp-win-v1`)}catch{return!1}}function N(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=g(e,t.hostDir,`skills`,`open-knowledge`),s=g(o,`SKILL.md`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&M(l,n);if(!c&&!u){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{m(o,e),k(i,o,n);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function P(t,r,i,a){let o=e=>{r.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return a({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await r.readRecordedVersion(t)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of c)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=n[o.id],c=i.existsSync(g(t,`.agents`,`skills`,s)),l=await r.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(t,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(t,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>i.existsSync(g(t,`.agents`,`skills`,n[e.id])));if(u!==null&&u===l&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],_=d.length===c.length,v=!0;for(let{id:e,sourceDir:r}of p){let o=j(t,n[e],r,i,a,l);h.push(...o.entries),o.centralWritten||(v=!1)}let y=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(_&&v&&y){let e=null;try{await r.writeRecordedVersion(t,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:l,entries:h}}async function F(e){let t=e.logger??O,n=e.fs??E,r=e.home??T(),i={...D,...e.deps};return e.reclaimDisableEnv===`1`?(t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`}):{status:`done`,project:N(e.projectDir,i,n,t),user:await P(r,i,n,t)}}function I(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function L(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`reclaimed`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} reclaimed, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return t.join(`
1
+ import{S as e}from"./src-BgrRg-nl.mjs";import{An as t,Bn as n,Dn as r,En as i,In as a,Mn as o,Pn as s,Vn as c,jn as l}from"./src-D87GkAFF.mjs";import{t as u}from"./esm-EvSEzE_V.mjs";import{a as d,d as f,f as p,t as m}from"./write-project-skill-CLggzjLg.mjs";import{dirname as h,join as g,resolve as _}from"node:path";import{existsSync as v,mkdirSync as y,readFileSync as b,readdirSync as x,rmSync as S,statSync as C,writeFileSync as w}from"node:fs";import{homedir as T}from"node:os";const E={existsSync:e=>v(e),isDirectory:e=>{try{return C(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>x(e),readFileSync:e=>b(e),writeFileSync:(e,t)=>{w(e,t)},mkdirSync:(e,t)=>{y(e,t)},rmSync:(e,t)=>{S(e,t)}},D={resolveProjectBundledSkillDir:()=>a(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>a(e,{checkDesktop:!1}),readBundledVersion:()=>r(),readRecordedVersion:e=>t(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>s(e),readBundleDecision:(e,t)=>i(e,t),writeBundleDecision:(e,t,n)=>l(e,t,n),removeBundleFromDisk:(e,t)=>d(e,t)};function O(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function k(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(h(t),{recursive:!0}),A(e,t,n)}function A(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=g(e,r),a=g(t,r);n.isDirectory(i)?A(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function j(e,t,n,r,i,a){let o=[],s=g(e,`.agents`,`skills`,t),c=r.existsSync(s),l=!1;try{k(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=g(e,c.hostDir),u=g(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}let d=r.existsSync(u);try{k(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:l}}function M(e,t){if(!e)return!1;try{if(!t.existsSync(e))return!1;let n=t.readFileSync(e).toString(`utf8`);return n.includes(`# ok-mcp-v1`)||n.includes(`# ok-mcp-win-v1`)}catch{return!1}}function N(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=g(e,t.hostDir,`skills`,`open-knowledge`),s=g(o,`SKILL.md`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&M(l,n);if(!c&&!u){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{m(o,e),k(i,o,n);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function P(t,r,i,a){let o=e=>{r.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return a({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await r.readRecordedVersion(t)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of c)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=n[o.id],c=i.existsSync(g(t,`.agents`,`skills`,s)),l=await r.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(t,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(t,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>i.existsSync(g(t,`.agents`,`skills`,n[e.id])));if(u!==null&&u===l&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],_=d.length===c.length,v=!0;for(let{id:e,sourceDir:r}of p){let o=j(t,n[e],r,i,a,l);h.push(...o.entries),o.centralWritten||(v=!1)}let y=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(_&&v&&y){let e=null;try{await r.writeRecordedVersion(t,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:l,entries:h}}async function F(e){let t=e.logger??O,n=e.fs??E,r=e.home??T(),i={...D,...e.deps};return e.reclaimDisableEnv===`1`?(t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`}):{status:`done`,project:N(e.projectDir,i,n,t),user:await P(r,i,n,t)}}function I(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function L(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`reclaimed`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} reclaimed, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return t.join(`
2
2
  `)}function R(){return new u(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").action(async()=>{let e=await F({projectDir:_(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null});process.stdout.write(`${L(e)}\n`),process.exitCode=I(e)})}export{R as n,F as t};
3
- //# sourceMappingURL=repair-skills-CZbrTVch.mjs.map
3
+ //# sourceMappingURL=repair-skills-CjpripUK.mjs.map
@@ -1,2 +1,2 @@
1
- import"./src-BU7I7py6.mjs";import{dirname as e,join as t,resolve as n}from"node:path";import{closeSync as r,existsSync as i,mkdirSync as a,openSync as o,readFileSync as s,unlinkSync as c,writeFileSync as l,writeSync as u}from"node:fs";import{homedir as d,hostname as f}from"node:os";import{fileURLToPath as p}from"node:url";import{randomUUID as m}from"node:crypto";function h(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function g(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}const _=/^[A-Za-z0-9-]{8,64}$/;let v=null;function y(e){return t(e??d(),`.ok`,`machine-id`)}function b(t){if(t===void 0&&v!==null)return v;let n=y(t),r=null;try{let e=s(n,`utf-8`).trim();_.test(e)&&(r=e)}catch{}if(r===null){r=m();try{a(e(n),{recursive:!0}),l(n,`${r}\n`,{encoding:`utf-8`,mode:384})}catch(e){console.warn(`[machine-id] Failed to persist ${n} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return t===void 0&&(v=r),r}function x(){try{let t=n(e(p(import.meta.url)),`..`,`package.json`),r=JSON.parse(s(t,`utf-8`));if(typeof r.version==`string`&&r.version.length>0)return r.version}catch{}return`0.0.0-unknown`}const S=x(),C=1;var w=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function T(e,t){return n(e,`${t}.lock`)}const E=new Map;function D(e){E.set(e,(E.get(e)??0)+1)}function O(e){let t=E.get(e);return t===void 0||t<=1?(E.delete(e),!0):(E.set(e,t-1),!1)}function k(e){return typeof e.machineId==`string`?e.machineId===b():e.hostname===f()}const A=new Set;let j=!1;function M(e){A.add(e),!j&&(j=!0,process.on(`exit`,()=>{for(let e of A)try{let t=JSON.parse(s(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==b()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==f())continue;c(e)}catch{}}))}function N(e,t){try{let n=JSON.parse(s(e,`utf-8`));return n&&typeof n==`object`&&g(n.pid)?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function P(e){let{lockName:t,lockDir:n,metadata:s}=e,d=`[${t}-lock]`;a(n,{recursive:!0});let p=T(n,t),m={pid:process.pid,hostname:f(),port:s.port,startedAt:new Date().toISOString(),worktreeRoot:s.worktreeRoot,machineId:b(),...s.kind!==void 0&&{kind:s.kind},...s.parentPid!==void 0&&{parentPid:s.parentPid},...s.capabilities!==void 0&&{capabilities:s.capabilities},protocolVersion:s.protocolVersion??1,runtimeVersion:s.runtimeVersion??S},g=JSON.stringify(m,null,2);for(let e=0;e<3;e++){if(!i(p))try{let e=o(p,`wx`,384);try{u(e,g)}finally{r(e)}return D(p),M(p),F({lockName:t,lockDir:n,lockPath:p})}catch(e){if(e.code!==`EEXIST`)throw e}let e=N(p,d);if(e){if(k(e)&&e.pid===process.pid)return l(p,g,{encoding:`utf-8`,mode:384}),D(p),M(p),F({lockName:t,lockDir:n,lockPath:p});if(h(e.pid))throw new w(e,p,t);console.warn(`${d} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{c(p)}catch{}}throw Error(`${d} Failed to acquire ${p} after 3 attempts (concurrent acquire contention).`)}function F(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>V({lockName:t,lockDir:n}),updatePort:e=>I({lockName:t,lockDir:n,port:e})}}function I(e){let{lockName:t,lockDir:n,port:r}=e,a=`[${t}-lock]`,o=T(n,t);if(!i(o)){console.warn(`${a} Lock file missing at ${o} during port update — skipping`);return}let c;try{let e=JSON.parse(s(o,`utf-8`));if(!e||typeof e!=`object`||!g(e.pid)){console.warn(`${a} Corrupt lock at ${o} during port update — skipping`);return}c=e}catch{console.warn(`${a} Unreadable lock at ${o} during port update — skipping`);return}if(c.pid===process.pid&&k(c)){c.port=r;try{l(o,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${a} Failed to update port in ${o}: ${e instanceof Error?e.message:String(e)}`)}}}function L(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=T(n,t);if((E.get(i)??0)>1)return;let a;try{let e=JSON.parse(s(i,`utf-8`));if(!e||typeof e!=`object`||!g(e.pid)){console.warn(`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){e.code!==`ENOENT`&&console.warn(`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&k(a)&&a.draining!==!0){a.draining=!0;try{l(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function R(e){let{lockName:t,lockDir:n}=e,r=T(n,t);if(!i(r))return null;let a;try{let e=JSON.parse(s(r,`utf-8`));if(!e||typeof e!=`object`||!g(e.pid))return null;a=e}catch{return null}if(!k(a))return null;if(!h(a.pid)){try{c(r)}catch{}return null}return a}function z(e){let{lockName:t,lockDir:n}=e,r=T(n,t);if(!i(r))return{status:`absent`};let a;try{a=JSON.parse(s(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!a||typeof a!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:a};let o=a;if(!g(o.pid)||typeof o.hostname!=`string`||typeof o.port!=`number`||typeof o.startedAt!=`string`||typeof o.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:a};let l={pid:o.pid,hostname:o.hostname,port:o.port,startedAt:o.startedAt,worktreeRoot:o.worktreeRoot,machineId:typeof o.machineId==`string`?o.machineId:void 0,draining:o.draining===!0?!0:void 0,protocolVersion:typeof o.protocolVersion==`number`?o.protocolVersion:void 0,runtimeVersion:typeof o.runtimeVersion==`string`?o.runtimeVersion:void 0};if(!k(l))return{status:`stale`,lock:l};if(!h(l.pid)){try{c(r)}catch{}return{status:`stale`,lock:l}}return l.protocolVersion===void 0||l.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:a}:{status:`live`,lock:l}}async function B(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>R({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function V(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,a=`[${t}-lock]`,o=T(n,t);if(O(o)){if(r){L({lockName:t,lockDir:n});return}if(i(o))try{let e=JSON.parse(s(o,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!k(e))return;c(o),A.delete(o)}catch(e){console.warn(`${a} Failed to release ${o}: ${e instanceof Error?e.message:String(e)}`)}}}var H=class extends w{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function U(e,t){try{return P({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof w&&e.lockName===`server`?new H(e.existing,e.lockPath):e}}function W(e,t){I({lockName:`server`,lockDir:e,port:t})}function G(e){return R({lockName:`server`,lockDir:e})}function K(e,t){V({lockName:`server`,lockDir:e,...t})}function q(e){L({lockName:`server`,lockDir:e})}function J(e,t){return B({lockName:`server`,lockDir:e,...t})}export{C as _,K as a,g as b,w as c,L as d,R as f,S as g,I as h,G as i,P as l,V as m,U as n,W as o,z as p,q as r,J as s,H as t,T as u,b as v,h as y};
2
- //# sourceMappingURL=server-lock-wMKEjgnN.mjs.map
1
+ import"./src-BgrRg-nl.mjs";import{dirname as e,join as t,resolve as n}from"node:path";import{closeSync as r,existsSync as i,mkdirSync as a,openSync as o,readFileSync as s,unlinkSync as c,writeFileSync as l,writeSync as u}from"node:fs";import{homedir as d,hostname as f}from"node:os";import{fileURLToPath as p}from"node:url";import{randomUUID as m}from"node:crypto";function h(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function g(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}const _=/^[A-Za-z0-9-]{8,64}$/;let v=null;function y(e){return t(e??d(),`.ok`,`machine-id`)}function b(t){if(t===void 0&&v!==null)return v;let n=y(t),r=null;try{let e=s(n,`utf-8`).trim();_.test(e)&&(r=e)}catch{}if(r===null){r=m();try{a(e(n),{recursive:!0}),l(n,`${r}\n`,{encoding:`utf-8`,mode:384})}catch(e){console.warn(`[machine-id] Failed to persist ${n} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return t===void 0&&(v=r),r}function x(){try{let t=n(e(p(import.meta.url)),`..`,`package.json`),r=JSON.parse(s(t,`utf-8`));if(typeof r.version==`string`&&r.version.length>0)return r.version}catch{}return`0.0.0-unknown`}const S=x(),C=1;var w=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function T(e,t){return n(e,`${t}.lock`)}const E=new Map;function D(e){E.set(e,(E.get(e)??0)+1)}function O(e){let t=E.get(e);return t===void 0||t<=1?(E.delete(e),!0):(E.set(e,t-1),!1)}function k(e){return typeof e.machineId==`string`?e.machineId===b():e.hostname===f()}const A=new Set;let j=!1;function M(e){A.add(e),!j&&(j=!0,process.on(`exit`,()=>{for(let e of A)try{let t=JSON.parse(s(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==b()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==f())continue;c(e)}catch{}}))}function N(e,t){try{let n=JSON.parse(s(e,`utf-8`));return n&&typeof n==`object`&&g(n.pid)?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function P(e){let{lockName:t,lockDir:n,metadata:s}=e,d=`[${t}-lock]`;a(n,{recursive:!0});let p=T(n,t),m={pid:process.pid,hostname:f(),port:s.port,startedAt:new Date().toISOString(),worktreeRoot:s.worktreeRoot,machineId:b(),...s.kind!==void 0&&{kind:s.kind},...s.parentPid!==void 0&&{parentPid:s.parentPid},...s.capabilities!==void 0&&{capabilities:s.capabilities},protocolVersion:s.protocolVersion??1,runtimeVersion:s.runtimeVersion??S},g=JSON.stringify(m,null,2);for(let e=0;e<3;e++){if(!i(p))try{let e=o(p,`wx`,384);try{u(e,g)}finally{r(e)}return D(p),M(p),F({lockName:t,lockDir:n,lockPath:p})}catch(e){if(e.code!==`EEXIST`)throw e}let e=N(p,d);if(e){if(k(e)&&e.pid===process.pid)return l(p,g,{encoding:`utf-8`,mode:384}),D(p),M(p),F({lockName:t,lockDir:n,lockPath:p});if(h(e.pid))throw new w(e,p,t);console.warn(`${d} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{c(p)}catch{}}throw Error(`${d} Failed to acquire ${p} after 3 attempts (concurrent acquire contention).`)}function F(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>V({lockName:t,lockDir:n}),updatePort:e=>I({lockName:t,lockDir:n,port:e})}}function I(e){let{lockName:t,lockDir:n,port:r}=e,a=`[${t}-lock]`,o=T(n,t);if(!i(o)){console.warn(`${a} Lock file missing at ${o} during port update — skipping`);return}let c;try{let e=JSON.parse(s(o,`utf-8`));if(!e||typeof e!=`object`||!g(e.pid)){console.warn(`${a} Corrupt lock at ${o} during port update — skipping`);return}c=e}catch{console.warn(`${a} Unreadable lock at ${o} during port update — skipping`);return}if(c.pid===process.pid&&k(c)){c.port=r;try{l(o,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${a} Failed to update port in ${o}: ${e instanceof Error?e.message:String(e)}`)}}}function L(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=T(n,t);if((E.get(i)??0)>1)return;let a;try{let e=JSON.parse(s(i,`utf-8`));if(!e||typeof e!=`object`||!g(e.pid)){console.warn(`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){e.code!==`ENOENT`&&console.warn(`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&k(a)&&a.draining!==!0){a.draining=!0;try{l(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function R(e){let{lockName:t,lockDir:n}=e,r=T(n,t);if(!i(r))return null;let a;try{let e=JSON.parse(s(r,`utf-8`));if(!e||typeof e!=`object`||!g(e.pid))return null;a=e}catch{return null}if(!k(a))return null;if(!h(a.pid)){try{c(r)}catch{}return null}return a}function z(e){let{lockName:t,lockDir:n}=e,r=T(n,t);if(!i(r))return{status:`absent`};let a;try{a=JSON.parse(s(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!a||typeof a!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:a};let o=a;if(!g(o.pid)||typeof o.hostname!=`string`||typeof o.port!=`number`||typeof o.startedAt!=`string`||typeof o.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:a};let l={pid:o.pid,hostname:o.hostname,port:o.port,startedAt:o.startedAt,worktreeRoot:o.worktreeRoot,machineId:typeof o.machineId==`string`?o.machineId:void 0,draining:o.draining===!0?!0:void 0,protocolVersion:typeof o.protocolVersion==`number`?o.protocolVersion:void 0,runtimeVersion:typeof o.runtimeVersion==`string`?o.runtimeVersion:void 0};if(!k(l))return{status:`stale`,lock:l};if(!h(l.pid)){try{c(r)}catch{}return{status:`stale`,lock:l}}return l.protocolVersion===void 0||l.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:a}:{status:`live`,lock:l}}async function B(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>R({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function V(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,a=`[${t}-lock]`,o=T(n,t);if(O(o)){if(r){L({lockName:t,lockDir:n});return}if(i(o))try{let e=JSON.parse(s(o,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!k(e))return;c(o),A.delete(o)}catch(e){console.warn(`${a} Failed to release ${o}: ${e instanceof Error?e.message:String(e)}`)}}}var H=class extends w{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function U(e,t){try{return P({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof w&&e.lockName===`server`?new H(e.existing,e.lockPath):e}}function W(e,t){I({lockName:`server`,lockDir:e,port:t})}function G(e){return R({lockName:`server`,lockDir:e})}function K(e,t){V({lockName:`server`,lockDir:e,...t})}function q(e){L({lockName:`server`,lockDir:e})}function J(e,t){return B({lockName:`server`,lockDir:e,...t})}export{C as _,K as a,g as b,w as c,L as d,R as f,S as g,I as h,G as i,P as l,V as m,U as n,W as o,z as p,q as r,J as s,H as t,T as u,b as v,h as y};
2
+ //# sourceMappingURL=server-lock-Cn2-KrjV.mjs.map
@@ -0,0 +1 @@
1
+ import{a as e,o as t,r as n}from"./server-lock-Cn2-KrjV.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
@@ -455,7 +455,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
455
455
  `){let{editColumn:r,deleteCount:i,insertText:a}=F$(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function L$(e,t){let n=Z.getPreferredLineEnding(e,XY),r=e.split(Z.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>F$(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=I$(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}function R$(e,t){return L$(e,P$({strings:{doc:e},config:t}).doc??[])}function z$(e,t){let n=P$({strings:{doc:e},config:t}).doc??[],r=e.split(`
456
456
  `),i=B$(t);return n.map(e=>H$(e,r,V$(e,i)))}function B$(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function V$(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function H$(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[U$(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function U$(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}const W$=Js([M(),F([`error`,`warning`]),ec(A(),Vs())]),G$=[{id:`markdownlint`,sliceSchema:P({enabled:M(),rules:ec(A(),W$)}),defaultSlice:{enabled:!1,rules:qY},async lint(e,t){return z$(e,JY(t.rules))},fix(e,t){return R$(e,JY(t.rules))}}],K$={enabled:!0,plugins:Object.fromEntries(G$.map(e=>[e.id,e.defaultSlice]))};function q$(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??qY}}}}const J$=Object.fromEntries(G$.map(e=>[e.id,e.sliceSchema])),Y$=P({effective:P({enabled:M(),plugins:P(J$)}),configFile:A().nullable().optional(),configProblems:N(A()).optional()}),X$=Js([M(),ec(A(),Vs())]),Z$=P({ruleId:A().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Js([X$,Ls()])}),Q$=P({line:j(),character:j()}),$$=P({start:Q$,end:Q$}),e1=P({range:$$,severity:F([`error`,`warning`,`info`,`hint`]),source:A(),code:A(),message:A(),fixes:N(P({range:$$,newText:A()})).optional()}),t1=P({file:A(),diagnostics:N(e1)}),n1=P({files:N(t1),fileCount:j(),errorCount:j(),warningCount:j(),warnings:N(A())}),r1=P({docName:EO,summary:OO,...DO}).loose(),i1=P({file:A(),fixedCount:j(),diagnostics:N(e1),errorCount:j(),warningCount:j(),warning:A().optional()}),a1=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],o1=(()=>{let e=new Map;for(let t of a1){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function s1(e){return o1.get(e.toUpperCase())??null}function c1(e,t){let n=s1(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))s1(t)===n&&(r={key:t,value:i});return r}async function l1(e,t,n){if(!t.enabled)return[];let r=[];for(let i of G$){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}function u1(e,t){if(!t.enabled)return e;let n=e;for(let e of G$){let r=t.plugins[e.id];!r.enabled||!e.fix||(n=e.fix(n,r))}return n}const d1=/\p{M}+/gu,f1=/[^\p{L}\p{N}]+/gu,p1=/^-+|-+$/g;function m1(e){return e.trim().normalize(`NFKD`).replace(d1,``).toLowerCase().replace(f1,`-`).replace(p1,``)}function h1(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function g1(e,t){let n=m1(e);return n?h1(n,t):``}const _1=new Set([`img`,`video`,`audio`,`mark`]);new Map(WH.flatMap(e=>e.surface===`compat`&&_1.has(e.rendersAs)?[[e.name,e]]:[])),MR(`<>`);const v1=cJ(),y1=Eq(),b1=Dq();function x1(){return WH.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function S1(){return x1().filter(e=>C1(e)!==`fence`)}function C1(e){return e.name===`MermaidFence`?`fence`:e.hasChildren?`jsx-block`:`jsx-void`}function w1(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:C1(e)}}function T1(e){if(e.hidden!==!0&&e.type!==`reactnode`){if(`defaultValue`in e&&e.defaultValue!==void 0)return e.defaultValue;if(e.type===`enum`)return e.enumValues[0];if(e.type===`string`)return``;if(e.type===`number`)return 0;if(e.type===`boolean`)return!1}}function E1(e,t){return!(e.omitOnDefault===!0&&`defaultValue`in e&&Object.is(e.defaultValue,t)||e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&t===``)}function D1(e){let t=[];for(let n of e.props){let e=T1(n);e!==void 0&&E1(n,e)&&t.push(rH(n.name,e))}return t}function O1(e){return jW(e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`Body content here.`,{extensions:[v1],mdastExtensions:[y1]}).children}function k1(e){let t=C1(e),n;if(t===`fence`)n={type:`code`,lang:`mermaid`,meta:null,value:e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`graph LR
457
457
  A --> B`};else{let r=D1(e),i=t===`jsx-block`?O1(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return NL({type:`root`,children:[n]},{extensions:[b1]}).trimEnd()}function A1(e){let t=[];for(let n of e.props){if(n.hidden===!0)continue;let e={name:n.name,type:n.type,required:n.required};n.description!==void 0&&(e.description=n.description),n.advanced===!0&&(e.advanced=!0),n.omitOnDefault===!0&&(e.omitOnDefault=!0),n.type===`enum`&&(e.values=n.enumValues,n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue)),n.type===`string`&&(n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.language!==void 0&&(e.language=n.language),n.accept!==void 0&&(e.accept=n.accept)),n.type===`boolean`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.type===`number`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),t.push(e)}return t}function j1(e){return{...w1(e),example:k1(e),params:A1(e)}}function M1(){return[``,"**Custom canonical components.** OK `.md` / `.mdx` supports the JSX components below — use whichever is semantically useful in any part of the doc. For full source syntax + parameter schemas, call `palette({ components: [ids] })` with the ids you want to use. Fenced code blocks render naturally and don't need a fetch — including ` ```mermaid ` for diagrams (mermaid label text has sharp edges — `palette({ components: [\"Mermaid\"] })` lists them; parse failures come back as `warnings` entries on write/edit) and ` ```html preview ` for interactive HTML/JS/CSS pages (the fence info-string `preview` token renders the block as a live iframe; works for `html` / `htm` / `xml`; optional `h=` / `w=` tokens set size, e.g. ` ```html preview h=400px `). Use ` ```html preview ` whenever you want anything interactive or JS-powered (charts, demos, calculators, animations) — just author the standalone HTML page in the fence. Call `palette` for the markdown-native component forms (write `> [!NOTE]`, not `<Callout>`), copy-ready themed `html preview` starters, and the theme tokens (`var(--chart-1)`, `var(--foreground)`, …) an embed should reference so it tracks the reader's light/dark theme. Arbitrary `<TagName>` JSX falls through as raw MDX when no canonical fits.",``,...S1().map(w1).map(e=>`- \`${e.id}\` (${e.kind}) — ${e.description}`)].join(`
458
- `)}const N1=[`text`,`number`,`boolean`,`date`,`list`,`object`];F(N1);const P1=Js([A(),j(),M()]),F1=Tc(()=>Js([P1.transform(e=>String(e)),ec(A(),I1),N(F1)])),I1=Tc(()=>Js([A(),j(),M(),N(F1),ec(A(),I1)]));function L1(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(L1(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:L1(r);return t}return e}const R1=Ac(L1,ec(A(),I1));ec(A(),Js([I1,Ls()]));function z1(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}const B1=P({docName:EO,summary:OO,content:A().optional(),...DO}).loose(),V1=P({docName:EO,summary:OO,markdown:A(),position:F([`append`,`prepend`,`replace`]).optional(),extension:F(Bu).optional(),...DO}).loose(),H1=P({docName:EO,summary:OO,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...DO}).loose(),U1=P({docName:EO,connectionId:A().min(1),scope:F([`last`,`session`,`file`]).optional(),...DO}).loose(),W1=P({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),G1=Xs(`kind`,[P({kind:I(`inline`),content:A()}),P({kind:I(`truncated`),byteLength:j().int().nonnegative(),hint:A()})]),K1=P({kind:I(`content-divergence`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),divergenceType:A().optional(),currentState:G1.optional(),hint:A().optional()}).loose(),q1=P({type:I(`orphan`),parentCandidates:N(A()),message:A()}).loose(),J1=P({kind:I(`disk-edit-reconciled`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),mergeOutcome:A().optional(),hint:A().optional()}).loose(),Y1=Xs(`kind`,[K1,J1]),X1=Xs(`kind`,[K1,J1,P({kind:I(`mermaid-parse-error`),fenceIndex:j().int().positive(),fenceFirstLine:A(),message:A(),line:j().int().positive().optional()}).loose(),P({kind:I(`lint-violation`),source:A(),code:A(),message:A(),severity:F([`error`,`warning`,`info`,`hint`]),line:j().int().positive(),column:j().int().positive()}).loose()]),Z1=N(X1).min(1),Q1=P({href:A(),resolvedTo:A().nullable(),reason:F([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose(),$1=N(Q1),e0=P({timestamp:A().min(1),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional()}).loose(),t0=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:N(q1).optional(),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional(),brokenLinks:$1}).loose(),n0=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional(),brokenLinks:$1}).loose(),r0=P({docName:A().min(1),scope:F([`last`,`session`]),undone:M()}).loose(),i0=P({docName:EO,patch:ec(A(),Js([I1,Ls()])),types:ec(A(),F(N1)).optional(),summary:OO,...DO}).loose(),a0=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),appliedKeys:N(A()),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional(),brokenLinks:$1}).loose(),o0=P({entries:N(P({level:F([`info`,`warn`,`error`]),message:A().max(8192),event:A().optional(),fields:ec(A(),Vs()).optional(),ts:j().optional(),sourceId:A().optional(),lineNumber:j().optional()}).loose()).max(100)}).loose(),s0=P({accepted:j().int().min(0)}).loose(),c0=P({status:A().min(1),reason:A()}).loose(),l0=P({docName:A().min(1),content:A(),lifecycle:c0.nullable()}).loose(),u0=P({documents:N(P({kind:F([`document`,`asset`,`folder`,`file`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:M().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:F([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:N(A().min(1)).optional(),hasChildren:M().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`})),truncated:M().optional()}).loose(),d0=P({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),f0=P({docName:A().min(1),backlinks:N(d0)}).loose(),p0=P({counts:ec(A().min(1),j().int().nonnegative())}).loose(),m0=Xs(`kind`,[P({kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),P({kind:I(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),h0=P({docName:A().min(1),forwardLinks:N(m0)}).loose(),g0=Xs(`kind`,[P({id:A().min(1),kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:N(A()).nullable()}).loose(),P({id:A().min(1),kind:I(`external`),url:A().min(1),label:A()}).loose()]),_0=P({source:A().min(1),target:A().min(1)}).loose(),v0=P({nodes:N(g0),links:N(_0)}).loose(),y0=P({ts:j().int().min(0),url:A(),method:A(),ua:A().optional(),origin:A().optional(),referer:A().optional(),host:A().optional(),remote:A().optional(),secChUa:A().optional(),secChUaMobile:A().optional(),secChUaPlatform:A().optional(),secFetchSite:A().optional(),secFetchDest:A().optional(),secFetchMode:A().optional(),secFetchUser:A().optional()}).loose(),b0=P({app:Js([I(`cursor`),I(`codex`),I(`claude`),Ls()]),signals_fired:N(A())}).loose(),x0=P({entries:N(y0),count:j().int().min(0),detection:b0}).loose(),S0=P({writers:N(P({id:A().min(1),name:A().optional(),email:A().optional()}).loose()).optional(),summary:OO,...DO}).loose(),C0=P({checkpointRef:A().min(1)}).loose(),w0=P({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:N(A()),summaries:N(A()).optional()}).loose(),T0=P({entries:N(P({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:F([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:N(w0),checkpoint:Vs().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:M().optional(),hasMore:M().optional()}).loose(),E0=P({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),D0=P({contentDir:A().min(1),pathSeparator:F([`/`,`\\`]),symlinkResolved:M()}).loose(),O0=N(Xs(`source`,[P({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:I(`flat`)}).loose(),P({docName:A().min(1),timestamp:A().min(1),source:I(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),k0=P({domain:A().min(1),title:A().optional(),description:A().optional(),siteName:A().optional(),faviconDataUri:A().optional()}).loose(),A0=P({url:A()}).loose(),j0=Xs(`ok`,[P({ok:I(!0),metadata:k0}).loose(),P({ok:I(!1),reason:A()}).loose()]),M0=P({orphans:N(P({docName:A().min(1),title:A()}).loose())}).loose(),N0=P({hubs:N(P({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),P0=P({source:A().min(1),title:A(),snippet:A().nullable()}).loose(),F0=P({deadLinks:N(P({target:A().min(1),sources:N(P0)}).loose())}).loose(),I0=P({target:P({docName:A().min(1),title:A(),aliases:N(A())}).loose(),mentions:N(P({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:M()}).loose(),L0=P({projectPath:A().min(1)}).loose(),R0=F([`not-a-git-worktree`,`init-failed`]),z0=Xs(`ok`,[P({ok:I(!0),projectPath:A().min(1)}).loose(),P({ok:I(!1),reason:R0,message:A().min(1)}).loose()]),B0=P({host:A().min(1).optional()}).loose(),V0=P({key:A().min(1)}).loose(),H0=P({keyPresent:M()}).loose(),U0=P({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),W0=P({authenticated:M()}).loose(),G0=P({}).loose(),K0=P({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),q0=P({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:N(K0)}).loose(),J0=P({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),Y0=P({sessionAlive:M(),agent:J0.nullable(),files:N(q0)}).loose(),X0=P({diff:A(),generatedAt:j().int().min(0)}).loose(),Z0=P({}).loose(),Q0=P({}).loose(),$0=P({}).loose(),e2=P({}).loose(),t2=P({}).loose(),n2=P({}).loose(),r2=P({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:F([`idle`,`writing`]),ts:j().int().min(0)}).loose(),i2=P({presence:ec(A().min(1),r2)}).loose(),a2=ec(A().min(1),M()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});P({path:A().min(1,`path must be non-empty`)}).loose();const o2=P({}).loose(),s2=P({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),c2=P({fromPath:A().min(1),toPath:A().min(1)}).loose(),l2=P({}).loose(),u2=P({path:A().min(1),...DO,summary:OO}).loose(),d2=P({docName:A().min(1)}).loose(),f2=P({path:A().min(1),...DO,summary:OO}).loose(),p2=P({path:A().min(1)}).loose(),m2=P({kind:F([`file`,`folder`]),path:A().min(1),...DO,summary:OO}).loose(),h2=P({kind:F([`file`,`folder`]),path:A().min(1),duplicatedDocNames:N(A().min(1))}).loose(),g2=P({pages:N(P({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1),icon:A().min(1).max(2048).optional()}).loose())}).loose(),_2=P({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),v2=P({docName:A().min(1),headings:N(_2)}).loose(),y2=P({docName:A().min(1),rewrites:j().int().nonnegative()}).loose(),b2=P({kind:F([`file`,`folder`,`asset`]),fromPath:A().min(1),toPath:A().min(1),...DO,summary:OO}).loose(),x2=P({renamed:N(s2),renamedAssets:N(c2),rewrittenDocs:N(y2).optional(),summary:W1.optional()}).loose(),S2=P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...DO}).loose(),C2=P({deletedDocNames:N(A().min(1))}).loose(),w2=P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...DO,summary:OO}).loose(),T2=P({deletedDocNames:N(A().min(1))}).loose(),E2=P({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:OO,...DO}).loose(),D2=P({restoredFrom:A().min(1),timestamp:A().min(1),summary:W1.optional(),warning:K1.optional(),warnings:Z1.optional()}).loose(),O2=F([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),k2=P({label:A().min(1),webUrl:gs().nullable()}).loose(),A2=Xs(`checkStatus`,[P({checkStatus:I(`allowed`)}).loose(),P({checkStatus:I(`denied`),deniedReason:F([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),P({checkStatus:I(`unknown`),unknownError:F([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),j2=F([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),M2=P({state:O2,lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:M(),syncEnabled:M(),identityUnresolved:M(),remote:k2.nullable().optional(),pushError:A().optional(),pushErrorCode:j2.optional(),pullError:A().optional(),pullErrorCode:j2.optional(),pausedReason:A().optional(),pushPermission:A2.optional()}).loose(),N2=P({op:F([`sync`,`push`,`pull`]).optional()}).loose(),P2=P({op:F([`sync`,`push`,`pull`])}).loose(),F2=P({conflicts:N(P({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),I2=P({file:A().min(1),strategy:F([`mine`,`theirs`,`content`,`delete`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),L2=P({}).loose(),R2=P({file:A().min(1),base:A(),ours:A(),theirs:A(),kind:F([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:A().nullable()}).loose(),z2=P({plan:Dc(e=>e!==void 0,{message:`plan is required`})}).loose(),B2=P({plan:Dc(e=>e!==void 0,{message:`plan is required`})}).loose(),V2=P({result:Dc(e=>e!==void 0,{message:`result is required`})}).loose(),H2=P({path:A().min(1),summary:A().min(1)}).loose(),U2=P({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose(),W2=P({packs:N(P({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:N(H2),entryCounts:U2}).loose())}).loose(),G2=P({noOpen:M().optional(),out:A().min(1).optional()}).loose(),K2=P({reason:F([`unsupported-platform`,`spawn-error`]),message:A()}).loose(),q2=Xs(`status`,[P({status:I(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),P({status:I(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:K2.optional()}).loose(),P({status:I(`failed`),buildError:A()}).loose(),P({status:I(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),J2=[`.ok`,`skill-targets.json`],Y2=F(Ku),X2=Ks({schema:I(1),targets:N(Y2).default([])});function Z2(e){let t;try{t=JSON.parse(e)}catch{return null}let n=X2.safeParse(t);return n.success?n.data:null}const Q2=P({tags:N(P({name:A().min(1),count:j().int().nonnegative(),isLeaf:M()}).loose())}).loose(),$2=P({docName:A().min(1),title:A(),matchingTags:N(A().min(1)),snippet:A().nullable()}).loose(),e4=P({name:A().min(1),docs:N($2)}).loose(),t4=P({folder:Vs(),frontmatter_local:ec(A(),Vs()).nullable()}).loose(),n4=P({path:A(),frontmatter:ec(A(),Vs()).optional()}).loose(),r4=P({applied:Vs()}).loose(),i4=ec(A(),Vs()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),a4=P({template:P({name:A().min(1),folder:A(),scope:F([`local`,`inherited`]),path:A().min(1),frontmatter:i4,body:A()}).strict()}).strict(),o4=P({templates:N(P({name:A().min(1),title:A().optional(),description:A().optional(),path:A().min(1),source_folder:A()}).strict()),truncated:M()}).strict(),s4=P({folder:A(),name:A(),body:A().optional(),frontmatter:i4.optional(),...DO,summary:OO}).strict(),c4=P({path:A().min(1),created:M(),warnings:N(A())}).strict(),l4=P({existed:M(),path:A().min(1)}).strict(),u4=P({fromFolder:A(),fromName:A(),toFolder:A(),toName:A(),body:A().optional(),frontmatter:i4.optional(),...DO,summary:OO}).strict(),d4=P({from:A().min(1),to:A().min(1),committed:M()}).strict(),f4=F(Tu),p4=/^[a-z0-9-]+$/,m4=/<\/?[A-Za-z][^>]*>/;function h4(e){return m4.test(e)}const g4=/^[A-Za-z0-9_-]+$/,_4=P({name:A(),description:A()}).strict(),v4=P({skill:P({name:A().min(1),scope:f4,path:A().min(1),frontmatter:_4,body:A(),files:N(P({path:A().min(1),text:A().nullable()})).optional(),managed:M().optional()}).strict()}).strict(),y4=P({skills:N(P({name:A().min(1),description:A().optional(),scope:f4,path:A().min(1),absolutePath:A().min(1).optional(),installed:M(),hosts:N(A()),installedVersion:A().optional(),bundledVersion:A().optional(),updateAvailable:M().optional(),managed:M().optional()}).strict()),truncated:M()}).strict(),b4=P({scope:f4.default(`project`),name:A(),body:A().optional(),frontmatter:_4,...DO,summary:OO}).strict(),x4=P({path:A().min(1),created:M(),warnings:N(A())}).strict(),S4=P({scope:f4.default(`project`),name:A(),...DO,summary:OO}).strict(),C4=P({name:A().min(1),version:A().min(1),previousVersion:A().optional(),checkpointRef:A().optional()}).strict(),w4=P({existed:M(),path:A().min(1)}).strict(),T4=P({scope:f4.default(`project`),fromName:A(),toName:A(),body:A().optional(),frontmatter:_4.optional(),...DO,summary:OO}).strict(),E4=P({from:A().min(1),to:A().min(1),committed:M()}).strict(),D4=F([`reference`,`script`]),O4=P({scope:f4.default(`project`),name:A(),path:A().min(1),content:A(),...DO,summary:OO}).strict(),k4=P({path:A().min(1),created:M(),kind:D4,content:M()}).strict(),A4=P({path:A().min(1),kind:D4,text:A()}).strict(),j4=P({path:A().min(1),existed:M(),kind:D4}).strict(),M4=P({scope:f4.default(`project`),name:A(),targets:N(Y2).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...DO,summary:OO}).strict(),N4=P({name:A().min(1),hosts:N(A()),scripts:M(),warnings:N(A()),warningCodes:N(F([`no-targets`,`scripts-present`]))}).strict(),P4=P({scope:f4.default(`project`),name:A()}).strict(),F4=P({name:A().min(1),uninstalled:M()}).strict(),I4=P({targets:N(Y2),configured:M()}).strict(),L4=P({targets:N(Y2)}).strict(),R4=P({targets:N(Y2),reprojected:N(P({name:A(),hosts:N(A())}).strict()),bundleHosts:N(A()),removedFrom:N(A())}).strict(),z4=P({scope:f4.default(`project`),name:A(),version:A().regex(/^[0-9a-f]{40}$/i),...DO,summary:OO}).strict(),B4=P({name:A().min(1),version:A(),restoredFiles:N(A()),warnings:N(A())}).strict(),V4=P({query:A().optional(),intent:F([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:F([`navigation`,`relevance`]).optional(),scopes:N(F([`page`,`folder`,`content`,`file`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional(),semantic:M().optional(),source:F([`omnibar`,`mcp`,`http`]).optional()}).loose(),H4=P({kind:F([`page`,`folder`,`content`,`file`]),path:A().min(1),title:A(),score:j(),signals:ec(A(),Vs()),snippet:A().optional()}).loose(),U4=P({capable:M(),applied:M(),coverage:P({embedded:j().int().nonnegative(),total:j().int().nonnegative()})}).loose(),W4=P({enabled:M(),keyPresent:M(),keySource:F([`file`,`env`]).nullable(),keyHint:A().nullable(),ready:M(),capable:M(),embedded:j().int().nonnegative(),total:j().int().nonnegative()}).loose(),G4=P({query:A(),intent:F([`autocomplete`,`full_text`,`omnibar`]),results:N(H4),elapsedMs:j().nonnegative(),semantic:U4.optional(),truncated:M().optional(),ready:M().optional()}).loose(),K4=P({version:A().min(1),recordedAt:A().min(1)}).loose(),q4=P({currentVersion:A().min(1),targets:ec(A(),K4.nullable())}).loose(),J4=`server-info`,Y4=`branch-switched`,X4=`disk-ack`,Z4=`config-validation-rejected`,Q4=`config-ignore-nested-error`,$4=F([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),e3=P({v:I(1),ch:I(J4),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),t3=P({v:I(1),ch:I(Y4),seq:j(),branch:A().min(1)}).loose(),n3=P({v:I(1),ch:$4,seq:j()}).loose(),r3=P({v:I(1),ch:I(X4),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),i3=P({v:I(1),ch:I(Z4),seq:j(),docName:A().min(1),error:tu}).loose(),a3=P({v:I(1),ch:I(Q4),seq:j(),path:A().min(1),error:A().min(1)}).loose();var o3=t(r(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var D=-b+v;D<=b-y;D+=2){for(var T=l+D,E=D==-b||D!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,ee=E-D;E<o&&ee<s&&e.charAt(o-E-1)==t.charAt(s-ee-1);)E++,ee++;if(f[T]=E,E>o)y+=2;else if(ee>s)v+=2;else if(!h){var S=l+m-D;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
458
+ `)}const N1=[`text`,`number`,`boolean`,`date`,`list`,`object`];F(N1);const P1=Js([A(),j(),M()]),F1=Tc(()=>Js([P1.transform(e=>String(e)),ec(A(),I1),N(F1)])),I1=Tc(()=>Js([A(),j(),M(),N(F1),ec(A(),I1)]));function L1(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(L1(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:L1(r);return t}return e}const R1=Ac(L1,ec(A(),I1));ec(A(),Js([I1,Ls()]));function z1(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}const B1=P({docName:EO,summary:OO,content:A().optional(),...DO}).loose(),V1=P({docName:EO,summary:OO,markdown:A(),position:F([`append`,`prepend`,`replace`]).optional(),extension:F(Bu).optional(),...DO}).loose(),H1=P({docName:EO,summary:OO,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...DO}).loose(),U1=P({docName:EO,connectionId:A().min(1),scope:F([`last`,`session`,`file`,`count`]).optional(),count:j().int().positive().optional(),...DO}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]}),W1=P({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),G1=Xs(`kind`,[P({kind:I(`inline`),content:A()}),P({kind:I(`truncated`),byteLength:j().int().nonnegative(),hint:A()})]),K1=P({kind:I(`content-divergence`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),divergenceType:A().optional(),currentState:G1.optional(),hint:A().optional()}).loose(),q1=P({type:I(`orphan`),parentCandidates:N(A()),message:A()}).loose(),J1=P({kind:I(`disk-edit-reconciled`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),mergeOutcome:A().optional(),hint:A().optional()}).loose(),Y1=Xs(`kind`,[K1,J1]),X1=Xs(`kind`,[K1,J1,P({kind:I(`mermaid-parse-error`),fenceIndex:j().int().positive(),fenceFirstLine:A(),message:A(),line:j().int().positive().optional()}).loose(),P({kind:I(`lint-violation`),source:A(),code:A(),message:A(),severity:F([`error`,`warning`,`info`,`hint`]),line:j().int().positive(),column:j().int().positive()}).loose()]),Z1=N(X1).min(1),Q1=P({href:A(),resolvedTo:A().nullable(),reason:F([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose(),$1=N(Q1),e0=P({timestamp:A().min(1),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional()}).loose(),t0=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:N(q1).optional(),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional(),brokenLinks:$1}).loose(),n0=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional(),brokenLinks:$1}).loose(),r0=P({docName:A().min(1),scope:F([`last`,`session`,`count`]),undone:M()}).loose(),i0=P({docName:EO,patch:ec(A(),Js([I1,Ls()])),types:ec(A(),F(N1)).optional(),summary:OO,...DO}).loose(),a0=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),appliedKeys:N(A()),summary:W1.optional(),warning:Y1.optional(),warnings:Z1.optional(),brokenLinks:$1}).loose(),o0=P({entries:N(P({level:F([`info`,`warn`,`error`]),message:A().max(8192),event:A().optional(),fields:ec(A(),Vs()).optional(),ts:j().optional(),sourceId:A().optional(),lineNumber:j().optional()}).loose()).max(100)}).loose(),s0=P({accepted:j().int().min(0)}).loose(),c0=P({status:A().min(1),reason:A()}).loose(),l0=P({docName:A().min(1),content:A(),lifecycle:c0.nullable()}).loose(),u0=P({documents:N(P({kind:F([`document`,`asset`,`folder`,`file`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:M().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:F([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:N(A().min(1)).optional(),hasChildren:M().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`})),truncated:M().optional()}).loose(),d0=P({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),f0=P({docName:A().min(1),backlinks:N(d0)}).loose(),p0=P({counts:ec(A().min(1),j().int().nonnegative())}).loose(),m0=Xs(`kind`,[P({kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),P({kind:I(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),h0=P({docName:A().min(1),forwardLinks:N(m0)}).loose(),g0=Xs(`kind`,[P({id:A().min(1),kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:N(A()).nullable()}).loose(),P({id:A().min(1),kind:I(`external`),url:A().min(1),label:A()}).loose()]),_0=P({source:A().min(1),target:A().min(1)}).loose(),v0=P({nodes:N(g0),links:N(_0)}).loose(),y0=P({ts:j().int().min(0),url:A(),method:A(),ua:A().optional(),origin:A().optional(),referer:A().optional(),host:A().optional(),remote:A().optional(),secChUa:A().optional(),secChUaMobile:A().optional(),secChUaPlatform:A().optional(),secFetchSite:A().optional(),secFetchDest:A().optional(),secFetchMode:A().optional(),secFetchUser:A().optional()}).loose(),b0=P({app:Js([I(`cursor`),I(`codex`),I(`claude`),Ls()]),signals_fired:N(A())}).loose(),x0=P({entries:N(y0),count:j().int().min(0),detection:b0}).loose(),S0=P({writers:N(P({id:A().min(1),name:A().optional(),email:A().optional()}).loose()).optional(),summary:OO,...DO}).loose(),C0=P({checkpointRef:A().min(1)}).loose(),w0=P({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:N(A()),summaries:N(A()).optional()}).loose(),T0=P({entries:N(P({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:F([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:N(w0),checkpoint:Vs().nullable(),parentSha:A().nullable().optional()}).loose()),total:j().int().nonnegative().optional(),truncated:M().optional(),hasMore:M().optional()}).loose(),E0=P({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),D0=P({contentDir:A().min(1),pathSeparator:F([`/`,`\\`]),symlinkResolved:M()}).loose(),O0=N(Xs(`source`,[P({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:I(`flat`)}).loose(),P({docName:A().min(1),timestamp:A().min(1),source:I(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),k0=P({domain:A().min(1),title:A().optional(),description:A().optional(),siteName:A().optional(),faviconDataUri:A().optional()}).loose(),A0=P({url:A()}).loose(),j0=Xs(`ok`,[P({ok:I(!0),metadata:k0}).loose(),P({ok:I(!1),reason:A()}).loose()]),M0=P({orphans:N(P({docName:A().min(1),title:A()}).loose())}).loose(),N0=P({hubs:N(P({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),P0=P({source:A().min(1),title:A(),snippet:A().nullable()}).loose(),F0=P({deadLinks:N(P({target:A().min(1),sources:N(P0)}).loose())}).loose(),I0=P({target:P({docName:A().min(1),title:A(),aliases:N(A())}).loose(),mentions:N(P({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:M()}).loose(),L0=P({projectPath:A().min(1)}).loose(),R0=F([`not-a-git-worktree`,`init-failed`]),z0=Xs(`ok`,[P({ok:I(!0),projectPath:A().min(1)}).loose(),P({ok:I(!1),reason:R0,message:A().min(1)}).loose()]),B0=P({host:A().min(1).optional()}).loose(),V0=P({key:A().min(1)}).loose(),H0=P({keyPresent:M()}).loose(),U0=P({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),W0=P({authenticated:M()}).loose(),G0=P({}).loose(),K0=P({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),q0=P({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:N(K0)}).loose(),J0=P({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),Y0=P({sessionAlive:M(),agent:J0.nullable(),files:N(q0)}).loose(),X0=P({diff:A(),before:A(),after:A(),generatedAt:j().int().min(0)}).loose(),Z0=P({}).loose(),Q0=P({}).loose(),$0=P({}).loose(),e2=P({}).loose(),t2=P({}).loose(),n2=P({}).loose(),r2=P({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:F([`idle`,`writing`]),ts:j().int().min(0)}).loose(),i2=P({presence:ec(A().min(1),r2)}).loose(),a2=ec(A().min(1),M()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});P({path:A().min(1,`path must be non-empty`)}).loose();const o2=P({}).loose(),s2=P({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),c2=P({fromPath:A().min(1),toPath:A().min(1)}).loose(),l2=P({}).loose(),u2=P({path:A().min(1),...DO,summary:OO}).loose(),d2=P({docName:A().min(1)}).loose(),f2=P({path:A().min(1),...DO,summary:OO}).loose(),p2=P({path:A().min(1)}).loose(),m2=P({kind:F([`file`,`folder`]),path:A().min(1),...DO,summary:OO}).loose(),h2=P({kind:F([`file`,`folder`]),path:A().min(1),duplicatedDocNames:N(A().min(1))}).loose(),g2=P({pages:N(P({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1),icon:A().min(1).max(2048).optional()}).loose())}).loose(),_2=P({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),v2=P({docName:A().min(1),headings:N(_2)}).loose(),y2=P({docName:A().min(1),rewrites:j().int().nonnegative()}).loose(),b2=P({kind:F([`file`,`folder`,`asset`]),fromPath:A().min(1),toPath:A().min(1),...DO,summary:OO}).loose(),x2=P({renamed:N(s2),renamedAssets:N(c2),rewrittenDocs:N(y2).optional(),summary:W1.optional()}).loose(),S2=P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...DO}).loose(),C2=P({deletedDocNames:N(A().min(1))}).loose(),w2=P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...DO,summary:OO}).loose(),T2=P({deletedDocNames:N(A().min(1))}).loose(),E2=P({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:OO,...DO}).loose(),D2=P({restoredFrom:A().min(1),timestamp:A().min(1),summary:W1.optional(),warning:K1.optional(),warnings:Z1.optional()}).loose(),O2=F([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),k2=P({label:A().min(1),webUrl:gs().nullable()}).loose(),A2=Xs(`checkStatus`,[P({checkStatus:I(`allowed`)}).loose(),P({checkStatus:I(`denied`),deniedReason:F([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),P({checkStatus:I(`unknown`),unknownError:F([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),j2=F([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),M2=P({state:O2,lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:M(),syncEnabled:M(),identityUnresolved:M(),remote:k2.nullable().optional(),pushError:A().optional(),pushErrorCode:j2.optional(),pullError:A().optional(),pullErrorCode:j2.optional(),pausedReason:A().optional(),pushPermission:A2.optional()}).loose(),N2=P({op:F([`sync`,`push`,`pull`]).optional()}).loose(),P2=P({op:F([`sync`,`push`,`pull`])}).loose(),F2=P({conflicts:N(P({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),I2=P({file:A().min(1),strategy:F([`mine`,`theirs`,`content`,`delete`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),L2=P({}).loose(),R2=P({file:A().min(1),base:A(),ours:A(),theirs:A(),kind:F([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:A().nullable()}).loose(),z2=P({plan:Dc(e=>e!==void 0,{message:`plan is required`})}).loose(),B2=P({plan:Dc(e=>e!==void 0,{message:`plan is required`})}).loose(),V2=P({result:Dc(e=>e!==void 0,{message:`result is required`})}).loose(),H2=P({path:A().min(1),summary:A().min(1)}).loose(),U2=P({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose(),W2=P({packs:N(P({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:N(H2),entryCounts:U2}).loose())}).loose(),G2=P({noOpen:M().optional(),out:A().min(1).optional()}).loose(),K2=P({reason:F([`unsupported-platform`,`spawn-error`]),message:A()}).loose(),q2=Xs(`status`,[P({status:I(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),P({status:I(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:K2.optional()}).loose(),P({status:I(`failed`),buildError:A()}).loose(),P({status:I(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),J2=[`.ok`,`skill-targets.json`],Y2=F(Ku),X2=Ks({schema:I(1),targets:N(Y2).default([])});function Z2(e){let t;try{t=JSON.parse(e)}catch{return null}let n=X2.safeParse(t);return n.success?n.data:null}const Q2=P({tags:N(P({name:A().min(1),count:j().int().nonnegative(),isLeaf:M()}).loose())}).loose(),$2=P({docName:A().min(1),title:A(),matchingTags:N(A().min(1)),snippet:A().nullable()}).loose(),e4=P({name:A().min(1),docs:N($2)}).loose(),t4=P({folder:Vs(),frontmatter_local:ec(A(),Vs()).nullable()}).loose(),n4=P({path:A(),frontmatter:ec(A(),Vs()).optional()}).loose(),r4=P({applied:Vs()}).loose(),i4=ec(A(),Vs()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),a4=P({template:P({name:A().min(1),folder:A(),scope:F([`local`,`inherited`]),path:A().min(1),frontmatter:i4,body:A()}).strict()}).strict(),o4=P({templates:N(P({name:A().min(1),title:A().optional(),description:A().optional(),path:A().min(1),source_folder:A()}).strict()),truncated:M()}).strict(),s4=P({folder:A(),name:A(),body:A().optional(),frontmatter:i4.optional(),...DO,summary:OO}).strict(),c4=P({path:A().min(1),created:M(),warnings:N(A())}).strict(),l4=P({existed:M(),path:A().min(1)}).strict(),u4=P({fromFolder:A(),fromName:A(),toFolder:A(),toName:A(),body:A().optional(),frontmatter:i4.optional(),...DO,summary:OO}).strict(),d4=P({from:A().min(1),to:A().min(1),committed:M()}).strict(),f4=F(Tu),p4=/^[a-z0-9-]+$/,m4=/<\/?[A-Za-z][^>]*>/;function h4(e){return m4.test(e)}const g4=/^[A-Za-z0-9_-]+$/,_4=P({name:A(),description:A()}).strict(),v4=P({skill:P({name:A().min(1),scope:f4,path:A().min(1),frontmatter:_4,body:A(),files:N(P({path:A().min(1),text:A().nullable()})).optional(),managed:M().optional()}).strict()}).strict(),y4=P({skills:N(P({name:A().min(1),description:A().optional(),scope:f4,path:A().min(1),absolutePath:A().min(1).optional(),installed:M(),hosts:N(A()),installedVersion:A().optional(),bundledVersion:A().optional(),updateAvailable:M().optional(),managed:M().optional()}).strict()),truncated:M()}).strict(),b4=P({scope:f4.default(`project`),name:A(),body:A().optional(),frontmatter:_4,...DO,summary:OO}).strict(),x4=P({path:A().min(1),created:M(),warnings:N(A())}).strict(),S4=P({scope:f4.default(`project`),name:A(),...DO,summary:OO}).strict(),C4=P({name:A().min(1),version:A().min(1),previousVersion:A().optional(),checkpointRef:A().optional()}).strict(),w4=P({existed:M(),path:A().min(1)}).strict(),T4=P({scope:f4.default(`project`),fromName:A(),toName:A(),body:A().optional(),frontmatter:_4.optional(),...DO,summary:OO}).strict(),E4=P({from:A().min(1),to:A().min(1),committed:M()}).strict(),D4=F([`reference`,`script`]),O4=P({scope:f4.default(`project`),name:A(),path:A().min(1),content:A(),...DO,summary:OO}).strict(),k4=P({path:A().min(1),created:M(),kind:D4,content:M()}).strict(),A4=P({path:A().min(1),kind:D4,text:A()}).strict(),j4=P({path:A().min(1),existed:M(),kind:D4}).strict(),M4=P({scope:f4.default(`project`),name:A(),targets:N(Y2).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...DO,summary:OO}).strict(),N4=P({name:A().min(1),hosts:N(A()),scripts:M(),warnings:N(A()),warningCodes:N(F([`no-targets`,`scripts-present`]))}).strict(),P4=P({scope:f4.default(`project`),name:A()}).strict(),F4=P({name:A().min(1),uninstalled:M()}).strict(),I4=P({targets:N(Y2),configured:M()}).strict(),L4=P({targets:N(Y2)}).strict(),R4=P({targets:N(Y2),reprojected:N(P({name:A(),hosts:N(A())}).strict()),bundleHosts:N(A()),removedFrom:N(A())}).strict(),z4=P({scope:f4.default(`project`),name:A(),version:A().regex(/^[0-9a-f]{40}$/i),...DO,summary:OO}).strict(),B4=P({name:A().min(1),version:A(),restoredFiles:N(A()),warnings:N(A())}).strict(),V4=P({query:A().optional(),intent:F([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:F([`navigation`,`relevance`]).optional(),scopes:N(F([`page`,`folder`,`content`,`file`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional(),semantic:M().optional(),source:F([`omnibar`,`mcp`,`http`]).optional()}).loose(),H4=P({kind:F([`page`,`folder`,`content`,`file`]),path:A().min(1),title:A(),score:j(),signals:ec(A(),Vs()),snippet:A().optional()}).loose(),U4=P({capable:M(),applied:M(),coverage:P({embedded:j().int().nonnegative(),total:j().int().nonnegative()})}).loose(),W4=P({enabled:M(),keyPresent:M(),keySource:F([`file`,`env`]).nullable(),keyHint:A().nullable(),ready:M(),capable:M(),embedded:j().int().nonnegative(),total:j().int().nonnegative()}).loose(),G4=P({query:A(),intent:F([`autocomplete`,`full_text`,`omnibar`]),results:N(H4),elapsedMs:j().nonnegative(),semantic:U4.optional(),truncated:M().optional(),ready:M().optional()}).loose(),K4=P({version:A().min(1),recordedAt:A().min(1)}).loose(),q4=P({currentVersion:A().min(1),targets:ec(A(),K4.nullable())}).loose(),J4=`server-info`,Y4=`branch-switched`,X4=`disk-ack`,Z4=`config-validation-rejected`,Q4=`config-ignore-nested-error`,$4=F([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),e3=P({v:I(1),ch:I(J4),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),t3=P({v:I(1),ch:I(Y4),seq:j(),branch:A().min(1)}).loose(),n3=P({v:I(1),ch:$4,seq:j()}).loose(),r3=P({v:I(1),ch:I(X4),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),i3=P({v:I(1),ch:I(Z4),seq:j(),docName:A().min(1),error:tu}).loose(),a3=P({v:I(1),ch:I(Q4),seq:j(),path:A().min(1),error:A().min(1)}).loose();var o3=t(r(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var D=-b+v;D<=b-y;D+=2){for(var T=l+D,E=D==-b||D!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,ee=E-D;E<o&&ee<s&&e.charAt(o-E-1)==t.charAt(s-ee-1);)E++,ee++;if(f[T]=E,E>o)y+=2;else if(ee>s)v+=2;else if(!h){var S=l+m-D;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
459
459
  `,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&amp;`).replace(o,`&lt;`).replace(s,`&gt;`).replace(c,`&para;<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
460
460
  `),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
461
461
  `],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
@@ -500,4 +500,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
500
500
  `);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=z9(n.join(`
501
501
  `))[R9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
502
502
  `).replace(/\n+$/,``)}}function V9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=dC(t);if(n===``)return{identity:{},starterContent:t};let i=pC(n),a=nte(i);if(a)return{identity:a.identity,starterContent:B9(a.docFrontmatterText,r)};let{frontmatter:o}=dC(r);if(o!==``)return{identity:z9(i),starterContent:r};let s=z9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:B9(i,r)}}function rte(e,t){let{docFrontmatterText:n,markdown:r}=tte(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,jc.stringify)({[R9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function ite(e){return V9(e).starterContent}function ate(){let e=!1,t=``,n=0;return r=>{let i=ote(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function ote(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}const ste=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],H9={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function cte(e,t=ste){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const lte={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function U9(e){return e?lte[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const ute={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function dte(e){let t=e?.trim();return t?ute[U9(t)]??t:`Agent`}function W9(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}const G9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function K9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function q9(e){let t=e.trim();return G9.test(t)||t.startsWith(`//`)}function fte(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(q9(n))return{kind:`external`,url:n};let r=W9(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=K9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function pte(e,t){let n=e.trim();if(!n)return null;if(q9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=K9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function mte(e,t){let n=e.trim();if(!n||G9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function J9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function Y9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function X9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Z9(e){return e.split(`/`).filter(e=>e!==``)}function hte(e,t){let n=X9(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function Q9(e,t){let n=X9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:Z9(r).length}function $9(e,t){let n=Z9(e),r=Z9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function gte(){let e=new Map;function t(t){let n=J9(t);if(n===``)return;let r=Y9(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=J9(t),r=Y9(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=X9(J9(n)),o=[],s=[];for(let e of i)hte(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=Q9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=Q9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=$9(a,X9(t));for(let r=1;r<e.length;r++){let i=e[r],o=$9(a,X9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function _te(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function vte(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}export{g3 as $,Hc as $a,Zu as $i,L0 as $n,K$ as $r,c4 as $t,P6 as A,hu as Aa,wO as Ai,b2 as An,ri as Ao,B1 as Ar,T4 as At,f6 as B,Rl as Ba,Jp as Bi,n2 as Bn,O as Bo,g1 as Br,P4 as Bt,Nee as C,zu as Ca,HO as Ci,S2 as Cn,A as Co,X1 as Cr,A4 as Ct,R6 as D,Ou as Da,GO as Di,l2 as Dn,zo as Do,r0 as Dr,M4 as Dt,F6 as E,Mu as Ea,ZO as Ei,h2 as En,gs as Eo,U1 as Er,v4 as Et,E6 as F,nu as Fa,pO as Fi,T2 as Fn,yn as Fo,I1 as Fr,B4 as Ft,N3 as G,Al as Ga,od as Gi,$0 as Gn,y as Go,c1 as Gr,g4 as Gt,U3 as H,Il as Ha,cd as Hi,o2 as Hn,gt as Ho,u1 as Hr,S4 as Ht,x6 as I,ql as Ia,fC as Ii,Y0 as In,dn as Io,z1 as Ir,f4 as It,k3 as J,Nl as Ja,nd as Ji,B0 as Jn,t1 as Jr,l4 as Jt,M3 as K,kl as Ka,id as Ki,Z0 as Kn,v as Ko,n1 as Kr,e4 as Kt,m6 as L,Jl as La,dC as Li,X0 as Ln,Ht as Lo,S1 as Lr,I4 as Lt,A6 as M,mu as Ma,bO as Mi,E2 as Mn,pn as Mo,Q1 as Mr,b4 as Mt,k6 as N,lu as Na,yO as Ni,D2 as Nn,hn as No,i0 as Nr,x4 as Nt,z6 as O,Au as Oa,QO as Oi,v2 as On,Lo as Oo,V1 as Or,q4 as Ot,D6 as P,au as Pa,_O as Pi,w2 as Pn,_n as Po,a0 as Pr,z4 as Pt,h3 as Q,qc as Qa,$u as Qi,V0 as Qn,q$ as Qr,s4 as Qt,b6 as R,Gl as Ra,pC as Ri,a2 as Rn,At as Ro,j1 as Rr,L4 as Rt,$ee as S,Eu as Sa,BO as Si,d2 as Sn,ec as So,s0 as Sr,j4 as St,Kee as T,Lu as Ta,ak as Ti,m2 as Tn,Vs as To,n0 as Tr,k4 as Tt,L3 as U,jl as Ua,sd as Ui,e2 as Un,b as Uo,l1 as Ur,C4 as Ut,K3 as V,zl as Va,L as Vi,t2 as Vn,vt as Vo,m1 as Vr,F4 as Vt,P3 as W,Ml as Wa,ad as Wi,Q0 as Wn,x as Wo,s1 as Wr,y4 as Wt,b3 as X,Pl as Xa,td as Xi,W0 as Xn,i1 as Xr,u4 as Xt,O3 as Y,Fl as Ya,ed as Yi,U0 as Yn,r1 as Yr,a4 as Yt,C3 as Z,Uc as Za,Qu as Zi,H0 as Zn,Z$ as Zr,d4 as Zt,Jee as _,Cu as _a,rk as _i,N2 as _n,Ks as _o,u0 as _r,p4 as _t,pte as a,Ku as aa,GV as ai,Z2 as an,ul as ao,k0 as ar,i3 as at,Qee as b,Du as ba,RO as bi,p2 as bn,oc as bo,v0 as br,W4 as bt,H9 as c,Hu as ca,ck as ci,B2 as cn,F as co,T0 as cr,e3 as ct,U9 as d,_u as da,gk as di,z2 as dn,N as do,S0 as dr,Z4 as dt,Uu as ea,qY as ei,o4 as en,Kc as eo,z0 as er,y3 as et,ate as f,Su as fa,mk as fi,R2 as fn,M as fo,C0 as fr,X4 as ft,V9 as g,yu as ga,tk as gi,M2 as gn,I as go,f0 as gr,r4 as gt,ite as h,bu as ha,ek as hi,L2 as hn,Qs as ho,p0 as hr,n4 as ht,fte as i,Yu as ia,QH as ii,X2 as in,cl as io,I0 as ir,a3 as it,O6 as j,du as ja,SO as ji,x2 as jn,gr as jo,e0 as jr,E4 as jt,B6 as k,Fu as ka,UO as ki,g2 as kn,da as ko,t0 as kr,N4 as kt,cte as l,Vu as la,fk as li,V2 as ln,Ls as lo,E0 as lr,Y4 as lt,rte as m,vu as ma,dk as mi,I2 as mn,Xs as mo,x0 as mr,t4 as mt,vte as n,Xu as na,PY as ni,J2 as nn,Gc as no,N0 as nr,u3 as nt,mte as o,Ju as oa,lk as oi,G2 as on,Ms as oo,A0 as or,n3 as ot,R9 as p,xu as pa,pk as pi,F2 as pn,Dc as po,D0 as pr,J4 as pt,A3 as q,Ol as qa,rd as qi,G0 as qn,Y$ as qr,Q2 as qt,gte as r,Gu as ra,OK as ri,Y2 as rn,Wc as ro,M0 as rr,t3 as rt,W9 as s,qu as sa,hk as si,q2 as sn,ac as so,j0 as sr,r3 as st,_te as t,Wu as ta,FY as ti,h4 as tn,ll as to,F0 as tr,d3 as tt,dte as u,Bu as ua,sk as ui,W2 as un,zs as uo,O0 as ur,Q4 as ut,Yee as v,wu as va,AO as vi,P2 as vn,j as vo,l0 as vr,V4 as vt,Mee as w,Pu as wa,ik as wi,C2 as wn,Js as wo,H1 as wr,O4 as wt,ete as x,gu as xa,LO as xi,u2 as xn,Ac as xo,o0 as xr,w4 as xt,I9 as y,Tu as ya,NO as yi,f2 as yn,P as yo,h0 as yr,G4 as yt,p6 as z,Bl as za,ix as zi,i2 as zn,k as zo,M1 as zr,R4 as zt};
503
- //# sourceMappingURL=src-BU7I7py6.mjs.map
503
+ //# sourceMappingURL=src-BgrRg-nl.mjs.map
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{Ho as t,M as n}from"./src-BU7I7py6.mjs";import{Mr as r,Tr as i,et as a,fa as o,la as s,nn as c,nt as l,rt as u,tt as d}from"./src-C0CgVA8i.mjs";import{b as f,u as p,v as m,y as h}from"./server-lock-wMKEjgnN.mjs";import{t as g}from"./yazl-BucAN8Ez.mjs";import{t as _}from"./esm-EvSEzE_V.mjs";import"./gh-detect-93wtg_nV.mjs";import{E as v,S as y,T as b,_ as ee,b as te,o as x,v as S,w as C}from"./init-CINP1v0y.mjs";import{n as ne}from"./constants-B51-MH_i.mjs";import{t as w}from"./is-object-DYBErO9v.mjs";import{_ as T,d as E,i as D,v as O}from"./write-project-skill-DkTM_Oeh.mjs";import"./loader-a2k4G6Yz.mjs";import{c as re}from"./colors-CpVsnmzb.mjs";import"./preview-CvyqQIIL.mjs";import{execSync as ie,spawnSync as ae}from"node:child_process";import{basename as k,dirname as A,isAbsolute as oe,join as j,relative as se,resolve as M,sep as ce}from"node:path";import{cpSync as le,createWriteStream as ue,existsSync as N,lstatSync as de,mkdirSync as P,mkdtempSync as fe,readFileSync as F,readdirSync as I,readlinkSync as pe,rmSync as L,statSync as me,writeFileSync as R}from"node:fs";import{arch as he,freemem as ge,homedir as _e,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import{readFile as z,realpath as B}from"node:fs/promises";import{createHash as V}from"node:crypto";const Te=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],Ee=Te.map(e=>e.name);function H(e){let t=new Set,n=0;return{redacted:e.split(`
1
+ import{o as e}from"./chunk-DTipWd-i.mjs";import{Ho as t,M as n}from"./src-BgrRg-nl.mjs";import{Mr as r,Tr as i,et as a,fa as o,la as s,nn as c,nt as l,rt as u,tt as d}from"./src-D87GkAFF.mjs";import{b as f,u as p,v as m,y as h}from"./server-lock-Cn2-KrjV.mjs";import{t as g}from"./yazl-BucAN8Ez.mjs";import{t as _}from"./esm-EvSEzE_V.mjs";import"./gh-detect-dM8nUKzs.mjs";import{E as v,S as y,T as b,_ as ee,b as te,o as x,v as S,w as C}from"./init-Ci1MYYU2.mjs";import{n as ne}from"./constants-pfoTSanN.mjs";import{t as w}from"./is-object-DYBErO9v.mjs";import{_ as T,d as E,i as D,v as O}from"./write-project-skill-CLggzjLg.mjs";import"./loader-CAkdpGQG.mjs";import{c as re}from"./colors-CpVsnmzb.mjs";import"./preview-DJCHpjjT.mjs";import{execSync as ie,spawnSync as ae}from"node:child_process";import{basename as k,dirname as A,isAbsolute as oe,join as j,relative as se,resolve as M,sep as ce}from"node:path";import{cpSync as le,createWriteStream as ue,existsSync as N,lstatSync as de,mkdirSync as P,mkdtempSync as fe,readFileSync as F,readdirSync as I,readlinkSync as pe,rmSync as L,statSync as me,writeFileSync as R}from"node:fs";import{arch as he,freemem as ge,homedir as _e,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import{readFile as z,realpath as B}from"node:fs/promises";import{createHash as V}from"node:crypto";const Te=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],Ee=Te.map(e=>e.name);function H(e){let t=new Set,n=0;return{redacted:e.split(`
2
2
  `).map(e=>{let r=e;for(let{name:e,regex:i,replacement:a}of Te)i.lastIndex=0,i.test(r)&&(t.add(e),n++,i.lastIndex=0,r=r.replace(i,a));return r}).join(`
3
3
  `),patterns:[...t],lineCount:n}}function De(){return j(_e(),`.ok`,`bug-reports`)}function Oe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`);return j(De(),`${t}-bugreport.zip`)}function ke(e,t){let n=j(e,`.ok`,`config.yml`);if(N(n))try{let e=F(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e instanceof Error?e.message:String(e)},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return N(j(e,`.ok`))?V(`sha256`).update(M(e)).digest(`hex`).slice(0,12):null}function Ae(){let e={timestamp:new Date().toISOString(),platform:ye(),osType:Ce(),osRelease:be(),hostname:`[redacted]`,uptime:we(),freeMem:ge(),totalMem:Se(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ie(`sw_vers -productVersion 2>/dev/null`,r({encoding:`utf8`})).trim()}catch{}try{let t=j(__dirname,`..`,`..`,`package.json`);N(t)&&(e.okVersion=JSON.parse(F(t,`utf8`)).version)}catch{}return e}function je(e,t){if(!N(t))return{files:[]};let n=I(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>j(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return F(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Me(e){let t=j(e,`.ok`,`local`);return N(t)?{files:[`server.lock`,`last-spawn-error.log`].map(e=>j(t,e)).filter(e=>N(e))}:{files:[]}}function Ne(e){let t=j(e,`.ok`,`local`,`logs`);return N(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>j(t,e)).filter(e=>N(e))}:{files:[]}}function Pe(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=H(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function U(e){for(let t of e.files)try{Pe({zipfile:e.zipfile,name:`${e.prefix}/${k(t)}`,content:F(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n instanceof Error?n.message:String(n)},`bug-report: skipped unreadable file`)}}async function Fe(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??j(_e(),`.ok`,`logs`),o=t.projectDir?ke(t.projectDir,i):null;P(A(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Ae();s.desktop=t.desktop??null;let{files:c}=je(o,a),{files:l}=t.projectDir?Me(t.projectDir):{files:[]},{files:u}=t.projectDir?Ne(t.projectDir):{files:[]};i?.info({logFileCount:c.length,lockFileCount:l.length,localSinkFileCount:u.length},`files collected`);let d=[],f=[],{ZipFile:p}=await import(`./yazl-DvlathRc.mjs`).then(t=>e(t.default,1)),m=new p;U({zipfile:m,files:c,prefix:`logs`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:l,prefix:`lockdir`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:u,prefix:`local-logs`,redact:n,bundleFiles:f,redactions:d,logger:i});for(let e of t.extraFiles??[])try{let t=F(e.sourcePath),n=`extra/${e.zipName??k(e.sourcePath)}`;m.addBuffer(t,n),f.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Pe({zipfile:m,name:`note.txt`,content:t.note,redact:n,bundleFiles:f,redactions:d});let h=JSON.stringify(s,null,2);m.addBuffer(Buffer.from(h,`utf8`),`sysinfo.json`),f.push(`sysinfo.json`);let g={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:f,redactions:d,sysinfo:s};m.addBuffer(Buffer.from(JSON.stringify(g,null,2),`utf8`),`MANIFEST.json`);let _=d.reduce((e,t)=>e+t.lineCount,0),v=[`# Bug Report Bundle`,``,`Generated: ${g.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${g.disciplineVersion}`,``,`## Contents`,``,...f.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${Ee.join(`, `)}`,_>0?`${_} line(s) were scrubbed across ${d.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
4
4
  `);m.addBuffer(Buffer.from(v,`utf8`),`README.md`),m.end();let y=ue(r);return m.outputStream.pipe(y),await new Promise((e,t)=>{y.on(`close`,e),y.on(`error`,t)}),i?.info({bundlePath:r,fileCount:f.length,redactionCount:_},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:f,redactions:d,redactedLineCount:_,generatedAt:g.generatedAt}}}var W=t(),Ie=e(g(),1);const Le=new Set([`doc.name`]);function Re(e){return`doc:${V(`sha256`).update(e).digest(`hex`).slice(0,8)}`}function ze(e,t,n){let r=e.docNameMap[n];if(r===void 0){e.docNameMap[n]=t;return}if(r===t)return;let i=e.docNameCollisions[n];i?i.includes(t)||i.push(t):e.docNameCollisions[n]=[t]}function Be(e,t){let n=t.originalToHashed.get(e);if(n!==void 0)return n;let r=Re(e);return t.originalToHashed.set(e,r),ze(t,e,r),r}function G(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return G(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!Ve(e))return e;let n=typeof e.key==`string`&&Le.has(e.key)&&Ve(e.value)&&typeof e.value.stringValue==`string`?e.value.stringValue:null,r={};for(let[i,a]of Object.entries(e))if(n!==null&&i===`value`&&Ve(a)){let e=Be(n,t);r[i]={...a,stringValue:e}}else Le.has(i)&&typeof a==`string`?r[i]=Be(a,t):r[i]=K(a,t);return r}function He(e,t){if(t.originalToHashed.size===0)return e;let n=Array.from(t.originalToHashed.entries()).sort(([e],[t])=>t.length-e.length),r=e;for(let[e,t]of n)e.length!==0&&r.includes(e)&&(r=r.split(e).join(t));return r}function Ue(e,t){let n=F(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
@@ -18,4 +18,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{Ho as t,M as n}from"./src-BU7I7p
18
18
  `).replace(/\n/g,`\r
19
19
  `));let d=`${i?``:``}${u}`;return d!==r&&o(e,d,{mode:C(e)}),{kind:`removed`}}const Jt=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Yt(e,t,n=c){if(e!==void 0&&!Jt.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Xt=null;function Zt(e){Xt=e}function Qt(){return Xt??process.cwd()}function $t(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function en(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function tn(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:d(r),command:r,isDesktop:$t(r)}}function nn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&nn(e)?`ui-orphan`:`stale`}const rn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function an(e){switch(e){case`running`:return Z.default.green(e);case`desktop`:return Z.default.blue(e);case`foreign`:return Z.default.cyan(e);case`ui-orphan`:return Z.default.magenta(e);case`stale`:return Z.default.yellow(e)}}function on(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function sn(e){return`${on(e.server.usage)} | ${on(e.ui?.usage??null)}`}function cn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function ln(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,cn(e),sn(e),t,String(n),en(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=an(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=Z.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
20
20
  `)}async function un(e={}){let t=e.discover??a,n=e.inspect??X,r=e.log??(e=>console.log(e)),i=e.resolveCommand??l,o=e.resolveUsage??u,s=await t(),c=[];for(let e of s){let t=n(e,`server`),r=n(e,`ui`),a=tn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:o(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:o(r.lock.pid));a!=null&&c.push(a)}if(e.json){let e=c.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(ln(e.all?c:c.filter(e=>rn.has(Q(e)))))}function dn(){return new _(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await un({all:t.all===!0||e===`all`,json:t.json===!0})})}function fn(e,t,n={}){let r=n.isAlive??h,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function pn(e){let t=e.inspect??(t=>X(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=fn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function mn(e,t=h){let n=await a(),r=null;for(let i of n){let n=X(i,`server`),a=X(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function hn(e){let t=pn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function gn(e){return new _(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=pn({lockDir:i(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await un({});return}if(n===`all`){let e=await a();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=X(n,`server`),r=X(n,`ui`);!$(e,h)&&!$(r,h)||(hn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await mn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}hn(t);return}hn(i(M(Qt(),n)))})}function _n(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function vn(e,t){let n,r;try{n=await B(M(e)),r=await B(M(A(e)))}catch{return{kind:`not-git`}}if(!bn(n,r))return{kind:`symlink-escape`};let i=j(n,`.git`),a;try{a=me(i)}catch{return{kind:`not-git`}}let o;if(a.isDirectory()){let e;try{e=await B(i)}catch{return{kind:`not-git`}}if(!bn(e,n))return{kind:`symlink-escape`};o=e}else if(a.isFile()){let e;try{e=await z(i,`utf-8`)}catch{return{kind:`not-git`}}let t=/^gitdir:\s*(.+)$/m.exec(e.trim());if(!t)return{kind:`not-git`};let r=t[1].trim(),a=oe(r)?r:M(n,r);try{o=await B(a)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let s=j(await yn(o),`config`),c;try{c=await z(s,`utf-8`)}catch{return{kind:`not-git`}}let l=Sn(c);if(l===null)return{kind:`no-origin`};let u=At(l);if(u===null||u.hostname!==`github.com`)return{kind:`non-github`};let d=u.owner.toLowerCase()===t.owner.toLowerCase(),f=u.name.toLowerCase()===t.repo.toLowerCase();return!d||!f?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://github.com/${u.owner}/${u.name}.git`}}async function yn(e){let t;try{t=(await z(j(e,`commondir`),`utf-8`)).trim()}catch{return e}if(t.length===0)return e;let n=oe(t)?t:M(e,t);try{return await B(n)}catch{return n}}function bn(e,t){if(e===t)return!0;let n=se(t,e);return n.length>0&&!n.startsWith(`..`)&&!oe(n)}function xn(e){let t=e.indexOf(`#`),n=e.indexOf(`;`),r=-1;return t>=0&&n>=0?r=Math.min(t,n):t>=0?r=t:n>=0&&(r=n),(r===-1?e:e.slice(0,r)).trim()}function Sn(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=xn(n);if(e.length===0)continue;if(e.startsWith(`[`)){t=/^\[\s*remote\s+["']origin["']\s*\]$/.test(e);continue}if(!t)continue;let r=/^url\s*=\s*(.+)$/.exec(e);if(r)return Cn(r[1])}return null}function Cn(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const wn=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=S(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=D(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function Tn(e,t,n={},r=wn){let i=[];for(let a of t){let t=E[a];for(let a of r)i.push(a.write(t,e,n))}return i}function En(e,t,n={}){return{integrations:Tn(e,t,n)}}export{Ot as C,H as D,Oe as E,X as S,Tt as T,Bt as _,gn as a,Mt as b,Zt as c,Pt as d,It as f,zt as g,Lt as h,pn as i,Yt as l,Vt as m,vn as n,dn as o,Ft as p,_n as r,Qt as s,En as t,Wt as u,jt as v,wt as w,At as x,Nt as y};
21
- //# sourceMappingURL=src-cvLOShuL.mjs.map
21
+ //# sourceMappingURL=src-BrhuhPOn.mjs.map
@@ -1 +1 @@
1
- import{Go as e,Ji as t,S as n,Xi as r,Yi as i,d as a,da as o,l as s,la as c,v as l,xa as u}from"./src-BU7I7py6.mjs";import{$ as d,$i as f,$r as p,$t as m,A as h,Aa as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Ci as O,Cn as k,Cr as A,Ct as j,D as M,Da as N,Di as P,Dn as F,Dr as I,Dt as L,E as R,Ea as z,Ei as B,En as V,Er as H,Et as U,F as W,Fi as G,Fn as K,Fr as q,Ft as J,G as Y,Gi as X,Gn as Z,Gr as Q,Gt as $,H as ee,Hi as te,Hn as ne,Hr as re,Ht as ie,I as ae,Ii as oe,In as se,Ir as ce,It as le,J as ue,Ji as de,Jn as fe,Jr as pe,Jt as me,K as he,Ki as ge,Kn as _e,Kr as ve,Kt as ye,L as be,Li as xe,Ln as Se,Lr as Ce,Lt as we,M as Te,Ma as Ee,Mi as De,Mn as Oe,Mr as ke,Mt as Ae,N as je,Na as Me,Ni as Ne,Nn as Pe,Nr as Fe,Nt as Ie,O as Le,Oa as Re,Oi as ze,On as Be,Or as Ve,Ot as He,P as Ue,Pa as We,Pi as Ge,Pn as Ke,Pr as qe,Pt as Je,Q as Ye,Qi as Xe,Qr as Ze,Qt as Qe,R as $e,Ri as et,Rn as tt,Rr as nt,Rt as rt,S as it,Sa as at,Si as ot,Sn as st,Sr as ct,St as lt,T as ut,Ta as dt,Ti as ft,Tn as pt,Tr as mt,Tt as ht,U as gt,Ui as _t,Un as vt,Ur as yt,Ut as bt,V as xt,Vi as St,Vn as Ct,Vr as wt,Vt as Tt,W as Et,Wi as Dt,Wn as Ot,Wr as kt,Wt as At,X as jt,Xi as Mt,Xn as Nt,Xr as Pt,Xt as Ft,Y as It,Yi as Lt,Yn as Rt,Yr as zt,Yt as Bt,Z as Vt,Zi as Ht,Zn as Ut,Zr as Wt,Zt as Gt,_ as Kt,_a as qt,_i as Jt,_n as Yt,_r as Xt,_t as Zt,a as Qt,aa as $t,ai as en,an as tn,ar as nn,at as rn,b as an,ba as on,bi as sn,bn as cn,br as ln,bt as un,c as dn,ci as fn,cn as pn,cr as mn,d as hn,di as gn,dn as _n,dr as vn,ea as yn,ei as bn,en as xn,et as Sn,f as Cn,fi as wn,fn as Tn,fr as En,g as Dn,ga as On,gi as kn,gn as An,gr as jn,gt as Mn,h as Nn,ha as Pn,hi as Fn,hn as In,hr as Ln,ht as Rn,i as zn,ia as Bn,ii as Vn,in as Hn,ir as Un,it as Wn,j as Gn,ja as Kn,ji as qn,jn as Jn,jr as Yn,jt as Xn,k as Zn,ka as Qn,ki as $n,kn as er,kr as tr,kt as nr,l as rr,li as ir,ln as ar,lr as or,m as sr,ma as cr,mi as lr,mn as ur,mr as dr,mt as fr,n as pr,na as mr,ni as hr,nn as gr,nt as _r,o as vr,oa as yr,oi as br,on as xr,or as Sr,ot as Cr,p as wr,pa as Tr,pi as Er,pn as Dr,pr as Or,pt as kr,q as Ar,qi as jr,qn as Mr,qr as Nr,qt as Pr,r as Fr,ra as Ir,ri as Lr,rn as Rr,rr as zr,rt as Br,s as Vr,sa as Hr,si as Ur,sn as Wr,sr as Gr,t as Kr,ta as qr,ti as Jr,tn as Yr,tt as Xr,u as Zr,ui as Qr,un as $r,ur as ei,v as ti,va as ni,vi as ri,vn as ii,vr as ai,vt as oi,w as si,wa as ci,wi as li,wn as ui,wr as di,wt as fi,x as pi,xa as mi,xi as hi,xn as gi,xr as _i,xt as vi,y as yi,ya as bi,yi as xi,yn as Si,yr as Ci,yt as wi,z as Ti,zi as Ei,zn as Di,zr as Oi,zt as ki}from"./src-C0CgVA8i.mjs";import{_ as Ai,a as ji,b as Mi,c as Ni,f as Pi,g as Fi,h as Ii,i as Li,l as Ri,m as zi,n as Bi,o as Vi,p as Hi,r as Ui,s as Wi,t as Gi,u as Ki,v as qi,y as Ji}from"./server-lock-wMKEjgnN.mjs";export{Qn as AGENT_ID_MAX_LEN,g as AGENT_ID_RE,St as AGENT_WRITE_ORIGIN,bi as AgentFocusBroadcaster,Tr as AgentPresenceBroadcaster,te as AgentSessionCapacityError,_t as AgentSessionManager,fr as AutoStartDisabledError,tt as BUNDLE_IDS,Di as BUNDLE_SCOPE,C as BUNDLE_SKILL_NAME,Hn as BacklinkIndex,Lt as CC1Broadcaster,o as CC1_CONTRACT_VERSION,me as CONFIG_FILENAME,ir as CONFLICT_MARKER_RE,Gr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Kt as ConfigSchema,pe as DEFAULT_CHECKPOINT_RETENTION,_i as DEFAULT_EMBEDDINGS_DIMENSIONS,ht as DEFAULT_PACK_ID,ct as EMBEDDINGS_API_KEY_ENV,zt as FILE_SYSTEM_WRITER,Q as FILE_WATCHER_ORIGIN,jn as FileEmbeddingsBackend,bt as GIT_PREFLIGHT_FAIL_SPAN_NAME,Pt as GIT_UPSTREAM_WRITER,Me as GitDirAccessError,_n as GitNotAvailableError,Tn as GitTooOldError,Ne as HOCUSPOCUS_AUTH_REJECTION_REASONS,Ge as HocuspocusAuthRejection,G as HocuspocusAuthTokenSchema,Or as INSTALLED_AGENTS_SCHEMES,c as LINEAGE_EPOCH_KEY,be as LIVE_DERIVED_INDEX_DEBOUNCE_MS,U as LOG_MD_TEMPLATE,Mn as MANAGED_RENAME_ORIGIN,Dt as MAX_AGENT_SESSIONS,rn as MCP_CONNECTION_ID_HEADER,t as MCP_SERVER_NAME,Dr as MIN_GIT_VERSION,x as MISSING_OK_CONFIG_MESSAGE,We as MalformedGitPointerError,Vt as McpLogger,xt as MissingOkConfigError,tr as OBSERVER_SYNC_ORIGIN,Bt as OK_OKIGNORE_TEMPLATE,i as ORPHAN_MODES,e as PROTOCOL_VERSION,on as PinoLogger,Ni as ProcessLockCollisionError,rr as ProjectGitInitError,Zt as ROLLBACK_ORIGIN,Ft as ROOT_GITIGNORE_TEMPLATE,Fi as RUNTIME_VERSION,Wt as SERVICE_WRITER,Pe as SKILL_INSTALL_EVENTS_FILE_REL,l as SKILL_STATE_TARGETS,L as STARTER_FOLDERS,He as STARTER_FOLDER_FRONTMATTER_FILENAME,nr as STARTER_PACKS,b as STARTER_PACK_IDS,Xn as STARTER_TEMPLATES,ut as STATE_MANIFEST_FILENAME,Ai as STATE_SCHEMA_VERSION,u as SYSTEM_DOC_NAME,we as SeedPrerequisiteError,rt as SeedRootDirError,Gi as ServerLockCollisionError,Kr as SingleFileNotAFileError,pr as SingleFileNotFoundError,Fr as SingleFileNotMarkdownError,R as StateManifestError,si as TagIndex,Ct as USER_GLOBAL_BUNDLE_IDS,xr as UiLockCollisionError,oi as __getShowAllWalkStatsForTesting,wi as __resetShowAllWalkStatsForTesting,Ri as acquireProcessLock,Bi as acquireServerLock,Wr as acquireUiLock,X as applyAgentMarkdownWrite,ve as applyExternalChange,fi as applySeed,M as assertCompatibleStateManifest,ur as assertGitAvailable,Fe as assertNeverDiskEvent,kr as attachIdleShutdown,ti as bootServer,k as buildAndOpenSkill,Gt as buildConfigYmlContent,he as buildExecResult,K as buildSkillZip,Ae as buildStarterFolderFrontmatterYaml,Ze as buildWipTree,ne as bundleSkillMdPath,qe as classifyEvents,sn as classifyFsPath,Er as clearContributors,Xt as clearEmbeddingsKeyFromAllBackends,Ie as coercePackId,s as colorFromSeed,p as commitUpstreamImport,bn as commitWip,Jr as commitWipFromTree,In as compareSemver,Z as composeEffectiveLinterConfig,Qr as containsConflictMarkers,q as contentHash,lr as contributorCount,je as countShadowObjects,Ue as countStaleAgentWipRefs,W as countWipRefs,un as createApiExtension,H as createAssetServeMiddleware,zr as createContentFilter,Un as createContentFilterAsync,ai as createEmbeddingsSecretStore,zn as createEphemeralProjectDir,Nr as createExternalChangeHandler,Cn as createFileLogger,$e as createLiveDerivedIndexExtension,Et as createMcpHttpHandler,dr as createOsProbe,I as createPersistenceExtension,E as createServer,Gn as createServerObserverExtension,ge as createStreamingErrorWriter,mi as createTestLogger,Ci as describeStoredEmbeddingsKey,Dn as detectClaudeDesktopPresence,An as detectGit,Le as detectProjectShape,Sn as discoverLockDirs,fe as discoverMarkdownlintConfig,At as emitPreflightFailureSpan,Ar as encodeDocName,ue as encodeFolderRoute,It as encodeSkillRoute,Zr as ensureProjectGit,Qe as ensureProjectSkillGitignore,jr as errorResponse,ce as evictStaleTrackerEntries,Xr as extractOkBinaryPath,tn as extractWikiLinksFromMarkdown,Yt as fallbackPaths,hn as findEnclosingGitRoot,gr as findEnclosingProjectRoot,Rt as findNativeMarkdownlintFile,wr as flushFileLogger,oe as formatAuthRejectionWire,Fn as formatContributors,kn as formatContributorsFrom,lt as formatPackRationale,hr as gcCheckpointRefs,Ye as getCurrentMcpLogger,A as getLocalDir,sr as getLogFilePath,at as getLogger,Nn as getLogsDir,qi as getMachineId,qr as getMeter,cr as getMetrics,mr as getTracer,Pn as handleCollabSocketError,mn as handleSpawnCursor,ae as hasGcLogLatch,a as iconFromClientName,On as incrementCollabSocketFilteredError,qt as incrementServerObserverFire,m as initContent,Lr as initShadowRepo,Ir as initTelemetry,an as initToleranceTelemetryWriter,Wn as installPrettyZodErrors,D as installTestLoggers,ui as installUserSkill,S as isAllowedApiOrigin,ki as isAllowedWorkspaceHostHeader,Mt as isConfigDoc,xe as isHocuspocusAuthRejectionReason,Je as isKnownPackId,Ht as isLinkIndexExcludedDoc,T as isLoopbackAddress,Xe as isManagedArtifactDoc,r as isOrphanMode,y as isPairedWriteOrigin,or as isPathWithinDir,Ji as isProcessAlive,Rr as isProjectRoot,Si as isProjectSkillManaged,f as isReservedForUserTree,Ce as isSelfWrite,yn as isSystemDoc,pi as isToleranceTelemetryEnabled,Mi as isValidLockPid,nt as lastKnownHash,Vn as listRescueCheckpoints,J as listStarterPacks,Te as loadPrincipal,Ki as lockFilePath,ci as loggerFactory,dt as logsCurrentPath,z as logsPreviousPath,ln as makeLazyEmbeddingsKeyStore,Ui as markServerLockDraining,ee as mountMcpAndApi,hi as normalizeFsPath,vt as originGitHubHost,xn as packageVersionMajorMinor,et as parseAuthRejectionWire,ii as parseGitVersion,Ei as parseHocuspocusAuthToken,gt as parseKeepaliveConnectionId,Oi as pathToDocName,j as planSeed,Qt as prepareSingleFileOpen,_r as processCommand,Br as processUsage,pt as readAllTargets,Ti as readBranchFromHead,V as readBundleDecision,Nt as readOwnNativeRules,Pi as readProcessLock,Hi as readProcessLockDetailed,Ln as readProjectLocalSemanticConfig,Li as readServerLock,F as readServerPackageVersion,Be as readSkillInstallStateSnapshot,cn as readSkillManagement,Zn as readStateManifest,er as readTargetRecordedAt,v as readTargetVersion,pn as readUiLock,gn as reconcile,Jt as recordContributor,Ke as recordSkillInstallEvent,Y as registerAllTools,w as registerWrite,zi as releaseProcessLock,ji as releaseServerLock,ar as releaseUiLock,wt as removeLastKnownHash,ni as resetMetrics,n as resolveBundleEnabled,se as resolveBundledSkillDir,di as resolveContentDir,ei as resolveCursorBinaryDefault,vn as resolveCursorSpawnInvocation,_e as resolveEffectiveLinterConfig,mt as resolveLockDir,Mr as resolveNativeConfigForDoc,Ut as resolveNativeMarkdownlintConfig,le as resolvePack,Vr as resolvePackageVersion,jt as resolveUiInfo,ri as restoreContributors,yi as restoreLifecycleFromConflictsJson,nn as rewriteMarkdownLinksForDocumentRename,Sr as rewriteWikiLinksForDocumentRename,$ as runAuthReposSubprocess,ye as runAuthStatusSubprocess,Tt as runCloneSubprocess,Pr as runDeviceFlowSubprocess,d as runWithMcpLogger,Ve as safeContentPath,vi as safeSubdir,en as safetyCheckpoint,Cr as sanitizeClientName,br as saveInMemoryCheckpoint,Ur as saveVersion,Rn as seedBasenameIndex,vr as serializeError,Bn as setActiveSpanAttributes,Yn as setupServerObservers,fn as shadowGit,$t as shutdownTelemetry,gi as skillManagementPath,N as spansCurrentPath,Re as spansPreviousPath,En as spawnDetached,wn as splitMarkdownBlocks,re as startWatcher,de as streamingProblemEvent,xi as swapContributors,it as teardownToleranceTelemetryWriter,Kn as toBroadcasterKey,ot as tracedAppendFileSync,O as tracedLinkSync,li as tracedMkdir,ft as tracedMkdirSync,B as tracedRename,P as tracedRenameSync,ze as tracedRmSync,$n as tracedRmdirSync,_ as tracedUnlinkSync,qn as tracedWriteFile,De as tracedWriteFileSync,dn as untrackTrackedProjectSkillProjection,yt as updateLastKnownHash,Ii as updateProcessLockPort,Vi as updateServerLockPort,$r as updateUiLockPort,Ee as validateAgentId,ie as validateCloneInputs,Se as validateSkillZip,Wi as waitForServerLockDrain,ke as withHiddenWindowsConsole,yr as withSpan,Hr as withSpanSync,Jn as writeBundleDecision,Ot as writeMarkdownlintRule,Yr as writeRootGitignoreForNewRepo,st as writeSkillManagement,h as writeStateManifest,Oe as writeTargetVersion,kt as writeTracker};
1
+ import{Go as e,Ji as t,S as n,Xi as r,Yi as i,d as a,da as o,l as s,la as c,v as l,xa as u}from"./src-BgrRg-nl.mjs";import{$ as d,$i as f,$r as p,$t as m,A as h,Aa as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Ci as O,Cn as k,Cr as A,Ct as j,D as M,Da as N,Di as P,Dn as F,Dr as I,Dt as L,E as R,Ea as z,Ei as B,En as V,Er as H,Et as U,F as W,Fi as G,Fn as K,Fr as q,Ft as J,G as Y,Gi as X,Gn as Z,Gr as Q,Gt as $,H as ee,Hi as te,Hn as ne,Hr as re,Ht as ie,I as ae,Ii as oe,In as se,Ir as ce,It as le,J as ue,Ji as de,Jn as fe,Jr as pe,Jt as me,K as he,Ki as ge,Kn as _e,Kr as ve,Kt as ye,L as be,Li as xe,Ln as Se,Lr as Ce,Lt as we,M as Te,Ma as Ee,Mi as De,Mn as Oe,Mr as ke,Mt as Ae,N as je,Na as Me,Ni as Ne,Nn as Pe,Nr as Fe,Nt as Ie,O as Le,Oa as Re,Oi as ze,On as Be,Or as Ve,Ot as He,P as Ue,Pa as We,Pi as Ge,Pn as Ke,Pr as qe,Pt as Je,Q as Ye,Qi as Xe,Qr as Ze,Qt as Qe,R as $e,Ri as et,Rn as tt,Rr as nt,Rt as rt,S as it,Sa as at,Si as ot,Sn as st,Sr as ct,St as lt,T as ut,Ta as dt,Ti as ft,Tn as pt,Tr as mt,Tt as ht,U as gt,Ui as _t,Un as vt,Ur as yt,Ut as bt,V as xt,Vi as St,Vn as Ct,Vr as wt,Vt as Tt,W as Et,Wi as Dt,Wn as Ot,Wr as kt,Wt as At,X as jt,Xi as Mt,Xn as Nt,Xr as Pt,Xt as Ft,Y as It,Yi as Lt,Yn as Rt,Yr as zt,Yt as Bt,Z as Vt,Zi as Ht,Zn as Ut,Zr as Wt,Zt as Gt,_ as Kt,_a as qt,_i as Jt,_n as Yt,_r as Xt,_t as Zt,a as Qt,aa as $t,ai as en,an as tn,ar as nn,at as rn,b as an,ba as on,bi as sn,bn as cn,br as ln,bt as un,c as dn,ci as fn,cn as pn,cr as mn,d as hn,di as gn,dn as _n,dr as vn,ea as yn,ei as bn,en as xn,et as Sn,f as Cn,fi as wn,fn as Tn,fr as En,g as Dn,ga as On,gi as kn,gn as An,gr as jn,gt as Mn,h as Nn,ha as Pn,hi as Fn,hn as In,hr as Ln,ht as Rn,i as zn,ia as Bn,ii as Vn,in as Hn,ir as Un,it as Wn,j as Gn,ja as Kn,ji as qn,jn as Jn,jr as Yn,jt as Xn,k as Zn,ka as Qn,ki as $n,kn as er,kr as tr,kt as nr,l as rr,li as ir,ln as ar,lr as or,m as sr,ma as cr,mi as lr,mn as ur,mr as dr,mt as fr,n as pr,na as mr,ni as hr,nn as gr,nt as _r,o as vr,oa as yr,oi as br,on as xr,or as Sr,ot as Cr,p as wr,pa as Tr,pi as Er,pn as Dr,pr as Or,pt as kr,q as Ar,qi as jr,qn as Mr,qr as Nr,qt as Pr,r as Fr,ra as Ir,ri as Lr,rn as Rr,rr as zr,rt as Br,s as Vr,sa as Hr,si as Ur,sn as Wr,sr as Gr,t as Kr,ta as qr,ti as Jr,tn as Yr,tt as Xr,u as Zr,ui as Qr,un as $r,ur as ei,v as ti,va as ni,vi as ri,vn as ii,vr as ai,vt as oi,w as si,wa as ci,wi as li,wn as ui,wr as di,wt as fi,x as pi,xa as mi,xi as hi,xn as gi,xr as _i,xt as vi,y as yi,ya as bi,yi as xi,yn as Si,yr as Ci,yt as wi,z as Ti,zi as Ei,zn as Di,zr as Oi,zt as ki}from"./src-D87GkAFF.mjs";import{_ as Ai,a as ji,b as Mi,c as Ni,f as Pi,g as Fi,h as Ii,i as Li,l as Ri,m as zi,n as Bi,o as Vi,p as Hi,r as Ui,s as Wi,t as Gi,u as Ki,v as qi,y as Ji}from"./server-lock-Cn2-KrjV.mjs";export{Qn as AGENT_ID_MAX_LEN,g as AGENT_ID_RE,St as AGENT_WRITE_ORIGIN,bi as AgentFocusBroadcaster,Tr as AgentPresenceBroadcaster,te as AgentSessionCapacityError,_t as AgentSessionManager,fr as AutoStartDisabledError,tt as BUNDLE_IDS,Di as BUNDLE_SCOPE,C as BUNDLE_SKILL_NAME,Hn as BacklinkIndex,Lt as CC1Broadcaster,o as CC1_CONTRACT_VERSION,me as CONFIG_FILENAME,ir as CONFLICT_MARKER_RE,Gr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Kt as ConfigSchema,pe as DEFAULT_CHECKPOINT_RETENTION,_i as DEFAULT_EMBEDDINGS_DIMENSIONS,ht as DEFAULT_PACK_ID,ct as EMBEDDINGS_API_KEY_ENV,zt as FILE_SYSTEM_WRITER,Q as FILE_WATCHER_ORIGIN,jn as FileEmbeddingsBackend,bt as GIT_PREFLIGHT_FAIL_SPAN_NAME,Pt as GIT_UPSTREAM_WRITER,Me as GitDirAccessError,_n as GitNotAvailableError,Tn as GitTooOldError,Ne as HOCUSPOCUS_AUTH_REJECTION_REASONS,Ge as HocuspocusAuthRejection,G as HocuspocusAuthTokenSchema,Or as INSTALLED_AGENTS_SCHEMES,c as LINEAGE_EPOCH_KEY,be as LIVE_DERIVED_INDEX_DEBOUNCE_MS,U as LOG_MD_TEMPLATE,Mn as MANAGED_RENAME_ORIGIN,Dt as MAX_AGENT_SESSIONS,rn as MCP_CONNECTION_ID_HEADER,t as MCP_SERVER_NAME,Dr as MIN_GIT_VERSION,x as MISSING_OK_CONFIG_MESSAGE,We as MalformedGitPointerError,Vt as McpLogger,xt as MissingOkConfigError,tr as OBSERVER_SYNC_ORIGIN,Bt as OK_OKIGNORE_TEMPLATE,i as ORPHAN_MODES,e as PROTOCOL_VERSION,on as PinoLogger,Ni as ProcessLockCollisionError,rr as ProjectGitInitError,Zt as ROLLBACK_ORIGIN,Ft as ROOT_GITIGNORE_TEMPLATE,Fi as RUNTIME_VERSION,Wt as SERVICE_WRITER,Pe as SKILL_INSTALL_EVENTS_FILE_REL,l as SKILL_STATE_TARGETS,L as STARTER_FOLDERS,He as STARTER_FOLDER_FRONTMATTER_FILENAME,nr as STARTER_PACKS,b as STARTER_PACK_IDS,Xn as STARTER_TEMPLATES,ut as STATE_MANIFEST_FILENAME,Ai as STATE_SCHEMA_VERSION,u as SYSTEM_DOC_NAME,we as SeedPrerequisiteError,rt as SeedRootDirError,Gi as ServerLockCollisionError,Kr as SingleFileNotAFileError,pr as SingleFileNotFoundError,Fr as SingleFileNotMarkdownError,R as StateManifestError,si as TagIndex,Ct as USER_GLOBAL_BUNDLE_IDS,xr as UiLockCollisionError,oi as __getShowAllWalkStatsForTesting,wi as __resetShowAllWalkStatsForTesting,Ri as acquireProcessLock,Bi as acquireServerLock,Wr as acquireUiLock,X as applyAgentMarkdownWrite,ve as applyExternalChange,fi as applySeed,M as assertCompatibleStateManifest,ur as assertGitAvailable,Fe as assertNeverDiskEvent,kr as attachIdleShutdown,ti as bootServer,k as buildAndOpenSkill,Gt as buildConfigYmlContent,he as buildExecResult,K as buildSkillZip,Ae as buildStarterFolderFrontmatterYaml,Ze as buildWipTree,ne as bundleSkillMdPath,qe as classifyEvents,sn as classifyFsPath,Er as clearContributors,Xt as clearEmbeddingsKeyFromAllBackends,Ie as coercePackId,s as colorFromSeed,p as commitUpstreamImport,bn as commitWip,Jr as commitWipFromTree,In as compareSemver,Z as composeEffectiveLinterConfig,Qr as containsConflictMarkers,q as contentHash,lr as contributorCount,je as countShadowObjects,Ue as countStaleAgentWipRefs,W as countWipRefs,un as createApiExtension,H as createAssetServeMiddleware,zr as createContentFilter,Un as createContentFilterAsync,ai as createEmbeddingsSecretStore,zn as createEphemeralProjectDir,Nr as createExternalChangeHandler,Cn as createFileLogger,$e as createLiveDerivedIndexExtension,Et as createMcpHttpHandler,dr as createOsProbe,I as createPersistenceExtension,E as createServer,Gn as createServerObserverExtension,ge as createStreamingErrorWriter,mi as createTestLogger,Ci as describeStoredEmbeddingsKey,Dn as detectClaudeDesktopPresence,An as detectGit,Le as detectProjectShape,Sn as discoverLockDirs,fe as discoverMarkdownlintConfig,At as emitPreflightFailureSpan,Ar as encodeDocName,ue as encodeFolderRoute,It as encodeSkillRoute,Zr as ensureProjectGit,Qe as ensureProjectSkillGitignore,jr as errorResponse,ce as evictStaleTrackerEntries,Xr as extractOkBinaryPath,tn as extractWikiLinksFromMarkdown,Yt as fallbackPaths,hn as findEnclosingGitRoot,gr as findEnclosingProjectRoot,Rt as findNativeMarkdownlintFile,wr as flushFileLogger,oe as formatAuthRejectionWire,Fn as formatContributors,kn as formatContributorsFrom,lt as formatPackRationale,hr as gcCheckpointRefs,Ye as getCurrentMcpLogger,A as getLocalDir,sr as getLogFilePath,at as getLogger,Nn as getLogsDir,qi as getMachineId,qr as getMeter,cr as getMetrics,mr as getTracer,Pn as handleCollabSocketError,mn as handleSpawnCursor,ae as hasGcLogLatch,a as iconFromClientName,On as incrementCollabSocketFilteredError,qt as incrementServerObserverFire,m as initContent,Lr as initShadowRepo,Ir as initTelemetry,an as initToleranceTelemetryWriter,Wn as installPrettyZodErrors,D as installTestLoggers,ui as installUserSkill,S as isAllowedApiOrigin,ki as isAllowedWorkspaceHostHeader,Mt as isConfigDoc,xe as isHocuspocusAuthRejectionReason,Je as isKnownPackId,Ht as isLinkIndexExcludedDoc,T as isLoopbackAddress,Xe as isManagedArtifactDoc,r as isOrphanMode,y as isPairedWriteOrigin,or as isPathWithinDir,Ji as isProcessAlive,Rr as isProjectRoot,Si as isProjectSkillManaged,f as isReservedForUserTree,Ce as isSelfWrite,yn as isSystemDoc,pi as isToleranceTelemetryEnabled,Mi as isValidLockPid,nt as lastKnownHash,Vn as listRescueCheckpoints,J as listStarterPacks,Te as loadPrincipal,Ki as lockFilePath,ci as loggerFactory,dt as logsCurrentPath,z as logsPreviousPath,ln as makeLazyEmbeddingsKeyStore,Ui as markServerLockDraining,ee as mountMcpAndApi,hi as normalizeFsPath,vt as originGitHubHost,xn as packageVersionMajorMinor,et as parseAuthRejectionWire,ii as parseGitVersion,Ei as parseHocuspocusAuthToken,gt as parseKeepaliveConnectionId,Oi as pathToDocName,j as planSeed,Qt as prepareSingleFileOpen,_r as processCommand,Br as processUsage,pt as readAllTargets,Ti as readBranchFromHead,V as readBundleDecision,Nt as readOwnNativeRules,Pi as readProcessLock,Hi as readProcessLockDetailed,Ln as readProjectLocalSemanticConfig,Li as readServerLock,F as readServerPackageVersion,Be as readSkillInstallStateSnapshot,cn as readSkillManagement,Zn as readStateManifest,er as readTargetRecordedAt,v as readTargetVersion,pn as readUiLock,gn as reconcile,Jt as recordContributor,Ke as recordSkillInstallEvent,Y as registerAllTools,w as registerWrite,zi as releaseProcessLock,ji as releaseServerLock,ar as releaseUiLock,wt as removeLastKnownHash,ni as resetMetrics,n as resolveBundleEnabled,se as resolveBundledSkillDir,di as resolveContentDir,ei as resolveCursorBinaryDefault,vn as resolveCursorSpawnInvocation,_e as resolveEffectiveLinterConfig,mt as resolveLockDir,Mr as resolveNativeConfigForDoc,Ut as resolveNativeMarkdownlintConfig,le as resolvePack,Vr as resolvePackageVersion,jt as resolveUiInfo,ri as restoreContributors,yi as restoreLifecycleFromConflictsJson,nn as rewriteMarkdownLinksForDocumentRename,Sr as rewriteWikiLinksForDocumentRename,$ as runAuthReposSubprocess,ye as runAuthStatusSubprocess,Tt as runCloneSubprocess,Pr as runDeviceFlowSubprocess,d as runWithMcpLogger,Ve as safeContentPath,vi as safeSubdir,en as safetyCheckpoint,Cr as sanitizeClientName,br as saveInMemoryCheckpoint,Ur as saveVersion,Rn as seedBasenameIndex,vr as serializeError,Bn as setActiveSpanAttributes,Yn as setupServerObservers,fn as shadowGit,$t as shutdownTelemetry,gi as skillManagementPath,N as spansCurrentPath,Re as spansPreviousPath,En as spawnDetached,wn as splitMarkdownBlocks,re as startWatcher,de as streamingProblemEvent,xi as swapContributors,it as teardownToleranceTelemetryWriter,Kn as toBroadcasterKey,ot as tracedAppendFileSync,O as tracedLinkSync,li as tracedMkdir,ft as tracedMkdirSync,B as tracedRename,P as tracedRenameSync,ze as tracedRmSync,$n as tracedRmdirSync,_ as tracedUnlinkSync,qn as tracedWriteFile,De as tracedWriteFileSync,dn as untrackTrackedProjectSkillProjection,yt as updateLastKnownHash,Ii as updateProcessLockPort,Vi as updateServerLockPort,$r as updateUiLockPort,Ee as validateAgentId,ie as validateCloneInputs,Se as validateSkillZip,Wi as waitForServerLockDrain,ke as withHiddenWindowsConsole,yr as withSpan,Hr as withSpanSync,Jn as writeBundleDecision,Ot as writeMarkdownlintRule,Yr as writeRootGitignoreForNewRepo,st as writeSkillManagement,h as writeStateManifest,Oe as writeTargetVersion,kt as writeTracker};