@inkeep/open-knowledge 0.31.0-beta.7 → 0.31.0

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 (343) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +67 -57
  4. package/dist/config-schema.json +0 -17
  5. package/dist/config.project-local.schema.json +0 -17
  6. package/dist/constants-Buc3Khk9.mjs +2 -0
  7. package/dist/{dist-Pe1Q8dMj.mjs → dist-Bu8EnbFm.mjs} +27 -27
  8. package/dist/dist-s05zKf10.mjs +1 -0
  9. package/dist/{gh-detect-C6QZctcU.mjs → gh-detect-Dvi-l8Fu.mjs} +2 -2
  10. package/dist/index.d.mts +1 -92
  11. package/dist/index.mjs +1 -1
  12. package/dist/{init-DT-9Ccjv.mjs → init-0JqajBIK.mjs} +16 -16
  13. package/dist/init-BZ0VgwrF.mjs +1 -0
  14. package/dist/{is-object-Cie0xXKD.mjs → is-object-Cg453afR.mjs} +1 -1
  15. package/dist/{launch-json-removal-bo3gNUN4.mjs → launch-json-removal-Bc0nsm9s.mjs} +2 -2
  16. package/dist/loader-BO5HbT0u.mjs +1 -0
  17. package/dist/{loader-Biqewihc.mjs → loader-DX0gEzQH.mjs} +3 -3
  18. package/dist/{open-browser-CPSoIF8R.mjs → open-browser-B5VaZ8SA.mjs} +2 -2
  19. package/dist/{preview-DhDDUDKS.mjs → preview-BVy_yUWj.mjs} +2 -2
  20. package/dist/preview-CuQ-f0Ce.mjs +1 -0
  21. package/dist/public/assets/ActivityModeContent-O1kmRaYv.js +2 -0
  22. package/dist/public/assets/CodeMirrorPropInput-Bun2HhT4.js +3 -0
  23. package/dist/public/assets/ConsentDialogBody-BAqZ9VoD.js +2 -0
  24. package/dist/public/assets/DocumentContext-CfINo_Mw.js +35 -0
  25. package/dist/public/assets/EnableSyncConfirmDialog-CGcWliZX.js +1 -0
  26. package/dist/public/assets/GraphPanel-psKCWN5A.js +46 -0
  27. package/dist/public/assets/ManagedArtifactProperties-DgrIcsNj.js +1 -0
  28. package/dist/public/assets/McpConsentDialogBody-tmZV4IV0.js +1 -0
  29. package/dist/public/assets/{MermaidDocEditor-DX5BTbSo.js → MermaidDocEditor-BCfIy1Pt.js} +1 -1
  30. package/dist/public/assets/PropertyPanel-DATdDgBR.js +2 -0
  31. package/dist/public/assets/SettingsDialogBody-c0x_Jk-n.js +7 -0
  32. package/dist/public/assets/ShareBranchSwitchDialog-ByGG9GtW.js +1 -0
  33. package/dist/public/assets/ShareReceiveDialog-Dv8wcWQl.js +1 -0
  34. package/dist/public/assets/ShareReceiveMissDialog-C3kajhK9.js +1 -0
  35. package/dist/public/assets/SkillEditorActions-Cv2ng-RP.js +1 -0
  36. package/dist/public/assets/SourceEditor-jBkr15gq.js +1 -0
  37. package/dist/public/assets/{TerminalPanel-z1aKcdQN.js → TerminalPanel-BQO8Y-CN.js} +3 -3
  38. package/dist/public/assets/{_baseFor-0d9AvFx1.js → _baseFor-BmaoxMlo.js} +1 -1
  39. package/dist/public/assets/agent-presence-BIAongcY.js +1 -0
  40. package/dist/public/assets/{arc-BWLwkJ2r.js → arc-BXir8W_f.js} +1 -1
  41. package/dist/public/assets/architecture-YZFGNWBL-CaPSZfdV.js +1 -0
  42. package/dist/public/assets/{architectureDiagram-Q4EWVU46-KXeh9itt.js → architectureDiagram-Q4EWVU46-DBTz54wh.js} +1 -1
  43. package/dist/public/assets/arrow-up-right-8pfjkZqS.js +1 -0
  44. package/dist/public/assets/auth-state-cache-CrfcQc3U.js +11 -0
  45. package/dist/public/assets/{blockDiagram-DXYQGD6D-DtrdFoMb.js → blockDiagram-DXYQGD6D-D4bYX8pX.js} +1 -1
  46. package/dist/public/assets/button-cneJOVxD.js +1 -0
  47. package/dist/public/assets/{c4Diagram-AHTNJAMY-fq1Z49Kc.js → c4Diagram-AHTNJAMY-BOsQb_-W.js} +1 -1
  48. package/dist/public/assets/calendar-BbVtdK1g.js +1 -0
  49. package/dist/public/assets/channel-Cf4pPTY1.js +1 -0
  50. package/dist/public/assets/check-ChQiT7oS.js +1 -0
  51. package/dist/public/assets/checkbox-Du1jumyn.js +1 -0
  52. package/dist/public/assets/chevron-down-BNXqfGKq.js +1 -0
  53. package/dist/public/assets/chevron-left-BBxdkhy7.js +1 -0
  54. package/dist/public/assets/chevron-right-B0Wo_9Sg.js +1 -0
  55. package/dist/public/assets/{chunk-2KRD3SAO-Bk_Wilkm.js → chunk-2KRD3SAO-Cdn0_KuR.js} +1 -1
  56. package/dist/public/assets/{chunk-336JU56O-CL9kwjEg.js → chunk-336JU56O-C6KVZ0tT.js} +2 -2
  57. package/dist/public/assets/chunk-426QAEUC-BZfWcxWh.js +1 -0
  58. package/dist/public/assets/{chunk-4BX2VUAB-D96BT_Bg.js → chunk-4BX2VUAB-kKn-Fa2A.js} +1 -1
  59. package/dist/public/assets/{chunk-4TB4RGXK-1ZoApeth.js → chunk-4TB4RGXK-DPDZUWSG.js} +1 -1
  60. package/dist/public/assets/chunk-55IACEB6-D2oQNvOq.js +1 -0
  61. package/dist/public/assets/{chunk-5FUZZQ4R-DPbA0GBM.js → chunk-5FUZZQ4R-CE2r23Tt.js} +1 -1
  62. package/dist/public/assets/{chunk-5PVQY5BW-CQS0U6F7.js → chunk-5PVQY5BW-BaCH2jUD.js} +1 -1
  63. package/dist/public/assets/{chunk-67CJDMHE-okMxnkQT.js → chunk-67CJDMHE-Cf4qHZvI.js} +1 -1
  64. package/dist/public/assets/{chunk-7N4EOEYR-Drske5an.js → chunk-7N4EOEYR-CaLXISN2.js} +1 -1
  65. package/dist/public/assets/{chunk-AA7GKIK3-BlHxQeSp.js → chunk-AA7GKIK3-BesY--Yf.js} +1 -1
  66. package/dist/public/assets/{chunk-BSJP7CBP-BpNyv8Y4.js → chunk-BSJP7CBP-HRb_DZiR.js} +1 -1
  67. package/dist/public/assets/{chunk-CIAEETIT-8deU_mkj.js → chunk-CIAEETIT-C6kcGp2f.js} +1 -1
  68. package/dist/public/assets/{chunk-EDXVE4YY-VzPvg9KF.js → chunk-EDXVE4YY-BhzOYMWA.js} +1 -1
  69. package/dist/public/assets/{chunk-ENJZ2VHE-BjhT8OeZ.js → chunk-ENJZ2VHE-pRhNQy5K.js} +1 -1
  70. package/dist/public/assets/{chunk-FMBD7UC4-CGtQ8v2r.js → chunk-FMBD7UC4-B9WsPaBW.js} +1 -1
  71. package/dist/public/assets/{chunk-FOC6F5B3--YnpQUAX.js → chunk-FOC6F5B3-B34b1kdM.js} +1 -1
  72. package/dist/public/assets/{chunk-ICPOFSXX-By9Q-6fm.js → chunk-ICPOFSXX-FUqEyzVa.js} +2 -2
  73. package/dist/public/assets/{chunk-K5T4RW27-C_6VcMXC.js → chunk-K5T4RW27-BvMe003e.js} +1 -1
  74. package/dist/public/assets/{chunk-KGLVRYIC-C3De9ry6.js → chunk-KGLVRYIC-B2xoojsm.js} +1 -1
  75. package/dist/public/assets/{chunk-LIHQZDEY-D4-GsYgm.js → chunk-LIHQZDEY-qSFnrF4a.js} +1 -1
  76. package/dist/public/assets/{chunk-ORNJ4GCN-qQUTfvQr.js → chunk-ORNJ4GCN-BQkOf7L-.js} +1 -1
  77. package/dist/public/assets/{chunk-OYMX7WX6-DAJTRr-n.js → chunk-OYMX7WX6-keoSJPWn.js} +1 -1
  78. package/dist/public/assets/chunk-QZHKN3VN-CRAtM2dA.js +1 -0
  79. package/dist/public/assets/{chunk-U2HBQHQK-Cp-6rjnO.js → chunk-U2HBQHQK-BJ9jeiqm.js} +1 -1
  80. package/dist/public/assets/{chunk-X2U36JSP-BFqfQNWU.js → chunk-X2U36JSP-C2-eEatP.js} +1 -1
  81. package/dist/public/assets/{chunk-XPW4576I-DI0-cfrS.js → chunk-XPW4576I-iLIgnX6_.js} +1 -1
  82. package/dist/public/assets/{chunk-YZCP3GAM-sn7T8ho2.js → chunk-YZCP3GAM-DCLhfuTC.js} +1 -1
  83. package/dist/public/assets/{chunk-ZZ45TVLE-CxH2fGjk.js → chunk-ZZ45TVLE-Cuifzj6s.js} +1 -1
  84. package/dist/public/assets/classDiagram-6PBFFD2Q-v8EnrTlo.js +1 -0
  85. package/dist/public/assets/classDiagram-v2-HSJHXN6E-Bh3u7TCm.js +1 -0
  86. package/dist/public/assets/clone-CENMxO1q.js +1 -0
  87. package/dist/public/assets/collapsible-mJvufeMs.js +1 -0
  88. package/dist/public/assets/config-provider-C16_sC_R.js +4 -0
  89. package/dist/public/assets/{cose-bilkent-S5V4N54A-CXBsVXq9.js → cose-bilkent-S5V4N54A-B9iA1NZS.js} +1 -1
  90. package/dist/public/assets/{dagre-C2Qb6hf2.js → dagre-B1wiFyrD.js} +1 -1
  91. package/dist/public/assets/{dagre-KV5264BT-BQUJovtG.js → dagre-KV5264BT-GGwDqdQ_.js} +1 -1
  92. package/dist/public/assets/{diagram-5BDNPKRD-C6tTTvBq.js → diagram-5BDNPKRD-CY8bFFiZ.js} +1 -1
  93. package/dist/public/assets/{diagram-G4DWMVQ6-Cq1-s9xc.js → diagram-G4DWMVQ6-Ba38EFwg.js} +1 -1
  94. package/dist/public/assets/{diagram-MMDJMWI5-BE-MhKN8.js → diagram-MMDJMWI5-C4HgKh6K.js} +1 -1
  95. package/dist/public/assets/{diagram-TYMM5635-G0QPzMX4.js → diagram-TYMM5635-C41UHohH.js} +1 -1
  96. package/dist/public/assets/dialog-DdHaoAGK.js +45 -0
  97. package/dist/public/assets/dist-BSkHa6UR.js +1 -0
  98. package/dist/public/assets/{dist-Bj4Ae4LE.js → dist-BtuJEC9v.js} +108 -108
  99. package/dist/public/assets/{dist-CN2Ak373.js → dist-BzxczcQx.js} +1 -1
  100. package/dist/public/assets/{dist-CFvMrf5i.js → dist-COmtpu4e.js} +1 -1
  101. package/dist/public/assets/{dist-CqC3taBS.js → dist-C_IQr_bg.js} +1 -1
  102. package/dist/public/assets/{dist-C9FdwUZB.js → dist-Cdtf6fGT.js} +1 -1
  103. package/dist/public/assets/{dist-C_9BPzNE.js → dist-ClYcK7Yq.js} +1 -1
  104. package/dist/public/assets/dist-CoyydoqN.js +1 -0
  105. package/dist/public/assets/{dist-B0sSo1rx.js → dist-Csh9y0a0.js} +1 -1
  106. package/dist/public/assets/dist-CyYz03up.js +1 -0
  107. package/dist/public/assets/{dist-p4lElMBx.js → dist-DYyQPSDl.js} +1 -1
  108. package/dist/public/assets/dist-Dkr4jGYv.js +1 -0
  109. package/dist/public/assets/{dist-CPK5NxVp.js → dist-DmkgvB1A.js} +1 -1
  110. package/dist/public/assets/{dist-LqTeaHS1.js → dist-Dot7Y1W_.js} +1 -1
  111. package/dist/public/assets/{dist-BI2wTleN.js → dist-Gaq2suxg.js} +1 -1
  112. package/dist/public/assets/{dist-DfkfQshV.js → dist-HABBiN9I.js} +1 -1
  113. package/dist/public/assets/dist-fpPv-rVb.js +1 -0
  114. package/dist/public/assets/{dist-C9Q20TxL.js → dist-sRKGD4vA.js} +1 -1
  115. package/dist/public/assets/{doc-hash-BvJ4F5wQ.js → doc-hash-Ce3LmfP6.js} +1 -1
  116. package/dist/public/assets/{documents-events-KDHNhdfV.js → documents-events-BzQ1LRmI.js} +1 -1
  117. package/dist/public/assets/{erDiagram-SMLLAGMA-N7gNLe9o.js → erDiagram-SMLLAGMA-DYhY6Kqx.js} +1 -1
  118. package/dist/public/assets/eye-CWV-kBQc.js +1 -0
  119. package/dist/public/assets/{file-tree-adapter-D99FaCGJ.js → file-tree-adapter-CwWuHCOM.js} +1 -1
  120. package/dist/public/assets/{flatten-dENnAN6s.js → flatten-CQjVT6Ii.js} +1 -1
  121. package/dist/public/assets/{flowDiagram-DWJPFMVM-DgclgNSr.js → flowDiagram-DWJPFMVM-1K1AtH2O.js} +1 -1
  122. package/dist/public/assets/folder-open-ChJVxKuY.js +1 -0
  123. package/dist/public/assets/{ganttDiagram-T4ZO3ILL-CAydivVh.js → ganttDiagram-T4ZO3ILL-BeyyR9TG.js} +1 -1
  124. package/dist/public/assets/git-branch-YjYuPpdJ.js +1 -0
  125. package/dist/public/assets/gitGraph-7Q5UKJZL-Bte10OSc.js +1 -0
  126. package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-Qfom5ijS.js → gitGraphDiagram-UUTBAWPF-DWgxXelB.js} +1 -1
  127. package/dist/public/assets/{graphlib-BZWt_BGf.js → graphlib-CK7mhD3w.js} +1 -1
  128. package/dist/public/assets/index-Ba1S3D-p.css +1 -0
  129. package/dist/public/assets/index-vCSQZ9S5.js +2003 -0
  130. package/dist/public/assets/info-BlYnsVoP.js +1 -0
  131. package/dist/public/assets/info-OMHHGYJF-DAVSj56v.js +1 -0
  132. package/dist/public/assets/{infoDiagram-42DDH7IO-BLFTlht0.js → infoDiagram-42DDH7IO-Di3j3EUh.js} +1 -1
  133. package/dist/public/assets/input-tW78aNaR.js +1 -0
  134. package/dist/public/assets/{isEmpty-Dg6Et8UD.js → isEmpty-DGhTXexw.js} +1 -1
  135. package/dist/public/assets/isSymbol-DRPcfi38.js +1 -0
  136. package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-C8gBLX8v.js → ishikawaDiagram-UXIWVN3A-DI42GrR2.js} +1 -1
  137. package/dist/public/assets/{journeyDiagram-VCZTEJTY-DVV127Ia.js → journeyDiagram-VCZTEJTY-OV5qHmr0.js} +1 -1
  138. package/dist/public/assets/{kanban-definition-6JOO6SKY-Bi_LNUlw.js → kanban-definition-6JOO6SKY-CxQ7-Ree.js} +1 -1
  139. package/dist/public/assets/{keyboard-shortcuts-9kQVtaDu.js → keyboard-shortcuts-B5l045PW.js} +1 -1
  140. package/dist/public/assets/label-DPn_C7ZD.js +1 -0
  141. package/dist/public/assets/{line-CuRBOqmw.js → line-Dkx8G9Yq.js} +1 -1
  142. package/dist/public/assets/{linear-BnfMN22g.js → linear-9Xx8T62b.js} +1 -1
  143. package/dist/public/assets/loader-circle-B7Gv_Djz.js +1 -0
  144. package/dist/public/assets/{mermaid-parser.core-noqTIfNm.js → mermaid-parser.core-Cwc31N0O.js} +2 -2
  145. package/dist/public/assets/{mermaid.core-DMKNygs1.js → mermaid.core-DAi9DT6V.js} +3 -3
  146. package/dist/public/assets/{mindmap-definition-QFDTVHPH-DLIIn_h8.js → mindmap-definition-QFDTVHPH-BWEBzSzW.js} +1 -1
  147. package/dist/public/assets/miss-dialog-store-PJQ_kr0I.js +1 -0
  148. package/dist/public/assets/{navigation-targets-B1j0YdRn.js → navigation-targets-XC4PBjfz.js} +1 -1
  149. package/dist/public/assets/{now-esIbxJzw.js → now-C37BZh9O.js} +1 -1
  150. package/dist/public/assets/{open-managed-artifact-tab-BThYnqZz.js → open-managed-artifact-tab-DA0lLz1S.js} +1 -1
  151. package/dist/public/assets/{ordinal-DYUgOuL7.js → ordinal-CHifPrEh.js} +1 -1
  152. package/dist/public/assets/packet-4T2RLAQJ-BZDcl12z.js +1 -0
  153. package/dist/public/assets/panel-BH2RZRZQ.js +1 -0
  154. package/dist/public/assets/pending-receive-nav-store-BZqYvfd4.js +1 -0
  155. package/dist/public/assets/pie-ZZUOXDRM-D4-hdMsS.js +1 -0
  156. package/dist/public/assets/{pieDiagram-DEJITSTG-C-vgeRar.js → pieDiagram-DEJITSTG-BI6kYV3y.js} +1 -1
  157. package/dist/public/assets/project-paths-Bdm7wr4i.js +1 -0
  158. package/dist/public/assets/prop-types-BRDXyauO.js +1 -0
  159. package/dist/public/assets/{propagation-api-M_AcuP6N.js → propagation-api-BHhJitgG.js} +1 -1
  160. package/dist/public/assets/{quadrantDiagram-34T5L4WZ-BmQcA7GQ.js → quadrantDiagram-34T5L4WZ-DoQSwIHy.js} +1 -1
  161. package/dist/public/assets/radar-PYXPWWZC-5qU-LNrp.js +1 -0
  162. package/dist/public/assets/radio-group-B0RG5um-.js +1 -0
  163. package/dist/public/assets/{receive-store-1Qk9uwTc.js → receive-store-BSTpqIWS.js} +1 -1
  164. package/dist/public/assets/{reduce-BKUJZ1TP.js → reduce-CTE0I3YX.js} +1 -1
  165. package/dist/public/assets/refresh-cw-CluaccKu.js +1 -0
  166. package/dist/public/assets/{requirementDiagram-MS252O5E-DPE-Czmf.js → requirementDiagram-MS252O5E-BEVc-KLK.js} +1 -1
  167. package/dist/public/assets/{sankeyDiagram-XADWPNL6-C6mEVWX1.js → sankeyDiagram-XADWPNL6-2RCUEHbt.js} +1 -1
  168. package/dist/public/assets/{selection-context-_wSKX4pT.js → selection-context-D8rdwap3.js} +1 -1
  169. package/dist/public/assets/{sequenceDiagram-FGHM5R23-rp9LrkhC.js → sequenceDiagram-FGHM5R23-BwxKjMu8.js} +1 -1
  170. package/dist/public/assets/skill-actions-B89T-zt1.js +1 -0
  171. package/dist/public/assets/skills-api-BCCSobN4.js +1 -0
  172. package/dist/public/assets/{src-sATQ-1TS.js → src-DYQWxrea.js} +1 -1
  173. package/dist/public/assets/{src-DIGGo2K4.js → src-z-i21x0m.js} +1 -1
  174. package/dist/public/assets/{stateDiagram-FHFEXIEX-4q5ruYzC.js → stateDiagram-FHFEXIEX-C71hJfI3.js} +1 -1
  175. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-Cw1nXPsQ.js +1 -0
  176. package/dist/public/assets/{target-navigation-intent-DszwtIOt.js → target-navigation-intent-0O0lLUxg.js} +1 -1
  177. package/dist/public/assets/{telemetry-impl-Cs0UMIR2.js → telemetry-impl-DP51iS8w.js} +2 -2
  178. package/dist/public/assets/telemetry-startup-DK-ZExiC.js +1 -0
  179. package/dist/public/assets/textarea-CISJEQhO.js +1 -0
  180. package/dist/public/assets/{timeline-definition-GMOUNBTQ-CRtE2coR.js → timeline-definition-GMOUNBTQ-Bzsn0Uft.js} +1 -1
  181. package/dist/public/assets/toggle-group-CXHn0FKi.js +1 -0
  182. package/dist/public/assets/tooltip-FFg0kVkD.js +1 -0
  183. package/dist/public/assets/trash-2-Dcpo0Di-.js +1 -0
  184. package/dist/public/assets/treeView-SZITEDCU-BIqdNeir.js +1 -0
  185. package/dist/public/assets/treemap-W4RFUUIX-Bne30e5d.js +1 -0
  186. package/dist/public/assets/triangle-alert-c3yCucJv.js +1 -0
  187. package/dist/public/assets/typing-burst-detector-0csjpabL.js +6 -0
  188. package/dist/public/assets/{vennDiagram-DHZGUBPP-B5-arv9-.js → vennDiagram-DHZGUBPP-CnhxnPdb.js} +1 -1
  189. package/dist/public/assets/wardley-RL74JXVD-Bx6nHdkF.js +1 -0
  190. package/dist/public/assets/{wardleyDiagram-NUSXRM2D-NXmNnKuY.js → wardleyDiagram-NUSXRM2D-CynkQzsD.js} +1 -1
  191. package/dist/public/assets/workspace-paths-CgdsJHHk.js +1 -0
  192. package/dist/public/assets/{xychartDiagram-5P7HB3ND-B_cLbDrg.js → xychartDiagram-5P7HB3ND-Bwt6zYHi.js} +1 -1
  193. package/dist/public/index.html +83 -87
  194. package/dist/{repair-launch-json-B6nfMuDG.mjs → repair-launch-json-A83Cn4C3.mjs} +2 -2
  195. package/dist/{repair-mcp-configs-CfO_BZxd.mjs → repair-mcp-configs-Dp3AqC8R.mjs} +2 -2
  196. package/dist/repair-skills-D5HH0xbe.mjs +1 -0
  197. package/dist/{repair-skills-DuNm-kMp.mjs → repair-skills-Dgp9yVUB.mjs} +2 -2
  198. package/dist/schemas/v0/config.project-local.schema.json +0 -17
  199. package/dist/server-lock-GuuouVft-xGs0zrNQ.mjs +1 -0
  200. package/dist/{server-lock-iLcBw_q0-nWzkxbfg.mjs → server-lock-iLcBw_q0-6FEAZKHu.mjs} +45 -45
  201. package/dist/src-r-A-5thI.mjs +11 -0
  202. package/dist/start-B-mC7chd.mjs +1 -0
  203. package/dist/{start-D9sidghM.mjs → start-uH8C-cIP.mjs} +2 -2
  204. package/dist/{write-project-skill-DyoxYjJB.mjs → write-project-skill-XtppilgQ.mjs} +2 -2
  205. package/package.json +1 -1
  206. package/dist/constants-B8Zie8rF.mjs +0 -2
  207. package/dist/dist-BYM_jxPa.mjs +0 -1
  208. package/dist/init-D3BvztSN.mjs +0 -1
  209. package/dist/loader-BiXk2JV6.mjs +0 -1
  210. package/dist/preview-BrPKQxiM.mjs +0 -1
  211. package/dist/public/assets/ActivityModeContent-DCeOqkvP.js +0 -2
  212. package/dist/public/assets/CodeMirrorPropInput-B1vWorID.js +0 -3
  213. package/dist/public/assets/ConsentDialogBody-TGvdiCLr.js +0 -2
  214. package/dist/public/assets/CopyButton-DoEsGDa4.js +0 -1
  215. package/dist/public/assets/DocumentContext-BhV2wOiZ.js +0 -36
  216. package/dist/public/assets/EnableSyncConfirmDialog-Ca-ry-Ae.js +0 -1
  217. package/dist/public/assets/GraphPanel-lBz9qIQN.js +0 -46
  218. package/dist/public/assets/ManagedArtifactProperties-D_Nk4cbN.js +0 -1
  219. package/dist/public/assets/McpConsentDialogBody-Bsj9E3Ff.js +0 -1
  220. package/dist/public/assets/PropertyPanel-CDFSWToc.js +0 -2
  221. package/dist/public/assets/ReportBugDialogBody-CJkfjKa2.js +0 -2
  222. package/dist/public/assets/SettingsDialogBody-CZ8Q6HdO.js +0 -7
  223. package/dist/public/assets/ShareBranchSwitchDialog-BF1nOzHu.js +0 -1
  224. package/dist/public/assets/ShareReceiveDialog-Dqg_ZHxL.js +0 -1
  225. package/dist/public/assets/ShareReceiveMissDialog-Cmk3vfV-.js +0 -1
  226. package/dist/public/assets/SkillEditorActions-kSWzLf2i.js +0 -1
  227. package/dist/public/assets/SourceEditor-DUfgIVNL.js +0 -1
  228. package/dist/public/assets/agent-presence-CR_Kl3f1.js +0 -1
  229. package/dist/public/assets/architecture-YZFGNWBL-9BNhGkdz.js +0 -1
  230. package/dist/public/assets/arrow-up-right-Bj9cWgcz.js +0 -1
  231. package/dist/public/assets/auth-state-cache-QESJRGUP.js +0 -11
  232. package/dist/public/assets/calendar-B2qs7swV.js +0 -1
  233. package/dist/public/assets/channel-CuMNseph.js +0 -1
  234. package/dist/public/assets/check-nyYgwOgK.js +0 -1
  235. package/dist/public/assets/checkbox-CgcvT5md.js +0 -1
  236. package/dist/public/assets/chevron-down-B4gqqe-h.js +0 -1
  237. package/dist/public/assets/chevron-left-aRnXScdx.js +0 -1
  238. package/dist/public/assets/chevron-right-DjreZbLo.js +0 -1
  239. package/dist/public/assets/chunk-426QAEUC-pZbdhoaS.js +0 -1
  240. package/dist/public/assets/chunk-55IACEB6-HEGApgMn.js +0 -1
  241. package/dist/public/assets/chunk-QZHKN3VN-DI8KBGbP.js +0 -1
  242. package/dist/public/assets/classDiagram-6PBFFD2Q-D98rNdcz.js +0 -1
  243. package/dist/public/assets/classDiagram-v2-HSJHXN6E-Cz77sXrt.js +0 -1
  244. package/dist/public/assets/clipboard-adapter-BYqGVFAr.js +0 -1
  245. package/dist/public/assets/clone-DXiEg0sZ.js +0 -1
  246. package/dist/public/assets/collapsible-Cc4bgirL.js +0 -1
  247. package/dist/public/assets/config-provider-DJpUWM8E.js +0 -4
  248. package/dist/public/assets/copy-D8YVE0Jc.js +0 -1
  249. package/dist/public/assets/createLucideIcon-BPhNPfG7.js +0 -1
  250. package/dist/public/assets/dialog-BvTRDNMV.js +0 -45
  251. package/dist/public/assets/dist-B0Ibo2lT.js +0 -1
  252. package/dist/public/assets/dist-BR1KZiCX.js +0 -1
  253. package/dist/public/assets/dist-BhVkC6Rc.js +0 -1
  254. package/dist/public/assets/dist-CaqI7EF5.js +0 -1
  255. package/dist/public/assets/dist-jyqE5kfZ.js +0 -1
  256. package/dist/public/assets/eye-W_Da58Av.js +0 -1
  257. package/dist/public/assets/folder-open-DVXRBalt.js +0 -1
  258. package/dist/public/assets/git-branch-BfSSsaKF.js +0 -1
  259. package/dist/public/assets/gitGraph-7Q5UKJZL-DuuJiYvS.js +0 -1
  260. package/dist/public/assets/index-C3IDVWhb.css +0 -1
  261. package/dist/public/assets/index-DZyzbLiq.js +0 -2003
  262. package/dist/public/assets/info-DsmJgZ0m.js +0 -1
  263. package/dist/public/assets/info-OMHHGYJF-DmgDPzke.js +0 -1
  264. package/dist/public/assets/input-tBscWWrn.js +0 -1
  265. package/dist/public/assets/isSymbol-BhYgyzzO.js +0 -1
  266. package/dist/public/assets/label-DmfuSB7r.js +0 -1
  267. package/dist/public/assets/loader-circle-IFoG3v_v.js +0 -1
  268. package/dist/public/assets/miss-dialog-store-E61ZbtU3.js +0 -1
  269. package/dist/public/assets/packet-4T2RLAQJ-CVcq-ivT.js +0 -1
  270. package/dist/public/assets/panel-HcGnbQ9h.js +0 -1
  271. package/dist/public/assets/pending-receive-nav-store-D9kW0zL5.js +0 -1
  272. package/dist/public/assets/pie-ZZUOXDRM-DSvYqp8t.js +0 -1
  273. package/dist/public/assets/project-paths-CqH22Xq0.js +0 -1
  274. package/dist/public/assets/prop-types-CADDENK9.js +0 -1
  275. package/dist/public/assets/radar-PYXPWWZC-BrGdIzLo.js +0 -1
  276. package/dist/public/assets/radio-group-DyHNJs2C.js +0 -1
  277. package/dist/public/assets/refresh-cw-C6wj273J.js +0 -1
  278. package/dist/public/assets/skill-actions-CnQtb5aQ.js +0 -1
  279. package/dist/public/assets/skills-api-C6f0gQUn.js +0 -1
  280. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-9Y5TkQAw.js +0 -1
  281. package/dist/public/assets/telemetry-startup-BO7q-IdH.js +0 -1
  282. package/dist/public/assets/textarea-IugbKaIV.js +0 -1
  283. package/dist/public/assets/toggle-group-Hn7Etr9N.js +0 -1
  284. package/dist/public/assets/tooltip-tSMIHkKA.js +0 -1
  285. package/dist/public/assets/trash-2-DuQrfywu.js +0 -1
  286. package/dist/public/assets/treeView-SZITEDCU-C_aWaIS6.js +0 -1
  287. package/dist/public/assets/treemap-W4RFUUIX-CcQyutfG.js +0 -1
  288. package/dist/public/assets/triangle-alert-CX4BgEzP.js +0 -1
  289. package/dist/public/assets/typing-burst-detector--_GJ5sz1.js +0 -6
  290. package/dist/public/assets/wardley-RL74JXVD-B57ZwOFM.js +0 -1
  291. package/dist/public/assets/workspace-paths-GEb_gilm.js +0 -1
  292. package/dist/public/assets/x-Bcc1k6VU.js +0 -1
  293. package/dist/repair-skills-BDe9l22O.mjs +0 -1
  294. package/dist/server-lock-GuuouVft-CO_sPVNi.mjs +0 -1
  295. package/dist/src-CU3zxCid.mjs +0 -21
  296. package/dist/start-DHrKkLIh.mjs +0 -1
  297. /package/dist/public/assets/{ActivityPanelDiffView-B2UyxRqh.js → ActivityPanelDiffView-BWnxl5f-.js} +0 -0
  298. /package/dist/public/assets/{__vite-browser-external-DWP-nnLG.js → __vite-browser-external-TJ7c6L0o.js} +0 -0
  299. /package/dist/public/assets/{array-DCThpSXQ.js → array-FgcTybOD.js} +0 -0
  300. /package/dist/public/assets/{clike-DBPhSRc7.js → clike-Dwn0hkfx.js} +0 -0
  301. /package/dist/public/assets/{colors-BWTxgr-H.js → colors-D6fuRjk1.js} +0 -0
  302. /package/dist/public/assets/{config-context-B9tR3DuQ.js → config-context-CE3SCVYc.js} +0 -0
  303. /package/dist/public/assets/{cursor-BkiD2ODR.js → cursor-Bz3j3UrW.js} +0 -0
  304. /package/dist/public/assets/{cytoscape.esm-DI3FlJaw.js → cytoscape.esm-Dzv7Z08T.js} +0 -0
  305. /package/dist/public/assets/{defaultLocale-CRhqsANo.js → defaultLocale-B8_UIoxV.js} +0 -0
  306. /package/dist/public/assets/{desktop-bridge-types-BTzWYfK3.js → desktop-bridge-types-NXCK8Pd7.js} +0 -0
  307. /package/dist/public/assets/{diff-Drz_kYcR.js → diff-7ylxwA-Z.js} +0 -0
  308. /package/dist/public/assets/{dist-URshSBRl.js → dist-84zLmbM_.js} +0 -0
  309. /package/dist/public/assets/{dist-BRGTi0a4.js → dist-BvBijIC5.js} +0 -0
  310. /package/dist/public/assets/{dist-DXmpSd5X.js → dist-BzWUi0nJ.js} +0 -0
  311. /package/dist/public/assets/{documents-fetch-B7M_d64D.js → documents-fetch-oup83IZh.js} +0 -0
  312. /package/dist/public/assets/{external-link-Ds9yTh4D.js → external-link-DvDOavYT.js} +0 -0
  313. /package/dist/public/assets/{file-tree-rename-validation-DcXYaYEd.js → file-tree-rename-validation-DeKIxKnc.js} +0 -0
  314. /package/dist/public/assets/{floating-ui.dom-B3TJy2Tg.js → floating-ui.dom-DVRWCLii.js} +0 -0
  315. /package/dist/public/assets/{format-Dfi8-r7-.js → format-CC5hmMSn.js} +0 -0
  316. /package/dist/public/assets/{go-BpmSPnTF.js → go-DUVmyJ08.js} +0 -0
  317. /package/dist/public/assets/{init-Do59aTWs.js → init-BG_j-rIv.js} +0 -0
  318. /package/dist/public/assets/{isObjectLike-DBZB8Di0.js → isObjectLike-B-1HrArC.js} +0 -0
  319. /package/dist/public/assets/{katex-C_q0VtM5.js → katex-BunQWEOH.js} +0 -0
  320. /package/dist/public/assets/{lua-C_zL8YdL.js → lua-Deq9zhNp.js} +0 -0
  321. /package/dist/public/assets/{mcp-consent-store-Q4I4TJ6C.js → mcp-consent-store-BowAuxpw.js} +0 -0
  322. /package/dist/public/assets/{min-CHYmOP54.js → min-CFR8cRpW.js} +0 -0
  323. /package/dist/public/assets/{panzoom.es-IG_ffrHS.js → panzoom.es-B5TJP3N-.js} +0 -0
  324. /package/dist/public/assets/{parse-api-error-CKwNHPHP.js → parse-api-error-CqtA8BcL.js} +0 -0
  325. /package/dist/public/assets/{path-BumxrnWh.js → path-C0E9fOMz.js} +0 -0
  326. /package/dist/public/assets/{pdf-Dfrvv9Dp.js → pdf-BC6z-ijO.js} +0 -0
  327. /package/dist/public/assets/{pdf.worker-BW4O2Ok7.js → pdf.worker-CoJyScAX.js} +0 -0
  328. /package/dist/public/assets/{perl-CBgKNlH2.js → perl-D0WL8lyk.js} +0 -0
  329. /package/dist/public/assets/{properties-CYWLEd9P.js → properties-wKN3JgMQ.js} +0 -0
  330. /package/dist/public/assets/{r-C7V19TwF.js → r-B9o_5PRF.js} +0 -0
  331. /package/dist/public/assets/{rough.esm-DGd9yuC8.js → rough.esm-ClvsyqQj.js} +0 -0
  332. /package/dist/public/assets/{ruby-XhXUlf0J.js → ruby-DTqG95KX.js} +0 -0
  333. /package/dist/public/assets/{share-metadata-rows-C9T0cDSG.js → share-metadata-rows-DexRdF2p.js} +0 -0
  334. /package/dist/public/assets/{shell-CGj6v8kb.js → shell-DDux6XjL.js} +0 -0
  335. /package/dist/public/assets/{sql-CLlqBctF.js → sql-Drqtn151.js} +0 -0
  336. /package/dist/public/assets/{src-DHCu-mNI.js → src-DQSPzvWZ.js} +0 -0
  337. /package/dist/public/assets/{startup-marks-DkfPsa68.js → startup-marks-DDtA9pbt.js} +0 -0
  338. /package/dist/public/assets/{stex-Bt71ugp5.js → stex-4t0JIuX_.js} +0 -0
  339. /package/dist/public/assets/{swift-C_3ADj_i.js → swift-B0YNGkay.js} +0 -0
  340. /package/dist/public/assets/{toml-DohB9k6t.js → toml-DU2M2RLq.js} +0 -0
  341. /package/dist/public/assets/{trace-api-BIWqyPc9.js → trace-api-D6fqC5Nw.js} +0 -0
  342. /package/dist/public/assets/{w3c-keyname-CRPBoZED.js → w3c-keyname-CHcJEDvG.js} +0 -0
  343. /package/dist/public/assets/{worktree-store-DfQ15jw3.js → worktree-store-CPUnHORD.js} +0 -0
