@inkeep/open-knowledge 0.88.6-beta.4 → 0.88.6-beta.5

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 (203) hide show
  1. package/dist/alias-JE7RI5QX-D_KITrCa.mjs +1 -0
  2. package/dist/awk2-BBAGSFUB-CehlsFZ5.mjs +1 -0
  3. package/dist/bash-IJWYRKFO-D1gJZuWH.mjs +1 -0
  4. package/dist/chokidar-D0G-K3zc.mjs +3 -0
  5. package/dist/{chunk-3BS5SKQH-C9C8uLJE.mjs → chunk-3BS5SKQH-CKmQMz_L.mjs} +15 -15
  6. package/dist/{chunk-62RKD26F-Bv6peUyf.mjs → chunk-62RKD26F-B6OssxCM.mjs} +3 -3
  7. package/dist/{chunk-6Z5SFZXK-CiQN8zZ8.mjs → chunk-6Z5SFZXK-D2_6X1Dn.mjs} +35 -35
  8. package/dist/chunk-A4JSPFCI-DQxLkrTb.mjs +6 -0
  9. package/dist/chunk-D6CWQ5DW-BybImdUI.mjs +5 -0
  10. package/dist/chunk-GOV5EKKI-D42P07Xu.mjs +9 -0
  11. package/dist/{chunk-HKLCLINH-BHo2f5d2.mjs → chunk-HKLCLINH-C2rvDMlW.mjs} +20 -20
  12. package/dist/{chunk-HL6NGDO2-BFPiiJBP.mjs → chunk-HL6NGDO2-CvsVMff5.mjs} +9 -9
  13. package/dist/{chunk-I57KEIP3-C90kULU7.mjs → chunk-I57KEIP3-BrnLL4Gl.mjs} +4 -4
  14. package/dist/{chunk-K6LIBGJA-D-bMYdgr.mjs → chunk-K6LIBGJA-CN_13h4C.mjs} +7 -7
  15. package/dist/{chunk-KRBPSX3W-DXuvylLd.mjs → chunk-KRBPSX3W-CY8FCKFm.mjs} +2 -2
  16. package/dist/chunk-MDDMCKUK-ByCsPSNd.mjs +6 -0
  17. package/dist/chunk-MIZPJHVH-DrIwZ3F_.mjs +7 -0
  18. package/dist/chunk-NAERJDUW-nfjIZ3Pb.mjs +8 -0
  19. package/dist/chunk-NUYSJFDK-M0xrw_uS.mjs +7 -0
  20. package/dist/chunk-OCLXQMOG-DHLmxiVS.mjs +6 -0
  21. package/dist/{chunk-OCS6LSEM-BBT5tk28.mjs → chunk-OCS6LSEM-CUgQNrT_.mjs} +7 -7
  22. package/dist/{chunk-PBXLG62G-G7lHqZ9p.mjs → chunk-PBXLG62G-CuixUdAo.mjs} +3 -3
  23. package/dist/{chunk-T56QNPHK-BuLSSwpV.mjs → chunk-T56QNPHK-BhobE-0w.mjs} +3 -3
  24. package/dist/chunk-TLSUDHID-BpXt2GFu.mjs +6 -0
  25. package/dist/{chunk-TOMNU26N-CPb3jib2.mjs → chunk-TOMNU26N-Bhlbw7_h.mjs} +3 -3
  26. package/dist/{chunk-TP4BZANS-BKDDD1i2.mjs → chunk-TP4BZANS-Dv2qAxWh.mjs} +12 -12
  27. package/dist/{chunk-XKWWSDBF-CiyukTrj.mjs → chunk-XKWWSDBF-COm-Bab0.mjs} +10 -10
  28. package/dist/{chunk-YMMW5UAP-B7swMNER.mjs → chunk-YMMW5UAP-CTA9rr10.mjs} +7 -7
  29. package/dist/chunk-YTNYSM6T-gRMum0pq.mjs +11 -0
  30. package/dist/{chunk-YULBWSET-BjwIKz2I.mjs → chunk-YULBWSET-BZbeBpnM.mjs} +6 -6
  31. package/dist/{chunk-Z6LRHWXI-B5pNb54L.mjs → chunk-Z6LRHWXI-BE3EMa92.mjs} +5 -5
  32. package/dist/{chunk-ZZO3UDB3-Dr2Q2MNF.mjs → chunk-ZZO3UDB3-C92Poglu.mjs} +32 -32
  33. package/dist/cli-DtqA8k1H.mjs +110 -0
  34. package/dist/cli.mjs +1 -110
  35. package/dist/constants-D-73L_8T.mjs +1 -0
  36. package/dist/constants-ok-dir-DZ25OS9-.mjs +115 -0
  37. package/dist/{cp-XOYR4ABJ-BWvobbqd.mjs → cp-XOYR4ABJ-KRhRq3W9.mjs} +1 -1
  38. package/dist/{curl-47BFPSFW-CjxwhFSt.mjs → curl-47BFPSFW-D1cYHIfa.mjs} +8 -8
  39. package/dist/{diff-HJF2MPDN-B5Vu5bd_.mjs → diff-HJF2MPDN-CLb1d3Pm.mjs} +1 -1
  40. package/dist/dist-D4ipyg1q.mjs +1 -0
  41. package/dist/{dist-DIwQtyEF.mjs → dist-DPe6aLSk.mjs} +518 -522
  42. package/dist/env-5EPCWSXR-B6cYhau7.mjs +1 -0
  43. package/dist/expansion-VBDYWVZR-vhATs2YP.mjs +1 -0
  44. package/dist/expr-YYCVMXE3-BG-gQLPe.mjs +1 -0
  45. package/dist/{file-IGDTDPLG-CRy1Omyh.mjs → file-IGDTDPLG-CqcQiax7.mjs} +1 -1
  46. package/dist/find-DH2ALKQS-DUCbwSBg.mjs +1 -0
  47. package/dist/flag-coverage-6JEX67RU-BgXRRqNM.mjs +1 -0
  48. package/dist/fs-find-project-root-BYV07wjn.mjs +5 -0
  49. package/dist/git-credential-get-BOA4DNNp.mjs +2 -0
  50. package/dist/git-credential-helper-DY8W25nc.mjs +1 -0
  51. package/dist/git-credential-operation-9lLcCrJB.mjs +1 -0
  52. package/dist/grep-2HUTXO5U-CbvcQZdY.mjs +1 -0
  53. package/dist/index.mjs +302 -302
  54. package/dist/{init-DrtyRwCd.mjs → init-C08CTCp9.mjs} +28 -28
  55. package/dist/init-CSYVvJYZ.mjs +1 -0
  56. package/dist/jq-LYZFFBZB-DP4gih1P.mjs +1 -0
  57. package/dist/{js-exec-VXN6TZ7U-Z8_USGOo.mjs → js-exec-VXN6TZ7U-B4rL1N_3.mjs} +4 -4
  58. package/dist/{js-exec-VXN6TZ7U-D--44jnh.mjs → js-exec-VXN6TZ7U-CByMmXZz.mjs} +8 -8
  59. package/dist/launch-json-removal-B39BoBBe.mjs +1 -0
  60. package/dist/{lib-CxwDRGVJ.mjs → lib-CGyiYSWt.mjs} +15 -15
  61. package/dist/{ln-4TRFBYAT-xkfE7-89.mjs → ln-4TRFBYAT-RK1Uvly1.mjs} +1 -1
  62. package/dist/loader-D4dq2xfA.mjs +1 -0
  63. package/dist/loader-DeOCcx0c.mjs +1 -0
  64. package/dist/{lzma-CEMDJHEs.mjs → lzma-B6QS2aZK.mjs} +2 -2
  65. package/dist/{lzma-PPHiE419.mjs → lzma-VPfz3anC.mjs} +1 -1
  66. package/dist/md-manager-BGnqyqi1-DmEmjhMs.mjs +400 -0
  67. package/dist/{mkdir-TDEMSB6C-DKSMdaAE.mjs → mkdir-TDEMSB6C-Ds9y3YxN.mjs} +1 -1
  68. package/dist/{mv-Z6MORUFL-C-C4Dr_j.mjs → mv-Z6MORUFL-C9ixK1Sz.mjs} +1 -1
  69. package/dist/{open-browser-1Rfqcka0.mjs → open-browser-d8GjenQK.mjs} +1 -1
  70. package/dist/parse-worker.mjs +1 -1
  71. package/dist/preview-BD9T555q.mjs +1 -0
  72. package/dist/preview-BOmvdi0o.mjs +2 -0
  73. package/dist/printf-CX64KX2P-DlBDp9me.mjs +1 -0
  74. package/dist/public/assets/{AccountSection-CvEQFMeu.js → AccountSection-UK4fSEAo.js} +1 -1
  75. package/dist/public/assets/{ActivityModeContent-CXZShFfa.js → ActivityModeContent-CD3FGIx9.js} +1 -1
  76. package/dist/public/assets/{AddPropertiesButton-fzqN8jo0.js → AddPropertiesButton-B6p_gdr8.js} +1 -1
  77. package/dist/public/assets/{AgentDiffPane-DpPw6Vrx.js → AgentDiffPane-DkoQ7ai2.js} +1 -1
  78. package/dist/public/assets/{AttachmentsSection-CM625TNw.js → AttachmentsSection-B4oQIzeZ.js} +1 -1
  79. package/dist/public/assets/{CodeMirrorPropInput-DhTOQHoT.js → CodeMirrorPropInput-B9s5B9Bw.js} +1 -1
  80. package/dist/public/assets/{ContentRulesSection-CmbLyKpr.js → ContentRulesSection-aWJrYA4j.js} +1 -1
  81. package/dist/public/assets/{DocumentContext-BV1YTd2j.js → DocumentContext-DXpWi5ky.js} +1 -1
  82. package/dist/public/assets/{EditorModeToggle-DpLjVkbn.js → EditorModeToggle-Diya7MyF.js} +1 -1
  83. package/dist/public/assets/{ExcalidrawDocEditor-B8pXWkF3.js → ExcalidrawDocEditor-PRwr0WYf.js} +1 -1
  84. package/dist/public/assets/FeedbackForm-Cvqd9EXq.js +1 -0
  85. package/dist/public/assets/{ImportSkillDialog-BhxfW92X.js → ImportSkillDialog-CMk2xlCO.js} +1 -1
  86. package/dist/public/assets/{LinkPreviewsSection-CQbnzKbR.js → LinkPreviewsSection-KX_4h53c.js} +1 -1
  87. package/dist/public/assets/{LintConfigEditor-Cjpsh9rK.js → LintConfigEditor-7ZtCVw7Y.js} +1 -1
  88. package/dist/public/assets/{LintingSection-C1YnkUp9.js → LintingSection-ClAY_FjD.js} +1 -1
  89. package/dist/public/assets/ManagedArtifactProperties-C6A9h_XM.js +1 -0
  90. package/dist/public/assets/{ManagedArtifactProperties-Be_X7jvo.js → ManagedArtifactProperties-lEwwds9N.js} +1 -1
  91. package/dist/public/assets/{MermaidDocEditor-C4ZqQjrP.js → MermaidDocEditor-DHUtun4r.js} +1 -1
  92. package/dist/public/assets/{NetworkAccessSection-BBlBPreP.js → NetworkAccessSection-CkW30CIT.js} +1 -1
  93. package/dist/public/assets/{PropertyDisplayRow-Dug4mXDY.js → PropertyDisplayRow-D6c0dfSa.js} +1 -1
  94. package/dist/public/assets/{PublishToGitHubDialog-CTJhJVAo.js → PublishToGitHubDialog-CwF7zH2X.js} +1 -1
  95. package/dist/public/assets/{SchemaConfigEditor-BudGex9d.js → SchemaConfigEditor-BEJxtFtu.js} +1 -1
  96. package/dist/public/assets/{SearchSection-DoHDN8qv.js → SearchSection-CDyx2C9f.js} +1 -1
  97. package/dist/public/assets/{SessionsHost-hU0XdNe1.js → SessionsHost-H5NLeN9a.js} +2 -2
  98. package/dist/public/assets/{SettingsDialogBody-oVGZPfLs.js → SettingsDialogBody-C_YjecBu.js} +2 -2
  99. package/dist/public/assets/{ShareReceiveMissDialog-Cv1nXUjE.js → ShareReceiveMissDialog-D_FkOpht.js} +1 -1
  100. package/dist/public/assets/{SkillToolbarControls-Cmmd5rQT.js → SkillToolbarControls-CtxNLAp-.js} +1 -1
  101. package/dist/public/assets/{SourceEditor-BxGAh_1V.js → SourceEditor-B5LnWxyf.js} +1 -1
  102. package/dist/public/assets/{SyncSection-Bow4_eTH.js → SyncSection-D3PTVWIM.js} +1 -1
  103. package/dist/public/assets/{SyncStatusBadge-RstDs12m.js → SyncStatusBadge-BaJrZaL1.js} +1 -1
  104. package/dist/public/assets/{TerminalSection-CShVO8cy.js → TerminalSection-CsRkbMx2.js} +1 -1
  105. package/dist/public/assets/{TerminalWindowApp-QKtwgUJg.js → TerminalWindowApp-CA9GKqNE.js} +1 -1
  106. package/dist/public/assets/{TextDocEditor-CXd6guUM.js → TextDocEditor-Ch27GvYs.js} +1 -1
  107. package/dist/public/assets/{ThreadView-B1_dybM1.js → ThreadView-Dj6jQfOU.js} +1 -1
  108. package/dist/public/assets/{TimelineDiffPane-kMqLqGsp.js → TimelineDiffPane-4gPranZj.js} +1 -1
  109. package/dist/public/assets/{client-version-C9gO0ViI.js → client-version-B_xA5Zs6.js} +1 -1
  110. package/dist/public/assets/{comment-chips-CrIr3pI7.js → comment-chips-nSpyi8g5.js} +1 -1
  111. package/dist/public/assets/{config-provider-B6XrR1oF.js → config-provider-CNRgcd7O.js} +1 -1
  112. package/dist/public/assets/{doc-undo-manager-5pEmL4Md.js → doc-undo-manager-mWX4_oGV.js} +1 -1
  113. package/dist/public/assets/{index-B_LvEM9a.js → index-DvFhVjVJ.js} +7 -7
  114. package/dist/public/assets/{lint-plugins-DjYwHU6Y.js → lint-plugins-DAx86XSh.js} +1 -1
  115. package/dist/public/assets/{pending-receive-nav-store-z_w0V1XK.js → pending-receive-nav-store-hbWxGWbG.js} +1 -1
  116. package/dist/public/assets/{preferred-session-events-CnyBH-J0.js → preferred-session-events-CD3TX4uI.js} +1 -1
  117. package/dist/public/assets/{progress-CaJJRh70.js → progress-Bp-8Nd7B.js} +1 -1
  118. package/dist/public/assets/{selection-context-rkLAW0dO.js → selection-context-C7DBYtd4.js} +1 -1
  119. package/dist/public/assets/{src-BHmw898V.js → src-Bd4ITI6l.js} +1 -1
  120. package/dist/public/assets/{telemetry-impl-DMjnHwnz.js → telemetry-impl-D34TS_t5.js} +1 -1
  121. package/dist/public/assets/{telemetry-startup-Dp5luYdb.js → telemetry-startup-S6YVb_-D.js} +1 -1
  122. package/dist/public/assets/{typing-burst-detector-CZm4MWxf.js → typing-burst-detector-BPhBcJhO.js} +1 -1
  123. package/dist/public/assets/{use-activity-panel-jNpqo2Qu.js → use-activity-panel-DAiQAul-.js} +1 -1
  124. package/dist/public/assets/{use-open-skill-CAlUFWAX.js → use-open-skill-BiGTEBAG.js} +1 -1
  125. package/dist/public/assets/{use-terminal-enabled-2ee2nusY.js → use-terminal-enabled-BPFt3ZjV.js} +1 -1
  126. package/dist/public/assets/{use-timeline-entry-diff-BFUF2Y2y.js → use-timeline-entry-diff-DI6wb0mp.js} +1 -1
  127. package/dist/public/index.html +19 -19
  128. package/dist/python3-DNGS4G3E-BgcDJ4cm.mjs +11 -0
  129. package/dist/{python3-DNGS4G3E-CixyRGKv.mjs → python3-DNGS4G3E-Cm5Hwa-u.mjs} +3 -3
  130. package/dist/registry-probes-CQ5QHLWA.mjs +16 -0
  131. package/dist/{removal-file-path-El1_tQoY.mjs → removal-file-path-DhnfL9uo.mjs} +1 -1
  132. package/dist/{repair-launch-json-CUEk_b1D.mjs → repair-launch-json-D4tGRImu.mjs} +1 -1
  133. package/dist/{repair-mcp-configs-D7S2EP20.mjs → repair-mcp-configs-CkXUYNJq.mjs} +1 -1
  134. package/dist/rg-XNF3R3II-BCapXTDd.mjs +1 -0
  135. package/dist/{rm-RTZG23RL-CVxZCS0d.mjs → rm-RTZG23RL-pdC15ghA.mjs} +1 -1
  136. package/dist/{rmdir-XTQXT7RK-DnFOfz6J.mjs → rmdir-XTQXT7RK-DcllfdyA.mjs} +1 -1
  137. package/dist/sed-JAPPVBEU-BogTEm4c.mjs +1 -0
  138. package/dist/{sleep-VZFPZFWA-C-QGmlTD.mjs → sleep-VZFPZFWA-Z-cEwS7i.mjs} +1 -1
  139. package/dist/sqlite3-TE5AIOTF-DqoN8a9C.mjs +1 -0
  140. package/dist/{sqlite3-TE5AIOTF-DVwda1Ow.mjs → sqlite3-TE5AIOTF-DxxxT49W.mjs} +3 -3
  141. package/dist/src-DxORHPwx.mjs +1 -0
  142. package/dist/src-uYPRavFi.mjs +16 -0
  143. package/dist/start-BVplvpm0.mjs +5 -0
  144. package/dist/start-Dp7OVBDP.mjs +1 -0
  145. package/dist/tar-MZQD7NO4-DEw7Py1-.mjs +1 -0
  146. package/dist/{tar-MZQD7NO4-BRGDcHqv.mjs → tar-MZQD7NO4-ljX84Spn.mjs} +2 -2
  147. package/dist/time-DEUO3QV2-BdkhaszE.mjs +1 -0
  148. package/dist/{timeout-VRKMCG72-Bn-zPLw8.mjs → timeout-VRKMCG72-BJshiKR9.mjs} +1 -1
  149. package/dist/token-store-Bmb3_0hU.mjs +2 -0
  150. package/dist/touch-DX2IJOQ4-DQk2E3PA.mjs +1 -0
  151. package/dist/{tr-2HXZRDSW-D6nqhlWa.mjs → tr-2HXZRDSW-B9XzLO_W.mjs} +1 -1
  152. package/dist/xan-UD7JYIL2-B0nl-bKu.mjs +1 -0
  153. package/dist/xargs-I6EZUCYF-DyMYQH4H.mjs +1 -0
  154. package/dist/yq-OAKYHSXH-BuWuWli6.mjs +1 -0
  155. package/package.json +4 -4
  156. package/dist/alias-JE7RI5QX-DJCUhA0w.mjs +0 -1
  157. package/dist/awk2-BBAGSFUB-e61UM1Y8.mjs +0 -1
  158. package/dist/bash-IJWYRKFO-L9NsSg-G.mjs +0 -1
  159. package/dist/chokidar-BXdru135.mjs +0 -3
  160. package/dist/chunk-A4JSPFCI-Ywh1N_m_.mjs +0 -6
  161. package/dist/chunk-D6CWQ5DW-CWPsf9FV.mjs +0 -5
  162. package/dist/chunk-GOV5EKKI-DH8052og.mjs +0 -9
  163. package/dist/chunk-MDDMCKUK-B8V-vwhF.mjs +0 -6
  164. package/dist/chunk-MIZPJHVH-D45kCv1L.mjs +0 -7
  165. package/dist/chunk-NAERJDUW-g_zD_t_X.mjs +0 -8
  166. package/dist/chunk-NUYSJFDK-C3CfS8pU.mjs +0 -7
  167. package/dist/chunk-OCLXQMOG-BgcVHeKY.mjs +0 -6
  168. package/dist/chunk-TLSUDHID-BY7gVdyC.mjs +0 -6
  169. package/dist/chunk-YTNYSM6T-3WjLDS_v.mjs +0 -11
  170. package/dist/constants-BxUVFv0v.mjs +0 -1
  171. package/dist/dist-C1xee7WC.mjs +0 -1
  172. package/dist/env-5EPCWSXR-hkmWHgd5.mjs +0 -1
  173. package/dist/expansion-VBDYWVZR-CPnYsIZl.mjs +0 -1
  174. package/dist/expr-YYCVMXE3-DtiMaNQl.mjs +0 -1
  175. package/dist/find-DH2ALKQS-44-asZtW.mjs +0 -1
  176. package/dist/flag-coverage-6JEX67RU-CvfAS1f3.mjs +0 -1
  177. package/dist/grep-2HUTXO5U-CoGVhBxG.mjs +0 -1
  178. package/dist/init-D_UJIf3q.mjs +0 -1
  179. package/dist/jq-LYZFFBZB-CXMPfDWj.mjs +0 -1
  180. package/dist/launch-json-removal-CzsGIWza.mjs +0 -1
  181. package/dist/loader-651GN5sB.mjs +0 -1
  182. package/dist/loader-DbUHvJUZ.mjs +0 -1
  183. package/dist/md-manager-BGnqyqi1-uHVeQn_6.mjs +0 -514
  184. package/dist/preview-CZSVVTzm.mjs +0 -2
  185. package/dist/preview-Cem1ca21.mjs +0 -1
  186. package/dist/printf-CX64KX2P-zCdxSgaG.mjs +0 -1
  187. package/dist/public/assets/FeedbackForm-DZj72gd9.js +0 -1
  188. package/dist/public/assets/ManagedArtifactProperties-BJLN3Tgw.js +0 -1
  189. package/dist/python3-DNGS4G3E-CRyO5yp1.mjs +0 -11
  190. package/dist/registry-probes-BtvDhVsS.mjs +0 -17
  191. package/dist/rg-XNF3R3II-ClllMprJ.mjs +0 -1
  192. package/dist/sed-JAPPVBEU-D49-i6JC.mjs +0 -1
  193. package/dist/sqlite3-TE5AIOTF-BK092fD6.mjs +0 -1
  194. package/dist/src-D9bFP3lk.mjs +0 -1
  195. package/dist/src-TUVVD6Gp.mjs +0 -16
  196. package/dist/start-D8Lh1b_o.mjs +0 -1
  197. package/dist/start-MojQH3H6.mjs +0 -5
  198. package/dist/tar-MZQD7NO4-D__44nPJ.mjs +0 -1
  199. package/dist/time-DEUO3QV2-BAt2bzlP.mjs +0 -1
  200. package/dist/touch-DX2IJOQ4-BJTz2DiT.mjs +0 -1
  201. package/dist/xan-UD7JYIL2-IybnHHpT.mjs +0 -1
  202. package/dist/xargs-I6EZUCYF-CpVYZvg1.mjs +0 -1
  203. package/dist/yq-OAKYHSXH-kqRGBS-8.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{$f as r,Af as i,Gf as a,Hf as o,Id as s,K as c,Kf as l,Lf as u,Nf as d,Pf as f,Qf as p,Rf as m,Uf as h,V as g,Xa as _,Ya as v,Zf as y,_ as b,a as x,al as S,ap as C,ep as w,jf as ee,kc as te,kf as ne,op as re,qf as ie,tt as ae,vd as oe,z as se,zd as ce}from"./md-manager-BGnqyqi1-uHVeQn_6.mjs";import{Aa as le,B as ue,Br as de,F as fe,Hs as pe,Kr as me,Ms as T,Nt as he,Pa as ge,Qo as _e,Qr as ve,R as ye,W as be,Xo as xe,_i as Se,at as Ce,ct as we,ds as Te,ea as Ee,ei as De,fs as Oe,hn as ke,ka as Ae,lr as je,ls as Me,m as Ne,mi as Pe,nr as Fe,ps as Ie,qa as Le,qo as Re,us as E,xs as ze,z as Be}from"./dist-DIwQtyEF.mjs";import{i as Ve,n as D,o as O,r as He,s as k,t as A}from"./colors-r_owlCuY.mjs";import{t as j}from"./is-object-BGze3w87.mjs";import{t as Ue}from"./constants-BxUVFv0v.mjs";import{t as We}from"./preview-CZSVVTzm.mjs";import{createRequire as Ge}from"node:module";import{execFileSync as Ke}from"node:child_process";import qe,{basename as Je,dirname as M,isAbsolute as Ye,join as N,posix as Xe,relative as P,resolve as F,sep as I,win32 as Ze}from"node:path";import L from"node:process";import{fileURLToPath as Qe}from"node:url";import{copyFileSync as $e,existsSync as R,lstatSync as et,mkdirSync as tt,readFileSync as z,readdirSync as nt,readlinkSync as rt,realpathSync as it,rmSync as at,statSync as ot,writeFileSync as st}from"node:fs";import{homedir as B}from"node:os";import{inspect as ct,stripVTControlCharacters as lt,styleText as V}from"node:util";import*as ut from"node:readline";import{AsyncLocalStorage as dt,AsyncResource as ft}from"node:async_hooks";var pt=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),mt=n((e=>{let{InvalidArgumentError:t}=pt();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),ht=n((e=>{let{humanReadableArgName:t}=mt();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
1
+ import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{A as r,C as i,I as a,L as o,O as s,S as c,d as l,j as u,k as d,w as f,x as p}from"./constants-ok-dir-DZ25OS9-.mjs";import{Cf as m,K as h,V as g,Xa as _,Ya as v,_ as y,_d as b,a as x,bd as S,df as ee,ff as C,hf as te,kc as ne,mf as re,tt as ie,uf as ae,vf as oe,wf as se,yf as ce,z as w}from"./md-manager-BGnqyqi1-DmEmjhMs.mjs";import{B as le,Ca as ue,F as de,Fr as fe,Ji as pe,Ko as me,Ns as he,Nt as ge,Oa as _e,R as ve,Va as ye,Vo as be,Vr as xe,W as Se,Wo as Ce,Yr as we,as as T,at as Te,cr as Ee,ct as De,di as Oe,hn as ke,hs as Ae,is as je,m as Me,os as Ne,qr as Pe,rs as Fe,ss as Ie,tr as Le,wa as Re,z as ze}from"./dist-DPe6aLSk.mjs";import{n as Be,s as E}from"./fs-find-project-root-BYV07wjn.mjs";import{i as Ve,n as D,o as O,r as He,s as k,t as A}from"./colors-r_owlCuY.mjs";import{t as j}from"./is-object-BGze3w87.mjs";import{t as Ue}from"./constants-D-73L_8T.mjs";import{t as We}from"./preview-BOmvdi0o.mjs";import{createRequire as Ge}from"node:module";import{fileURLToPath as Ke}from"node:url";import qe,{basename as Je,dirname as M,isAbsolute as Ye,join as N,posix as Xe,relative as P,resolve as F,sep as I,win32 as Ze}from"node:path";import L from"node:process";import{copyFileSync as Qe,existsSync as R,lstatSync as $e,mkdirSync as et,readFileSync as z,readdirSync as tt,readlinkSync as nt,realpathSync as rt,rmSync as it,statSync as at,writeFileSync as ot}from"node:fs";import{homedir as B}from"node:os";import{AsyncLocalStorage as st,AsyncResource as ct}from"node:async_hooks";import{execFileSync as lt}from"node:child_process";import{inspect as ut,stripVTControlCharacters as dt,styleText as V}from"node:util";import*as ft from"node:readline";var pt=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),mt=n((e=>{let{InvalidArgumentError:t}=pt();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),ht=n((e=>{let{humanReadableArgName:t}=mt();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
2
2
  `)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
3
3
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
4
4
  `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),gt=n((e=>{let{InvalidArgumentError:t}=pt();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
@@ -16,7 +16,7 @@ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._life
16
16
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
17
17
  - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=i.resolve(e,t);if(a.existsSync(n))return n;if(s.includes(i.extname(t)))return;let r=s.find(e=>a.existsSync(`${n}${e}`));if(r)return`${n}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=i.resolve(i.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=i.basename(this._scriptPath,i.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}n=s.includes(i.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=g(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=g(o.execArgv).concat(t),f=r.spawn(o.argv[0],t,{stdio:`inherit`})):f=r.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
18
18
  `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in o.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new p(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=m(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=m(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>c(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(o.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
19
- Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function g(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}t.Command=h,t.useColor=_}));const{program:yt,createCommand:bt,createArgument:xt,createOption:St,CommanderError:Ct,InvalidArgumentError:wt,InvalidOptionArgumentError:Tt,Command:Et,Argument:Dt,Option:Ot,Help:kt}=t(n((e=>{let{Argument:t}=mt(),{Command:n}=vt(),{CommanderError:r,InvalidArgumentError:i}=pt(),{Help:a}=ht(),{Option:o}=gt();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default,At=new Set([`emacs`,`vim`]);function jt(e){return At.has(e)}function Mt(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(jt))):[]}const Nt=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Pt=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ft=e=>e.name===`space`,It=e=>e.name===`backspace`,Lt=e=>`1234567890`.includes(e.name),Rt=e=>e.name===`enter`||e.name===`return`;var zt=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Bt=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Vt=class extends Error{name=`ExitPromptError`},Ht=class extends Error{name=`HookError`},Ut=class extends Error{name=`ValidationError`};const Wt=new dt;function Gt(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Kt(e,t){let n=Gt(e);return Wt.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function H(){let e=Wt.getStore();if(!e)throw new Ht(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function qt(){return H().rl}function Jt(e){return ft.bind((...t)=>{let n=H(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function Yt(e){let t=H(),{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 Xt(){H().handleChange()}const Zt={queue(e){let t=H(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(qt());if(r!=null&&typeof r!=`function`)throw new Ut(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=H();Jt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=H();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function Qt(e){return typeof e==`function`}function U(e){return Yt(t=>{let n=ft.bind(function(e){t.get()!==e&&(t.set(e),Xt())});if(t.initialized)return[t.get(),n];let r=Qt(e)?e():e;return t.set(r),[r,n]})}function $t(e,t){Yt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&Zt.queue(e),n.set(t)})}function en(){return L.platform.startsWith(`win`)?!!L.env.CI||!!L.env.WT_SESSION||!!L.env.TERMINUS_SUBLIME||L.env.ConEmuTask===`{cmd::Cmder}`||L.env.TERM_PROGRAM===`Terminus-Sublime`||L.env.TERM_PROGRAM===`vscode`||L.env.TERM===`xterm-256color`||L.env.TERM===`alacritty`||L.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:L.env.TERM!==`linux`}const tn={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:`╱`},nn={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:`⅒`},rn={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`},an={...tn,...nn},on={...tn,...rn},W=en()?an:on;Object.entries(nn);const sn={prefix:{idle:V(`blue`,`?`),done:V(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>V(`yellow`,e))},keybindings:[],style:{answer:e=>V(`cyan`,e),message:e=>V(`bold`,e),error:e=>V(`red`,`> ${e}`),defaultAnswer:e=>V(`dim`,`(${e})`),help:e=>V(`dim`,e),highlight:e=>V(`cyan`,e),key:e=>V(`cyan`,V(`bold`,`<${e}>`))}};function cn(){return{...sn,keybindings:Mt()}}function ln(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 un(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ln(n)&&ln(r)?un(n,r):r}return t}function dn(...e){return un(cn(),...e.filter(e=>e!=null))}function fn({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=dn(t);return $t(()=>{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)}}r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function pn(e,t){return Yt(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 mn(e){return U({current:e})[0]}function hn(e){let t=mn(e);t.current=e,$t(e=>{let n=!1,r=Jt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var gn=t(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}}))(),1);const _n=(()=>{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}})(),vn=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,yn=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,bn=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,xn=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Sn=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Cn=/\t{1,1000}/y,wn=/[\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,Tn=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,En=/\p{M}+/gu,Dn={limit:1/0,ellipsis:``},On=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?On(i,Dn,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Tn,l],[bn,0],[xn,o],[Cn,s],[wn,c],[Sn,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(En,``)){let t=e.codePointAt(0)||0;if(S=vn(t)?2:yn(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===Sn?_n(e.slice(p,n.lastIndex)):n===wn?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}},kn={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>On(e,kn,t).width,An=`]8;;`,jn=RegExp(`(?:\\[(?<code>\\d+)m|\\${An}(?<uri>.*))`,`y`),Mn=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},Nn=e=>`[${e}m`,Pn=e=>`${An}${e}`,Fn=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(An,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())},In=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ln=(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=G(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=G(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(``),Fn(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Fn(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Fn(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>In(e)));let l=s.join(`
19
+ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function g(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}t.Command=h,t.useColor=_}));const{program:yt,createCommand:bt,createArgument:xt,createOption:St,CommanderError:Ct,InvalidArgumentError:wt,InvalidOptionArgumentError:Tt,Command:Et,Argument:Dt,Option:Ot,Help:kt}=t(n((e=>{let{Argument:t}=mt(),{Command:n}=vt(),{CommanderError:r,InvalidArgumentError:i}=pt(),{Help:a}=ht(),{Option:o}=gt();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default,At=new Set([`emacs`,`vim`]);function jt(e){return At.has(e)}function Mt(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(jt))):[]}const Nt=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Pt=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ft=e=>e.name===`space`,It=e=>e.name===`backspace`,Lt=e=>`1234567890`.includes(e.name),Rt=e=>e.name===`enter`||e.name===`return`;var zt=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Bt=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Vt=class extends Error{name=`ExitPromptError`},Ht=class extends Error{name=`HookError`},Ut=class extends Error{name=`ValidationError`};const Wt=new st;function Gt(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Kt(e,t){let n=Gt(e);return Wt.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function H(){let e=Wt.getStore();if(!e)throw new Ht(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function qt(){return H().rl}function Jt(e){return ct.bind((...t)=>{let n=H(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function Yt(e){let t=H(),{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 Xt(){H().handleChange()}const Zt={queue(e){let t=H(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(qt());if(r!=null&&typeof r!=`function`)throw new Ut(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=H();Jt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=H();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function Qt(e){return typeof e==`function`}function U(e){return Yt(t=>{let n=ct.bind(function(e){t.get()!==e&&(t.set(e),Xt())});if(t.initialized)return[t.get(),n];let r=Qt(e)?e():e;return t.set(r),[r,n]})}function $t(e,t){Yt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&Zt.queue(e),n.set(t)})}function en(){return L.platform.startsWith(`win`)?!!L.env.CI||!!L.env.WT_SESSION||!!L.env.TERMINUS_SUBLIME||L.env.ConEmuTask===`{cmd::Cmder}`||L.env.TERM_PROGRAM===`Terminus-Sublime`||L.env.TERM_PROGRAM===`vscode`||L.env.TERM===`xterm-256color`||L.env.TERM===`alacritty`||L.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:L.env.TERM!==`linux`}const tn={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:`╱`},nn={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:`⅒`},rn={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`},an={...tn,...nn},on={...tn,...rn},W=en()?an:on;Object.entries(nn);const sn={prefix:{idle:V(`blue`,`?`),done:V(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>V(`yellow`,e))},keybindings:[],style:{answer:e=>V(`cyan`,e),message:e=>V(`bold`,e),error:e=>V(`red`,`> ${e}`),defaultAnswer:e=>V(`dim`,`(${e})`),help:e=>V(`dim`,e),highlight:e=>V(`cyan`,e),key:e=>V(`cyan`,V(`bold`,`<${e}>`))}};function cn(){return{...sn,keybindings:Mt()}}function ln(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 un(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ln(n)&&ln(r)?un(n,r):r}return t}function dn(...e){return un(cn(),...e.filter(e=>e!=null))}function fn({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=dn(t);return $t(()=>{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)}}r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function pn(e,t){return Yt(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 mn(e){return U({current:e})[0]}function hn(e){let t=mn(e);t.current=e,$t(e=>{let n=!1,r=Jt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var gn=t(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}}))(),1);const _n=(()=>{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}})(),vn=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,yn=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,bn=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,xn=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Sn=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Cn=/\t{1,1000}/y,wn=/[\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,Tn=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,En=/\p{M}+/gu,Dn={limit:1/0,ellipsis:``},On=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?On(i,Dn,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Tn,l],[bn,0],[xn,o],[Cn,s],[wn,c],[Sn,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(En,``)){let t=e.codePointAt(0)||0;if(S=vn(t)?2:yn(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===Sn?_n(e.slice(p,n.lastIndex)):n===wn?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}},kn={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>On(e,kn,t).width,An=`]8;;`,jn=RegExp(`(?:\\[(?<code>\\d+)m|\\${An}(?<uri>.*))`,`y`),Mn=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},Nn=e=>`[${e}m`,Pn=e=>`${An}${e}`,Fn=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(An,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())},In=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ln=(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=G(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=G(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(``),Fn(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Fn(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Fn(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>In(e)));let l=s.join(`
20
20
  `),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===`›`){jn.lastIndex=e+1;let t=jn.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]===`
21
21
  `){a&&(r+=Pn(``));let e=i?Mn(i):void 0;i&&e&&(r+=Nn(e))}else t===`
22
22
  `&&(i&&Mn(i)&&(r+=Nn(i)),a&&(r+=Pn(a)))}return r},Rn=/\r?\n/;function zn(e,t,n){return String(e).normalize().split(Rn).map(e=>Ln(e,t,n)).join(`
@@ -27,10 +27,10 @@ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let
27
27
  `)),c=s.reduce((e,t)=>e+t.length,0),l=e=>s[e]??[],u=Hn({active:t,renderedItems:s,pageSize:r,loop:i}),d=l(t).slice(0,r),f=u+d.length<=r?u:r-d.length,p=Array.from({length:r});p.splice(f,d.length,...d);let m=new Set([t]),h=f+d.length,g=o(t+1);for(;h<r&&!m.has(g)&&(i&&c>r?g!==t:g>t);){let e=l(g).slice(0,r-h);p.splice(h,e.length,...e),m.add(g),h+=e.length,g=o(g+1)}for(h=f-1,g=o(t-1);h>=0&&!m.has(g)&&(i&&c>r?g!==t:g<t);){let e=l(g),t=e.slice(Math.max(0,e.length-h-1));p.splice(h-t.length+1,t.length,...t),m.add(g),h-=t.length,g=o(g-1)}return p.filter(e=>typeof e==`string`).join(`
28
28
  `)}var Wn=t(n(((t,n)=>{let r=e(`stream`);n.exports=class extends r{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on(`pipe`,this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,t){return this._dest?this._dest[e]:this._src?this._src[e]:t}#n(e,...t){typeof this._dest?.[e]==`function`&&this._dest[e](...t),typeof this._src?.[e]==`function`&&this._src[e](...t)}get isTTY(){return this.#e===null?this.#t(`isTTY`,!1):this.#e}set isTTY(e){this.#e=e}get rows(){return this.#t(`rows`)}get columns(){return this.#t(`columns`)}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return e.indexOf(this._prompt)===0&&(e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit(`data`,e);this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit(`data`,this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit(`data`,e)}end(e){this.muted&&(e=e&&this.replace?e.toString().replace(/./g,this.replace):null),e&&this.emit(`data`,e),this.emit(`end`)}destroy(...e){return this.#n(`destroy`,...e)}destroySoon(...e){return this.#n(`destroySoon`,...e)}close(...e){return this.#n(`close`,...e)}}}))(),1);const Gn=[];Gn.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&Gn.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&Gn.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const Kn=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,qn=Symbol.for(`signal-exit emitter`),Jn=globalThis,Yn=Object.defineProperty.bind(Object);var Xn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Jn[qn])return Jn[qn];Yn(Jn,qn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},Zn=class{};const Qn=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var $n=class extends Zn{onExit(){return()=>{}}load(){}unload(){}},er=class extends Zn{#e=tr.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new Xn;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of Gn)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!Kn(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of Gn)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,Gn.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return Kn(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&Kn(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}return n.call(this.#n,e,...t)}};const tr=globalThis.process,{onExit:nr,load:rr,unload:ir}=Qn(Kn(tr)?new er(tr):new $n),ar=`\x1B[?25l`,or=(e=1)=>e>0?`[${e}A`:``,sr=(e=1)=>e>0?`[${e}B`:``,cr=(e,t)=>typeof t==`number`&&!Number.isNaN(t)?`[${t+1};${e+1}H`:`[${e+1}G`,lr=e=>e>0?(`\x1B[2K`+or(1)).repeat(e-1)+`\x1B[2K\x1B[G`:``,ur=e=>e.split(`
29
29
  `).length,dr=e=>e.split(`
30
- `).pop()??``;var fr=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=dr(e),r=lt(n),i=r;this.rl.line.length>0&&(i=i.slice(0,-this.rl.line.length)),this.rl.setPrompt(i),this.cursorPos=this.rl.getCursorPos();let a=Vn();e=Bn(e,a),t=Bn(t,a),r.length%a===0&&(e+=`
30
+ `).pop()??``;var fr=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=dr(e),r=dt(n),i=r;this.rl.line.length>0&&(i=i.slice(0,-this.rl.line.length)),this.rl.setPrompt(i),this.cursorPos=this.rl.getCursorPos();let a=Vn();e=Bn(e,a),t=Bn(t,a),r.length%a===0&&(e+=`
31
31
  `);let o=e+(t?`
32
32
  `+t:``),s=Math.floor(r.length/a)-this.cursorPos.rows+(t?ur(t):0);s>0&&(o+=or(s)),o+=cr(this.cursorPos.cols),this.write(sr(this.extraLinesUnderPrompt)+lr(this.height)+o),this.extraLinesUnderPrompt=s,this.height=ur(o)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(cr(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt(``);let t=sr(this.extraLinesUnderPrompt);t+=e?lr(this.height):`
33
- `,t+=`\x1B[G`,t+=`\x1B[?25h`,this.write(t),this.rl.close()}},pr=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}};const mr=globalThis.setImmediate;function hr(){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 gr(e){let t=hr();return(n,r={})=>{let{input:i=process.stdin,signal:a}=r,o=new Set,s=new Wn.default;s.pipe(r.output??process.stdout);let c=ut.createInterface({terminal:!0,input:i,output:s});s.mute();let l=new fr(c),{promise:u,resolve:d,reject:f}=pr.withResolver(),p=()=>f(new Bt);if(a){let e=()=>f(new zt({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(nr((e,t)=>{f(new Vt(`User force closed the prompt with ${e} ${t}`))}));let m=()=>f(new Vt(`User force closed the prompt with SIGINT`));return c.on(`SIGINT`,m),o.add(()=>c.removeListener(`SIGINT`,m)),Kt(c,a=>{let m=ft.bind(()=>Zt.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=qe.resolve(e)),Error(`Prompt functions must return a string.\n at ${e}`)}let[o,s]=typeof a==`string`?[a]:a;l.render(o,s),Zt.run()}catch(e){f(e)}if(r=!0,i!==null){let{value:e}=i;i=null,d(e)}})};return`readableFlowing`in i?mr(h):h(),Object.assign(u.then(e=>(Zt.clearAll(),e),e=>{throw Zt.clearAll(),e}).finally(()=>{o.forEach(e=>e()),l.done({clearContent:!!r.clearPromptOnDone}),s.end()}).then(()=>u),{cancel:p})})}}var K=class{separator=V(`dim`,Array.from({length:15}).join(W.line));type=`separator`;constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`separator`)}};
33
+ `,t+=`\x1B[G`,t+=`\x1B[?25h`,this.write(t),this.rl.close()}},pr=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}};const mr=globalThis.setImmediate;function hr(){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 gr(e){let t=hr();return(n,r={})=>{let{input:i=process.stdin,signal:a}=r,o=new Set,s=new Wn.default;s.pipe(r.output??process.stdout);let c=ft.createInterface({terminal:!0,input:i,output:s});s.mute();let l=new fr(c),{promise:u,resolve:d,reject:f}=pr.withResolver(),p=()=>f(new Bt);if(a){let e=()=>f(new zt({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(nr((e,t)=>{f(new Vt(`User force closed the prompt with ${e} ${t}`))}));let m=()=>f(new Vt(`User force closed the prompt with SIGINT`));return c.on(`SIGINT`,m),o.add(()=>c.removeListener(`SIGINT`,m)),Kt(c,a=>{let m=ct.bind(()=>Zt.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=qe.resolve(e)),Error(`Prompt functions must return a string.\n at ${e}`)}let[o,s]=typeof a==`string`?[a]:a;l.render(o,s),Zt.run()}catch(e){f(e)}if(r=!0,i!==null){let{value:e}=i;i=null,d(e)}})};return`readableFlowing`in i?mr(h):h(),Object.assign(u.then(e=>(Zt.clearAll(),e),e=>{throw Zt.clearAll(),e}).finally(()=>{o.forEach(e=>e()),l.done({clearContent:!!r.clearPromptOnDone}),s.end()}).then(()=>u),{cancel:p})})}}var K=class{separator=V(`dim`,Array.from({length:15}).join(W.line));type=`separator`;constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`separator`)}};
34
34
  /*!
35
35
  * Copyright (c) Squirrel Chat et al., All rights reserved.
36
36
  * SPDX-License-Identifier: BSD-3-Clause
@@ -278,7 +278,7 @@ let Lr=/^[a-z0-9-_]+$/i;function Rr(e){let t=typeof e;if(t===`object`){if(Array.
278
278
  `)+Gr(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=Vr(t[c],e,r,i),a+=`
279
279
  `}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function Kr(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(Rr(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=Gr(0,e,``,t,n);return r[r.length-1]===`
280
280
  `?r:r+`
281
- `}var qr=oe();function Jr(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 Yr(e){return!e||typeof e!=`object`?String(e):`${typeof e} keys=[${Object.keys(e).join(`,`)}]`}function Xr(e,t){let n=[],r=new WeakSet,i=t;for(;i instanceof Error&&!r.has(i);)r.add(i),n.push(i.message),i=i.cause;return n.length===0?`${e}: ${Yr(t)}`:`${e}: ${n.reverse().slice(0,5).join(` -> `)}`}function Y(e,t){process.env.OK_DEBUG_NATIVE&&process.stderr.write(`[ok] native-config ${Xr(e,t)}\n`)}const Zr=[`native`,`index.js`];function Qr(e={},t=Y){let n=e.moduleUrl??import.meta.url,r=e.requireModule??Ge(n);try{let e=M(Qe(n));return r(N(e,...Zr))}catch(e){Jr(e)||t(`bundled loader failed to load`,e)}try{return r(`@inkeep/open-knowledge-native-config`)}catch(e){return Jr(e)||t(`workspace addon failed to load`,e),null}}function $r(){let e=Qr();return e&&typeof e.parseTomlToJson==`function`?e:null}function ei(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return Y(`addon loaded but probe failed`,e),!1}}function ti(e){if(!j(e))throw Error(`TOML root is not a table`);return e}function ni(e){return{backend:`native`,parseToObject(t){return ti(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}},removeEntryKey(t,n,r){let i=e.removeMcpServerKey(t,n,r);return{text:i.text,existed:i.existed}}}}function ri(){return{backend:`fallback`,parseToObject(e){return ti(Ir(e))}}}function ii(e=$r){let t=e();return t&&ei(t)?ni(t):ri()}let ai=null;function oi(){return ai===null&&(ai=ii()),ai}function si(){let e=oi();return e.backend===`native`?e:void 0}const ci=ne,X=i,li=d,ui=`node`,di={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`};function fi(){let e=re();return e===`stable`?{...di}:{...di,[ie]:e}}const pi=`@inkeep/open-knowledge`;function mi(e){return`${se(`unix-chain`,e.mcpChainTag)}2`}function hi(e){return`${se(`windows-chain`,e.mcpChainTag)}1`}function gi(e){let t=l[e],n=`${pi}@${t.npmDistTag}`,r=e===`stable`?``:`\nexport ${ie}=${e}`;return`${mi(t)}${r}
281
+ `}var qr=p();function Jr(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 Yr(e){return!e||typeof e!=`object`?String(e):`${typeof e} keys=[${Object.keys(e).join(`,`)}]`}function Xr(e,t){let n=[],r=new WeakSet,i=t;for(;i instanceof Error&&!r.has(i);)r.add(i),n.push(i.message),i=i.cause;return n.length===0?`${e}: ${Yr(t)}`:`${e}: ${n.reverse().slice(0,5).join(` -> `)}`}function Y(e,t){process.env.OK_DEBUG_NATIVE&&process.stderr.write(`[ok] native-config ${Xr(e,t)}\n`)}const Zr=[`native`,`index.js`];function Qr(e={},t=Y){let n=e.moduleUrl??import.meta.url,r=e.requireModule??Ge(n);try{let e=M(Ke(n));return r(N(e,...Zr))}catch(e){Jr(e)||t(`bundled loader failed to load`,e)}try{return r(`@inkeep/open-knowledge-native-config`)}catch(e){return Jr(e)||t(`workspace addon failed to load`,e),null}}function $r(){let e=Qr();return e&&typeof e.parseTomlToJson==`function`?e:null}function ei(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return Y(`addon loaded but probe failed`,e),!1}}function ti(e){if(!j(e))throw Error(`TOML root is not a table`);return e}function ni(e){return{backend:`native`,parseToObject(t){return ti(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}},removeEntryKey(t,n,r){let i=e.removeMcpServerKey(t,n,r);return{text:i.text,existed:i.existed}}}}function ri(){return{backend:`fallback`,parseToObject(e){return ti(Ir(e))}}}function ii(e=$r){let t=e();return t&&ei(t)?ni(t):ri()}let ai=null;function oi(){return ai===null&&(ai=ii()),ai}function si(){let e=oi();return e.backend===`native`?e:void 0}const ci=ae,X=ee,li=re,ui=`node`,di={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`};function fi(){let e=o();return e===`stable`?{...di}:{...di,[f]:e}}const pi=`@inkeep/open-knowledge`;function mi(e){return`${w(`unix-chain`,e.mcpChainTag)}2`}function hi(e){return`${w(`windows-chain`,e.mcpChainTag)}1`}function gi(e){let t=i[e],n=`${pi}@${t.npmDistTag}`,r=e===`stable`?``:`\nexport ${f}=${e}`;return`${mi(t)}${r}
282
282
  USER_BUNDLE="$HOME/Applications/${t.productName}.app/Contents/Resources/cli/bin/ok.sh"
283
283
  [ -f "$USER_BUNDLE" ] && [ -x "$USER_BUNDLE" ] && exec "$USER_BUNDLE" mcp
284
284
  BUNDLE="/Applications/${t.productName}.app/Contents/Resources/cli/bin/ok.sh"
@@ -290,7 +290,7 @@ for d in "$HOME/.nvm/versions/node"/*/bin "$HOME/.fnm/node-versions"/*/installat
290
290
  [ -f "$d/npx" ] && [ -x "$d/npx" ] && exec "$d/npx" -y ${n} mcp
291
291
  done
292
292
  echo "OpenKnowledge: install OK Desktop or Node.js 24+, then restart your editor" >&2
293
- exit 127`}function _i(e){let t=l[e],n=`${pi}@${t.npmDistTag}`,r=`${t.cliCommandNames[0]}.cmd`,i=t.npmDistTag===`latest`?pi:n,a=e===`stable`?``:`\n$env:${ie} = '${e}'`;return`${hi(t)}${a}
293
+ exit 127`}function _i(e){let t=i[e],n=`${pi}@${t.npmDistTag}`,r=`${t.cliCommandNames[0]}.cmd`,a=t.npmDistTag===`latest`?pi:n,o=e===`stable`?``:`\n$env:${f} = '${e}'`;return`${hi(t)}${o}
294
294
  if ($env:PATHEXT -notmatch 'CMD') { $env:PATHEXT = '.COM;.EXE;.BAT;.CMD;' + $env:PATHEXT }
295
295
  if ($env:APPDATA) {
296
296
  $shim = Join-Path $env:APPDATA 'npm\\${r}'
@@ -313,27 +313,27 @@ foreach ($d in $dirs) {
313
313
  $probe = Join-Path $d 'npx.cmd'
314
314
  if (Test-Path -LiteralPath $probe -PathType Leaf) { & $probe -y '${n}' mcp; exit $LASTEXITCODE }
315
315
  }
316
- [Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g ${i}), then restart your editor')
317
- exit 127`}const vi=`A dev build writes no MCP launcher for an installed OpenKnowledge channel, because that launcher runs a released CLI. Register this checkout by running \`${a} init --dev-mcp\` in the project, or set OK_CHANNEL=stable.`;function yi(){let e=re();if(e===`dev`)throw Error(vi);return e}mi(l.stable),gi(`stable`),hi(l.stable),_i(`stable`);function bi(e){return`// ok-pi-bridge${e.mcpChainTag}`}function xi(e){return`${bi(e)}-v1`}function Si(e){return`${bi(e)}-dev`}bi(l.stable),xi(l.stable);function Ci(e){if(typeof e!=`object`||!e)return!1;let t=p(),n=e;if(n.command===`/bin/sh`){if(!Array.isArray(n.args)||n.args[0]!==`-l`||n.args[1]!==`-c`)return!1;let e=n.args[2];return Mi(e,mi(t))}if(n.command===`powershell`){if(!Array.isArray(n.args)||n.args[0]!==`-NoProfile`||n.args[1]!==`-NonInteractive`||n.args[2]!==`-Command`)return!1;let e=n.args[3];return Mi(e,hi(t))}if(n.type===`local`&&Array.isArray(n.command)){if(n.command[0]===`/bin/sh`){if(n.command[1]!==`-l`||n.command[2]!==`-c`)return!1;let e=n.command[3];return Mi(e,mi(t))}if(n.command[0]===`powershell`){if(n.command[1]!==`-NoProfile`||n.command[2]!==`-NonInteractive`||n.command[3]!==`-Command`)return!1;let e=n.command[4];return Mi(e,hi(t))}return!1}if(n.command===`ok-pi-managed-extension`){if(!Array.isArray(n.args))return!1;let e=n.args[0];return typeof e==`string`&&e.startsWith(xi(t))}return!1}function wi(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=F(e);if(Je(t)===`cli.mjs`&&Je(M(t))===`dist`)return t;let n=t.split(I),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r),a=i.length===0?I:i.join(I);return N(a,`packages`,`cli`,`dist`,`cli.mjs`)}function Z(e={}){return e.mode===`dev`?{command:ui,args:[wi(),`mcp`],env:fi()}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,_i(yi())]}:{command:`/bin/sh`,args:[`-l`,`-c`,gi(yi())]}}function Ti(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[ui,wi(),`mcp`],environment:fi()}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,_i(yi())]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,gi(yi())]}}function Ei(e){if(typeof e!=`object`||!e||C())return!1;let t=e;return Di(t,Z({mode:`published`,platformName:`darwin`}))||Di(t,Z({mode:`published`,platformName:`win32`}))}function Di(e,t){return Object.keys(e).length===Object.keys(t).length&&Oi(e,t)}function Oi(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function ki(e,t){let n=e=>Ni(e);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`&&e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3])}function Ai(e){return e.format===`toml`?oi().backend===`native`:e.format===`json`||e.format===`yaml`}function ji(e){return Array.isArray(e.command)?e.command:[e.command,...Array.isArray(e.args)?e.args:[]]}function Mi(e,t){return typeof e==`string`&&e.trimStart().startsWith(t)}function Ni(e){return Mi(e,`# ok-mcp`)}function Pi(e){return typeof e==`string`&&(e===pi||e.startsWith(`${pi}@`))}function Fi(e){if(typeof e!=`object`||!e)return!1;let t=ji(e),n=t.findIndex(e=>e===`-c`||e===`-Command`);return n>=0&&Ni(t[n+1])?!0:t.some(Pi)}function Ii(e){if(typeof e!=`object`||!e)return!1;let t=ji(e);if(t[0]!==ui||t[2]!==`mcp`)return!1;try{return t[1]===wi()}catch{return!1}}const Li=[`command`,`args`,`env`],Ri=[`type`,`command`,`environment`];function zi(e){return e.type===`local`&&Array.isArray(e.command)?Ri:Li}function Bi(e,t){if(t===null||typeof e!=`object`||!e)return[];let n=e;return zi(t).filter(e=>t[e]===void 0&&n[e]!==void 0)}function Vi(e,t){return e.format===`file`||C()?null:e.buildEntry(t,{})}function Hi(e,t){return Bi(e,t).length>0}function Ui(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:ki(t.args,t.command)}function Wi(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&ki(r,n)}function Q(e){return e===`win32`?Ze:Xe}function Gi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=e.env??process.env,i=Q(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA||i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME||i.join(n,`.config`)}function Ki(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.claude.json`)}function qi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=e.env??process.env;if(t===`darwin`)return Xe.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??Ze.join(n,`AppData`,`Roaming`);return Ze.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function Ji(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.cursor`,`mcp.json`)}function Yi(e={}){let t=e.platformName??process.platform,n=e.home??B();return(e.env??process.env).CODEX_HOME??Q(t).join(n,`.codex`)}function Xi(e={}){return Q(e.platformName??process.platform).join(Yi(e),`config.toml`)}function Zi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=(e.env??process.env).COPILOT_HOME??Q(t).join(n,`.copilot`);return Q(t).join(r,`mcp-config.json`)}function Qi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=e.env??process.env,i=Q(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function $i(e={}){return Q(e.platformName??process.platform).join(Qi(e),`opencode.json`)}function ea(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.openclaw`,`openclaw.json`)}function ta(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.hermes`,`config.yaml`)}function na(e={}){let t=e.platformName??process.platform,n=e.home??B();return(e.env??process.env).PI_CODING_AGENT_DIR??Q(t).join(n,`.pi`,`agent`)}function ra(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function ia(e,t){let n=Q(t);return[{file:n.join(e,`.lmstudio`,`mcp.json`),dir:n.join(e,`.lmstudio`)},{file:n.join(e,`.cache`,`lm-studio`,`mcp.json`),dir:n.join(e,`.cache`,`lm-studio`)}]}function aa(e){try{return nt(e).length>0}catch{return!1}}function oa(e={}){let t=e.platformName??process.platform,[n,r]=ia(e.home??B(),t),i=[n,r].find(e=>R(e.file));return i?i.file:aa(r.dir)?r.file:n.file}const $={claude:{id:`claude`,label:X.claude,configPath:(e,t)=>Ki({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.claude`),projectConfigPath:e=>N(e,`.mcp.json`),projectSkillPath:e=>N(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:X[`claude-desktop`],configPath:(e,t)=>qi({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(qi({home:t}))},cursor:{id:`cursor`,label:X.cursor,configPath:(e,t)=>Ji({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(Ji({home:t})),projectConfigPath:e=>N(e,`.cursor`,`mcp.json`),projectSkillPath:e=>N(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:X.codex,configPath:(e,t)=>Xi({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(Xi({home:t})),projectConfigPath:e=>N(e,`.codex`,`config.toml`),projectSkillPath:e=>N(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:X.copilot,configPath:(e,t)=>Zi({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(Zi({home:t})),projectSkillPath:e=>N(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:X.opencode,configPath:(e,t)=>$i({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>r(),buildEntry:(e,t)=>Ti(t),scope:`global`,detectPath:(e,t)=>M($i({home:t})),projectConfigPath:e=>N(e,`opencode.json`),projectSkillPath:e=>N(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:X.openclaw,configPath:(e,t)=>ea({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:X.pi,configPath:()=>{throw Error(`Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at ${o(p())} (run \`${y()} init\` in the project).`)},format:`file`,topLevelKey:`mcpServers`,serverName:()=>r(),scope:`project`,detectPath:(e,t)=>na({home:t}),projectConfigPath:e=>N(e,o(p())),projectSkillPath:e=>N(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:X.antigravity,configPath:(e,t)=>ra({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:X[`lm-studio`],configPath:(e,t)=>oa({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(oa({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:X.hermes,configPath:(e,t)=>ta({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.hermes`),offerOnlyWhenDetected:!0}};function sa(e){let t=e.filter(e=>!Object.hasOwn($,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${ci.join(`, `)}`);return e.map(e=>$[e])}const ca=`**/.ok/*`,la=`!**/${te}/`;function ua(e){let t=[`.ok/`,`.okignore`];for(let n of ci){let r=$[n];r.projectConfigPath&&t.push(Ta(r.projectConfigPath(e),e))}return t.push(`.claude/launch.json`),Array.from(new Set(t))}function da(e){let t=N(e,...x);if(!R(t))return[];try{let e=g(z(t,`utf-8`));if(!e)return[];let n=[];for(let[t,r]of Object.entries(e.skills))if(t!==`open-knowledge`)for(let e of r.hosts){let r=ee[e];r&&n.push(`${r}/${t}/`)}return Array.from(new Set(n))}catch{return[]}}function fa(e,t){let n=ga(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:ba(n)};let r=xa(e);if(r.kind!==`ok`)return r.result;let i=R(r.path)?z(r.path,`utf-8`):``,a=new Set(da(e)),o=[],s=a.size===0?i:i.split(`
316
+ [Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g ${a}), then restart your editor')
317
+ exit 127`}const vi=`A dev build writes no MCP launcher for an installed OpenKnowledge channel, because that launcher runs a released CLI. Register this checkout by running \`${c} init --dev-mcp\` in the project, or set OK_CHANNEL=stable.`;function yi(){let e=o();if(e===`dev`)throw Error(vi);return e}mi(i.stable),gi(`stable`),hi(i.stable),_i(`stable`);function bi(e){return`// ok-pi-bridge${e.mcpChainTag}`}function xi(e){return`${bi(e)}-v1`}function Si(e){return`${bi(e)}-dev`}bi(i.stable),xi(i.stable);function Ci(e){if(typeof e!=`object`||!e)return!1;let t=d(),n=e;if(n.command===`/bin/sh`){if(!Array.isArray(n.args)||n.args[0]!==`-l`||n.args[1]!==`-c`)return!1;let e=n.args[2];return Mi(e,mi(t))}if(n.command===`powershell`){if(!Array.isArray(n.args)||n.args[0]!==`-NoProfile`||n.args[1]!==`-NonInteractive`||n.args[2]!==`-Command`)return!1;let e=n.args[3];return Mi(e,hi(t))}if(n.type===`local`&&Array.isArray(n.command)){if(n.command[0]===`/bin/sh`){if(n.command[1]!==`-l`||n.command[2]!==`-c`)return!1;let e=n.command[3];return Mi(e,mi(t))}if(n.command[0]===`powershell`){if(n.command[1]!==`-NoProfile`||n.command[2]!==`-NonInteractive`||n.command[3]!==`-Command`)return!1;let e=n.command[4];return Mi(e,hi(t))}return!1}if(n.command===`ok-pi-managed-extension`){if(!Array.isArray(n.args))return!1;let e=n.args[0];return typeof e==`string`&&e.startsWith(xi(t))}return!1}function wi(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=F(e);if(Je(t)===`cli.mjs`&&Je(M(t))===`dist`)return t;let n=t.split(I),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r),a=i.length===0?I:i.join(I);return N(a,`packages`,`cli`,`dist`,`cli.mjs`)}function Z(e={}){return e.mode===`dev`?{command:ui,args:[wi(),`mcp`],env:fi()}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,_i(yi())]}:{command:`/bin/sh`,args:[`-l`,`-c`,gi(yi())]}}function Ti(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[ui,wi(),`mcp`],environment:fi()}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,_i(yi())]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,gi(yi())]}}function Ei(e){if(typeof e!=`object`||!e||a())return!1;let t=e;return Di(t,Z({mode:`published`,platformName:`darwin`}))||Di(t,Z({mode:`published`,platformName:`win32`}))}function Di(e,t){return Object.keys(e).length===Object.keys(t).length&&Oi(e,t)}function Oi(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function ki(e,t){let n=e=>Ni(e);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`&&e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3])}function Ai(e){return e.format===`toml`?oi().backend===`native`:e.format===`json`||e.format===`yaml`}function ji(e){return Array.isArray(e.command)?e.command:[e.command,...Array.isArray(e.args)?e.args:[]]}function Mi(e,t){return typeof e==`string`&&e.trimStart().startsWith(t)}function Ni(e){return Mi(e,`# ok-mcp`)}function Pi(e){return typeof e==`string`&&(e===pi||e.startsWith(`${pi}@`))}function Fi(e){if(typeof e!=`object`||!e)return!1;let t=ji(e),n=t.findIndex(e=>e===`-c`||e===`-Command`);return n>=0&&Ni(t[n+1])?!0:t.some(Pi)}function Ii(e){if(typeof e!=`object`||!e)return!1;let t=ji(e);if(t[0]!==ui||t[2]!==`mcp`)return!1;try{return t[1]===wi()}catch{return!1}}const Li=[`command`,`args`,`env`],Ri=[`type`,`command`,`environment`];function zi(e){return e.type===`local`&&Array.isArray(e.command)?Ri:Li}function Bi(e,t){if(t===null||typeof e!=`object`||!e)return[];let n=e;return zi(t).filter(e=>t[e]===void 0&&n[e]!==void 0)}function Vi(e,t){return e.format===`file`||a()?null:e.buildEntry(t,{})}function Hi(e,t){return Bi(e,t).length>0}function Ui(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:ki(t.args,t.command)}function Wi(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&ki(r,n)}function Q(e){return e===`win32`?Ze:Xe}function Gi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=e.env??process.env,i=Q(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA||i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME||i.join(n,`.config`)}function Ki(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.claude.json`)}function qi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=e.env??process.env;if(t===`darwin`)return Xe.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??Ze.join(n,`AppData`,`Roaming`);return Ze.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function Ji(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.cursor`,`mcp.json`)}function Yi(e={}){let t=e.platformName??process.platform,n=e.home??B();return(e.env??process.env).CODEX_HOME??Q(t).join(n,`.codex`)}function Xi(e={}){return Q(e.platformName??process.platform).join(Yi(e),`config.toml`)}function Zi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=(e.env??process.env).COPILOT_HOME??Q(t).join(n,`.copilot`);return Q(t).join(r,`mcp-config.json`)}function Qi(e={}){let t=e.platformName??process.platform,n=e.home??B(),r=e.env??process.env,i=Q(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function $i(e={}){return Q(e.platformName??process.platform).join(Qi(e),`opencode.json`)}function ea(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.openclaw`,`openclaw.json`)}function ta(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.hermes`,`config.yaml`)}function na(e={}){let t=e.platformName??process.platform,n=e.home??B();return(e.env??process.env).PI_CODING_AGENT_DIR??Q(t).join(n,`.pi`,`agent`)}function ra(e={}){let t=e.platformName??process.platform,n=e.home??B();return Q(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function ia(e,t){let n=Q(t);return[{file:n.join(e,`.lmstudio`,`mcp.json`),dir:n.join(e,`.lmstudio`)},{file:n.join(e,`.cache`,`lm-studio`,`mcp.json`),dir:n.join(e,`.cache`,`lm-studio`)}]}function aa(e){try{return tt(e).length>0}catch{return!1}}function oa(e={}){let t=e.platformName??process.platform,[n,r]=ia(e.home??B(),t),i=[n,r].find(e=>R(e.file));return i?i.file:aa(r.dir)?r.file:n.file}const $={claude:{id:`claude`,label:X.claude,configPath:(e,t)=>Ki({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.claude`),projectConfigPath:e=>N(e,`.mcp.json`),projectSkillPath:e=>N(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:X[`claude-desktop`],configPath:(e,t)=>qi({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(qi({home:t}))},cursor:{id:`cursor`,label:X.cursor,configPath:(e,t)=>Ji({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(Ji({home:t})),projectConfigPath:e=>N(e,`.cursor`,`mcp.json`),projectSkillPath:e=>N(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:X.codex,configPath:(e,t)=>Xi({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(Xi({home:t})),projectConfigPath:e=>N(e,`.codex`,`config.toml`),projectSkillPath:e=>N(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:X.copilot,configPath:(e,t)=>Zi({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(Zi({home:t})),projectSkillPath:e=>N(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:X.opencode,configPath:(e,t)=>$i({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>r(),buildEntry:(e,t)=>Ti(t),scope:`global`,detectPath:(e,t)=>M($i({home:t})),projectConfigPath:e=>N(e,`opencode.json`),projectSkillPath:e=>N(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:X.openclaw,configPath:(e,t)=>ea({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:X.pi,configPath:()=>{throw Error(`Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at ${m(d())} (run \`${s()} init\` in the project).`)},format:`file`,topLevelKey:`mcpServers`,serverName:()=>r(),scope:`project`,detectPath:(e,t)=>na({home:t}),projectConfigPath:e=>N(e,m(d())),projectSkillPath:e=>N(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:X.antigravity,configPath:(e,t)=>ra({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:X[`lm-studio`],configPath:(e,t)=>oa({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>M(oa({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:X.hermes,configPath:(e,t)=>ta({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>r(),buildEntry:(e,t)=>Z(t),scope:`global`,detectPath:(e,t)=>N(t??B(),`.hermes`),offerOnlyWhenDetected:!0}};function sa(e){let t=e.filter(e=>!Object.hasOwn($,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${ci.join(`, `)}`);return e.map(e=>$[e])}const ca=`**/.ok/*`,la=`!**/${ne}/`;function ua(e){let t=[`.ok/`,`.okignore`];for(let n of ci){let r=$[n];r.projectConfigPath&&t.push(Ta(r.projectConfigPath(e),e))}return t.push(`.claude/launch.json`),Array.from(new Set(t))}function da(e){let t=N(e,...x);if(!R(t))return[];try{let e=g(z(t,`utf-8`));if(!e)return[];let n=[];for(let[t,r]of Object.entries(e.skills))if(t!==`open-knowledge`)for(let e of r.hosts){let r=C[e];r&&n.push(`${r}/${t}/`)}return Array.from(new Set(n))}catch{return[]}}function fa(e,t){let n=ga(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:ba(n)};let r=xa(e);if(r.kind!==`ok`)return r.result;let i=R(r.path)?z(r.path,`utf-8`):``,a=new Set(da(e)),o=[],s=a.size===0?i:i.split(`
318
318
  `).filter(e=>{let t=e.trim();return!a.has(t)||(o.push(t),!1)}).join(`
319
319
  `),c=wa(s),l=[],u=[];for(let e of t)Ca(c,e)?u.push(e):l.push(e);if(l.length===0&&o.length===0)return{kind:`updated`,appended:l,alreadyPresent:u,removed:[]};let d=l.length===0||s.length===0||s.endsWith(`
320
320
  `)?``:`
321
321
  `,f=l.length===0?``:`${l.join(`
322
- `)}\n`;try{st(r.path,`${s}${d}${f}`,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:l,alreadyPresent:u,removed:o}}function pa(e,t){let n=xa(e);if(n.kind!==`ok`)return n.result;if(!R(n.path))return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let r=t.map(e=>Sa(e)),i=new Set;for(let e of r)for(let t of e)i.add(t);i.add(ca),i.add(la);for(let t of da(e))i.add(t);let a;try{a=z(n.path,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}let o=a.split(`
322
+ `)}\n`;try{ot(r.path,`${s}${d}${f}`,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:l,alreadyPresent:u,removed:o}}function pa(e,t){let n=xa(e);if(n.kind!==`ok`)return n.result;if(!R(n.path))return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let r=t.map(e=>Sa(e)),i=new Set;for(let e of r)for(let t of e)i.add(t);i.add(ca),i.add(la);for(let t of da(e))i.add(t);let a;try{a=z(n.path,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}let o=a.split(`
323
323
  `),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=[...s];if(s.size===0)return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let u=c.join(`
324
- `);if(u!==a)try{st(n.path,u,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:[],alreadyPresent:[],removed:l}}function ma(e){let t=xa(e);if(t.kind!==`ok`)return t.result.reason===`no-git`||t.result.reason===`malformed-pointer`||t.result.reason===`inaccessible`?`no-git`:`shared`;if(!R(t.path))return`shared`;let n;try{n=z(t.path,`utf-8`)}catch{return`shared`}let r=wa(n),i=ua(e);for(let e of i)if(Ca(r,e))return`local-only`;return r.has(ca)?`local-only`:`shared`}function ha(e){let t=xa(e);if(t.kind!==`ok`||!R(t.path))return[];let n;try{n=z(t.path,`utf-8`)}catch{return[]}let r=wa(n),i=[...ua(e),...da(e)].filter(e=>Ca(r,e)),a=new Set(i),o=[];for(let e of Object.values(ee))e!==null&&o.push(e);let s=[];for(let e of r){if(a.has(e))continue;if(e===ca||e===la){s.push(e);continue}let t=e.replace(/^\//,``).replace(/\/$/,``);o.some(e=>t.startsWith(`${e}/`)&&t.length>e.length+1)&&s.push(e)}return[...i,...s]}function ga(e,t){let n=[];for(let r of t){let t=F(e,r);if(R(t))try{Ke(`git`,[`ls-files`,`--error-unmatch`,...c([r])],Re({cwd:e,stdio:[`ignore`,`ignore`,`ignore`]})),n.push(r)}catch{}}return{tracked:n}}const _a=/^[\w.\-/]+$/;function va(e){return process.platform===`win32`?`"${e.replaceAll(`"`,``)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`}function ya(e){return _a.test(e)?e:va(ae(e))}function ba(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}-- ${ya(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(`
325
- `)}function xa(e){let t=ze(e);switch(t.kind){case`repository`:{let e=t.repository.readCommonDir();if(e.kind===`unreadable`)return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`inaccessible`}};let n=N(e.path,`info`);return R(n)?{kind:`ok`,path:N(n,`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 Sa(e){let t=e.replace(/\/$/,``);return new Set([e,t,`/${e}`,`/${t}`])}function Ca(e,t){for(let n of Sa(t))if(e.has(n))return!0;return!1}function wa(e){let t=new Set;for(let n of e.split(`
326
- `)){let e=n.trim();e.length!==0&&t.add(e)}return t}function Ta(e,t){return Ea(P(t,e))}function Ea(e){return I===`/`?e:e.split(I).join(`/`)}function Da(e,t){let n=M(t),r=R(t)?`overwritten`:`written`;if(r===`written`&&R(n))throw Error(`Refusing to replace ${n}: it exists but holds no SKILL.md, so it is not a bundle OpenKnowledge wrote. Move it aside and try again.`);return at(n,{recursive:!0,force:!0}),tt(M(n),{recursive:!0}),Oa(e,n),r}function Oa(e,t){tt(t,{recursive:!0});for(let n of nt(e,{withFileTypes:!0})){let r=N(e,n.name),i=N(t,n.name);n.isDirectory()?Oa(r,i):$e(r,i)}}var ka=class extends Error{name=`ProjectPathSafetyError`;code=`PROJECT_PATH_SAFETY`};function Aa(e,t){let n;try{n=et(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw new ka(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Ma(e,t)}function ja(e,t){Ma(e,t)}function Ma(e,t){Na(e,t)}function Na(e,t){let n=t,r;try{r=it(n)}catch{r=F(n)}let i=M(e);for(;i.length>1&&i!==I;){let t;try{t=it(i)}catch(e){if(e.code===`ENOENT`){i=M(i);continue}throw e}let n=P(r,t);if(n===``||!n.startsWith(`..`)&&!Ye(n))return;throw new ka(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${r}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function Pa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Fa(e,t,n){try{if(ot(n).size>10485760)return!1}catch{return!1}let r;try{r=z(n,`utf-8`)}catch{return!1}let i=[],a=Oe(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!Pa(a))return!1;let o=a[e.topLevelKey];if(!Pa(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;if(!Pa(s))return!1;let c=s[e.serverName(t)];return Pa(c)&&c.enabled===!1?!1:Fi(c)||Ii(c)}function Ia(e){let t=s[e]?.satisfiers.find(e=>e.piece===`mcp`&&e.scope===`project`),n=t?.pathId===void 0?null:ce(t.pathId);return n===null||n.kind!==`editor-project-config`||n.editor===e?null:$[n.editor]??null}function La(e,t,n={}){if(!m.includes(e.id))return!0;let r=Ia(e.id),i=r?.projectConfigPath?.(t);if(r!==null&&i!==void 0&&Fa(r,t,i))return!0;try{return Fa(e,t,e.configPath(t,n.home))}catch{return!1}}function Ra(e){let t=new Set(f.filter(e=>e.scope===`project`).map(e=>e.editorId));return e.filter(e=>t.has(e))}function za(e,t){if(Ra(t).length===0)return null;let n=N(e,v,u,`SKILL.md`);try{let t=ge(`project`,{checkDesktop:!0});return Aa(M(n),e),{editorId:`agents`,label:`.agents hub`,action:Da(t,n),path:n}}catch(e){return{editorId:`agents`,label:`.agents hub`,action:`failed`,path:n,error:e instanceof Error?e.message:String(e)}}}function Ba(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!La(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=ge(`project`,{checkDesktop:!0});Aa(M(r),t);let i=Da(n,r);return{editorId:e.id,label:e.label,action:i,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function Va(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=M(n);return R(n)?(ja(r,t),at(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function Ha(e){switch(e?.code){case`EACCES`:case`EPERM`:return`permission-denied`;case`ELOOP`:return`unresolved-symlink`;case`EISDIR`:case`ENOTDIR`:return`not-a-file`;case`ENOENT`:return`disappeared`;default:return`unreadable`}}function Ua(e){switch(e){case`permission-denied`:return`permission denied; check file and parent-directory permissions, then retry`;case`missing-symlink-target`:return`the symlink target is missing; restore the target or correct the symlink, then retry`;case`unresolved-symlink`:return`the path or symlink could not be resolved; check path permissions and repair any symlink cycle, then retry`;case`not-a-file`:return`the path is not a regular file; restore the intended configuration file, then retry`;case`disappeared`:return`the file disappeared; retry to check its current state`;case`unreadable`:return`the file could not be read; check that the path is accessible, then retry`;default:throw Error(`unhandled configuration file decline reason: ${e}`)}}function Wa(e){for(let t of e.split(`
327
- `)){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 Ga(e){let t=(e.match(/\r\n/g)??[]).length;return t!==0&&t>=(e.match(/\n/g)??[]).length-t}function Ka(e){try{return ot(e).mode&511}catch{return}}function qa(e,t){let n=e.charCodeAt(0)===65279,r=n?e.slice(1):e,i=r.includes(`\r
324
+ `);if(u!==a)try{ot(n.path,u,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:[],alreadyPresent:[],removed:l}}function ma(e){let t=xa(e);if(t.kind!==`ok`)return t.result.reason===`no-git`||t.result.reason===`malformed-pointer`||t.result.reason===`inaccessible`?`no-git`:`shared`;if(!R(t.path))return`shared`;let n;try{n=z(t.path,`utf-8`)}catch{return`shared`}let r=wa(n),i=ua(e);for(let e of i)if(Ca(r,e))return`local-only`;return r.has(ca)?`local-only`:`shared`}function ha(e){let t=xa(e);if(t.kind!==`ok`||!R(t.path))return[];let n;try{n=z(t.path,`utf-8`)}catch{return[]}let r=wa(n),i=[...ua(e),...da(e)].filter(e=>Ca(r,e)),a=new Set(i),o=[];for(let e of Object.values(C))e!==null&&o.push(e);let s=[];for(let e of r){if(a.has(e))continue;if(e===ca||e===la){s.push(e);continue}let t=e.replace(/^\//,``).replace(/\/$/,``);o.some(e=>t.startsWith(`${e}/`)&&t.length>e.length+1)&&s.push(e)}return[...i,...s]}function ga(e,t){let n=[];for(let r of t){let t=F(e,r);if(R(t))try{lt(`git`,[`ls-files`,`--error-unmatch`,...h([r])],be({cwd:e,stdio:[`ignore`,`ignore`,`ignore`]})),n.push(r)}catch{}}return{tracked:n}}const _a=/^[\w.\-/]+$/;function va(e){return process.platform===`win32`?`"${e.replaceAll(`"`,``)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`}function ya(e){return _a.test(e)?e:va(ie(e))}function ba(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}-- ${ya(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(`
325
+ `)}function xa(e){let t=Ae(e);switch(t.kind){case`repository`:{let e=t.repository.readCommonDir();if(e.kind===`unreadable`)return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`inaccessible`}};let n=N(e.path,`info`);return R(n)?{kind:`ok`,path:N(n,`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 Sa(e){let t=e.replace(/\/$/,``);return new Set([e,t,`/${e}`,`/${t}`])}function Ca(e,t){for(let n of Sa(t))if(e.has(n))return!0;return!1}function wa(e){let t=new Set;for(let n of e.split(`
326
+ `)){let e=n.trim();e.length!==0&&t.add(e)}return t}function Ta(e,t){return Ea(P(t,e))}function Ea(e){return I===`/`?e:e.split(I).join(`/`)}function Da(e,t){let n=M(t),r=R(t)?`overwritten`:`written`;if(r===`written`&&R(n))throw Error(`Refusing to replace ${n}: it exists but holds no SKILL.md, so it is not a bundle OpenKnowledge wrote. Move it aside and try again.`);return it(n,{recursive:!0,force:!0}),et(M(n),{recursive:!0}),Oa(e,n),r}function Oa(e,t){et(t,{recursive:!0});for(let n of tt(e,{withFileTypes:!0})){let r=N(e,n.name),i=N(t,n.name);n.isDirectory()?Oa(r,i):Qe(r,i)}}var ka=class extends Error{name=`ProjectPathSafetyError`;code=`PROJECT_PATH_SAFETY`};function Aa(e,t){let n;try{n=$e(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw new ka(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Ma(e,t)}function ja(e,t){Ma(e,t)}function Ma(e,t){Na(e,t)}function Na(e,t){let n=t,r;try{r=rt(n)}catch{r=F(n)}let i=M(e);for(;i.length>1&&i!==I;){let t;try{t=rt(i)}catch(e){if(e.code===`ENOENT`){i=M(i);continue}throw e}let n=P(r,t);if(n===``||!n.startsWith(`..`)&&!Ye(n))return;throw new ka(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${r}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function Pa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Fa(e,t,n){try{if(at(n).size>10485760)return!1}catch{return!1}let r;try{r=z(n,`utf-8`)}catch{return!1}let i=[],a=Ne(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!Pa(a))return!1;let o=a[e.topLevelKey];if(!Pa(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;if(!Pa(s))return!1;let c=s[e.serverName(t)];return Pa(c)&&c.enabled===!1?!1:Fi(c)||Ii(c)}function Ia(e){let t=b[e]?.satisfiers.find(e=>e.piece===`mcp`&&e.scope===`project`),n=t?.pathId===void 0?null:S(t.pathId);return n===null||n.kind!==`editor-project-config`||n.editor===e?null:$[n.editor]??null}function La(e,t,n={}){if(!ce.includes(e.id))return!0;let r=Ia(e.id),i=r?.projectConfigPath?.(t);if(r!==null&&i!==void 0&&Fa(r,t,i))return!0;try{return Fa(e,t,e.configPath(t,n.home))}catch{return!1}}function Ra(e){let t=new Set(te.filter(e=>e.scope===`project`).map(e=>e.editorId));return e.filter(e=>t.has(e))}function za(e,t){if(Ra(t).length===0)return null;let n=N(e,v,oe,`SKILL.md`);try{let t=_e(`project`,{checkDesktop:!0});return Aa(M(n),e),{editorId:`agents`,label:`.agents hub`,action:Da(t,n),path:n}}catch(e){return{editorId:`agents`,label:`.agents hub`,action:`failed`,path:n,error:e instanceof Error?e.message:String(e)}}}function Ba(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!La(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=_e(`project`,{checkDesktop:!0});Aa(M(r),t);let i=Da(n,r);return{editorId:e.id,label:e.label,action:i,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function Va(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=M(n);return R(n)?(ja(r,t),it(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function Ha(e){switch(e?.code){case`EACCES`:case`EPERM`:return`permission-denied`;case`ELOOP`:return`unresolved-symlink`;case`EISDIR`:case`ENOTDIR`:return`not-a-file`;case`ENOENT`:return`disappeared`;default:return`unreadable`}}function Ua(e){switch(e){case`permission-denied`:return`permission denied; check file and parent-directory permissions, then retry`;case`missing-symlink-target`:return`the symlink target is missing; restore the target or correct the symlink, then retry`;case`unresolved-symlink`:return`the path or symlink could not be resolved; check path permissions and repair any symlink cycle, then retry`;case`not-a-file`:return`the path is not a regular file; restore the intended configuration file, then retry`;case`disappeared`:return`the file disappeared; retry to check its current state`;case`unreadable`:return`the file could not be read; check that the path is accessible, then retry`;default:throw Error(`unhandled configuration file decline reason: ${e}`)}}function Wa(e){for(let t of e.split(`
327
+ `)){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 Ga(e){let t=(e.match(/\r\n/g)??[]).length;return t!==0&&t>=(e.match(/\n/g)??[]).length-t}function Ka(e){try{return at(e).mode&511}catch{return}}function qa(e,t){let n=e.charCodeAt(0)===65279,r=n?e.slice(1):e,i=r.includes(`\r
328
328
  `)?`\r
329
329
  `:`
330
- `,a=Te(r,t,void 0,{formattingOptions:{...Wa(r),eol:i}});if(a.length===0)return{text:e,changed:!1};let o=`${n?``:``}${Me(r,a)}`;return{text:o,changed:o!==e}}const Ja={icon:{checked:V(`green`,W.circleFilled),unchecked:W.circle,cursor:W.pointer,disabledChecked:V(`green`,W.circleDouble),disabledUnchecked:`-`},style:{disabled:e=>V(`dim`,e),renderSelectedChoices:e=>e.map(e=>e.short).join(`, `),description:e=>V(`cyan`,e),keysHelpTip:e=>e.map(([e,t])=>`${V(`bold`,e)} ${V(`dim`,t)}`).join(V(`dim`,` • `))},i18n:{disabledError:`This option is disabled and cannot be toggled.`}};function Ya(e){return!K.isSeparator(e)&&!e.disabled}function Xa(e){return!K.isSeparator(e)}function Za(e){return!K.isSeparator(e)&&e.checked}function Qa(e){return Ya(e)?{...e,checked:!e.checked}:e}function $a(e){return function(t){return Ya(t)?{...t,checked:e}:t}}function eo(e){return e.map(e=>{if(K.isSeparator(e))return e;if(typeof e!=`object`||!e||!(`value`in e)){let t=String(e);return{value:e,name:t,short:t,checkedName:t,disabled:!1,checked:!1}}let t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,checkedName:e.checkedName??t,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var to=gr((e,t)=>{let{pageSize:n=7,loop:r=!0,required:i,validate:a=()=>!0}=e,o={all:`a`,invert:`i`,...e.shortcuts},s=dn(Ja,e.theme),{keybindings:c}=s,[l,u]=U(`idle`),d=fn({status:l,theme:s}),[f,p]=U(eo(e.choices)),m=pn(()=>{let e=f.findIndex(Xa),t=f.findLastIndex(Xa);if(e===-1)throw new Ut(`[checkbox prompt] No selectable choices. All choices are disabled.`);return{first:e,last:t}},[f]),[h,g]=U(m.first),[_,v]=U();hn(async e=>{if(Rt(e)){let e=f.filter(Za),n=await a([...e]);i&&!e.length?v(`At least one choice must be selected`):n===!0?(u(`done`),t(e.map(e=>e.value))):v(n||`You must select a valid value`)}else if(Nt(e,c)||Pt(e,c)){if(_&&v(void 0),r||Nt(e,c)&&h!==m.first||Pt(e,c)&&h!==m.last){let t=Nt(e,c)?-1:1,n=h;do n=(n+t+f.length)%f.length;while(!Xa(f[n]));g(n)}}else if(Ft(e)){let e=f[h];e&&!K.isSeparator(e)&&(e.disabled?v(s.i18n.disabledError):(v(void 0),p(f.map((e,t)=>t===h?Qa(e):e))))}else if(e.name===o.all){let e=f.some(e=>Ya(e)&&!e.checked);p(f.map($a(e)))}else if(e.name===o.invert)p(f.map(Qa));else if(Lt(e)){let t=Number(e.name)-1,n=-1,r=f.findIndex(e=>!K.isSeparator(e)&&(n++,n===t)),i=f[r];i&&Ya(i)&&(g(r),p(f.map((e,t)=>t===r?Qa(e):e)))}});let y=s.style.message(e.message,l),b,x=Un({items:f,active:h,renderItem({item:e,isActive:t}){if(K.isSeparator(e))return` ${e.separator}`;let n=t?s.icon.cursor:` `;if(e.disabled){let t=typeof e.disabled==`string`?e.disabled:`(disabled)`,r=e.checked?s.icon.disabledChecked:s.icon.disabledUnchecked;return s.style.disabled(`${n}${r} ${e.name} ${t}`)}t&&(b=e.description);let r=e.checked?s.icon.checked:s.icon.unchecked,i=e.checked?e.checkedName:e.name;return(t?s.style.highlight:e=>e)(`${n}${r} ${i}`)},pageSize:n,loop:r});if(l===`done`){let e=f.filter(Za);return[d,y,s.style.answer(s.style.renderSelectedChoices(e,f))].filter(Boolean).join(` `)}let S=[[`↑↓`,`navigate`],[`space`,`select`]];o.all&&S.push([o.all,`all`]),o.invert&&S.push([o.invert,`invert`]),S.push([`⏎`,`submit`]);let C=s.style.keysHelpTip(S);return`${[[d,y].filter(Boolean).join(` `),x,` `,b?s.style.description(b):``,_?s.style.error(_):``,C].filter(Boolean).join(`
331
- `).trimEnd()}${ar}`});const no={icon:{cursor:W.pointer},style:{disabled:e=>V(`dim`,e),description:e=>V(`cyan`,e),keysHelpTip:e=>e.map(([e,t])=>`${V(`bold`,e)} ${V(`dim`,t)}`).join(V(`dim`,` • `))},i18n:{disabledError:`This option is disabled and cannot be selected.`},indexMode:`hidden`};function ro(e){return!K.isSeparator(e)&&!e.disabled}function io(e){return!K.isSeparator(e)}function ao(e){return e.map(e=>{if(K.isSeparator(e))return e;if(typeof e!=`object`||!e||!(`value`in e)){let t=String(e);return{value:e,name:t,short:t,disabled:!1}}let t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var oo=gr((e,t)=>{let{loop:n=!0,pageSize:r=7}=e,i=dn(no,e.theme),{keybindings:a}=i,[o,s]=U(`idle`),c=fn({status:o,theme:i}),l=mn(),u=!a.includes(`vim`),d=pn(()=>ao(e.choices),[e.choices]),f=pn(()=>{let e=d.findIndex(io),t=d.findLastIndex(io);if(e===-1)throw new Ut(`[select prompt] No selectable choices. All choices are disabled.`);return{first:e,last:t}},[d]),p=pn(()=>`default`in e?d.findIndex(t=>ro(t)&&t.value===e.default):-1,[e.default,d]),[m,h]=U(p===-1?f.first:p),g=d[m];if(g==null||K.isSeparator(g))throw Error(`Active index does not point to a choice`);let[_,v]=U();hn((e,r)=>{if(clearTimeout(l.current),_&&v(void 0),Rt(e))g.disabled?v(i.i18n.disabledError):(s(`done`),t(g.value));else if(Nt(e,a)||Pt(e,a)){if(r.clearLine(0),n||Nt(e,a)&&m!==f.first||Pt(e,a)&&m!==f.last){let t=Nt(e,a)?-1:1,n=m;do n=(n+t+d.length)%d.length;while(!io(d[n]));h(n)}}else if(Lt(e)&&!Number.isNaN(Number(r.line))){let e=Number(r.line)-1,t=-1,n=d.findIndex(n=>!K.isSeparator(n)&&(t++,t===e)),i=d[n];i!=null&&ro(i)&&h(n),l.current=setTimeout(()=>{r.clearLine(0)},700)}else if(It(e))r.clearLine(0);else if(u){let e=r.line.toLowerCase(),t=d.findIndex(t=>K.isSeparator(t)||!ro(t)?!1:t.name.toLowerCase().startsWith(e));t!==-1&&h(t),l.current=setTimeout(()=>{r.clearLine(0)},700)}}),$t(()=>()=>{clearTimeout(l.current)},[]);let y=i.style.message(e.message,o),b=i.style.keysHelpTip([[`↑↓`,`navigate`],[`⏎`,`select`]]),x=0,S=Un({items:d,active:m,renderItem({item:e,isActive:t,index:n}){if(K.isSeparator(e))return x++,` ${e.separator}`;let r=t?i.icon.cursor:` `,a=i.indexMode===`number`?`${n+1-x}. `:``;if(e.disabled){let n=typeof e.disabled==`string`?e.disabled:`(disabled)`,r=t?i.icon.cursor:`-`;return i.style.disabled(`${r} ${a}${e.name} ${n}`)}return(t?i.style.highlight:e=>e)(`${r} ${a}${e.name}`)},pageSize:r,loop:n});if(o===`done`)return[c,y,i.style.answer(g.short)].filter(Boolean).join(` `);let{description:C}=g;return`${[[c,y].filter(Boolean).join(` `),S,` `,C?i.style.description(C):``,_?i.style.error(_):``,b].filter(Boolean).join(`
332
- `).trimEnd()}${ar}`});function so(e){let t=p(),n=e.split(/\r?\n/,1)[0]??``;if(n===Si(t))return!0;let r=bi(t);return n.startsWith(r)&&/^-v\d+$/.test(n.slice(r.length))}function co(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`&&so(n)}function lo(e){return{command:`ok-pi-managed-extension`,args:[e]}}function uo(e={}){let t=e.mode===`dev`,n=p(),r=t?Si(n):xi(n),i=`${h(n)}_`,a={unix:Z({...e,platformName:`darwin`}),win32:Z({...e,platformName:`win32`})};return`${r}
330
+ `,a=T(r,t,void 0,{formattingOptions:{...Wa(r),eol:i}});if(a.length===0)return{text:e,changed:!1};let o=`${n?``:``}${Fe(r,a)}`;return{text:o,changed:o!==e}}const Ja={icon:{checked:V(`green`,W.circleFilled),unchecked:W.circle,cursor:W.pointer,disabledChecked:V(`green`,W.circleDouble),disabledUnchecked:`-`},style:{disabled:e=>V(`dim`,e),renderSelectedChoices:e=>e.map(e=>e.short).join(`, `),description:e=>V(`cyan`,e),keysHelpTip:e=>e.map(([e,t])=>`${V(`bold`,e)} ${V(`dim`,t)}`).join(V(`dim`,` • `))},i18n:{disabledError:`This option is disabled and cannot be toggled.`}};function Ya(e){return!K.isSeparator(e)&&!e.disabled}function Xa(e){return!K.isSeparator(e)}function Za(e){return!K.isSeparator(e)&&e.checked}function Qa(e){return Ya(e)?{...e,checked:!e.checked}:e}function $a(e){return function(t){return Ya(t)?{...t,checked:e}:t}}function eo(e){return e.map(e=>{if(K.isSeparator(e))return e;if(typeof e!=`object`||!e||!(`value`in e)){let t=String(e);return{value:e,name:t,short:t,checkedName:t,disabled:!1,checked:!1}}let t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,checkedName:e.checkedName??t,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var to=gr((e,t)=>{let{pageSize:n=7,loop:r=!0,required:i,validate:a=()=>!0}=e,o={all:`a`,invert:`i`,...e.shortcuts},s=dn(Ja,e.theme),{keybindings:c}=s,[l,u]=U(`idle`),d=fn({status:l,theme:s}),[f,p]=U(eo(e.choices)),m=pn(()=>{let e=f.findIndex(Xa),t=f.findLastIndex(Xa);if(e===-1)throw new Ut(`[checkbox prompt] No selectable choices. All choices are disabled.`);return{first:e,last:t}},[f]),[h,g]=U(m.first),[_,v]=U();hn(async e=>{if(Rt(e)){let e=f.filter(Za),n=await a([...e]);i&&!e.length?v(`At least one choice must be selected`):n===!0?(u(`done`),t(e.map(e=>e.value))):v(n||`You must select a valid value`)}else if(Nt(e,c)||Pt(e,c)){if(_&&v(void 0),r||Nt(e,c)&&h!==m.first||Pt(e,c)&&h!==m.last){let t=Nt(e,c)?-1:1,n=h;do n=(n+t+f.length)%f.length;while(!Xa(f[n]));g(n)}}else if(Ft(e)){let e=f[h];e&&!K.isSeparator(e)&&(e.disabled?v(s.i18n.disabledError):(v(void 0),p(f.map((e,t)=>t===h?Qa(e):e))))}else if(e.name===o.all){let e=f.some(e=>Ya(e)&&!e.checked);p(f.map($a(e)))}else if(e.name===o.invert)p(f.map(Qa));else if(Lt(e)){let t=Number(e.name)-1,n=-1,r=f.findIndex(e=>!K.isSeparator(e)&&(n++,n===t)),i=f[r];i&&Ya(i)&&(g(r),p(f.map((e,t)=>t===r?Qa(e):e)))}});let y=s.style.message(e.message,l),b,x=Un({items:f,active:h,renderItem({item:e,isActive:t}){if(K.isSeparator(e))return` ${e.separator}`;let n=t?s.icon.cursor:` `;if(e.disabled){let t=typeof e.disabled==`string`?e.disabled:`(disabled)`,r=e.checked?s.icon.disabledChecked:s.icon.disabledUnchecked;return s.style.disabled(`${n}${r} ${e.name} ${t}`)}t&&(b=e.description);let r=e.checked?s.icon.checked:s.icon.unchecked,i=e.checked?e.checkedName:e.name;return(t?s.style.highlight:e=>e)(`${n}${r} ${i}`)},pageSize:n,loop:r});if(l===`done`){let e=f.filter(Za);return[d,y,s.style.answer(s.style.renderSelectedChoices(e,f))].filter(Boolean).join(` `)}let S=[[`↑↓`,`navigate`],[`space`,`select`]];o.all&&S.push([o.all,`all`]),o.invert&&S.push([o.invert,`invert`]),S.push([`⏎`,`submit`]);let ee=s.style.keysHelpTip(S);return`${[[d,y].filter(Boolean).join(` `),x,` `,b?s.style.description(b):``,_?s.style.error(_):``,ee].filter(Boolean).join(`
331
+ `).trimEnd()}${ar}`});const no={icon:{cursor:W.pointer},style:{disabled:e=>V(`dim`,e),description:e=>V(`cyan`,e),keysHelpTip:e=>e.map(([e,t])=>`${V(`bold`,e)} ${V(`dim`,t)}`).join(V(`dim`,` • `))},i18n:{disabledError:`This option is disabled and cannot be selected.`},indexMode:`hidden`};function ro(e){return!K.isSeparator(e)&&!e.disabled}function io(e){return!K.isSeparator(e)}function ao(e){return e.map(e=>{if(K.isSeparator(e))return e;if(typeof e!=`object`||!e||!(`value`in e)){let t=String(e);return{value:e,name:t,short:t,disabled:!1}}let t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var oo=gr((e,t)=>{let{loop:n=!0,pageSize:r=7}=e,i=dn(no,e.theme),{keybindings:a}=i,[o,s]=U(`idle`),c=fn({status:o,theme:i}),l=mn(),u=!a.includes(`vim`),d=pn(()=>ao(e.choices),[e.choices]),f=pn(()=>{let e=d.findIndex(io),t=d.findLastIndex(io);if(e===-1)throw new Ut(`[select prompt] No selectable choices. All choices are disabled.`);return{first:e,last:t}},[d]),p=pn(()=>`default`in e?d.findIndex(t=>ro(t)&&t.value===e.default):-1,[e.default,d]),[m,h]=U(p===-1?f.first:p),g=d[m];if(g==null||K.isSeparator(g))throw Error(`Active index does not point to a choice`);let[_,v]=U();hn((e,r)=>{if(clearTimeout(l.current),_&&v(void 0),Rt(e))g.disabled?v(i.i18n.disabledError):(s(`done`),t(g.value));else if(Nt(e,a)||Pt(e,a)){if(r.clearLine(0),n||Nt(e,a)&&m!==f.first||Pt(e,a)&&m!==f.last){let t=Nt(e,a)?-1:1,n=m;do n=(n+t+d.length)%d.length;while(!io(d[n]));h(n)}}else if(Lt(e)&&!Number.isNaN(Number(r.line))){let e=Number(r.line)-1,t=-1,n=d.findIndex(n=>!K.isSeparator(n)&&(t++,t===e)),i=d[n];i!=null&&ro(i)&&h(n),l.current=setTimeout(()=>{r.clearLine(0)},700)}else if(It(e))r.clearLine(0);else if(u){let e=r.line.toLowerCase(),t=d.findIndex(t=>K.isSeparator(t)||!ro(t)?!1:t.name.toLowerCase().startsWith(e));t!==-1&&h(t),l.current=setTimeout(()=>{r.clearLine(0)},700)}}),$t(()=>()=>{clearTimeout(l.current)},[]);let y=i.style.message(e.message,o),b=i.style.keysHelpTip([[`↑↓`,`navigate`],[`⏎`,`select`]]),x=0,S=Un({items:d,active:m,renderItem({item:e,isActive:t,index:n}){if(K.isSeparator(e))return x++,` ${e.separator}`;let r=t?i.icon.cursor:` `,a=i.indexMode===`number`?`${n+1-x}. `:``;if(e.disabled){let n=typeof e.disabled==`string`?e.disabled:`(disabled)`,r=t?i.icon.cursor:`-`;return i.style.disabled(`${r} ${a}${e.name} ${n}`)}return(t?i.style.highlight:e=>e)(`${r} ${a}${e.name}`)},pageSize:r,loop:n});if(o===`done`)return[c,y,i.style.answer(g.short)].filter(Boolean).join(` `);let{description:ee}=g;return`${[[c,y].filter(Boolean).join(` `),S,` `,ee?i.style.description(ee):``,_?i.style.error(_):``,b].filter(Boolean).join(`
332
+ `).trimEnd()}${ar}`});function so(e){let t=d(),n=e.split(/\r?\n/,1)[0]??``;if(n===Si(t))return!0;let r=bi(t);return n.startsWith(r)&&/^-v\d+$/.test(n.slice(r.length))}function co(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`&&so(n)}function lo(e){return{command:`ok-pi-managed-extension`,args:[e]}}function uo(e={}){let t=e.mode===`dev`,n=d(),r=t?Si(n):xi(n),i=`${se(n)}_`,a={unix:Z({...e,platformName:`darwin`}),win32:Z({...e,platformName:`win32`})};return`${r}
333
333
  /**
334
- * Open Knowledge bridge for Pi — MANAGED FILE, written by \`${y()} init\`.
334
+ * Open Knowledge bridge for Pi — MANAGED FILE, written by \`${s()} init\`.
335
335
  * Hand edits are overwritten whenever OK re-syncs this project; remove it
336
- * with \`${y()} deinit\` (or delete the file) to disconnect Pi from OK.
336
+ * with \`${s()} deinit\` (or delete the file) to disconnect Pi from OK.
337
337
  *
338
338
  * On session start it spawns Open Knowledge's MCP stdio server via OK's
339
339
  * resilient launcher (bundle, then npx, then version-manager probes), performs
@@ -672,22 +672,22 @@ export default function okBridge(pi: {
672
672
  }
673
673
  });
674
674
  }
675
- `}function fo(e,t){let n=P(ke(t),ke(e));return n.length>0&&!n.startsWith(`..`)&&!Ye(n)}const po=e=>{try{let t=Ke(`git`,[`rev-parse`,`--show-toplevel`],Re({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function mo(e,t={}){let n=t.homeDir??B(),r=t.gitTopLevel??po,i=F(e),a;try{a=it(i)}catch{a=i}let o=a,s=0;for(;s<30&&o!==n&&o!==`/`&&o!==``;){if(Pe(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&&fo(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 ho(){let e=Qr();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function go(e){let t=e,n=new Set;for(;;){let r;try{r=et(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=rt(t)}catch(t){return Y(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=Ye(i)?i:N(M(t),i)}}let _o;function vo(){return _o===void 0&&(_o=ho()),_o}function yo(e,t=vo){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){Y(`resolveSymlinkWritePath threw`,e)}return go(e)}const bo={allowTrailingComma:!0,disallowComments:!1};function xo(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function So(e){let t=[],n=Ie(e,t,bo);return t.some(t=>!xo(t,e))||n?.type!==`object`?null:n}function Co(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&E(e)===t&&(n+=1)}return n}function wo(e,t){T(e,`${JSON.stringify(t,null,2)}\n`)}function To(e,t){let n=Kr(t);T(e,n.endsWith(`
676
- `)?n:`${n}\n`)}function Eo(e,t){let n=(0,qr.stringify)(t);T(e,n.endsWith(`
675
+ `}function fo(e,t){let n=P(ke(t),ke(e));return n.length>0&&!n.startsWith(`..`)&&!Ye(n)}const po=e=>{try{let t=lt(`git`,[`rev-parse`,`--show-toplevel`],be({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function mo(e,t={}){let n=t.homeDir??B(),r=t.gitTopLevel??po,i=F(e),a;try{a=rt(i)}catch{a=i}let o=a,s=0;for(;s<30&&o!==n&&o!==`/`&&o!==``;){if(Be(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&&fo(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 ho(){let e=Qr();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function go(e){let t=e,n=new Set;for(;;){let r;try{r=$e(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=nt(t)}catch(t){return Y(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=Ye(i)?i:N(M(t),i)}}let _o;function vo(){return _o===void 0&&(_o=ho()),_o}function yo(e,t=vo){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){Y(`resolveSymlinkWritePath threw`,e)}return go(e)}const bo={allowTrailingComma:!0,disallowComments:!1};function xo(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function So(e){let t=[],n=Ie(e,t,bo);return t.some(t=>!xo(t,e))||n?.type!==`object`?null:n}function Co(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&je(e)===t&&(n+=1)}return n}function wo(e,t){E(e,`${JSON.stringify(t,null,2)}\n`)}function To(e,t){let n=Kr(t);E(e,n.endsWith(`
676
+ `)?n:`${n}\n`)}function Eo(e,t){let n=(0,qr.stringify)(t);E(e,n.endsWith(`
677
677
  `)?n:`${n}\n`)}const Do=10485760;function Oo(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)=>Oo(e,t[n]));if(j(e)&&j(t)){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&Oo(e[n],t[n]))}return!1}function ko(e,t,n){return j(e)&&n.every(n=>Oo(e[n],t[n]))}function Ao(e){for(let t of e.split(`
678
- `)){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 jo(e,t,n){return t===void 0?[e,n]:[e,t,n]}function Mo(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function No(e,t,n){let r=e[t];return n===void 0?r:j(r)?r[n]:void 0}function Po(e,t,n,r,i,a=!1,o=!1){if(!R(e))return o?{kind:`unchanged`}:(wo(e,Mo(t,i,n,r)),{kind:`written`});let s;try{s=z(e,`utf-8`)}catch(e){return Y(`json config read failed`,e),{kind:`declined`,reason:Ha(e)}}if(s.trim()===``)return o?{kind:`unchanged`}:(wo(e,Mo(t,i,n,r)),{kind:`written`});if(Buffer.byteLength(s,`utf-8`)>Do)return{kind:`declined`,reason:`oversize`};let c=So(s);if(!c)return{kind:`declined`,reason:`unparseable`};if(Co(c,t)>1)return{kind:`declined`,reason:`duplicate-container`};let l=No(E(c),t,i),u=j(l)?l[n]:void 0,d=u!==void 0,f=zi(r);if(d&&a?Ei(u):d&&ko(u,r,f))return{kind:o?`unchanged`:`overwritten`};let p=s.charCodeAt(0)===65279,m=p?s.slice(1):s,h=m.includes(`\r
678
+ `)){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 jo(e,t,n){return t===void 0?[e,n]:[e,t,n]}function Mo(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function No(e,t,n){let r=e[t];return n===void 0?r:j(r)?r[n]:void 0}function Po(e,t,n,r,i,a=!1,o=!1){if(!R(e))return o?{kind:`unchanged`}:(wo(e,Mo(t,i,n,r)),{kind:`written`});let s;try{s=z(e,`utf-8`)}catch(e){return Y(`json config read failed`,e),{kind:`declined`,reason:Ha(e)}}if(s.trim()===``)return o?{kind:`unchanged`}:(wo(e,Mo(t,i,n,r)),{kind:`written`});if(Buffer.byteLength(s,`utf-8`)>Do)return{kind:`declined`,reason:`oversize`};let c=So(s);if(!c)return{kind:`declined`,reason:`unparseable`};if(Co(c,t)>1)return{kind:`declined`,reason:`duplicate-container`};let l=No(je(c),t,i),u=j(l)?l[n]:void 0,d=u!==void 0,f=zi(r);if(d&&a?Ei(u):d&&ko(u,r,f))return{kind:o?`unchanged`:`overwritten`};let p=s.charCodeAt(0)===65279,m=p?s.slice(1):s,h=m.includes(`\r
679
679
  `)?`\r
680
680
  `:`
681
- `,g={...Ao(m),eol:h},_=jo(t,i,n),v=m;if(o)for(let e of d?Bi(u,r):[]){let t=Te(v,[..._,e],void 0,{formattingOptions:g});v=Me(v,t)}else if(d&&!a&&Fi(u))for(let e of f){let t=Te(v,[..._,e],r[e],{formattingOptions:g});v=Me(v,t)}else{let e=Te(v,_,r,{formattingOptions:g});v=Me(v,e)}let y=`${p?``:``}${v}`;return y!==s&&T(e,y,{mode:Ka(e)}),o&&y===s?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}function Fo(e,t,n,r,i,a=!1,o=!1){let s=``;if(R(t))try{s=z(t,`utf-8`)}catch(e){return Y(`toml config read failed`,e),{kind:`declined`,reason:Ha(e)}}let c=s.trim()===``;if(c&&o)return{kind:`unchanged`};if(e.backend===`fallback`)return c?(To(t,{[n]:{[r]:i}}),{kind:`written`}):{kind:`declined`,reason:`no-native-writer`};let l=s.charCodeAt(0)===65279,u=l?s.slice(1):s,d=Ga(u),f=c||u.endsWith(`
681
+ `,g={...Ao(m),eol:h},_=jo(t,i,n),v=m;if(o)for(let e of d?Bi(u,r):[]){let t=T(v,[..._,e],void 0,{formattingOptions:g});v=Fe(v,t)}else if(d&&!a&&Fi(u))for(let e of f){let t=T(v,[..._,e],r[e],{formattingOptions:g});v=Fe(v,t)}else{let e=T(v,_,r,{formattingOptions:g});v=Fe(v,e)}let y=`${p?``:``}${v}`;return y!==s&&E(e,y,{mode:Ka(e)}),o&&y===s?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}function Fo(e,t,n,r,i,a=!1,o=!1){let s=``;if(R(t))try{s=z(t,`utf-8`)}catch(e){return Y(`toml config read failed`,e),{kind:`declined`,reason:Ha(e)}}let c=s.trim()===``;if(c&&o)return{kind:`unchanged`};if(e.backend===`fallback`)return c?(To(t,{[n]:{[r]:i}}),{kind:`written`}):{kind:`declined`,reason:`no-native-writer`};let l=s.charCodeAt(0)===65279,u=l?s.slice(1):s,d=Ga(u),f=c||u.endsWith(`
682
682
  `),p,m=!1;try{let t=Io(e,u,n,r);if(o){let n=u;for(let a of t===void 0?[]:Bi(t,i))n=e.removeEntryKey(n,r,a).text;p={text:n,existed:t!==void 0}}else{let n=Lo(t,i,a);m=n.kind===`replace`;let o=m?e.removeEntry(u,r).text:u;if(n.kind===`merge`)for(let t of n.prune)o=e.removeEntryKey(o,r,t).text;p=e.upsertEntry(o,r,i)}}catch(e){return Y(`upsertEntry failed`,e),{kind:`declined`,reason:`unparseable`}}let h=p.text;f?h.endsWith(`
683
683
  `)||(h=`${h}\n`):h=h.replace(/\n+$/,``),d&&(h=h.replace(/\r\n/g,`
684
684
  `).replace(/\n/g,`\r
685
- `));let g=`${l?``:``}${h}`;return g!==s&&T(t,g,{mode:Ka(t)}),o&&g===s?{kind:`unchanged`}:{kind:p.existed||m?`overwritten`:`written`}}function Io(e,t,n,r){if(t.trim()===``)return;let i=e.parseToObject(t)[n],a=j(i)?i[r]:void 0;return j(a)?a:void 0}function Lo(e,t,n){return e===void 0||Ei(e)?{kind:`merge`,prune:[]}:n||!Fi(e)?{kind:`replace`}:{kind:`merge`,prune:Bi(e,t)}}function Ro(e,t,n,r,i=!1,a=!1){let o=``;if(R(e))try{o=z(e,`utf-8`)}catch(e){return Y(`yaml config read failed`,e),{kind:`declined`,reason:Ha(e)}}if(o.trim()===``)return a?{kind:`unchanged`}:(Eo(e,{[t]:{[n]:r}}),{kind:`written`});if(Buffer.byteLength(o,`utf-8`)>Do)return{kind:`declined`,reason:`oversize`};let s=o.charCodeAt(0)===65279,c=s?o.slice(1):o,l=(0,qr.parseDocument)(c);if(l.errors.length>0)return{kind:`declined`,reason:`unparseable`};let u=[t,n],d=l.hasIn(u);l.hasIn([t])&&!(0,qr.isCollection)(l.getIn([t],!0))&&l.deleteIn([t]);let f=l.getIn(u,!0),p=d&&(0,qr.isCollection)(f)&&(i?Ei(f.toJSON()):Fi(f.toJSON()));if(a){if(d&&(0,qr.isCollection)(f))for(let e of Bi(f.toJSON(),r))l.deleteIn([...u,e])}else if(p)for(let e of zi(r))r[e]===void 0?l.deleteIn([...u,e]):l.setIn([...u,e],l.createNode(r[e]));else l.setIn(u,l.createNode(r));let m=l.toString(),h=Ga(c);c.endsWith(`
685
+ `));let g=`${l?``:``}${h}`;return g!==s&&E(t,g,{mode:Ka(t)}),o&&g===s?{kind:`unchanged`}:{kind:p.existed||m?`overwritten`:`written`}}function Io(e,t,n,r){if(t.trim()===``)return;let i=e.parseToObject(t)[n],a=j(i)?i[r]:void 0;return j(a)?a:void 0}function Lo(e,t,n){return e===void 0||Ei(e)?{kind:`merge`,prune:[]}:n||!Fi(e)?{kind:`replace`}:{kind:`merge`,prune:Bi(e,t)}}function Ro(e,t,n,r,i=!1,a=!1){let o=``;if(R(e))try{o=z(e,`utf-8`)}catch(e){return Y(`yaml config read failed`,e),{kind:`declined`,reason:Ha(e)}}if(o.trim()===``)return a?{kind:`unchanged`}:(Eo(e,{[t]:{[n]:r}}),{kind:`written`});if(Buffer.byteLength(o,`utf-8`)>Do)return{kind:`declined`,reason:`oversize`};let s=o.charCodeAt(0)===65279,c=s?o.slice(1):o,l=(0,qr.parseDocument)(c);if(l.errors.length>0)return{kind:`declined`,reason:`unparseable`};let u=[t,n],d=l.hasIn(u);l.hasIn([t])&&!(0,qr.isCollection)(l.getIn([t],!0))&&l.deleteIn([t]);let f=l.getIn(u,!0),p=d&&(0,qr.isCollection)(f)&&(i?Ei(f.toJSON()):Fi(f.toJSON()));if(a){if(d&&(0,qr.isCollection)(f))for(let e of Bi(f.toJSON(),r))l.deleteIn([...u,e])}else if(p)for(let e of zi(r))r[e]===void 0?l.deleteIn([...u,e]):l.setIn([...u,e],l.createNode(r[e]));else l.setIn(u,l.createNode(r));let m=l.toString(),h=Ga(c);c.endsWith(`
686
686
  `)?m.endsWith(`
687
687
  `)||(m=`${m}\n`):m=m.replace(/\n+$/,``),h&&(m=m.replace(/\r\n/g,`
688
688
  `).replace(/\n/g,`\r
689
- `));let g=`${s?``:``}${m}`;return g!==o&&T(e,g,{mode:Ka(e)}),a&&g===o?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}const zo=e=>e!==`project`,Bo=e=>e!==`user`;async function Vo(){let e=await to({message:`Where should the MCP server be configured?
690
- `,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 Ho(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??Vo)():`both`}async function Uo(e){return oo({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json)?`,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 \`${y()} config-sharing share\`.`}]})}async function Wo(e){if(e.sharing!==void 0)return e.sharing;let t=ma(e.projectRoot)===`local-only`||e.freshProject===!0?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Uo)(t):t}var Go=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}},Ko=class extends Error{constructor(e){super(`A dev MCP entry is written to project config only, never to user-level editor config, so --scope ${e} is not supported with --dev-mcp or OK_CHANNEL=dev. Re-run with --scope project or without --scope.`),this.name=`DevMcpScopeError`}};const qo=`A dev build registers OpenKnowledge MCP in project config only, never in user-level editor config. Run \`${a} init --dev-mcp\` in the project, or set OK_CHANNEL=stable.`;function Jo(e){if(e===void 0||e===!0)return new Set(Ce);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(he.filter(e=>t.includes(e)))}function Yo(e,t,n){let r=F(n,e),i;try{i=ot(r)}catch(e){let t=e.code;throw t===`ENOENT`?new Go(`--content-dir path does not exist: ${r}`):new Go(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new Go(`--content-dir must be a directory: ${r}`);let a=Xo(t),o=Xo(r),s=P(a,o);if(s.startsWith(`..`)||Ye(s))throw new Go(`--content-dir must be inside the project root (${t}); got ${r}`);return s===``?`.`:s}function Xo(e){try{return it(e)}catch{return e}}const Zo=`open-knowledge-ui`;function Qo(e,t,n){try{let r=e.detectPath?.(t,n)??M(e.configPath(t,n));return R(r)}catch{return!1}}function $o(e,t,n){try{let r=F(M(e.configPath(t,n))),i=F(e.detectPath?.(t,n)??r);return i===r||r.startsWith(i+I)}catch{return!1}}function es(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.pruneOnly===!0;if(s&&(e.format===`file`||!R(o)))return{editorId:e.id,label:e.label,action:`skipped-flag`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}};let c=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0||$o(e,t,r);if(!i&&c&&!Qo(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{Aa(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 ns(e,o,a,n,{isProjectScope:i!==void 0});let l;try{l=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{s||tt(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 u={action:`written`},d;try{pe(`${o}.lock`,()=>{let t=yo(o).writePath;if(s||tt(M(t),{recursive:!0}),e.format===`toml`){let r=Fo(oi(),t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}if(e.format===`yaml`){let r=Ro(t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}let r=Po(t,e.topLevelKey,a,l,e.serverMapSubKey,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){d=e instanceof Error?e:Error(String(e))}return d?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:d.message,...i===void 0?{}:{configScope:`project`}}:u.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:u.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:u.action===`unchanged`?`skipped-flag`:u.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const ts={pi:uo};function ns(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=ts[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{tt(M(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{pe(`${t}.lock`,()=>{let e=null;try{e=z(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}T(t,c,e===null?void 0:{mode:Ka(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 rs(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!R(n)))return{editorId:e.id,label:e.label,path:n}}async function is(e){let t=sa(e.editors).filter(e=>e.scope===`global`);if(C())return t.map(t=>({editorId:t.id,label:t.label,action:`failed`,configPath:t.configPath(``,e.home),serverName:t.serverName(``),error:qo}));let n={mode:`published`,skipAvailabilityCheck:!0,...e.replaceEntry===!0?{replaceEntry:!0}:{},...e.pruneOnly===!0?{pruneOnly:!0}:{}};return t.map(t=>es(t,``,n,e.home))}function as(e,t,n,r){let i=ss(e,t,n,r);return i.kind===`present`?i.entry:null}function os(e,t,n,r){let i=No(e,t,r);if(!j(i))return{kind:`no-entry`};let a=i[n];return j(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function ss(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!R(i))return{kind:`absent`};try{if(ot(i).size>Do)return{kind:`decline`,reason:`oversize`}}catch(e){return{kind:`decline`,reason:Ha(e)}}let a;try{a=z(i,`utf-8`)}catch(e){return{kind:`decline`,reason:Ha(e)}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:lo(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=oi().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return os(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,qr.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:os(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=So(a);return s?Co(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:os(E(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function cs(e={}){let t=F(e.cwd??process.cwd()),n=e.projectRootMode===`cwd`?{projectRoot:t,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:mo(t,{homeDir:e.home}),r=n.projectRoot;if(De(r,e.home??B()))throw new be(r);if(ve(r))throw new fe(r);let i=!R(N(r,`.ok`)),a=n.gitRootPromoted?P(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Yo(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${k(`[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 \`${y()} init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=e.devMcp===!0||C();if(c&&e.mcp!==!1&&e.scope&&e.scope!==`project`)throw new Ko(e.scope);let l=await je(r),u;try{u=de(r,{contentDir:o})}catch(t){let i=$.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:l.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 d=u.created.includes(Ue),f=!1;if(l.didInit)try{f=_e(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{Ae(r)===`removed`&&console.warn(`[ok] Removed the OpenKnowledge project-skill lines from .gitignore. The skill is ordinary project content now — commit it if your team wants it on clone.`)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore cleanup at ${r}: ${e instanceof Error?e.message:String(e)}`)}let p=await Ho({scope:c?`project`:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),m=e.editors??ms(r,e.home),h=e.editors??m,g=sa(m),v=sa(h),b=e.mcp===!1||p===null,x=Array.from(new Map([...g,...b?[]:v].map(e=>[e.id,e])).values()),S=g.filter(t=>Qo(t,r,e.home)),w=[],ee=[],te=new Set;for(let t of x){if(b){let n=``;try{n=t.configPath(r,e.home)}catch{}w.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(zo(p)&&g.includes(t)&&t.scope===`global`&&w.push(es(t,r,s,e.home)),Bo(p)&&v.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=es(t,r,s,e.home,n);w.push(i),(i.action===`written`||i.action===`overwritten`)&&te.add(n)}}let ne=new Set;for(let t of v){let n=t.projectSkillPath?.(r);!n||ne.has(n)||(ne.add(n),ee.push(Ba(t,r,{home:e.home})))}let re=za(r,v.map(e=>e.id));re&&ee.push(re);let ie=ee.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.editorId);if(ie.length>0){let t=e.home??B();le({source:_,skills:[Ne.project],agents:ie,scope:r},{home:t,enabled:Le(t).enabled})}let ae=!b&&p!==null&&Bo(p)?v.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,oe=b?[]:S.map(e=>rs(e,r)).filter(e=>e!==void 0).filter(e=>!te.has(e.path)),se=e.installUserSkill??me,ce=e.home??B(),ue=Jo(e.skills),pe=typeof e.skills!=`string`,T=!1,ge=!1,ye=!1,Ce=!1,we=!1,Te=!1,Oe=!1,ke=[];for(let t of he){if(!ue.has(t))continue;if(T=!0,pe){let e=await Ee(ce,Ne[t]).then(e=>({ok:!0,value:e}),()=>({ok:!1}));if(!e.ok){ke.push({bundleId:t,result:`decision-read-failed`}),Oe=!0;continue}if(e.value===!1){ke.push({bundleId:t,result:`opted-out`}),Te=!0;continue}}await xe(ce,Ne[t],!0).catch(()=>{});let n=await se({home:e.home,bundleId:t,force:!0});ke.push({bundleId:t,result:n}),n===`installed`?ge=!0:n===`failed`?ye=!0:n===`no-hosts`?we=!0:Ce=!0}let Me=ye?`failed`:Oe?`decision-read-failed`:ge?`installed`:T&&Ce?`skip-current`:T&&we?`no-hosts`:Te?`opted-out`:`declined`,Pe=ge?Fe(ce).map(e=>e.editorId):[],Ie=Le(ce).enabled&&!Se(),Re=b?`skipped-flag`:`skipped-missing`,E=w.find(e=>e.editorId===`claude`)??w[0]??{action:Re,configPath:$.claude.configPath(r,e.home)},ze=await ls({projectRoot:r,desiredMode:await Wo({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,freshProject:i,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:u.created,contentUpdated:u.updated,contentSkipped:u.skipped,editors:w,projectSkills:ee,legacyProjectConfigs:oe,skillInstall:Me,skillBundles:ke,skillsRequested:e.skills,skillHosts:Pe,skillInstallsCounted:Ie,didGitInit:l.didInit,rootGitignoreCreated:f,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:d?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:E.action,mcpPath:E.configPath,mcpError:`error`in E?E.error:void 0,projectScopeUnsupportedLabels:ae,sharing:ze}}async function ls(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=ma(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=ua(t);if(n===`local-only`){let e=fa(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`}:us(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=pa(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:us(t,o,`remove`)}function us(e,t,n){let r=ma(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:t.removed.length>0?`cleaned`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:t.removed}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function ds(e){switch(e){case`permission-denied`:return`permission denied; check file and parent-directory permissions`;case`unresolved-symlink`:return`could not resolve the path or symlink; check permissions and symlink cycles`;case`not-a-file`:return`config path is not a regular file`;case`disappeared`:return`config disappeared while being read; retry to check its current state`;case`unreadable`:return`could not read the config file; check that the path is accessible`;case`unparseable`:return`config could not be parsed`;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`;case void 0:return`config not readable`;default:throw Error(`unhandled MCP decline reason: ${e}`)}}function fs(e,t){let n=[],i=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),a=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),s=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 c=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(A(`Content already present at ${c}/`)),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(A(`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(o)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(s)n.push(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let i of e.editors){let e=i.configPath.startsWith(t)?P(t,i.configPath):i.configPath.replace(/^\/Users\/[^/]+/,`~`),a=i.serverName===r()?``:` (${i.serverName})`,o=i.configScope===`project`?` (project)`:``,s=`${i.label}${o}`,c=` `.repeat(Math.max(1,20-s.length)),l=i.editorId===`claude-desktop`&&(i.action===`written`||i.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(i.action){case`written`:n.push(` ${s}${c}${e} ${O(`registered`)}${a}${l}`);break;case`overwritten`:n.push(` ${s}${c}${e} ${O(`updated`)}${a}${l}`);break;case`skipped-missing`:n.push(` ${s}${c}${e} config root missing; skipped`);break;case`failed`:n.push(` ${s}${c}${e} ${He(`FAILED`)}: ${i.error}`);break;case`declined`:n.push(` ${s}${c}${e} left unchanged (${ds(i.declineReason)})`);break;case`skipped-flag`:break;default:i.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`)}let i=l.dev.mcpServerName;e.editors.some(e=>e.serverName===i&&(e.action===`written`||e.action===`overwritten`))&&n.push(` The ${i} entry runs this checkout on this machine only; keep it out of commits.`)}if(e.projectSkills.length>0){n.push(``),n.push(A(`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} ${O(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${O(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${He(`FAILED`)}: ${r.error}`)}}}if(a&&(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===`declined`)n.push(``),n.push(A(`User-global skills:`)),typeof e.skillsRequested==`string`?(n.push(` ${D(`none installed — --skills "${e.skillsRequested}" names no known skill bundle (known: ${he.join(`, `)})`)}`),n.push(` ${D(`No user-global skill was installed or removed.`)}`)):(n.push(` ${D(`none installed — skipped for this run (--no-skills)`)}`),n.push(` ${D(`No user-global skill was installed or removed; any already on this`)}`),n.push(` ${D(`machine are untouched. Run init without the flag to install them:`)}`),n.push(` ${D(` ${y()} init`)}`),n.push(` ${D(`--no-skills covers user-global skills only, not project-local skills.`)}`));else if(e.skillInstall){n.push(``),n.push(A(`User-global skills:`));let t=e.skillBundles??[],r=Math.max(0,...t.map(e=>Ne[e.bundleId].length));for(let i of t){let t=Ne[i.bundleId].padEnd(r);switch(i.result){case`installed`:{let r=(e.skillHosts??[]).map(e=>X[e]??e),i=r.length>0?r.join(`, `):`the shared ~/.agents store`;n.push(` ${t} ${O(`installed for ${i}`)}`);break}case`skip-current`:n.push(` ${t} ${O(`already installed at current version`)}`);break;case`no-hosts`:n.push(` ${t} ${D(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${k(`${t} install failed`)}`);break;case`opted-out`:n.push(` ${t} ${D(`not installed — turned off on this machine; reinstall with ${y()} init --skills ${i.bundleId} or Settings → Skills Studio`)}`);break;case`decision-read-failed`:n.push(` ${k(`${t} not installed — could not read whether it is turned off on this machine; rerun ${y()} init once ${S(b)} is readable`)}`);break;default:i.result}}e.skillInstallsCounted&&t.some(e=>e.result===`installed`)&&(n.push(` ${D(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${D(`Opt out: DO_NOT_TRACK=1, or Settings → User → Preferences.`)}`)),t.some(e=>e.result===`failed`)&&n.push(` ${k(`Retry with: ${y()} repair-skills`)}`)}e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(k(`⚠ --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(k(`⚠ 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 \`${y()} 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 \`${y()} init --content-dir .\` from there, or set`),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(We(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(..._s(e.sharing,t));let u=e=>[`${e}- ${Ve(`${y()} seed --list-packs`)} — browse the starter packs`,`${e}- ${Ve(`${y()} seed`)} — scaffold an empty repo`];if(i){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(`${O(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${Ve(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`);let i=3;e.contentScaffoldFailed||(n.push(` ${i++}. (Optional) scaffold the starter knowledge-base structure:`),n.push(...u(` `))),n.push(` ${i}. Ask your agent to capture a source, research a topic, or build a wiki —`),n.push(` the procedures ship as skills alongside the MCP tools.`)}else e.contentScaffoldFailed||(n.push(``),n.push(`${A(`Next steps:`)} (optional) scaffold the starter knowledge-base structure:`),n.push(...u(` `)));return n.join(`
691
- `)}function ps(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 ms(e,t){let n=[];for(let r of ci)r!==`claude-desktop`&&Qo($[r],e,t)&&n.push(r);return n}function hs(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:ct(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 gs(){return new Et(`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 (node + packages/cli/dist/cli.mjs, debug logging) in project config only, as the dev channel unless OK_CHANNEL is set`).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 Ot(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new Ot(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new Ot(`--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();e.devMcp&&w(process.env);let n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?hs():null;try{let r;try{r=await cs({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof Go||e instanceof Ko||e instanceof be||e instanceof fe){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof ye||e instanceof Be||e instanceof ue){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof we){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.
692
- `),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-DbUHvJUZ.mjs`),{resolveContentDir:s}=await import(`./dist-C1xee7WC.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-Cem1ca21.mjs`),t=s(c,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(ps(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${fs(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function _s(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?(n.push(` ${O(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`),e.removed.length>0&&n.push(` cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`)):e.action===`cleaned`?n.push(` ${O(`local-only`)} — already excluded; cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${O(`local-only`)} — already excluded; nothing to do.`):n.push(` ${O(`local-only`)}`):e.action===`removed`?n.push(` ${O(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${O(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
693
- `))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${Ve(`${y()} config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(k(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${Ve(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${Ve(`${y()} config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(k(`Sharing mode unavailable: ${e.reason}.`));return n}}export{Z as $,Ga as A,Da as B,yo as C,Rt as Ct,oo as D,co as E,Ot as Et,Na as F,ua as G,ba as H,Aa as I,pa as J,ga as K,ja as L,Ua as M,Ha as N,to as O,ka as P,li as Q,Va as R,$o as S,U as St,uo as T,wt as Tt,ha as U,fa as V,da as W,X,ci as Y,$ as Z,Wo as _,gr as _t,ls as a,Ei as at,es as b,fn as bt,ms as c,Gi as ct,gs as d,si as dt,Vi as et,Qo as f,oi as ft,Yo as g,Qr as gt,Ho as h,Yr as ht,ts as i,Ci as it,qa as j,Ka as k,fs as l,na as lt,Jo as m,Xr as mt,Ko as n,Hi as nt,ps as o,Wi as ot,as as p,Y as pt,ma as q,Zo as r,Ui as rt,ss as s,Q as st,Go as t,Bi as tt,_s as u,Ai as ut,cs as v,ar as vt,mo as w,Et as wt,is as x,dn as xt,jo as y,hn as yt,Ba as z};
689
+ `));let g=`${s?``:``}${m}`;return g!==o&&E(e,g,{mode:Ka(e)}),a&&g===o?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}const zo=e=>e!==`project`,Bo=e=>e!==`user`;async function Vo(){let e=await to({message:`Where should the MCP server be configured?
690
+ `,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 Ho(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??Vo)():`both`}async function Uo(e){return oo({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json)?`,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 \`${s()} config-sharing share\`.`}]})}async function Wo(e){if(e.sharing!==void 0)return e.sharing;let t=ma(e.projectRoot)===`local-only`||e.freshProject===!0?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Uo)(t):t}var Go=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}},Ko=class extends Error{constructor(e){super(`A dev MCP entry is written to project config only, never to user-level editor config, so --scope ${e} is not supported with --dev-mcp or OK_CHANNEL=dev. Re-run with --scope project or without --scope.`),this.name=`DevMcpScopeError`}};const qo=`A dev build registers OpenKnowledge MCP in project config only, never in user-level editor config. Run \`${c} init --dev-mcp\` in the project, or set OK_CHANNEL=stable.`;function Jo(e){if(e===void 0||e===!0)return new Set(Te);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(ge.filter(e=>t.includes(e)))}function Yo(e,t,n){let r=F(n,e),i;try{i=at(r)}catch(e){let t=e.code;throw t===`ENOENT`?new Go(`--content-dir path does not exist: ${r}`):new Go(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new Go(`--content-dir must be a directory: ${r}`);let a=Xo(t),o=Xo(r),s=P(a,o);if(s.startsWith(`..`)||Ye(s))throw new Go(`--content-dir must be inside the project root (${t}); got ${r}`);return s===``?`.`:s}function Xo(e){try{return rt(e)}catch{return e}}const Zo=`open-knowledge-ui`;function Qo(e,t,n){try{let r=e.detectPath?.(t,n)??M(e.configPath(t,n));return R(r)}catch{return!1}}function $o(e,t,n){try{let r=F(M(e.configPath(t,n))),i=F(e.detectPath?.(t,n)??r);return i===r||r.startsWith(i+I)}catch{return!1}}function es(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.pruneOnly===!0;if(s&&(e.format===`file`||!R(o)))return{editorId:e.id,label:e.label,action:`skipped-flag`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}};let c=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0||$o(e,t,r);if(!i&&c&&!Qo(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{Aa(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 ns(e,o,a,n,{isProjectScope:i!==void 0});let l;try{l=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{s||et(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 u={action:`written`},d;try{he(`${o}.lock`,()=>{let t=yo(o).writePath;if(s||et(M(t),{recursive:!0}),e.format===`toml`){let r=Fo(oi(),t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}if(e.format===`yaml`){let r=Ro(t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}let r=Po(t,e.topLevelKey,a,l,e.serverMapSubKey,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){d=e instanceof Error?e:Error(String(e))}return d?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:d.message,...i===void 0?{}:{configScope:`project`}}:u.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:u.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:u.action===`unchanged`?`skipped-flag`:u.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const ts={pi:uo};function ns(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=ts[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{et(M(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{he(`${t}.lock`,()=>{let e=null;try{e=z(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}E(t,c,e===null?void 0:{mode:Ka(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 rs(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!R(n)))return{editorId:e.id,label:e.label,path:n}}async function is(e){let t=sa(e.editors).filter(e=>e.scope===`global`);if(a())return t.map(t=>({editorId:t.id,label:t.label,action:`failed`,configPath:t.configPath(``,e.home),serverName:t.serverName(``),error:qo}));let n={mode:`published`,skipAvailabilityCheck:!0,...e.replaceEntry===!0?{replaceEntry:!0}:{},...e.pruneOnly===!0?{pruneOnly:!0}:{}};return t.map(t=>es(t,``,n,e.home))}function as(e,t,n,r){let i=ss(e,t,n,r);return i.kind===`present`?i.entry:null}function os(e,t,n,r){let i=No(e,t,r);if(!j(i))return{kind:`no-entry`};let a=i[n];return j(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function ss(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!R(i))return{kind:`absent`};try{if(at(i).size>Do)return{kind:`decline`,reason:`oversize`}}catch(e){return{kind:`decline`,reason:Ha(e)}}let a;try{a=z(i,`utf-8`)}catch(e){return{kind:`decline`,reason:Ha(e)}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:lo(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=oi().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return os(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,qr.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:os(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=So(a);return s?Co(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:os(je(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function cs(e={}){let t=F(e.cwd??process.cwd()),n=e.projectRootMode===`cwd`?{projectRoot:t,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:mo(t,{homeDir:e.home}),r=n.projectRoot;if(we(r,e.home??B()))throw new Se(r);if(Pe(r))throw new de(r);let i=!R(N(r,`.ok`)),o=n.gitRootPromoted?P(r,t):void 0,c=e.contentDir===void 0?n.defaultContentDir:Yo(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&c===`.`&&process.stderr.write(`${k(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${o}/, 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 \`${s()} init --content-dir .\`, or set content.dir: ${o} in .ok/config.yml.\n`);let l={mode:e.devMcp?`dev`:`published`},u=e.devMcp===!0||a();if(u&&e.mcp!==!1&&e.scope&&e.scope!==`project`)throw new Ko(e.scope);let d=await Ee(r),f;try{f=fe(r,{contentDir:c})}catch(t){let i=$.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:d.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:o,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 p=f.created.includes(Ue),m=!1;if(d.didInit)try{m=me(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{ue(r)===`removed`&&console.warn(`[ok] Removed the OpenKnowledge project-skill lines from .gitignore. The skill is ordinary project content now — commit it if your team wants it on clone.`)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore cleanup at ${r}: ${e instanceof Error?e.message:String(e)}`)}let h=await Ho({scope:u?`project`:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),g=e.editors??ms(r,e.home),v=e.editors??g,y=sa(g),b=sa(v),x=e.mcp===!1||h===null,S=Array.from(new Map([...y,...x?[]:b].map(e=>[e.id,e])).values()),ee=y.filter(t=>Qo(t,r,e.home)),C=[],te=[],ne=new Set;for(let t of S){if(x){let n=``;try{n=t.configPath(r,e.home)}catch{}C.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(zo(h)&&y.includes(t)&&t.scope===`global`&&C.push(es(t,r,l,e.home)),Bo(h)&&b.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=es(t,r,l,e.home,n);C.push(i),(i.action===`written`||i.action===`overwritten`)&&ne.add(n)}}let re=new Set;for(let t of b){let n=t.projectSkillPath?.(r);!n||re.has(n)||(re.add(n),te.push(Ba(t,r,{home:e.home})))}let ie=za(r,b.map(e=>e.id));ie&&te.push(ie);let ae=te.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.editorId);if(ae.length>0){let t=e.home??B();Re({source:_,skills:[Me.project],agents:ae,scope:r},{home:t,enabled:ye(t).enabled})}let oe=!x&&h!==null&&Bo(h)?b.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,se=x?[]:ee.map(e=>rs(e,r)).filter(e=>e!==void 0).filter(e=>!ne.has(e.path)),ce=e.installUserSkill??xe,w=e.home??B(),le=Jo(e.skills),he=typeof e.skills!=`string`,_e=!1,ve=!1,be=!1,T=!1,Te=!1,De=!1,ke=!1,Ae=[];for(let t of ge){if(!le.has(t))continue;if(_e=!0,he){let e=await pe(w,Me[t]).then(e=>({ok:!0,value:e}),()=>({ok:!1}));if(!e.ok){Ae.push({bundleId:t,result:`decision-read-failed`}),ke=!0;continue}if(e.value===!1){Ae.push({bundleId:t,result:`opted-out`}),De=!0;continue}}await Ce(w,Me[t],!0).catch(()=>{});let n=await ce({home:e.home,bundleId:t,force:!0});Ae.push({bundleId:t,result:n}),n===`installed`?ve=!0:n===`failed`?be=!0:n===`no-hosts`?Te=!0:T=!0}let je=be?`failed`:ke?`decision-read-failed`:ve?`installed`:_e&&T?`skip-current`:_e&&Te?`no-hosts`:De?`opted-out`:`declined`,Ne=ve?Le(w).map(e=>e.editorId):[],Fe=ye(w).enabled&&!Oe(),Ie=x?`skipped-flag`:`skipped-missing`,ze=C.find(e=>e.editorId===`claude`)??C[0]??{action:Ie,configPath:$.claude.configPath(r,e.home)},Be=await ls({projectRoot:r,desiredMode:await Wo({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,freshProject:i,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:f.created,contentUpdated:f.updated,contentSkipped:f.skipped,editors:C,projectSkills:te,legacyProjectConfigs:se,skillInstall:je,skillBundles:Ae,skillsRequested:e.skills,skillHosts:Ne,skillInstallsCounted:Fe,didGitInit:d.didInit,rootGitignoreCreated:m,gitRootPromoted:n.gitRootPromoted,promotedFromDir:o,contentDir:p?c:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:ze.action,mcpPath:ze.configPath,mcpError:`error`in ze?ze.error:void 0,projectScopeUnsupportedLabels:oe,sharing:Be}}async function ls(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=ma(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=ua(t);if(n===`local-only`){let e=fa(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`}:us(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=pa(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:us(t,o,`remove`)}function us(e,t,n){let r=ma(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:t.removed.length>0?`cleaned`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:t.removed}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function ds(e){switch(e){case`permission-denied`:return`permission denied; check file and parent-directory permissions`;case`unresolved-symlink`:return`could not resolve the path or symlink; check permissions and symlink cycles`;case`not-a-file`:return`config path is not a regular file`;case`disappeared`:return`config disappeared while being read; retry to check its current state`;case`unreadable`:return`could not read the config file; check that the path is accessible`;case`unparseable`:return`config could not be parsed`;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`;case void 0:return`config not readable`;default:throw Error(`unhandled MCP decline reason: ${e}`)}}function fs(e,t){let n=[],a=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),o=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),c=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),u=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 d=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`Content scaffolded at ${d}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(A(`Content already present at ${d}/`)),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(A(`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(c)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(u)n.push(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let i of e.editors){let e=i.configPath.startsWith(t)?P(t,i.configPath):i.configPath.replace(/^\/Users\/[^/]+/,`~`),a=i.serverName===r()?``:` (${i.serverName})`,o=i.configScope===`project`?` (project)`:``,s=`${i.label}${o}`,c=` `.repeat(Math.max(1,20-s.length)),l=i.editorId===`claude-desktop`&&(i.action===`written`||i.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(i.action){case`written`:n.push(` ${s}${c}${e} ${O(`registered`)}${a}${l}`);break;case`overwritten`:n.push(` ${s}${c}${e} ${O(`updated`)}${a}${l}`);break;case`skipped-missing`:n.push(` ${s}${c}${e} config root missing; skipped`);break;case`failed`:n.push(` ${s}${c}${e} ${He(`FAILED`)}: ${i.error}`);break;case`declined`:n.push(` ${s}${c}${e} left unchanged (${ds(i.declineReason)})`);break;case`skipped-flag`:break;default:i.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`)}let a=i.dev.mcpServerName;e.editors.some(e=>e.serverName===a&&(e.action===`written`||e.action===`overwritten`))&&n.push(` The ${a} entry runs this checkout on this machine only; keep it out of commits.`)}if(e.projectSkills.length>0){n.push(``),n.push(A(`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} ${O(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${O(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${He(`FAILED`)}: ${r.error}`)}}}if(o&&(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===`declined`)n.push(``),n.push(A(`User-global skills:`)),typeof e.skillsRequested==`string`?(n.push(` ${D(`none installed — --skills "${e.skillsRequested}" names no known skill bundle (known: ${ge.join(`, `)})`)}`),n.push(` ${D(`No user-global skill was installed or removed.`)}`)):(n.push(` ${D(`none installed — skipped for this run (--no-skills)`)}`),n.push(` ${D(`No user-global skill was installed or removed; any already on this`)}`),n.push(` ${D(`machine are untouched. Run init without the flag to install them:`)}`),n.push(` ${D(` ${s()} init`)}`),n.push(` ${D(`--no-skills covers user-global skills only, not project-local skills.`)}`));else if(e.skillInstall){n.push(``),n.push(A(`User-global skills:`));let t=e.skillBundles??[],r=Math.max(0,...t.map(e=>Me[e.bundleId].length));for(let i of t){let t=Me[i.bundleId].padEnd(r);switch(i.result){case`installed`:{let r=(e.skillHosts??[]).map(e=>X[e]??e),i=r.length>0?r.join(`, `):`the shared ~/.agents store`;n.push(` ${t} ${O(`installed for ${i}`)}`);break}case`skip-current`:n.push(` ${t} ${O(`already installed at current version`)}`);break;case`no-hosts`:n.push(` ${t} ${D(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${k(`${t} install failed`)}`);break;case`opted-out`:n.push(` ${t} ${D(`not installed — turned off on this machine; reinstall with ${s()} init --skills ${i.bundleId} or Settings → Skills Studio`)}`);break;case`decision-read-failed`:n.push(` ${k(`${t} not installed — could not read whether it is turned off on this machine; rerun ${s()} init once ${l(y)} is readable`)}`);break;default:i.result}}e.skillInstallsCounted&&t.some(e=>e.result===`installed`)&&(n.push(` ${D(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${D(`Opt out: DO_NOT_TRACK=1, or Settings → User → Preferences.`)}`)),t.some(e=>e.result===`failed`)&&n.push(` ${k(`Retry with: ${s()} repair-skills`)}`)}e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(k(`⚠ --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(k(`⚠ 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 \`${s()} 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 \`${s()} init --content-dir .\` from there, or set`),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(We(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(..._s(e.sharing,t));let f=e=>[`${e}- ${Ve(`${s()} seed --list-packs`)} — browse the starter packs`,`${e}- ${Ve(`${s()} seed`)} — scaffold an empty repo`];if(a){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(`${O(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${Ve(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`);let i=3;e.contentScaffoldFailed||(n.push(` ${i++}. (Optional) scaffold the starter knowledge-base structure:`),n.push(...f(` `))),n.push(` ${i}. Ask your agent to capture a source, research a topic, or build a wiki —`),n.push(` the procedures ship as skills alongside the MCP tools.`)}else e.contentScaffoldFailed||(n.push(``),n.push(`${A(`Next steps:`)} (optional) scaffold the starter knowledge-base structure:`),n.push(...f(` `)));return n.join(`
691
+ `)}function ps(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 ms(e,t){let n=[];for(let r of ci)r!==`claude-desktop`&&Qo($[r],e,t)&&n.push(r);return n}function hs(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:ut(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 gs(){return new Et(`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 (node + packages/cli/dist/cli.mjs, debug logging) in project config only, as the dev channel unless OK_CHANNEL is set`).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 Ot(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new Ot(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new Ot(`--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();e.devMcp&&u(process.env);let n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?hs():null;try{let r;try{r=await cs({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof Go||e instanceof Ko||e instanceof Se||e instanceof de){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof ve||e instanceof ze||e instanceof le){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof De){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.
692
+ `),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-D4dq2xfA.mjs`),{resolveContentDir:s}=await import(`./dist-D4ipyg1q.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-BD9T555q.mjs`),t=s(c,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(ps(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${fs(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function _s(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?(n.push(` ${O(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`),e.removed.length>0&&n.push(` cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`)):e.action===`cleaned`?n.push(` ${O(`local-only`)} — already excluded; cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${O(`local-only`)} — already excluded; nothing to do.`):n.push(` ${O(`local-only`)}`):e.action===`removed`?n.push(` ${O(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${O(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
693
+ `))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${Ve(`${s()} config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(k(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${Ve(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${Ve(`${s()} config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(k(`Sharing mode unavailable: ${e.reason}.`));return n}}export{Z as $,Ga as A,Da as B,yo as C,Rt as Ct,oo as D,co as E,Ot as Et,Na as F,ua as G,ba as H,Aa as I,pa as J,ga as K,ja as L,Ua as M,Ha as N,to as O,ka as P,li as Q,Va as R,$o as S,U as St,uo as T,wt as Tt,ha as U,fa as V,da as W,X,ci as Y,$ as Z,Wo as _,gr as _t,ls as a,Ei as at,es as b,fn as bt,ms as c,Gi as ct,gs as d,si as dt,Vi as et,Qo as f,oi as ft,Yo as g,Qr as gt,Ho as h,Yr as ht,ts as i,Ci as it,qa as j,Ka as k,fs as l,na as lt,Jo as m,Xr as mt,Ko as n,Hi as nt,ps as o,Wi as ot,as as p,Y as pt,ma as q,Zo as r,Ui as rt,ss as s,Q as st,Go as t,Bi as tt,_s as u,Ai as ut,cs as v,ar as vt,mo as w,Et as wt,is as x,dn as xt,jo as y,hn as yt,Ba as z};