@@ -0,0 +1 @@
1
+ import{Fi as e,Gt as t,Hi as n,Pn as r,Q as i,_ as a,a as o,an as s,b as c,c as l,da as u,di as d,f,g as p,gn as m,h,i as g,kn as _,l as v,m as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E,un as D,v as O,y as k}from"./server-lock-iLcBw_q0-6FEAZKHu.mjs";import{$ as A,$i as j,$n as M,$r as N,$t as P,A as F,Ai as I,An as L,Ar as R,At as z,B,Bi as V,Bn as H,Br as U,Bt as W,C as G,Ci as K,Cn as q,Cr as J,Ct as Y,D as X,Di as Z,Dn as Q,Dr as $,Dt as ee,E as te,Ei as ne,En as re,Er as ie,Et as ae,F as oe,Fi as se,Fn as ce,Fr as le,Ft as ue,G as de,Gi as fe,Gn as pe,Gr as me,Gt as he,H as ge,Hi as _e,Hn as ve,Hr as ye,Ht as be,I as xe,Ii as Se,In as Ce,Ir as we,It as Te,J as Ee,Ji as De,Jn as Oe,Jr as ke,Jt as Ae,K as je,Ki as Me,Kn as Ne,Kr as Pe,Kt as Fe,L as Ie,Li as Le,Ln as Re,Lr as ze,Lt as Be,M as Ve,Mi as He,Mn as Ue,Mr as We,Mt as Ge,N as Ke,Ni as qe,Nn as Je,Nr as Ye,Nt as Xe,O as Ze,Oi as Qe,On as $e,Or as et,Ot as tt,P as nt,Pi as rt,Pn as it,Pr as at,Pt as ot,Q as st,Qi as ct,Qn as lt,Qr as ut,Qt as dt,R as ft,Ri as pt,Rn as mt,Rr as ht,Rt as gt,S as _t,Si as vt,Sn as yt,Sr as bt,St as xt,T as St,Ti as Ct,Tn as wt,Tr as Tt,Tt as Et,U as Dt,Ui as Ot,Un as kt,Ur as At,Ut as jt,V as Mt,Vi as Nt,Vn as Pt,Vr as Ft,Vt as It,W as Lt,Wi as Rt,Wn as zt,Wr as Bt,Wt as Vt,X as Ht,Xi as Ut,Xn as Wt,Xr as Gt,Xt as Kt,Y as qt,Yi as Jt,Yn as Yt,Yr as Xt,Yt as Zt,Z as Qt,Zi as $t,Zn as en,Zr as tn,Zt as nn,_ as rn,_a as an,_i as on,_n as sn,_r as cn,_t as ln,a as un,aa as dn,ai as fn,an as pn,ar as mn,at as hn,b as gn,bi as _n,bn as vn,br as yn,bt as bn,c as xn,ci as Sn,cn as Cn,cr as wn,ct as Tn,d as En,di as Dn,dn as On,dr as kn,dt as An,ea as jn,ei as Mn,en as Nn,er as Pn,et as Fn,f as In,fi as Ln,fn as Rn,fr as zn,ft as Bn,g as Vn,gi as Hn,gn as Un,gr as Wn,gt as Gn,h as Kn,hi as qn,hn as Jn,hr as Yn,ht as Xn,i as Zn,ia as Qn,ii as $n,in as er,ir as tr,it as nr,j as rr,ji as ir,jn as ar,jr as or,jt as sr,k as cr,ki as lr,kn as ur,kr as dr,kt as fr,l as pr,li as mr,ln as hr,lr as gr,lt as _r,m as vr,mi as yr,mn as br,mr as xr,mt as Sr,n as Cr,na as wr,ni as Tr,nn as Er,nr as Dr,nt as Or,o as kr,oi as Ar,on as jr,or as Mr,ot as Nr,p as Pr,pi as Fr,pn as Ir,pr as Lr,pt as Rr,q as zr,qi as Br,qn as Vr,qr as Hr,qt as Ur,r as Wr,ra as Gr,ri as Kr,rn as qr,rr as Jr,rt as Yr,s as Xr,si as Zr,sn as Qr,sr as $r,st as ei,t as ti,ta as ni,ti as ri,tn as ii,tr as ai,tt as oi,u as si,ui as ci,un as li,ur as ui,ut as di,v as fi,va as pi,vi as mi,vn as hi,vr as gi,vt as _i,w as vi,wi as yi,wn as bi,wr as xi,wt as Si,x as Ci,xi as wi,xn as Ti,xr as Ei,xt as Di,y as Oi,yi as ki,yn as Ai,yr as ji,yt as Mi,z as Ni,zi as Pi,zn as Fi,zr as Ii,zt as Li}from"./dist-Bu8EnbFm.mjs";export{ti as AGENT_ID_MAX_LEN,Cr as AGENT_ID_RE,Wr as AGENT_WRITE_ORIGIN,Zn as AgentFocusBroadcaster,un as AgentPresenceBroadcaster,kr as AgentSessionCapacityError,Xr as AgentSessionManager,xn as AutoStartDisabledError,pr as BUNDLE_IDS,si as BUNDLE_SCOPE,En as BUNDLE_SKILL_NAME,In as BacklinkIndex,Pr as CC1Broadcaster,i as CC1_CONTRACT_VERSION,vr as CONFIG_FILENAME,Kn as CONFLICT_MARKER_RE,Vn as CURSOR_BUNDLE_PATHS_BY_PLATFORM,rn as ConfigSchema,fi as DEFAULT_CHECKPOINT_RETENTION,Oi as DEFAULT_EMBEDDINGS_DIMENSIONS,gn as DEFAULT_PACK_ID,Ci as EMBEDDINGS_API_KEY_ENV,_t as FILE_SYSTEM_WRITER,G as FILE_WATCHER_ORIGIN,vi as FileEmbeddingsBackend,St as GIT_PREFLIGHT_FAIL_SPAN_NAME,te as GIT_UPSTREAM_WRITER,an as GitDirAccessError,X as GitNotAvailableError,Ze as GitTooOldError,cr as HOCUSPOCUS_AUTH_REJECTION_REASONS,F as HocuspocusAuthRejection,rr as HocuspocusAuthTokenSchema,Ve as INSTALLED_AGENTS_SCHEMES,t as LINEAGE_EPOCH_KEY,Ke as LIVE_DERIVED_INDEX_DEBOUNCE_MS,nt as LOG_MD_TEMPLATE,oe as MANAGED_RENAME_ORIGIN,xe as MAX_AGENT_SESSIONS,Ie as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,ft as MIN_GIT_VERSION,Ni as MISSING_OK_CONFIG_MESSAGE,pi as MalformedGitPointerError,B as McpLogger,Mt as MissingOkConfigError,ge as OBSERVER_SYNC_ORIGIN,Dt as OK_OKIGNORE_TEMPLATE,D as ORPHAN_MODES,m as PROTOCOL_VERSION,Lt as PinoLogger,T as ProcessLockCollisionError,de as ProjectGitInitError,je as ROLLBACK_ORIGIN,zr as ROOT_GITIGNORE_TEMPLATE,b as RUNTIME_VERSION,Ee as SERVICE_WRITER,qt as SKILL_INSTALL_EVENTS_FILE_REL,_ as SKILL_STATE_TARGETS,Ht as STARTER_FOLDERS,Qt as STARTER_FOLDER_FRONTMATTER_FILENAME,st as STARTER_PACKS,A as STARTER_PACK_IDS,Fn as STARTER_TEMPLATES,oi as STATE_MANIFEST_FILENAME,C as STATE_SCHEMA_VERSION,r as SYSTEM_DOC_NAME,Or as SeedPrerequisiteError,Yr as SeedRootDirError,g as ServerLockCollisionError,nr as SingleFileNotAFileError,hn as SingleFileNotFoundError,Nr as SingleFileNotMarkdownError,ei as StateManifestError,Tn as TagIndex,_r as USER_GLOBAL_BUNDLE_IDS,di as UiLockCollisionError,An as __getShowAllWalkStatsForTesting,Bn as __resetShowAllWalkStatsForTesting,o as acquireProcessLock,x as acquireServerLock,Rr as acquireUiLock,Sr as applyAgentMarkdownWrite,Xn as applyExternalChange,Gn as applySeed,ln as assertCompatibleStateManifest,_i as assertGitAvailable,Mi as assertNeverDiskEvent,bn as attachIdleShutdown,Di as bootServer,xt as buildAndOpenSkill,Y as buildConfigYmlContent,Si as buildExecResult,Et as buildSkillZip,ae as buildStarterFolderFrontmatterYaml,ee as buildWipTree,tt as bundleSkillMdPath,fr as classifyEvents,z as classifyFsPath,sr as clearContributors,Ge as clearEmbeddingsKeyFromAllBackends,Xe as coercePackId,d as colorFromSeed,ot as commitUpstreamImport,ue as commitWip,Te as commitWipFromTree,Be as compareSemver,gt as containsConflictMarkers,Li as contentHash,W as contributorCount,It as countShadowObjects,be as countStaleAgentWipRefs,jt as countWipRefs,Vt as createApiExtension,he as createAssetServeMiddleware,Fe as createContentFilter,Ur as createContentFilterAsync,Ae as createEmbeddingsSecretStore,Zt as createEphemeralProjectDir,Kt as createExternalChangeHandler,nn as createFileLogger,dt as createLiveDerivedIndexExtension,P as createMcpHttpHandler,Nn as createOsProbe,ii as createPersistenceExtension,Er as createServer,qr as createServerObserverExtension,er as createStreamingErrorWriter,pn as createTestLogger,jr as describeStoredEmbeddingsKey,Qr as detectClaudeDesktopPresence,Cn as detectGit,hr as detectProjectShape,li as discoverLockDirs,On as emitPreflightFailureSpan,Rn as encodeDocName,Ir as encodeFolderRoute,br as encodeSkillRoute,Jn as ensureProjectGit,Un as errorResponse,sn as evictStaleTrackerEntries,hi as extractOkBinaryPath,Ai as extractWikiLinksFromMarkdown,vn as fallbackPaths,Ti as findEnclosingGitRoot,yt as findEnclosingProjectRoot,q as flushFileLogger,bi as formatAuthRejectionWire,wt as formatContributors,re as formatContributorsFrom,Q as formatPackRationale,$e as gcCheckpointRefs,ur as getCurrentMcpLogger,L as getLocalDir,ar as getLogFilePath,Ue as getLogger,Je as getLogsDir,w as getMachineId,it as getMeter,ce as getMetrics,Ce as getTracer,Re as handleCollabSocketError,mt as handleSpawnCursor,Fi as hasGcLogLatch,e as iconFromClientName,H as incrementCollabSocketFilteredError,Pt as incrementServerObserverFire,ve as initContent,kt as initShadowRepo,zt as initTelemetry,pe as initToleranceTelemetryWriter,Ne as installPrettyZodErrors,Vr as installTestLoggers,Oe as installUserSkill,Yt as isAllowedApiOrigin,Wt as isAllowedWorkspaceHostHeader,en as isConfigDoc,lt as isHocuspocusAuthRejectionReason,M as isKnownPackId,Pn as isLinkIndexExcludedDoc,ai as isLoopbackAddress,Dr as isManagedArtifactDoc,n as isOrphanMode,Jr as isPairedWriteOrigin,tr as isPathWithinDir,l as isProcessAlive,mn as isProjectRoot,Mr as isProjectSkillManaged,$r as isReservedForUserTree,wn as isSelfWrite,gr as isSystemDoc,ui as isToleranceTelemetryEnabled,v as isValidLockPid,kn as lastKnownHash,zn as listRescueCheckpoints,Lr as listStarterPacks,xr as loadPrincipal,E as lockFilePath,Yn as loggerFactory,Wn as logsCurrentPath,cn as logsPreviousPath,gi as makeLazyEmbeddingsKeyStore,f as markServerLockDraining,ji as mountMcpAndApi,yn as normalizeFsPath,Ei as packageVersionMajorMinor,bt as parseAuthRejectionWire,J as parseGitVersion,xi as parseHocuspocusAuthToken,Tt as parseKeepaliveConnectionId,ie as pathToDocName,$ as planSeed,et as prepareSingleFileOpen,dr as processCommand,R as processUsage,or as readAllTargets,We as readBranchFromHead,Ye as readBundleDecision,S as readProcessLock,y as readProcessLockDetailed,at as readProjectLocalSemanticConfig,h as readServerLock,le as readServerPackageVersion,we as readSkillInstallStateSnapshot,ze as readSkillManagement,ht as readStateManifest,Ii as readTargetRecordedAt,U as readTargetVersion,Ft as readUiLock,ye as reconcile,At as recordContributor,Bt as recordSkillInstallEvent,me as registerAllTools,Pe as registerWrite,p as releaseProcessLock,a as releaseServerLock,Hr as releaseUiLock,ke as removeLastKnownHash,Xt as resetMetrics,u as resolveBundleEnabled,Gt as resolveBundledSkillDir,tn as resolveContentDir,ut as resolveCursorBinaryDefault,N as resolveCursorSpawnInvocation,Mn as resolveLockDir,ri as resolvePack,Tr as resolvePackageVersion,Kr as resolveUiInfo,$n as restoreContributors,fn as restoreLifecycleFromConflictsJson,Ar as rewriteMarkdownLinksForDocumentRename,Zr as rewriteWikiLinksForDocumentRename,Sn as runAuthReposSubprocess,mr as runAuthStatusSubprocess,ci as runCloneSubprocess,Dn as runDeviceFlowSubprocess,Ln as runWithMcpLogger,Fr as safeContentPath,yr as safeSubdir,qn as safetyCheckpoint,Hn as sanitizeClientName,on as saveInMemoryCheckpoint,mi as saveVersion,ki as seedBasenameIndex,_n as serializeError,wi as setActiveSpanAttributes,vt as setupServerObservers,K as shadowGit,yi as shutdownTelemetry,Ct as skillManagementPath,ne as spansCurrentPath,Z as spansPreviousPath,Qe as spawnDetached,lr as splitMarkdownBlocks,I as startWatcher,ir as streamingProblemEvent,He as swapContributors,qe as teardownToleranceTelemetryWriter,rt as toBroadcasterKey,se as tracedAppendFileSync,Se as tracedLinkSync,Le as tracedMkdir,pt as tracedMkdirSync,Pi as tracedRename,V as tracedRenameSync,Nt as tracedRmSync,_e as tracedRmdirSync,Ot as tracedUnlinkSync,Rt as tracedWriteFile,fe as tracedWriteFileSync,Me as updateLastKnownHash,O as updateProcessLockPort,k as updateServerLockPort,Br as updateUiLockPort,De as validateAgentId,Jt as validateCloneInputs,Ut as validateSkillZip,c as waitForServerLockDrain,$t as withHiddenWindowsConsole,ct as withSpan,j as withSpanSync,jn as writeBundleDecision,ni as writeRootGitignoreForNewRepo,wr as writeSkillManagement,Gr as writeStateManifest,Qn as writeTargetVersion,dn as writeTracker};
@@ -1,3 +1,3 @@
1
- import{Qo as e}from"./server-lock-iLcBw_q0-nWzkxbfg.mjs";import{execFileSync as t}from"node:child_process";import{dirname as n,join as r}from"node:path";import{homedir as i}from"node:os";import{existsSync as a,mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";var l=e();const u=`open-knowledge`;function d(e){try{e()}catch{}}var f=class{backend=`keyring`;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(u,e).getPassword()}catch(t){return d(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return d(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return d(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(u,e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(u,e).deletePassword()}catch{}}},p=class{backend=`file`;authFile;constructor(e){this.authFile=e??r(i(),`.ok`,`auth.yml`)}read(){if(!a(this.authFile))return{};try{return(0,l.parse)(s(this.authFile,`utf-8`))??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=n(this.authFile);a(t)||o(t,{recursive:!0,mode:448}),c(this.authFile,(0,l.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},m=class{backend=`keyring`;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ~/.ok/auth.yml to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function h(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(u,`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
1
+ import{Jo as e}from"./server-lock-iLcBw_q0-6FEAZKHu.mjs";import{execFileSync as t}from"node:child_process";import{dirname as n,join as r}from"node:path";import{homedir as i}from"node:os";import{existsSync as a,mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";var l=e();const u=`open-knowledge`;function d(e){try{e()}catch{}}var f=class{backend=`keyring`;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(u,e).getPassword()}catch(t){return d(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return d(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return d(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(u,e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(u,e).deletePassword()}catch{}}},p=class{backend=`file`;authFile;constructor(e){this.authFile=e??r(i(),`.ok`,`auth.yml`)}read(){if(!a(this.authFile))return{};try{return(0,l.parse)(s(this.authFile,`utf-8`))??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=n(this.authFile);a(t)||o(t,{recursive:!0,mode:448}),c(this.authFile,(0,l.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},m=class{backend=`keyring`;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ~/.ok/auth.yml to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function h(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(u,`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
2
2
  `),d(()=>t?.onBackendSelected?.({backend:`keyring`})),new m(new f(t?.onKeychainRead),new p(e))}catch(n){let r=n instanceof Error?`${n.name}: ${n.message}`:String(n);return process.stderr.write(`[auth] token storage: file (~/.ok/auth.yml) — OS keychain unavailable: ${r}\n`),d(()=>t?.onBackendSelected?.({backend:`file`,reason:r})),new p(e)}}function g(e){let t=null;return function(){if(t)return t;let n=2e3;return t=(async()=>{let t=null,r=new Promise(r=>{t=setTimeout(()=>{process.stderr.write(`[auth] token storage: keyring init exceeded ${n}ms; falling back to file (~/.ok/auth.yml)\n`),r(new p(e))},n)});try{return await Promise.race([h(e),r])}catch{return new p(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function _(e){let t=g(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token}}}}function v(e){let t=g(e);return{backend:`file`,async get(e){return(await t()).get(e)},async set(e,n,r,i){return(await t()).set(e,n,r,i)},async clear(e){return(await t()).clear(e)}}}async function y(e,t){let n=[],r=new p(t);await r.get(e)!=null&&(await r.clear(e),n.push(`file`));let i;try{let{Entry:t}=await import(`@napi-rs/keyring`);new t(u,`__probe__`);let r,a=await new f(e=>{e.kind===`read-error`&&(r=e.error??`read-error`)}).get(e);if(r!==void 0)i=r;else if(a!=null)try{new t(u,e).deletePassword(),n.push(`keychain`)}catch(e){i=e instanceof Error?e.name:`delete-error`}}catch{}return{touched:n,keychainError:i}}const b=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`],x={encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3,windowsHide:!0};function S(e,n={}){let r=n._exec??t,i=n._fileExists??a,o=[`auth`,`token`,...e?[`--hostname`,e]:[]],s=[`gh`,...b.filter(i)];for(let e of s)try{let t=r(e,o,x).toString().trim();if(t.length>0)return{available:!0,token:t}}catch{}return{available:!1}}export{v as a,_ as i,y as n,h as r,S as t};
3
- //# sourceMappingURL=gh-detect-C6QZctcU.mjs.map
3
+ //# sourceMappingURL=gh-detect-Dvi-l8Fu.mjs.map
package/dist/index.d.mts CHANGED
@@ -93,35 +93,6 @@ declare function makeLazyProbeTokenStore(authFile?: string): {
93
93
  } | null>;
94
94
  };
95
95
  //#endregion
96
- //#region src/diagnose/bundle.d.ts
97
- interface DesktopMetadata {
98
- electronVersion: string;
99
- packaged: boolean;
100
- channel: string;
101
- }
102
- //#endregion
103
- //#region src/commands/bug-report-bundle.d.ts
104
- declare function defaultBugReportZipPath(now?: Date): string;
105
- /** Structural subset of a pino logger, so callers outside the CLI can inject their own. */
106
- interface BundleLogger {
107
- info(payload: Record<string, unknown>, message: string): void;
108
- warn(payload: Record<string, unknown>, message: string): void;
109
- }
110
- /** File copied byte-for-byte into the bundle under `extra/` — never text-scrubbed. */
111
- interface BundleExtraFile {
112
- sourcePath: string;
113
- /** Zip entry name under `extra/`; defaults to the source file's basename. */
114
- zipName?: string;
115
- }
116
- //#endregion
117
- //#region src/commands/bug-report-redact.d.ts
118
- /** Apply {@link SECRET_PATTERNS} line by line; report which patterns matched. */
119
- declare function redactContent(content: string): {
120
- redacted: string;
121
- patterns: string[];
122
- lineCount: number;
123
- };
124
- //#endregion
125
96
  //#region src/commands/editors.d.ts
126
97
  type EditorId = CoreEditorId;
127
98
  declare const ALL_EDITOR_IDS: readonly EditorId[];
@@ -1217,67 +1188,5 @@ interface ProjectAiIntegrationsResult {
1217
1188
  }
1218
1189
  declare function writeProjectAiIntegrations(projectDir: string, selectedEditorIds: readonly EditorId[], installOptions?: McpInstallOptions): ProjectAiIntegrationsResult;
1219
1190
  //#endregion
1220
- //#region src/report-bundle.d.ts
1221
- type ReportBundleLevel = CoreReportBundleLevel;
1222
- type ReportBundleSummary = CoreReportBundleSummary;
1223
- interface CollectReportBundleOptions {
1224
- level: ReportBundleLevel;
1225
- /**
1226
- * Project root (where `.ok/` lives). Omit for a system-wide bundle:
1227
- * user-level logs + sysinfo only.
1228
- */
1229
- projectDir?: string;
1230
- /** Free-text user note included as `note.txt`. */
1231
- note?: string;
1232
- /** Apply redaction (secret-pattern scrub at both levels; doc-name anonymization at `full`). */
1233
- redact: boolean;
1234
- /** Zip destination; parent directories are created as needed. */
1235
- outputPath: string;
1236
- /** Files included byte-for-byte under `extra/` (e.g. an opted-in minidump) — never scrubbed. */
1237
- extraFiles?: BundleExtraFile[];
1238
- /** Override the user-level logs directory (standard-level test seam). */
1239
- userLogsDir?: string;
1240
- /**
1241
- * Collection-progress + warning sink. The full level reports its inventory
1242
- * via the manifest and uses this only for warnings (e.g. an opted-in extra
1243
- * file that could not be staged).
1244
- */
1245
- logger?: BundleLogger;
1246
- /**
1247
- * Host (desktop) metadata source for the bundle's runtime/sysinfo blocks.
1248
- * Defaults to reading the `OK_DESKTOP_*` env block, so CLI invocations are
1249
- * unchanged; the desktop app injects its typed metadata here directly
1250
- * instead of mutating `process.env` (which would leak into any child later
1251
- * spawned with the main process's env). Returning `null` means "not an
1252
- * Electron host" and is recorded as such at both levels.
1253
- */
1254
- readDesktopEnv?: () => DesktopMetadata | null;
1255
- }
1256
- interface ReportBundleResult {
1257
- zipPath: string;
1258
- summary: ReportBundleSummary;
1259
- }
1260
- /**
1261
- * Collect a bug-report bundle at the requested detail level and write it as
1262
- * a zip to `outputPath`.
1263
- *
1264
- * - `standard`: the `ok bug-report` content set — user-level logs,
1265
- * per-project lock/spawn-error + local sink logs, sysinfo. No git/server
1266
- * dependency.
1267
- * - `full`: the `ok diagnose bundle` superset — adds telemetry spans, live
1268
- * server state, runtime metadata, and doc-name anonymization.
1269
- * Availability-gated: pieces whose source is missing (no running server,
1270
- * no shadow repo, no telemetry sink) are omitted without error, and the
1271
- * bundled manifest inventory reflects what was actually included.
1272
- *
1273
- * Every full-only artifact is project-scoped, so without a `projectDir` both
1274
- * levels produce the same system-wide bundle.
1275
- *
1276
- * With `redact` on, the secret-pattern scrub applies at both levels; the
1277
- * full level additionally hashes doc names and masks the content-dir path
1278
- * (inverse map written as a sidecar next to the zip, never inside it).
1279
- */
1280
- declare function collectReportBundle(opts: CollectReportBundleOptions): Promise<ReportBundleResult>;
1281
- //#endregion
1282
- export { ALL_EDITOR_IDS, type BundleExtraFile, type BundleLogger, type CollectReportBundleOptions, EDITOR_LABELS, EDITOR_TARGETS, type EditorId, type EditorMcpResult, type EditorMcpTarget, type ExcludeWriteResult, type ExpectedShareRepo, type GhDetectResult, HOSTS_WITH_USER_SKILL_DIR, type IntegrationWriteOutcome, LAUNCH_CONFIG_NAME, type LoadConfigResult, type McpConfigDeclineEvent, type McpConfigDeclineScope, type McpConfigMigrateEvent, type McpConfigMigrateScope, type McpDeclineReason, type McpEntryClassification, type McpInstallOptions, type McpRemoveOutcome, PATH_SHIM_BEGIN, PATH_SHIM_BLOCK_RE, PATH_SHIM_END, type ParsedGitHubBlobUrl, type ParsedGitHubShareTarget, type ParsedGitHubTreeUrl, type PathDiscovery, type PathInstallConsent, type PathInstallMarker, type PreviewResult, type ProjectAiIntegrationsResult, type ProjectSkillRemoveResult, type ProjectSkillResult, type ReportBundleLevel, type ReportBundleResult, type ReportBundleSummary, type ResolveProjectRootOptions, type ResolveProjectRootResult, type ShareFolderValidationResult, type SharingMode, type SkillBundleTarget, type TokenStore, type TrackedRefusal, type UserMcpConfigsOptions, addOkPathsToGitExclude, assertProjectPathSafe, buildManagedServerEntry, buildMcpConfigDeclineEvent, buildMcpConfigMigrateEvent, classifyExistingMcpEntry, collectReportBundle, createTokenStore, defaultBugReportZipPath, detectGh, detectInstalledEditors, formatTrackedRemediation, getExcludedOkPaths, getOkArtifactPaths, isEntryUpToDate, isOwnManagedEntry, loadConfig, makeLazyProbeTokenStore, parseGitHubBlobUrl, parseGitHubShareUrl, parseGitHubTreeUrl, parseGitUrl, pathInstallMarkerPath, previewContent, probeTrackedOkPaths, readExistingMcpEntry, readSharingMode, redactContent, removeOkPathsFromGitExclude, removeOwnMcpEntry, removeProjectSkill, removeUserGlobalSkillBundle, resolveProjectRoot, runStop, truncatePriorEntry, userGlobalSkillBundleTargets, validateLocalFolderForShare, writeEditorMcpConfig, writeProjectAiIntegrations, writeProjectSkill, writeUserMcpConfigs };
1191
+ export { ALL_EDITOR_IDS, EDITOR_LABELS, EDITOR_TARGETS, type EditorId, type EditorMcpResult, type EditorMcpTarget, type ExcludeWriteResult, type ExpectedShareRepo, type GhDetectResult, HOSTS_WITH_USER_SKILL_DIR, type IntegrationWriteOutcome, LAUNCH_CONFIG_NAME, type LoadConfigResult, type McpConfigDeclineEvent, type McpConfigDeclineScope, type McpConfigMigrateEvent, type McpConfigMigrateScope, type McpDeclineReason, type McpEntryClassification, type McpInstallOptions, type McpRemoveOutcome, PATH_SHIM_BEGIN, PATH_SHIM_BLOCK_RE, PATH_SHIM_END, type ParsedGitHubBlobUrl, type ParsedGitHubShareTarget, type ParsedGitHubTreeUrl, type PathDiscovery, type PathInstallConsent, type PathInstallMarker, type PreviewResult, type ProjectAiIntegrationsResult, type ProjectSkillRemoveResult, type ProjectSkillResult, type ResolveProjectRootOptions, type ResolveProjectRootResult, type ShareFolderValidationResult, type SharingMode, type SkillBundleTarget, type TokenStore, type TrackedRefusal, type UserMcpConfigsOptions, addOkPathsToGitExclude, assertProjectPathSafe, buildManagedServerEntry, buildMcpConfigDeclineEvent, buildMcpConfigMigrateEvent, classifyExistingMcpEntry, createTokenStore, detectGh, detectInstalledEditors, formatTrackedRemediation, getExcludedOkPaths, getOkArtifactPaths, isEntryUpToDate, isOwnManagedEntry, loadConfig, makeLazyProbeTokenStore, parseGitHubBlobUrl, parseGitHubShareUrl, parseGitHubTreeUrl, parseGitUrl, pathInstallMarkerPath, previewContent, probeTrackedOkPaths, readExistingMcpEntry, readSharingMode, removeOkPathsFromGitExclude, removeOwnMcpEntry, removeProjectSkill, removeUserGlobalSkillBundle, resolveProjectRoot, runStop, truncatePriorEntry, userGlobalSkillBundleTargets, validateLocalFolderForShare, writeEditorMcpConfig, writeProjectAiIntegrations, writeProjectSkill, writeUserMcpConfigs };
1283
1192
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{i as e,r as t,t as n}from"./gh-detect-C6QZctcU.mjs";import{A as r,F as i,M as a,N as o,P as s,d as c,j as l,k as u,n as d,o as f,s as p,v as m,x as h,y as g}from"./init-DT-9Ccjv.mjs";import{E as _,S as v,T as y,_ as b,b as x,d as S,f as C,i as w,l as T,m as E,n as D,r as O,t as k,u as A,v as j,y as M}from"./src-CU3zxCid.mjs";import{_ as N,a as P,d as F,f as I,g as L,i as R,o as z,r as B,s as V,t as H,u as U,v as W}from"./write-project-skill-DyoxYjJB.mjs";import{n as G}from"./loader-Biqewihc.mjs";import{n as K}from"./preview-DhDDUDKS.mjs";import{n as q,t as J}from"./mcp-migrate-event-CyH1VVyy.mjs";export{V as ALL_EDITOR_IDS,U as EDITOR_LABELS,F as EDITOR_TARGETS,I as HOSTS_WITH_USER_SKILL_DIR,d as LAUNCH_CONFIG_NAME,A as PATH_SHIM_BEGIN,S as PATH_SHIM_BLOCK_RE,C as PATH_SHIM_END,u as addOkPathsToGitExclude,H as assertProjectPathSafe,L as buildManagedServerEntry,O as buildMcpConfigDeclineEvent,J as buildMcpConfigMigrateEvent,f as classifyExistingMcpEntry,v as collectReportBundle,t as createTokenStore,y as defaultBugReportZipPath,n as detectGh,p as detectInstalledEditors,r as formatTrackedRemediation,l as getExcludedOkPaths,a as getOkArtifactPaths,N as isEntryUpToDate,W as isOwnManagedEntry,G as loadConfig,e as makeLazyProbeTokenStore,b as parseGitHubBlobUrl,j as parseGitHubShareUrl,M as parseGitHubTreeUrl,x as parseGitUrl,E as pathInstallMarkerPath,K as previewContent,o as probeTrackedOkPaths,c as readExistingMcpEntry,s as readSharingMode,_ as redactContent,i as removeOkPathsFromGitExclude,T as removeOwnMcpEntry,B as removeProjectSkill,P as removeUserGlobalSkillBundle,h as resolveProjectRoot,w as runStop,q as truncatePriorEntry,z as userGlobalSkillBundleTargets,D as validateLocalFolderForShare,m as writeEditorMcpConfig,k as writeProjectAiIntegrations,R as writeProjectSkill,g as writeUserMcpConfigs};
1
+ import{i as e,r as t,t as n}from"./gh-detect-Dvi-l8Fu.mjs";import{A as r,F as i,M as a,N as o,P as s,d as c,j as l,k as u,n as d,o as f,s as p,v as m,x as h,y as g}from"./init-0JqajBIK.mjs";import{_,b as v,d as y,f as b,i as x,l as S,m as C,n as w,r as T,t as E,u as D,v as O,y as k}from"./src-r-A-5thI.mjs";import{_ as A,a as j,d as M,f as N,g as P,i as F,o as I,r as L,s as R,t as z,u as B,v as V}from"./write-project-skill-XtppilgQ.mjs";import{n as H}from"./loader-DX0gEzQH.mjs";import{n as U}from"./preview-BVy_yUWj.mjs";import{n as W,t as G}from"./mcp-migrate-event-CyH1VVyy.mjs";export{R as ALL_EDITOR_IDS,B as EDITOR_LABELS,M as EDITOR_TARGETS,N as HOSTS_WITH_USER_SKILL_DIR,d as LAUNCH_CONFIG_NAME,D as PATH_SHIM_BEGIN,y as PATH_SHIM_BLOCK_RE,b as PATH_SHIM_END,u as addOkPathsToGitExclude,z as assertProjectPathSafe,P as buildManagedServerEntry,T as buildMcpConfigDeclineEvent,G as buildMcpConfigMigrateEvent,f as classifyExistingMcpEntry,t as createTokenStore,n as detectGh,p as detectInstalledEditors,r as formatTrackedRemediation,l as getExcludedOkPaths,a as getOkArtifactPaths,A as isEntryUpToDate,V as isOwnManagedEntry,H as loadConfig,e as makeLazyProbeTokenStore,_ as parseGitHubBlobUrl,O as parseGitHubShareUrl,k as parseGitHubTreeUrl,v as parseGitUrl,C as pathInstallMarkerPath,U as previewContent,o as probeTrackedOkPaths,c as readExistingMcpEntry,s as readSharingMode,i as removeOkPathsFromGitExclude,S as removeOwnMcpEntry,L as removeProjectSkill,j as removeUserGlobalSkillBundle,h as resolveProjectRoot,x as runStop,W as truncatePriorEntry,I as userGlobalSkillBundleTargets,w as validateLocalFolderForShare,m as writeEditorMcpConfig,E as writeProjectAiIntegrations,F as writeProjectSkill,g as writeUserMcpConfigs};
@@ -1,4 +1,4 @@
1
- import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Bt as r,Et as i,Qo as a,ta as o}from"./server-lock-iLcBw_q0-nWzkxbfg.mjs";import{D as s,G as c,Hn as l,Jn as u,O as d,Qi as f,ar as p,d as m,ga as h,hn as g,lt as _,na as v,pa as y,ta as b,xa as x}from"./dist-Pe1Q8dMj.mjs";import{r as S,t as C}from"./esm-CsQUg9js.mjs";import{t as ee}from"./constants-B8Zie8rF.mjs";import{t as w}from"./is-object-Cie0xXKD.mjs";import{a as te,b as ne,d as T,g as E,h as re,i as ie,m as D,p as ae,s as oe,t as se}from"./write-project-skill-DyoxYjJB.mjs";import{i as O,n as ce,o as k,r as le,s as A,t as j}from"./colors-8SzMRIVy.mjs";import{t as ue}from"./preview-DhDDUDKS.mjs";import{createRequire as de}from"node:module";import{execFileSync as fe}from"node:child_process";import pe,{dirname as M,isAbsolute as me,join as N,relative as P,resolve as he,sep as ge}from"node:path";import F from"node:process";import{fileURLToPath as _e}from"node:url";import{homedir as ve}from"node:os";import{existsSync as I,lstatSync as ye,mkdirSync as be,readFileSync as L,readlinkSync as xe,realpathSync as Se,statSync as Ce,writeFileSync as we}from"node:fs";import{inspect as Te,stripVTControlCharacters as Ee,styleText as R}from"node:util";import{AsyncLocalStorage as De,AsyncResource as Oe}from"node:async_hooks";import*as ke from"node:readline";const Ae=new Set([`emacs`,`vim`]);function je(e){return Ae.has(e)}function Me(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(je))):[]}const z=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Ne=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Pe=e=>e.name===`space`,Fe=e=>e.name===`backspace`,Ie=e=>`1234567890`.includes(e.name),Le=e=>e.name===`enter`||e.name===`return`;var Re=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},ze=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Be=class extends Error{name=`ExitPromptError`},Ve=class extends Error{name=`HookError`},He=class extends Error{name=`ValidationError`};const Ue=new De;function We(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Ge(e,t){let n=We(e);return Ue.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function B(){let e=Ue.getStore();if(!e)throw new Ve(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ke(){return B().rl}function qe(e){return Oe.bind((...t)=>{let n=B(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function Je(e){let t=B(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function Ye(){B().handleChange()}const Xe={queue(e){let t=B(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ke());if(r!=null&&typeof r!=`function`)throw new He(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=B();qe(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=B();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function Ze(e){return typeof e==`function`}function V(e){return Je(t=>{let n=Oe.bind(function(e){t.get()!==e&&(t.set(e),Ye())});if(t.initialized)return[t.get(),n];let r=Ze(e)?e():e;return t.set(r),[r,n]})}function Qe(e,t){Je(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&Xe.queue(e),n.set(t)})}function $e(){return F.platform.startsWith(`win`)?!!F.env.CI||!!F.env.WT_SESSION||!!F.env.TERMINUS_SUBLIME||F.env.ConEmuTask===`{cmd::Cmder}`||F.env.TERM_PROGRAM===`Terminus-Sublime`||F.env.TERM_PROGRAM===`vscode`||F.env.TERM===`xterm-256color`||F.env.TERM===`alacritty`||F.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:F.env.TERM!==`linux`}const et={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},tt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},nt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},rt={...et,...tt},it={...et,...nt},H=$e()?rt:it;Object.entries(tt);const at={prefix:{idle:R(`blue`,`?`),done:R(`green`,H.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>R(`yellow`,e))},keybindings:[],style:{answer:e=>R(`cyan`,e),message:e=>R(`bold`,e),error:e=>R(`red`,`> ${e}`),defaultAnswer:e=>R(`dim`,`(${e})`),help:e=>R(`dim`,e),highlight:e=>R(`cyan`,e),key:e=>R(`cyan`,R(`bold`,`<${e}>`))}};function ot(){return{...at,keybindings:Me()}}function st(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ct(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=st(n)&&st(r)?ct(n,r):r}return t}function lt(...e){return ct(ot(),...e.filter(e=>e!=null))}function ut({status:e=`idle`,theme:t}){let[n,r]=V(!1),[i,a]=V(0),{prefix:o,spinner:s}=lt(t);return Qe(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function dt(e,t){return Je(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function ft(e){return V({current:e})[0]}function pt(e){let t=ft(e);t.current=e,Qe(e=>{let n=!1,r=qe((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var mt=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const ht=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),gt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,_t=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,vt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,yt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,bt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,xt=/\t{1,1000}/y,St=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Ct=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,wt=/\p{M}+/gu,Tt={limit:1/0,ellipsis:``},Et=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Et(i,Tt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Ct,l],[vt,0],[yt,o],[xt,s],[St,c],[bt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(wt,``)){let t=e.codePointAt(0)||0;if(S=gt(t)?2:_t(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===bt?ht(e.slice(p,n.lastIndex)):n===St?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Dt={limit:1/0,ellipsis:``,ellipsisWidth:0},U=(e,t={})=>Et(e,Dt,t).width,Ot=`]8;;`,kt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ot}(?<uri>.*))`,`y`),At=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},jt=e=>`[${e}m`,Mt=e=>`${Ot}${e}`,Nt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:U(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=U(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Ot,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Pt=e=>{let t=e.split(` `),n=t.length;for(;n&&!U(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ft=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=U(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=U(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Nt(s,r,t),c=U(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Nt(s,r,t),c=U(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Nt(s,r,t),c=U(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Pt(e)));let l=s.join(`
1
+ import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Bt as r,Et as i,Jo as a,Zi as o}from"./server-lock-iLcBw_q0-6FEAZKHu.mjs";import{D as s,G as c,Hn as l,Jn as u,O as d,Zi as f,ar as p,ba as m,d as h,ea as g,fa as _,ha as v,hn as y,lt as b,ta as x}from"./dist-Bu8EnbFm.mjs";import{r as S,t as C}from"./esm-CsQUg9js.mjs";import{t as ee}from"./constants-Buc3Khk9.mjs";import{a as te,b as ne,d as w,g as T,h as re,i as ie,m as ae,p as E,s as oe,t as se}from"./write-project-skill-XtppilgQ.mjs";import{t as D}from"./is-object-Cg453afR.mjs";import{i as O,n as ce,o as k,r as le,s as A,t as j}from"./colors-8SzMRIVy.mjs";import{t as ue}from"./preview-BVy_yUWj.mjs";import{createRequire as de}from"node:module";import{execFileSync as fe}from"node:child_process";import pe,{dirname as M,isAbsolute as me,join as N,relative as P,resolve as he,sep as ge}from"node:path";import F from"node:process";import{fileURLToPath as _e}from"node:url";import{homedir as ve}from"node:os";import{existsSync as I,lstatSync as ye,mkdirSync as be,readFileSync as L,readlinkSync as xe,realpathSync as Se,statSync as Ce,writeFileSync as we}from"node:fs";import{inspect as Te,stripVTControlCharacters as Ee,styleText as R}from"node:util";import{AsyncLocalStorage as De,AsyncResource as Oe}from"node:async_hooks";import*as ke from"node:readline";const Ae=new Set([`emacs`,`vim`]);function je(e){return Ae.has(e)}function Me(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(je))):[]}const z=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Ne=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Pe=e=>e.name===`space`,Fe=e=>e.name===`backspace`,Ie=e=>`1234567890`.includes(e.name),Le=e=>e.name===`enter`||e.name===`return`;var Re=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},ze=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Be=class extends Error{name=`ExitPromptError`},Ve=class extends Error{name=`HookError`},He=class extends Error{name=`ValidationError`};const Ue=new De;function We(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Ge(e,t){let n=We(e);return Ue.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function B(){let e=Ue.getStore();if(!e)throw new Ve(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ke(){return B().rl}function qe(e){return Oe.bind((...t)=>{let n=B(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function Je(e){let t=B(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function Ye(){B().handleChange()}const Xe={queue(e){let t=B(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ke());if(r!=null&&typeof r!=`function`)throw new He(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=B();qe(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=B();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function Ze(e){return typeof e==`function`}function V(e){return Je(t=>{let n=Oe.bind(function(e){t.get()!==e&&(t.set(e),Ye())});if(t.initialized)return[t.get(),n];let r=Ze(e)?e():e;return t.set(r),[r,n]})}function Qe(e,t){Je(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&Xe.queue(e),n.set(t)})}function $e(){return F.platform.startsWith(`win`)?!!F.env.CI||!!F.env.WT_SESSION||!!F.env.TERMINUS_SUBLIME||F.env.ConEmuTask===`{cmd::Cmder}`||F.env.TERM_PROGRAM===`Terminus-Sublime`||F.env.TERM_PROGRAM===`vscode`||F.env.TERM===`xterm-256color`||F.env.TERM===`alacritty`||F.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:F.env.TERM!==`linux`}const et={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},tt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},nt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},rt={...et,...tt},it={...et,...nt},H=$e()?rt:it;Object.entries(tt);const at={prefix:{idle:R(`blue`,`?`),done:R(`green`,H.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>R(`yellow`,e))},keybindings:[],style:{answer:e=>R(`cyan`,e),message:e=>R(`bold`,e),error:e=>R(`red`,`> ${e}`),defaultAnswer:e=>R(`dim`,`(${e})`),help:e=>R(`dim`,e),highlight:e=>R(`cyan`,e),key:e=>R(`cyan`,R(`bold`,`<${e}>`))}};function ot(){return{...at,keybindings:Me()}}function st(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ct(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=st(n)&&st(r)?ct(n,r):r}return t}function lt(...e){return ct(ot(),...e.filter(e=>e!=null))}function ut({status:e=`idle`,theme:t}){let[n,r]=V(!1),[i,a]=V(0),{prefix:o,spinner:s}=lt(t);return Qe(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function dt(e,t){return Je(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function ft(e){return V({current:e})[0]}function pt(e){let t=ft(e);t.current=e,Qe(e=>{let n=!1,r=qe((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var mt=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const ht=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),gt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,_t=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,vt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,yt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,bt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,xt=/\t{1,1000}/y,St=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Ct=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,wt=/\p{M}+/gu,Tt={limit:1/0,ellipsis:``},Et=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Et(i,Tt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Ct,l],[vt,0],[yt,o],[xt,s],[St,c],[bt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(wt,``)){let t=e.codePointAt(0)||0;if(S=gt(t)?2:_t(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===bt?ht(e.slice(p,n.lastIndex)):n===St?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Dt={limit:1/0,ellipsis:``,ellipsisWidth:0},U=(e,t={})=>Et(e,Dt,t).width,Ot=`]8;;`,kt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ot}(?<uri>.*))`,`y`),At=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},jt=e=>`[${e}m`,Mt=e=>`${Ot}${e}`,Nt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:U(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=U(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Ot,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Pt=e=>{let t=e.split(` `),n=t.length;for(;n&&!U(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ft=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=U(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=U(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Nt(s,r,t),c=U(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Nt(s,r,t),c=U(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Nt(s,r,t),c=U(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Pt(e)));let l=s.join(`
2
2
  `),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===`›`){kt.lastIndex=e+1;let t=kt.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
3
3
  `){a&&(r+=Mt(``));let e=i?At(i):void 0;i&&e&&(r+=jt(e))}else t===`
4
4
  `&&(i&&At(i)&&(r+=jt(i)),a&&(r+=Mt(a)))}return r},It=/\r?\n/;function Lt(e,t,n){return String(e).normalize().split(It).map(e=>Ft(e,t,n)).join(`
@@ -12,13 +12,13 @@ import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Bt as r,Et as i,Qo
12
12
  `).pop()??``;var fn=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,t=``){let n=Ee(dn(e)),r=n;this.rl.line.length>0&&(r=r.slice(0,-this.rl.line.length)),this.rl.setPrompt(r),this.cursorPos=this.rl.getCursorPos();let i=Bt();e=zt(e,i),t=zt(t,i),n.length%i===0&&(e+=`
13
13
  `);let a=e+(t?`
14
14
  `+t:``),o=Math.floor(n.length/i)-this.cursorPos.rows+(t?un(t):0);o>0&&(a+=an(o)),a+=sn(this.cursorPos.cols),this.write(on(this.extraLinesUnderPrompt)+ln(this.height)+a),this.extraLinesUnderPrompt=o,this.height=un(a)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(sn(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt(``);let t=on(this.extraLinesUnderPrompt);t+=e?ln(this.height):`
15
- `,t+=`\x1B[G`,t+=`\x1B[?25h`,this.write(t),this.rl.close()}},pn=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}},mn=t(Ut(),1);const hn=globalThis.setImmediate;function gn(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(e,n)=>{let r=n.slice(1);return t=r,r},Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function _n(e){let t=gn();return(n,r={})=>{let{input:i=process.stdin,signal:a}=r,o=new Set,s=new mn.default;s.pipe(r.output??process.stdout);let c=ke.createInterface({terminal:!0,input:i,output:s});s.mute();let l=new fn(c),{promise:u,resolve:d,reject:f}=pn.withResolver(),p=()=>f(new ze);if(a){let e=()=>f(new Re({cause:a.reason}));if(a.aborted)return e(),Object.assign(u,{cancel:p});a.addEventListener(`abort`,e),o.add(()=>a.removeEventListener(`abort`,e))}o.add(en((e,t)=>{f(new Be(`User force closed the prompt with ${e} ${t}`))}));let m=()=>f(new Be(`User force closed the prompt with SIGINT`));return c.on(`SIGINT`,m),o.add(()=>c.removeListener(`SIGINT`,m)),Ge(c,a=>{let m=Oe.bind(()=>Xe.clearAll());c.on(`close`,m),o.add(()=>c.removeListener(`close`,m));let h=()=>{let r=()=>l.checkCursorPos();c.input.on(`keypress`,r),o.add(()=>c.input.removeListener(`keypress`,r));let i=null;a(()=>{let r=!1;try{let a=e(n,e=>{r?d(e):i={value:e}});if(a===void 0){let e=t[1]?.getFileName();throw e&&!e.startsWith(`file://`)&&(e=pe.resolve(e)),Error(`Prompt functions must return a string.\n at ${e}`)}let[o,s]=typeof a==`string`?[a]:a;l.render(o,s),Xe.run()}catch(e){f(e)}if(r=!0,i!==null){let{value:e}=i;i=null,d(e)}})};return`readableFlowing`in i?hn(h):h(),Object.assign(u.then(e=>(Xe.clearAll(),e),e=>{throw Xe.clearAll(),e}).finally(()=>{o.forEach(e=>e()),l.done({clearContent:!!r.clearPromptOnDone}),s.end()}).then(()=>u),{cancel:p})})}}var G=class{separator=R(`dim`,Array.from({length:15}).join(H.line));type=`separator`;constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`separator`)}};function vn(e){let t=[`.ok/`,`.okignore`];for(let n of oe){let r=T[n];if(r.projectConfigPath&&t.push(An(r.projectConfigPath(e),e)),r.projectSkillPath){let n=An(r.projectSkillPath(e),e);t.push(`${Mn(n)}/`)}}t.push(`.claude/launch.json`);let n=N(e,...r);if(I(n))try{let e=o(L(n,`utf-8`));if(e)for(let[n,r]of Object.entries(e.skills))for(let e of r.hosts){let r=i[e];r&&t.push(`${r}/${n}/`)}}catch{}return Array.from(new Set(t))}function yn(e,t){let n=Cn(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:wn(n)};let r=Tn(e);if(r.kind!==`ok`)return r.result;let i=I(r.path)?L(r.path,`utf-8`):``,a=kn(i),o=[],s=[];for(let e of t)On(a,e)?s.push(e):o.push(e);if(o.length===0)return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]};let c=i.length===0||i.endsWith(`
15
+ `,t+=`\x1B[G`,t+=`\x1B[?25h`,this.write(t),this.rl.close()}},pn=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}},mn=t(Ut(),1);const hn=globalThis.setImmediate;function gn(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(e,n)=>{let r=n.slice(1);return t=r,r},Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function _n(e){let t=gn();return(n,r={})=>{let{input:i=process.stdin,signal:a}=r,o=new Set,s=new mn.default;s.pipe(r.output??process.stdout);let c=ke.createInterface({terminal:!0,input:i,output:s});s.mute();let l=new fn(c),{promise:u,resolve:d,reject:f}=pn.withResolver(),p=()=>f(new ze);if(a){let e=()=>f(new Re({cause:a.reason}));if(a.aborted)return e(),Object.assign(u,{cancel:p});a.addEventListener(`abort`,e),o.add(()=>a.removeEventListener(`abort`,e))}o.add(en((e,t)=>{f(new Be(`User force closed the prompt with ${e} ${t}`))}));let m=()=>f(new Be(`User force closed the prompt with SIGINT`));return c.on(`SIGINT`,m),o.add(()=>c.removeListener(`SIGINT`,m)),Ge(c,a=>{let m=Oe.bind(()=>Xe.clearAll());c.on(`close`,m),o.add(()=>c.removeListener(`close`,m));let h=()=>{let r=()=>l.checkCursorPos();c.input.on(`keypress`,r),o.add(()=>c.input.removeListener(`keypress`,r));let i=null;a(()=>{let r=!1;try{let a=e(n,e=>{r?d(e):i={value:e}});if(a===void 0){let e=t[1]?.getFileName();throw e&&!e.startsWith(`file://`)&&(e=pe.resolve(e)),Error(`Prompt functions must return a string.\n at ${e}`)}let[o,s]=typeof a==`string`?[a]:a;l.render(o,s),Xe.run()}catch(e){f(e)}if(r=!0,i!==null){let{value:e}=i;i=null,d(e)}})};return`readableFlowing`in i?hn(h):h(),Object.assign(u.then(e=>(Xe.clearAll(),e),e=>{throw Xe.clearAll(),e}).finally(()=>{o.forEach(e=>e()),l.done({clearContent:!!r.clearPromptOnDone}),s.end()}).then(()=>u),{cancel:p})})}}var G=class{separator=R(`dim`,Array.from({length:15}).join(H.line));type=`separator`;constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`separator`)}};function vn(e){let t=[`.ok/`,`.okignore`];for(let n of oe){let r=w[n];if(r.projectConfigPath&&t.push(An(r.projectConfigPath(e),e)),r.projectSkillPath){let n=An(r.projectSkillPath(e),e);t.push(`${Mn(n)}/`)}}t.push(`.claude/launch.json`);let n=N(e,...r);if(I(n))try{let e=o(L(n,`utf-8`));if(e)for(let[n,r]of Object.entries(e.skills))for(let e of r.hosts){let r=i[e];r&&t.push(`${r}/${n}/`)}}catch{}return Array.from(new Set(t))}function yn(e,t){let n=Cn(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:wn(n)};let r=Tn(e);if(r.kind!==`ok`)return r.result;let i=I(r.path)?L(r.path,`utf-8`):``,a=kn(i),o=[],s=[];for(let e of t)On(a,e)?s.push(e):o.push(e);if(o.length===0)return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]};let c=i.length===0||i.endsWith(`
16
16
  `)?``:`
17
17
  `,l=`${o.join(`
18
18
  `)}\n`;try{we(r.path,`${i}${c}${l}`,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]}}function bn(e,t){let n=Tn(e);if(n.kind!==`ok`)return n.result;if(!I(n.path))return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let r=t.map(e=>Dn(e)),i=new Set;for(let e of r)for(let t of e)i.add(t);let a;try{a=L(n.path,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}let o=a.split(`
19
19
  `),s=new Set,c=[];for(let e of o){let t=e.trim();if(i.has(t)){s.add(t);continue}c.push(e)}let l=t.filter(e=>{for(let t of Dn(e))if(s.has(t))return!0;return!1});if(s.size===0)return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let u=c.join(`
20
20
  `);if(u!==a)try{we(n.path,u,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:[],alreadyPresent:[],removed:l}}function xn(e){let t=Tn(e);if(t.kind!==`ok`)return t.result.reason===`no-git`||t.result.reason===`malformed-pointer`||t.result.reason===`inaccessible`?`no-git`:`shared`;if(!I(t.path))return`shared`;let n;try{n=L(t.path,`utf-8`)}catch{return`shared`}let r=kn(n),i=vn(e);for(let e of i)if(On(r,e))return`local-only`;return`shared`}function Sn(e){let t=Tn(e);if(t.kind!==`ok`||!I(t.path))return[];let n;try{n=L(t.path,`utf-8`)}catch{return[]}let r=kn(n);return vn(e).filter(e=>On(r,e))}function Cn(e,t){let n=[];for(let r of t)if(I(he(e,r)))try{fe(`git`,[`ls-files`,`--error-unmatch`,`--`,r],f({cwd:e,stdio:[`ignore`,`ignore`,`ignore`]})),n.push(r)}catch{}return{tracked:n}}function wn(e){let t=[];t.push(`Cannot switch OpenKnowledge to local-only — these OK files are tracked upstream:`),t.push(``);for(let n of e)t.push(` ${n}`);t.push(``),t.push(`.git/info/exclude only hides files that git isn't already tracking. To proceed, untrack them first:`),t.push(``);for(let n of e){let e=n.replace(/\/$/,``),r=n.endsWith(`/`)?`-r `:``;t.push(` git rm --cached ${r}${e}`)}return t.push(``),t.push("Then re-run the command. Note: `git rm --cached` removes the files from the index — your teammates will see a deletion on their next pull. If you don't want that, leave sharing mode set to 'shared'."),t.join(`
21
- `)}function Tn(e){let t=x(e);switch(t.kind){case`directory`:case`linked`:{let e=N(En(t.path),`info`);return I(e)?{kind:`ok`,path:N(e,`exclude`)}:{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`no-info-dir`}}}case`absent`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`no-git`}};case`malformed-pointer`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`malformed-pointer`}};case`inaccessible`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`inaccessible`}}}}function En(e){let t=N(e,`commondir`);if(!I(t))return e;let n;try{n=L(t,`utf-8`).trim()}catch{return e}return n.length===0?e:me(n)?n:he(e,n)}function Dn(e){let t=e.replace(/\/$/,``);return new Set([e,t,`/${e}`,`/${t}`])}function On(e,t){for(let n of Dn(t))if(e.has(n))return!0;return!1}function kn(e){let t=new Set;for(let n of e.split(`
21
+ `)}function Tn(e){let t=m(e);switch(t.kind){case`directory`:case`linked`:{let e=N(En(t.path),`info`);return I(e)?{kind:`ok`,path:N(e,`exclude`)}:{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`no-info-dir`}}}case`absent`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`no-git`}};case`malformed-pointer`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`malformed-pointer`}};case`inaccessible`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`inaccessible`}}}}function En(e){let t=N(e,`commondir`);if(!I(t))return e;let n;try{n=L(t,`utf-8`).trim()}catch{return e}return n.length===0?e:me(n)?n:he(e,n)}function Dn(e){let t=e.replace(/\/$/,``);return new Set([e,t,`/${e}`,`/${t}`])}function On(e,t){for(let n of Dn(t))if(e.has(n))return!0;return!1}function kn(e){let t=new Set;for(let n of e.split(`
22
22
  `)){let e=n.trim();e.length!==0&&t.add(e)}return t}function An(e,t){return jn(P(t,e))}function jn(e){return ge===`/`?e:e.split(ge).join(`/`)}function Mn(e){let t=e.lastIndexOf(`/`);return t<0?`.`:e.slice(0,t)}function Nn(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&K(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&K(e.charCodeAt(r)))for(r++;r<e.length&&K(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&K(e.charCodeAt(r))){for(r++;r<e.length&&K(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
23
23
  `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(Fn(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(Pn(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(Pn(t));return o=15}if(Fn(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
24
24
  `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!Fn(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,Fn(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!K(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(Pn(e)||Fn(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function Pn(e){return e===32||e===9}function Fn(e){return e===10||e===13}function K(e){return e>=48&&e<=57}var In;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(In||={});const q=Array(20).fill(0).map((e,t)=>` `.repeat(t)),Ln={" ":{"\n":Array(200).fill(0).map((e,t)=>`
@@ -33,7 +33,7 @@ import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Bt as r,Et as i,Qo
33
33
  `)return`
34
34
  `}return e&&e.eol||`
35
35
  `}function Hn(e,t){return`\r
36
- `.indexOf(e.charAt(t))!==-1}var Un;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Un||={});function Wn(e,t=[],n=Un.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}Xn(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:Zn(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function Gn(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function Kn(e){if(!e.parent||!e.parent.children)return[];let t=Kn(e.parent);if(e.parent.type===`property`){let n=e.parent.children[0].value;t.push(n)}else if(e.parent.type===`array`){let n=e.parent.children.indexOf(e);n!==-1&&t.push(n)}return t}function qn(e){switch(e.type){case`array`:return e.children.map(qn);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=qn(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function Jn(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function Yn(e,t,n=!1){if(Jn(e,t,n)){let r=e.children;if(Array.isArray(r))for(let e=0;e<r.length&&r[e].offset<=t;e++){let i=Yn(r[e],t,n);if(i)return i}return e}}function Xn(e,t,n=Un.DEFAULT){let r=Nn(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function ee(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function w(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function te(){return r.getToken()===10?(ee(!1),r.getToken()===6?(_(`:`),S(),E()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function ne(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);te()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function T(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,E()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function E(){switch(r.getToken()){case 3:return T();case 1:return ne();case 10:return ee(!0);default:return w()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):E()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function Zn(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}function Qn(e,t,n,r){let i=t.slice(),a=Wn(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=Gn(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return Y(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=Gn(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return Y(e,{offset:i,length:a-i,content:``},r)}else return Y(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return Y(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return Y(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return Y(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return Y(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function Y(e,t,n){if(!n.formattingOptions)return[t];let r=$n(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!Hn(r,i-1);)i--;for(;a<r.length&&!Hn(r,a);)a++}let o=zn(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=$n(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function $n(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var er;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(er||={});var tr;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(tr||={});const nr=Wn,rr=qn;var ir;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(ir||={});function ar(e,t,n,r){return Qn(e,t,n,r)}function or(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=$n(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}function sr(e){for(let t of e.split(`
36
+ `.indexOf(e.charAt(t))!==-1}var Un;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Un||={});function Wn(e,t=[],n=Un.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}Xn(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:Zn(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function Gn(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function Kn(e){if(!e.parent||!e.parent.children)return[];let t=Kn(e.parent);if(e.parent.type===`property`){let n=e.parent.children[0].value;t.push(n)}else if(e.parent.type===`array`){let n=e.parent.children.indexOf(e);n!==-1&&t.push(n)}return t}function qn(e){switch(e.type){case`array`:return e.children.map(qn);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=qn(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function Jn(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function Yn(e,t,n=!1){if(Jn(e,t,n)){let r=e.children;if(Array.isArray(r))for(let e=0;e<r.length&&r[e].offset<=t;e++){let i=Yn(r[e],t,n);if(i)return i}return e}}function Xn(e,t,n=Un.DEFAULT){let r=Nn(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function ee(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function te(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function ne(){return r.getToken()===10?(ee(!1),r.getToken()===6?(_(`:`),S(),re()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function w(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);ne()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function T(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,re()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function re(){switch(r.getToken()){case 3:return T();case 1:return w();case 10:return ee(!0);default:return te()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):re()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function Zn(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}function Qn(e,t,n,r){let i=t.slice(),a=Wn(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=Gn(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return Y(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=Gn(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return Y(e,{offset:i,length:a-i,content:``},r)}else return Y(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return Y(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return Y(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return Y(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return Y(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function Y(e,t,n){if(!n.formattingOptions)return[t];let r=$n(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!Hn(r,i-1);)i--;for(;a<r.length&&!Hn(r,a);)a++}let o=zn(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=$n(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function $n(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var er;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(er||={});var tr;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(tr||={});const nr=Wn,rr=qn;var ir;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(ir||={});function ar(e,t,n,r){return Qn(e,t,n,r)}function or(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=$n(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}function sr(e){for(let t of e.split(`
37
37
  `)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function cr(e){let t=(e.match(/\r\n/g)??[]).length;return t===0?!1:t>=(e.match(/\n/g)??[]).length-t}function lr(e){try{return Ce(e).mode&511}catch{return}}function ur(e,t){let n=e.charCodeAt(0)===65279,r=n?e.slice(1):e,i=r.includes(`\r
38
38
  `)?`\r
39
39
  `:`
@@ -288,7 +288,7 @@ let Jr=/^[a-z0-9-_]+$/i;function Yr(e){let t=typeof e;if(t===`object`){if(Array.
288
288
  `)+ni(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=Qr(t[c],e,r,i),a+=`
289
289
  `}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function ri(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(Yr(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=ni(0,e,``,t,n);return r[r.length-1]===`
290
290
  `?r:r+`
291
- `}const ii=`${ae}-dev`;function ai(e){return e.startsWith(ae)}function oi(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command!==`ok-pi-managed-extension`||!Array.isArray(t.args))return!1;let n=t.args[0];return typeof n==`string`&&ai(n)}function si(e){return{command:re,args:[e]}}function ci(e={}){let t=e.mode===`dev`?ii:D,n={unix:E({...e,platformName:`darwin`}),win32:E({...e,platformName:`win32`})};return`${t}
291
+ `}const ii=`${E}-dev`;function ai(e){return e.startsWith(E)}function oi(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command!==`ok-pi-managed-extension`||!Array.isArray(t.args))return!1;let n=t.args[0];return typeof n==`string`&&ai(n)}function si(e){return{command:re,args:[e]}}function ci(e={}){let t=e.mode===`dev`?ii:ae,n={unix:T({...e,platformName:`darwin`}),win32:T({...e,platformName:`win32`})};return`${t}
292
292
  /**
293
293
  * Open Knowledge bridge for Pi — MANAGED FILE, written by \`ok init\`.
294
294
  * Hand edits are overwritten whenever OK re-syncs this project; remove it
@@ -631,23 +631,23 @@ export default function okBridge(pi: {
631
631
  }
632
632
  });
633
633
  }
634
- `}function li(e,t){let n=P(t,e);return n.length>0&&!n.startsWith(`..`)&&!me(n)}const ui=e=>{try{let t=fe(`git`,[`rev-parse`,`--show-toplevel`],f({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function di(e,t={}){let n=t.homeDir??ve(),r=t.gitTopLevel??ui,i=he(e),a;try{a=Se(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(p(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=M(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&li(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}function fi(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function Q(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const pi=[`native`,`index.js`];function mi(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??de(t);try{return n(N(M(_e(t)),...pi))}catch(e){fi(e)||Q(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return fi(e)||Q(`workspace addon failed to load`,e),null}}function hi(){let e=mi();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function gi(e){let t=e,n=new Set;for(;;){let r;try{r=ye(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=xe(t)}catch(t){return Q(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=me(i)?i:N(M(t),i)}}let _i;function vi(){return _i===void 0&&(_i=hi()),_i}function yi(e,t=vi){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){Q(`resolveSymlinkWritePath threw`,e)}return gi(e)}function bi(){let e=mi();return e&&typeof e.parseTomlToJson==`function`?e:null}function xi(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return Q(`addon loaded but probe failed`,e),!1}}function Si(e){if(!w(e))throw Error(`TOML root is not a table`);return e}function Ci(e){return{backend:`native`,parseToObject(t){return Si(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}},removeEntry(t,n){let r=e.removeMcpServer(t,n);return{text:r.text,existed:r.existed}}}}function wi(){return{backend:`fallback`,parseToObject(e){return Si(qr(e))}}}function Ti(e=bi){let t=e();return t&&xi(t)?Ci(t):wi()}let Ei=null;function Di(){return Ei===null&&(Ei=Ti()),Ei}var Oi=a();const ki={allowTrailingComma:!0,disallowComments:!1};function Ai(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function ji(e){let t=[],n=nr(e,t,ki);return t.some(t=>!Ai(t,e))||!n||n.type!==`object`?null:n}function Mi(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&rr(e)===t&&(n+=1)}return n}function Ni(e,t){y(e,`${JSON.stringify(t,null,2)}\n`)}function Pi(e,t){let n=ri(t);y(e,n.endsWith(`
635
- `)?n:`${n}\n`)}function Fi(e,t){let n=(0,Oi.stringify)(t);y(e,n.endsWith(`
636
- `)?n:`${n}\n`)}const Ii=10*1024*1024;function Li(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>Li(e,t[n]));if(w(e)&&w(t)){let n=Object.keys(e);return n.length===Object.keys(t).length?n.every(n=>Object.hasOwn(t,n)&&Li(e[n],t[n])):!1}return!1}function Ri(e){for(let t of e.split(`
637
- `)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function zi(e,t,n){return t===void 0?[e,n]:[e,t,n]}function Bi(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function Vi(e,t,n){let r=e[t];return n===void 0?r:w(r)?r[n]:void 0}function Hi(e,t,n,r,i){if(!I(e))return Ni(e,Bi(t,i,n,r)),{kind:`written`};let a;try{a=L(e,`utf-8`)}catch(e){return Q(`json config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(a.trim()===``)return Ni(e,Bi(t,i,n,r)),{kind:`written`};if(Buffer.byteLength(a,`utf-8`)>Ii)return{kind:`declined`,reason:`oversize`};let o=ji(a);if(!o)return{kind:`declined`,reason:`unparseable`};if(Mi(o,t)>1)return{kind:`declined`,reason:`duplicate-container`};let s=Vi(rr(o),t,i),c=w(s)?s[n]:void 0,l=c!==void 0;if(l&&Li(c,r))return{kind:`overwritten`};let u=a.charCodeAt(0)===65279,d=u?a.slice(1):a,f=d.includes(`\r
634
+ `}function li(e,t){let n=P(t,e);return n.length>0&&!n.startsWith(`..`)&&!me(n)}const ui=e=>{try{let t=fe(`git`,[`rev-parse`,`--show-toplevel`],f({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function di(e,t={}){let n=t.homeDir??ve(),r=t.gitTopLevel??ui,i=he(e),a;try{a=Se(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(p(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=M(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&li(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}function fi(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function Q(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const pi=[`native`,`index.js`];function mi(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??de(t);try{return n(N(M(_e(t)),...pi))}catch(e){fi(e)||Q(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return fi(e)||Q(`workspace addon failed to load`,e),null}}function hi(){let e=mi();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function gi(e){let t=e,n=new Set;for(;;){let r;try{r=ye(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=xe(t)}catch(t){return Q(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=me(i)?i:N(M(t),i)}}let _i;function vi(){return _i===void 0&&(_i=hi()),_i}function yi(e,t=vi){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){Q(`resolveSymlinkWritePath threw`,e)}return gi(e)}function bi(){let e=mi();return e&&typeof e.parseTomlToJson==`function`?e:null}function xi(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return Q(`addon loaded but probe failed`,e),!1}}function Si(e){if(!D(e))throw Error(`TOML root is not a table`);return e}function Ci(e){return{backend:`native`,parseToObject(t){return Si(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}},removeEntry(t,n){let r=e.removeMcpServer(t,n);return{text:r.text,existed:r.existed}}}}function wi(){return{backend:`fallback`,parseToObject(e){return Si(qr(e))}}}function Ti(e=bi){let t=e();return t&&xi(t)?Ci(t):wi()}let Ei=null;function Di(){return Ei===null&&(Ei=Ti()),Ei}var Oi=a();const ki={allowTrailingComma:!0,disallowComments:!1};function Ai(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function ji(e){let t=[],n=nr(e,t,ki);return t.some(t=>!Ai(t,e))||!n||n.type!==`object`?null:n}function Mi(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&rr(e)===t&&(n+=1)}return n}function Ni(e,t){_(e,`${JSON.stringify(t,null,2)}\n`)}function Pi(e,t){let n=ri(t);_(e,n.endsWith(`
635
+ `)?n:`${n}\n`)}function Fi(e,t){let n=(0,Oi.stringify)(t);_(e,n.endsWith(`
636
+ `)?n:`${n}\n`)}const Ii=10*1024*1024;function Li(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>Li(e,t[n]));if(D(e)&&D(t)){let n=Object.keys(e);return n.length===Object.keys(t).length?n.every(n=>Object.hasOwn(t,n)&&Li(e[n],t[n])):!1}return!1}function Ri(e){for(let t of e.split(`
637
+ `)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function zi(e,t,n){return t===void 0?[e,n]:[e,t,n]}function Bi(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function Vi(e,t,n){let r=e[t];return n===void 0?r:D(r)?r[n]:void 0}function Hi(e,t,n,r,i){if(!I(e))return Ni(e,Bi(t,i,n,r)),{kind:`written`};let a;try{a=L(e,`utf-8`)}catch(e){return Q(`json config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(a.trim()===``)return Ni(e,Bi(t,i,n,r)),{kind:`written`};if(Buffer.byteLength(a,`utf-8`)>Ii)return{kind:`declined`,reason:`oversize`};let o=ji(a);if(!o)return{kind:`declined`,reason:`unparseable`};if(Mi(o,t)>1)return{kind:`declined`,reason:`duplicate-container`};let s=Vi(rr(o),t,i),c=D(s)?s[n]:void 0,l=c!==void 0;if(l&&Li(c,r))return{kind:`overwritten`};let u=a.charCodeAt(0)===65279,d=u?a.slice(1):a,f=d.includes(`\r
638
638
  `)?`\r
639
639
  `:`
640
- `,p=ar(d,zi(t,i,n),r,{formattingOptions:{...Ri(d),eol:f}}),m=`${u?``:``}${or(d,p)}`;return m!==a&&y(e,m,{mode:lr(e)}),{kind:l?`overwritten`:`written`}}function Ui(e,t,n,r,i){let a=``;if(I(t))try{a=L(t,`utf-8`)}catch(e){return Q(`toml config read failed`,e),{kind:`declined`,reason:`unparseable`}}let o=a.trim()===``;if(e.backend===`fallback`)return o?(Pi(t,{[n]:{[r]:i}}),{kind:`written`}):{kind:`declined`,reason:`no-native-writer`};let s=a.charCodeAt(0)===65279,c=s?a.slice(1):a,l=cr(c),u=o||c.endsWith(`
640
+ `,p=ar(d,zi(t,i,n),r,{formattingOptions:{...Ri(d),eol:f}}),m=`${u?``:``}${or(d,p)}`;return m!==a&&_(e,m,{mode:lr(e)}),{kind:l?`overwritten`:`written`}}function Ui(e,t,n,r,i){let a=``;if(I(t))try{a=L(t,`utf-8`)}catch(e){return Q(`toml config read failed`,e),{kind:`declined`,reason:`unparseable`}}let o=a.trim()===``;if(e.backend===`fallback`)return o?(Pi(t,{[n]:{[r]:i}}),{kind:`written`}):{kind:`declined`,reason:`no-native-writer`};let s=a.charCodeAt(0)===65279,c=s?a.slice(1):a,l=cr(c),u=o||c.endsWith(`
641
641
  `),d;try{d=e.upsertEntry(c,r,i)}catch(e){return Q(`upsertEntry failed`,e),{kind:`declined`,reason:`unparseable`}}let f=d.text;u?f.endsWith(`
642
642
  `)||(f=`${f}\n`):f=f.replace(/\n+$/,``),l&&(f=f.replace(/\r\n/g,`
643
643
  `).replace(/\n/g,`\r
644
- `));let p=`${s?``:``}${f}`;return p!==a&&y(t,p,{mode:lr(t)}),{kind:d.existed?`overwritten`:`written`}}function Wi(e,t,n,r){let i=``;if(I(e))try{i=L(e,`utf-8`)}catch(e){return Q(`yaml config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(i.trim()===``)return Fi(e,{[t]:{[n]:r}}),{kind:`written`};if(Buffer.byteLength(i,`utf-8`)>Ii)return{kind:`declined`,reason:`oversize`};let a=i.charCodeAt(0)===65279,o=a?i.slice(1):i,s=(0,Oi.parseDocument)(o);if(s.errors.length>0)return{kind:`declined`,reason:`unparseable`};let c=[t,n],l=s.hasIn(c);s.hasIn([t])&&!(0,Oi.isCollection)(s.getIn([t],!0))&&s.deleteIn([t]),s.setIn(c,s.createNode(r));let u=s.toString(),d=cr(o);o.endsWith(`
644
+ `));let p=`${s?``:``}${f}`;return p!==a&&_(t,p,{mode:lr(t)}),{kind:d.existed?`overwritten`:`written`}}function Wi(e,t,n,r){let i=``;if(I(e))try{i=L(e,`utf-8`)}catch(e){return Q(`yaml config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(i.trim()===``)return Fi(e,{[t]:{[n]:r}}),{kind:`written`};if(Buffer.byteLength(i,`utf-8`)>Ii)return{kind:`declined`,reason:`oversize`};let a=i.charCodeAt(0)===65279,o=a?i.slice(1):i,s=(0,Oi.parseDocument)(o);if(s.errors.length>0)return{kind:`declined`,reason:`unparseable`};let c=[t,n],l=s.hasIn(c);s.hasIn([t])&&!(0,Oi.isCollection)(s.getIn([t],!0))&&s.deleteIn([t]),s.setIn(c,s.createNode(r));let u=s.toString(),d=cr(o);o.endsWith(`
645
645
  `)?u.endsWith(`
646
646
  `)||(u=`${u}\n`):u=u.replace(/\n+$/,``),d&&(u=u.replace(/\r\n/g,`
647
647
  `).replace(/\n/g,`\r
648
- `));let f=`${a?``:``}${u}`;return f!==i&&y(e,f,{mode:lr(e)}),{kind:l?`overwritten`:`written`}}const Gi=e=>e!==`project`,Ki=e=>e!==`user`;async function qi(){let e=await vr({message:`Where should the MCP server be configured?
649
- `,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function Ji(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??qi)():`both`}async function Yi(e){return Cr({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function Xi(e){if(e.sharing!==void 0)return e.sharing;let t=xn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Yi)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Zi(e){if(e===void 0||e===!0)return new Set(_);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(_.filter(e=>t.includes(e)))}function Qi(e,t,n){let r=he(n,e),i;try{i=Ce(r)}catch(e){let t=e.code;throw t===`ENOENT`?new $(`--content-dir path does not exist: ${r}`):new $(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new $(`--content-dir must be a directory: ${r}`);let a=P($i(t),$i(r));if(a.startsWith(`..`)||me(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function $i(e){try{return Se(e)}catch{return e}}const ea=`open-knowledge-ui`;function ta(e,t,n){try{return I(e.detectPath?.(t,n)??M(e.configPath(t,n)))}catch{return!1}}function na(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0;if(!i&&s&&!ta(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{se(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return ia(e,o,a,n,{isProjectScope:i!==void 0});let c;try{c=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{be(M(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let l={action:`written`},u;try{h(`${o}.lock`,()=>{let t=yi(o).writePath;if(be(M(t),{recursive:!0}),e.format===`toml`){let n=Ui(Di(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=Wi(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=Hi(t,e.topLevelKey,a,c,e.serverMapSubKey);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){u=e instanceof Error?e:Error(String(e))}return u?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:u.message,...i===void 0?{}:{configScope:`project`}}:l.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:l.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:l.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const ra={pi:ci};function ia(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=ra[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{be(M(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{h(`${t}.lock`,()=>{let e=null;try{e=L(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}y(t,c,e===null?void 0:{mode:lr(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function aa(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!I(n)))return{editorId:e.id,label:e.label,path:n}}async function oa(e){let t=ne(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>na(t,``,n,e.home))}function sa(e,t,n,r){let i=la(e,t,n,r);return i.kind===`present`?i.entry:null}function ca(e,t,n,r){let i=Vi(e,t,r);if(!w(i))return{kind:`no-entry`};let a=i[n];return w(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function la(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!I(i))return{kind:`absent`};try{if(Ce(i).size>Ii)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=L(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:si(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=Di().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return ca(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Oi.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:ca(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=ji(a);return s?Mi(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:ca(rr(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function ua(e={}){let t=he(e.cwd??process.cwd()),n=di(t,{homeDir:e.home}),r=n.projectRoot,i=!I(N(r,`.ok`)),a=n.gitRootPromoted?P(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Qi(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${A(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await g(r),d;try{d=l(r,{contentDir:o})}catch(t){let i=T.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let f=d.created.includes(ee),p=!1;if(c.didInit)try{p=v(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}let h=await Ji({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),y=e.editors??ga(r,e.home),x=e.editors??oe.filter(e=>T[e].projectConfigPath!==void 0),S=ne(y),C=ne(x),w=e.mcp===!1||h===null,E=Array.from(new Map([...S,...w?[]:C].map(e=>[e.id,e])).values()),re=S.filter(t=>ta(t,r,e.home)),D=[],ae=[],se=new Set;for(let t of E){if(w){let n=``;try{n=t.configPath(r,e.home)}catch{}D.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(Gi(h)&&S.includes(t)&&t.scope===`global`&&D.push(na(t,r,s,e.home)),Ki(h)&&C.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=na(t,r,s,e.home,n);D.push(i),(i.action===`written`||i.action===`overwritten`)&&se.add(n)}}let O=new Set;for(let e of C){let t=e.projectSkillPath?.(r);!t||O.has(t)||(O.add(t),ae.push(ie(e,r)))}let ce=!w&&h!==null&&Ki(h)?C.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,k=w?[]:re.map(e=>aa(e,r)).filter(e=>e!==void 0).filter(e=>!se.has(e.path)),le=e.installUserSkill??u,j=e.home??ve(),ue=Zi(e.skills),de=!1,fe=!1,pe=!1,M=!1;for(let t of _){let n=ue.has(t);if(await b(j,m[t],n).catch(()=>{}),n){de=!0;let n=await le({home:e.home,bundleId:t,force:!0});n===`installed`?fe=!0:n===`failed`?pe=!0:M=!0}else try{te(j,t)}catch{}}let me=pe?`failed`:fe?`installed`:de&&M?`skip-current`:`declined`,ge=w?`skipped-flag`:`skipped-missing`,F=D.find(e=>e.editorId===`claude`)??D[0]??{action:ge,configPath:T.claude.configPath(r,e.home)},_e=await da({projectRoot:r,desiredMode:await Xi({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:d.created,contentUpdated:d.updated,contentSkipped:d.skipped,editors:D,projectSkills:ae,legacyProjectConfigs:k,skillInstall:me,didGitInit:c.didInit,rootGitignoreCreated:p,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:f?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:F.action,mcpPath:F.configPath,mcpError:`error`in F?F.error:void 0,projectScopeUnsupportedLabels:ce,sharing:_e}}async function da(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=xn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=vn(t);if(n===`local-only`){let e=yn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:fa(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=bn(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:fa(t,o,`remove`)}function fa(e,t,n){let r=xn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function pa(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function ma(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(j(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(j(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(j(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(j(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(j(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?P(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${k(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${k(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${le(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${pa(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(j(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?P(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${k(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${k(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${le(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${P(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(j(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${k(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${k(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${ce(`skipped (opted out via --no-skills)`)}`);break;case`failed`:n.push(` ${A(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${A(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(A(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(A(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(ue(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...ya(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${k(`✓`)} ${j(`Next steps:`)}`),n.push(` 1. Open your editor (${O(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${O(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${O(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${O(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${O(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${O(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
650
- `)}function ha(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function ga(e,t){let n=[];for(let r of oe)ta(T[r],e,t)&&n.push(r);return n}function _a(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Te(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function va(){return new C(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new S(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new S(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new S(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?_a():null;try{let r;try{r=await ua({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof $){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof s||e instanceof d){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof c){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
651
- `),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-BiXk2JV6.mjs`),{resolveContentDir:l}=await import(`./dist-BYM_jxPa.mjs`),u;try{u=o(r.projectRoot).config,i=u.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(u)try{let{previewContent:e}=await import(`./preview-BrPKQxiM.mjs`),t=l(u,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(ha(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${ma(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function ya(e,t){let n=[];switch(e.kind){case`applied`:return n.push(j(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${k(`local-only`)} — appended ${e.appended.length} path(s) to ${j(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${k(`local-only`)} — already excluded; nothing to do.`):n.push(` ${k(`local-only`)}`):e.action===`removed`?n.push(` ${k(`shared`)} — removed OK paths from ${j(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${k(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(A(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
648
+ `));let f=`${a?``:``}${u}`;return f!==i&&_(e,f,{mode:lr(e)}),{kind:l?`overwritten`:`written`}}const Gi=e=>e!==`project`,Ki=e=>e!==`user`;async function qi(){let e=await vr({message:`Where should the MCP server be configured?
649
+ `,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function Ji(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??qi)():`both`}async function Yi(e){return Cr({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function Xi(e){if(e.sharing!==void 0)return e.sharing;let t=xn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Yi)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Zi(e){if(e===void 0||e===!0)return new Set(b);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(b.filter(e=>t.includes(e)))}function Qi(e,t,n){let r=he(n,e),i;try{i=Ce(r)}catch(e){let t=e.code;throw t===`ENOENT`?new $(`--content-dir path does not exist: ${r}`):new $(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new $(`--content-dir must be a directory: ${r}`);let a=P($i(t),$i(r));if(a.startsWith(`..`)||me(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function $i(e){try{return Se(e)}catch{return e}}const ea=`open-knowledge-ui`;function ta(e,t,n){try{return I(e.detectPath?.(t,n)??M(e.configPath(t,n)))}catch{return!1}}function na(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0;if(!i&&s&&!ta(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{se(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return ia(e,o,a,n,{isProjectScope:i!==void 0});let c;try{c=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{be(M(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let l={action:`written`},u;try{v(`${o}.lock`,()=>{let t=yi(o).writePath;if(be(M(t),{recursive:!0}),e.format===`toml`){let n=Ui(Di(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=Wi(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=Hi(t,e.topLevelKey,a,c,e.serverMapSubKey);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){u=e instanceof Error?e:Error(String(e))}return u?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:u.message,...i===void 0?{}:{configScope:`project`}}:l.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:l.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:l.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const ra={pi:ci};function ia(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=ra[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{be(M(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{v(`${t}.lock`,()=>{let e=null;try{e=L(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}_(t,c,e===null?void 0:{mode:lr(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function aa(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!I(n)))return{editorId:e.id,label:e.label,path:n}}async function oa(e){let t=ne(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>na(t,``,n,e.home))}function sa(e,t,n,r){let i=la(e,t,n,r);return i.kind===`present`?i.entry:null}function ca(e,t,n,r){let i=Vi(e,t,r);if(!D(i))return{kind:`no-entry`};let a=i[n];return D(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function la(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!I(i))return{kind:`absent`};try{if(Ce(i).size>Ii)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=L(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:si(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=Di().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return ca(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Oi.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:ca(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=ji(a);return s?Mi(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:ca(rr(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function ua(e={}){let t=he(e.cwd??process.cwd()),n=di(t,{homeDir:e.home}),r=n.projectRoot,i=!I(N(r,`.ok`)),a=n.gitRootPromoted?P(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Qi(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${A(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await y(r),d;try{d=l(r,{contentDir:o})}catch(t){let i=w.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let f=d.created.includes(ee),p=!1;if(c.didInit)try{p=x(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}let m=await Ji({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),_=e.editors??ga(r,e.home),v=e.editors??oe.filter(e=>w[e].projectConfigPath!==void 0),S=ne(_),C=ne(v),T=e.mcp===!1||m===null,re=Array.from(new Map([...S,...T?[]:C].map(e=>[e.id,e])).values()),ae=S.filter(t=>ta(t,r,e.home)),E=[],se=[],D=new Set;for(let t of re){if(T){let n=``;try{n=t.configPath(r,e.home)}catch{}E.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(Gi(m)&&S.includes(t)&&t.scope===`global`&&E.push(na(t,r,s,e.home)),Ki(m)&&C.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=na(t,r,s,e.home,n);E.push(i),(i.action===`written`||i.action===`overwritten`)&&D.add(n)}}let O=new Set;for(let e of C){let t=e.projectSkillPath?.(r);!t||O.has(t)||(O.add(t),se.push(ie(e,r)))}let ce=!T&&m!==null&&Ki(m)?C.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,k=T?[]:ae.map(e=>aa(e,r)).filter(e=>e!==void 0).filter(e=>!D.has(e.path)),le=e.installUserSkill??u,j=e.home??ve(),ue=Zi(e.skills),de=!1,fe=!1,pe=!1,M=!1;for(let t of b){let n=ue.has(t);if(await g(j,h[t],n).catch(()=>{}),n){de=!0;let n=await le({home:e.home,bundleId:t,force:!0});n===`installed`?fe=!0:n===`failed`?pe=!0:M=!0}else try{te(j,t)}catch{}}let me=pe?`failed`:fe?`installed`:de&&M?`skip-current`:`declined`,ge=T?`skipped-flag`:`skipped-missing`,F=E.find(e=>e.editorId===`claude`)??E[0]??{action:ge,configPath:w.claude.configPath(r,e.home)},_e=await da({projectRoot:r,desiredMode:await Xi({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:d.created,contentUpdated:d.updated,contentSkipped:d.skipped,editors:E,projectSkills:se,legacyProjectConfigs:k,skillInstall:me,didGitInit:c.didInit,rootGitignoreCreated:p,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:f?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:F.action,mcpPath:F.configPath,mcpError:`error`in F?F.error:void 0,projectScopeUnsupportedLabels:ce,sharing:_e}}async function da(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=xn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=vn(t);if(n===`local-only`){let e=yn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:fa(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=bn(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:fa(t,o,`remove`)}function fa(e,t,n){let r=xn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function pa(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function ma(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(j(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(j(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(j(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(j(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(j(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?P(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${k(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${k(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${le(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${pa(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(j(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?P(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${k(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${k(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${le(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${P(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(j(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${k(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${k(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${ce(`skipped (opted out via --no-skills)`)}`);break;case`failed`:n.push(` ${A(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${A(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(A(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(A(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(ue(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...ya(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${k(`✓`)} ${j(`Next steps:`)}`),n.push(` 1. Open your editor (${O(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${O(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${O(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${O(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${O(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${O(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
650
+ `)}function ha(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function ga(e,t){let n=[];for(let r of oe)ta(w[r],e,t)&&n.push(r);return n}function _a(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Te(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function va(){return new C(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new S(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new S(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new S(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?_a():null;try{let r;try{r=await ua({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof $){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof s||e instanceof d){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof c){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
651
+ `),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-BO5HbT0u.mjs`),{resolveContentDir:l}=await import(`./dist-s05zKf10.mjs`),u;try{u=o(r.projectRoot).config,i=u.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(u)try{let{previewContent:e}=await import(`./preview-CuQ-f0Ce.mjs`),t=l(u,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(ha(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${ma(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function ya(e,t){let n=[];switch(e.kind){case`applied`:return n.push(j(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${k(`local-only`)} — appended ${e.appended.length} path(s) to ${j(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${k(`local-only`)} — already excluded; nothing to do.`):n.push(` ${k(`local-only`)}`):e.action===`removed`?n.push(` ${k(`shared`)} — removed OK paths from ${j(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${k(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(A(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
652
652
  `))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${O(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(A(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${O(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${O(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(A(`Sharing mode unavailable: ${e.reason}.`));return n}}export{wn as A,lt as B,vr as C,rr as D,ur as E,bn as F,Le as H,_n as I,rn as L,vn as M,Cn as N,nr as O,xn as P,pt as R,oi as S,cr as T,V,zi as _,ha as a,Di as b,ma as c,sa as d,Zi as f,ua as g,Xi as h,da as i,Sn as j,yn as k,ya as l,Qi as m,ea as n,la as o,Ji as p,ra as r,ga as s,$ as t,va as u,na as v,lr as w,di as x,oa as y,ut as z};
653
- //# sourceMappingURL=init-DT-9Ccjv.mjs.map
653
+ //# sourceMappingURL=init-0JqajBIK.mjs.map
@@ -0,0 +1 @@
1
+ import{g as e}from"./init-0JqajBIK.mjs";export{e as runInit};
@@ -1,2 +1,2 @@
1
1
  function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{e as t};
2
- //# sourceMappingURL=is-object-Cie0xXKD.mjs.map
2
+ //# sourceMappingURL=is-object-Cg453afR.mjs.map
@@ -1,2 +1,2 @@
1
- import{pa as e}from"./dist-Pe1Q8dMj.mjs";import{D as t,E as n,O as r,w as i}from"./init-DT-9Ccjv.mjs";import{t as a}from"./is-object-Cie0xXKD.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=r(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=t(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=n(m,[`configurations`,v]);return b?(e(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
- //# sourceMappingURL=launch-json-removal-bo3gNUN4.mjs.map
1
+ import{fa as e}from"./dist-Bu8EnbFm.mjs";import{D as t,E as n,O as r,w as i}from"./init-0JqajBIK.mjs";import{t as a}from"./is-object-Cg453afR.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=r(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=t(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=n(m,[`configurations`,v]);return b?(e(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
+ //# sourceMappingURL=launch-json-removal-Bc0nsm9s.mjs.map
@@ -0,0 +1 @@
1
+ import{n as e}from"./loader-DX0gEzQH.mjs";export{e as loadConfig};
@@ -1,4 +1,4 @@
1
- import{Qo as e,no as t,ro as n,so as r}from"./server-lock-iLcBw_q0-nWzkxbfg.mjs";import{_ as i,ha as a,ma as o}from"./dist-Pe1Q8dMj.mjs";import{t as s}from"./constants-B8Zie8rF.mjs";import{t as c}from"./is-object-Cie0xXKD.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";async function p(e){let t=l(e);try{return await f(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}var m=e();function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,m.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=r({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...i,source:e}}return i})}function v(e){let r=e??process.cwd(),c=[],u=a(`user`,r),d=o({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(r,`.ok`,s),m=g(p);if(m.value!==null){let e=t({value:m.value,file:m.path,source:m.source,doc:m.doc});if(e.length>0)throw Error(e.map(n).join(`
1
+ import{$a as e,Jo as t,Qa as n,ro as r}from"./server-lock-iLcBw_q0-6FEAZKHu.mjs";import{_ as i,ma as a,pa as o}from"./dist-Bu8EnbFm.mjs";import{t as s}from"./constants-Buc3Khk9.mjs";import{t as c}from"./is-object-Cg453afR.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";async function p(e){let t=l(e);try{return await f(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}var m=t();function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,m.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=r({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...i,source:e}}return i})}function v(t){let r=t??process.cwd(),c=[],u=a(`user`,r),d=o({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(r,`.ok`,s),m=g(p);if(m.value!==null){let t=n({value:m.value,file:m.path,source:m.source,doc:m.doc});if(t.length>0)throw Error(t.map(e).join(`
2
2
 
3
- `));f=h(f,m.value),c.push(p)}let v=i.safeParse(f);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(n(e))}return{config:v.data,sources:c}}function y(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??v,r=new Map,i=new Map,a=p(e.startupCwd);return async o=>{let s=await p(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{v as n,y as t};
4
- //# sourceMappingURL=loader-Biqewihc.mjs.map
3
+ `));f=h(f,m.value),c.push(p)}let v=i.safeParse(f);if(!v.success){let t={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(e(t))}return{config:v.data,sources:c}}function y(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??v,r=new Map,i=new Map,a=p(e.startupCwd);return async o=>{let s=await p(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{v as n,y as t};
4
+ //# sourceMappingURL=loader-DX0gEzQH.mjs.map
@@ -1,2 +1,2 @@
1
- import{Qi as e}from"./dist-Pe1Q8dMj.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}t(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,a]:[a],e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
2
- //# sourceMappingURL=open-browser-CPSoIF8R.mjs.map
1
+ import{Zi as e}from"./dist-Bu8EnbFm.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}t(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,a]:[a],e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
2
+ //# sourceMappingURL=open-browser-B5VaZ8SA.mjs.map