@inkeep/open-knowledge 0.58.1 → 0.58.2

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 (162) hide show
  1. package/dist/{acp-harness-probe-xgy7rAnp.mjs → acp-harness-probe-BV29NJeb.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-Df9TN5Iy.mjs +2 -0
  4. package/dist/git-handle-CNjG3dz9.mjs +1 -0
  5. package/dist/{git-handle-DBzPPd3f.mjs → git-handle-DGgEJR3Q.mjs} +2 -2
  6. package/dist/index.mjs +113 -113
  7. package/dist/init-4VhJZ-Vq.mjs +1 -0
  8. package/dist/{init-DlPmbtVI.mjs → init-DAhyRxDw.mjs} +3 -3
  9. package/dist/{launch-json-removal-CFgiLXcA.mjs → launch-json-removal-CdBxmBgo.mjs} +2 -2
  10. package/dist/{loader-DBn8SlY0.mjs → loader-5k0QB7UD.mjs} +2 -2
  11. package/dist/loader-DlEMH5xT.mjs +1 -0
  12. package/dist/md-manager-30E0O9b-.mjs +2 -0
  13. package/dist/{open-browser-BB1GQuUF.mjs → open-browser-CsDN5cE2.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/preview-BJ08kuFi.mjs +1 -0
  16. package/dist/{preview-Cl30UkIA.mjs → preview-rnbZQhXd.mjs} +2 -2
  17. package/dist/public/assets/{ActivityModeContent-Cd1OAYzL.js → ActivityModeContent-BwHUk9x-.js} +1 -1
  18. package/dist/public/assets/{AgentDiffPane-DZVN97i1.js → AgentDiffPane-C8uheQd-.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-CO-xPh2q.js → AgentThreadClientBinder-DTYzWGtR.js} +1 -1
  20. package/dist/public/assets/CodeMirrorPropInput-Bj9YNHN0.js +3 -0
  21. package/dist/public/assets/{DocumentContext-DEIQsbJW.js → DocumentContext-DkWkOb2l.js} +10 -10
  22. package/dist/public/assets/{EditorModeToggle-BY9m0wjZ.js → EditorModeToggle-Cewar40S.js} +1 -1
  23. package/dist/public/assets/{EnableSyncConfirmDialog-CWnWseMW.js → EnableSyncConfirmDialog-VBfYxggq.js} +1 -1
  24. package/dist/public/assets/{ExcalidrawDocEditor-CKiXFy_x.js → ExcalidrawDocEditor-v0dJebX9.js} +1 -1
  25. package/dist/public/assets/FeedbackForm-BYVLKB03.js +1 -0
  26. package/dist/public/assets/{GraphPanel-B5RqNmNS.js → GraphPanel-CDbqbQEy.js} +2 -2
  27. package/dist/public/assets/{ImportSkillDialog-09UPINAA.js → ImportSkillDialog-BHGHGngM.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-Duz9fAR3.js → LintConfigEditor-DIYxtFKZ.js} +1 -1
  29. package/dist/public/assets/ManagedArtifactProperties-97s8Kpwp.js +1 -0
  30. package/dist/public/assets/ManagedArtifactProperties-RI0RIpfn.js +1 -0
  31. package/dist/public/assets/{MermaidDocEditor-CtpHpbxE.js → MermaidDocEditor-B_j5uS72.js} +1 -1
  32. package/dist/public/assets/{PropertyDisplayRow-BHfWjWFh.js → PropertyDisplayRow-Di_FqHjH.js} +1 -1
  33. package/dist/public/assets/{ReportBugDialogBody-Dr26EF2g.js → ReportBugDialogBody-ClJwLWPA.js} +1 -1
  34. package/dist/public/assets/{SchemaConfigEditor-D9PYCPqf.js → SchemaConfigEditor-Caw0WoGW.js} +1 -1
  35. package/dist/public/assets/{SessionsHost-Cgxgg5Xm.js → SessionsHost-CeZg1uZf.js} +2 -2
  36. package/dist/public/assets/{SettingsDialogBody-DQWb0J5d.js → SettingsDialogBody-Ci6Ro2T3.js} +6 -6
  37. package/dist/public/assets/{ShareBranchSwitchDialog-HpdUO856.js → ShareBranchSwitchDialog-uJB6JRNs.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveDialog-tVWJPHxC.js → ShareReceiveDialog-DZEmg6tP.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveMissDialog-CdtJGmHs.js → ShareReceiveMissDialog-CkA5xIH-.js} +1 -1
  40. package/dist/public/assets/{SkillCostValue-DP0KhVX6.js → SkillCostValue-6xiHOBnl.js} +1 -1
  41. package/dist/public/assets/{SkillEditBanner-BAbEgc4W.js → SkillEditBanner-CPPbmflR.js} +1 -1
  42. package/dist/public/assets/{SkillInstallMenu-DDpaGouF.js → SkillInstallMenu-CTC2zZsI.js} +2 -2
  43. package/dist/public/assets/{SkillOriginInline-CtsMmW3A.js → SkillOriginInline-YR_v8nG_.js} +1 -1
  44. package/dist/public/assets/{SkillToolbarControls-Uh_M-Nv9.js → SkillToolbarControls-03RZ1dU4.js} +1 -1
  45. package/dist/public/assets/{SlidesToolbarControls-C7knOrss.js → SlidesToolbarControls-CkLjOqlc.js} +1 -1
  46. package/dist/public/assets/{SourceEditor-CNDJTbpc.js → SourceEditor-ClYjOYNu.js} +1 -1
  47. package/dist/public/assets/{TerminalPanel-5yBYrK8Y.js → TerminalPanel-D-jB2vUq.js} +3 -3
  48. package/dist/public/assets/{TerminalWindowApp-CnLQLW3I.js → TerminalWindowApp-CukmRTnj.js} +1 -1
  49. package/dist/public/assets/{TextDocEditor-5mUdtOMw.js → TextDocEditor-DEwbXP4Y.js} +1 -1
  50. package/dist/public/assets/{ThreadView-P-PiPS1h.js → ThreadView-CJsI7r6c.js} +3 -3
  51. package/dist/public/assets/{TimelineDiffPane-BQaKTpx8.js → TimelineDiffPane-DPTTRiaD.js} +1 -1
  52. package/dist/public/assets/{agent-diff-store-DIc_2bm6.js → agent-diff-store-DtNUPAuc.js} +1 -1
  53. package/dist/public/assets/auth-state-cache-cIXBAj7o.js +11 -0
  54. package/dist/public/assets/client-version-D7sx1Rjr.js +1 -0
  55. package/dist/public/assets/{comment-chips-UOlMv5tO.js → comment-chips-TnONx2o_.js} +1 -1
  56. package/dist/public/assets/{config-provider-Bbv6VafV.js → config-provider-BfPKv7D_.js} +3 -3
  57. package/dist/public/assets/{dist-B2PYdf6L.js → dist-DGemBD_J.js} +185 -185
  58. package/dist/public/assets/{doc-paths-BzBsdgOF.js → doc-paths-BkpejoFL.js} +1 -1
  59. package/dist/public/assets/{documents-events-B3aHqHDU.js → documents-events-B2g_1xMi.js} +1 -1
  60. package/dist/public/assets/{file-tree-adapter-C-_sBtIk.js → file-tree-adapter-BAEEzFBR.js} +1 -1
  61. package/dist/public/assets/{file-tree-utils-D07uWuBD.js → file-tree-utils-CzXn1zjH.js} +1 -1
  62. package/dist/public/assets/{folder-config-api-DWUKYOic.js → folder-config-api-DPWmRi8a.js} +1 -1
  63. package/dist/public/assets/follow-file-DZjqgOif.js +4 -0
  64. package/dist/public/assets/i18n-OKq2zgJD.js +1 -0
  65. package/dist/public/assets/{index-Bs1jwA4d.js → index-DfrYusq_.js} +14 -14
  66. package/dist/public/assets/{lint-config-client-uz0JfQyM.js → lint-config-client-sK38eqbj.js} +1 -1
  67. package/dist/public/assets/{markdownlint-rule-browser-B7KoHuCp.js → markdownlint-rule-browser-B5Hqnx8j.js} +1 -1
  68. package/dist/public/assets/messages-4c5nNBiJ.js +1 -0
  69. package/dist/public/assets/messages-C9cU3MwW.js +1 -0
  70. package/dist/public/assets/messages-CZrkiUlH.js +1 -0
  71. package/dist/public/assets/messages-CmYi8S53.js +1 -0
  72. package/dist/public/assets/messages-CxUlt8sa.js +1 -0
  73. package/dist/public/assets/messages-D5VXKR25.js +1 -0
  74. package/dist/public/assets/messages-D5zW0t5v.js +1 -0
  75. package/dist/public/assets/messages-D6c_oVqQ.js +1 -0
  76. package/dist/public/assets/messages-DN4QTNMp.js +1 -0
  77. package/dist/public/assets/messages-Dbr15TAB.js +1 -0
  78. package/dist/public/assets/messages-GpbpkDIs.js +1 -0
  79. package/dist/public/assets/messages-gyFFyNQP.js +1 -0
  80. package/dist/public/assets/navigation-targets-saCskzOA.js +1 -0
  81. package/dist/public/assets/{open-managed-artifact-tab-wTk-jvFI.js → open-managed-artifact-tab-ENQgQOde.js} +1 -1
  82. package/dist/public/assets/{pending-receive-nav-store-ChrCVFhp.js → pending-receive-nav-store-ONj5lhiT.js} +1 -1
  83. package/dist/public/assets/{prop-types-CzTU66xx.js → prop-types-efgXxLQK.js} +1 -1
  84. package/dist/public/assets/{receive-store-BNb1QM5F.js → receive-store-D0DFBX0k.js} +1 -1
  85. package/dist/public/assets/{selection-context-CwVqjIBq.js → selection-context-BIrUkkRy.js} +1 -1
  86. package/dist/public/assets/{skill-actions-B0Lfx1Jp.js → skill-actions-CGiiNBa2.js} +1 -1
  87. package/dist/public/assets/{skill-scope-CLmSkL31.js → skill-scope-gUkJkFRO.js} +1 -1
  88. package/dist/public/assets/skills-api-DriOKSSy.js +1 -0
  89. package/dist/public/assets/{src-BC9Ot14T.js → src-ChDVzbhC.js} +1 -1
  90. package/dist/public/assets/{tag-pill-input-C3H6jjkw.js → tag-pill-input-JkB_BjW_.js} +1 -1
  91. package/dist/public/assets/{target-navigation-intent-Z3qsc-3y.js → target-navigation-intent-CQRrvMAa.js} +1 -1
  92. package/dist/public/assets/{telemetry-impl-Dz1N6oIK.js → telemetry-impl-DF041M4B.js} +1 -1
  93. package/dist/public/assets/{telemetry-startup-hWX5HNgA.js → telemetry-startup-CmSqjT8K.js} +1 -1
  94. package/dist/public/assets/{terminal-cli-display-CXprjqVX.js → terminal-cli-display-w0URjEKX.js} +1 -1
  95. package/dist/public/assets/{terminal-launch-events-DQrbXVOu.js → terminal-launch-events-CLm4Tujb.js} +1 -1
  96. package/dist/public/assets/{terminal-telemetry-Cg19bGQH.js → terminal-telemetry-Bwit7Ew2.js} +1 -1
  97. package/dist/public/assets/{typing-burst-detector-CAgWYZ8p.js → typing-burst-detector-C9ot8C0H.js} +3 -3
  98. package/dist/public/assets/{uninstall-BHLZOGk6.js → uninstall-LCcNjUXD.js} +1 -1
  99. package/dist/public/assets/{use-activity-panel-BOsrrNzx.js → use-activity-panel-DVu8WkKk.js} +1 -1
  100. package/dist/public/assets/{use-apply-config-color-theme-BFjYwtG_.js → use-apply-config-color-theme-DZRctrdg.js} +1 -1
  101. package/dist/public/assets/{use-collab-url-VdWHbtIf.js → use-collab-url-cmMNtL6Q.js} +1 -1
  102. package/dist/public/assets/{use-live-xterm-theme-DqXV-fD-.js → use-live-xterm-theme-C1EtEd_i.js} +1 -1
  103. package/dist/public/assets/{use-open-skill-D4gF_c3G.js → use-open-skill-NgEIqB9-.js} +1 -1
  104. package/dist/public/assets/{use-popular-skills-CBFoMPQn.js → use-popular-skills-D5bWItau.js} +1 -1
  105. package/dist/public/assets/{use-settings-route-BCNil7dn.js → use-settings-route-BrzzIll2.js} +1 -1
  106. package/dist/public/assets/{use-skill-origin-DZ48Ce5_.js → use-skill-origin-Bpi6sqBq.js} +1 -1
  107. package/dist/public/assets/{use-skills-BOcl-P7c.js → use-skills-DJ009sMa.js} +1 -1
  108. package/dist/public/assets/{use-terminal-enabled-mEDq_d4f.js → use-terminal-enabled-C6CSKsS1.js} +1 -1
  109. package/dist/public/assets/use-timeline-entry-diff-DJUCL6Td.js +6 -0
  110. package/dist/public/assets/{use-workspace-DtniUxsw.js → use-workspace-8Sxb8Z6Q.js} +1 -1
  111. package/dist/public/index.html +47 -47
  112. package/dist/public/uninstall.html +4 -4
  113. package/dist/{repair-launch-json-Hx8_cm6Y.mjs → repair-launch-json-BkUd6kHr.mjs} +2 -2
  114. package/dist/{repair-mcp-configs-BVGE_9cU.mjs → repair-mcp-configs-DwWSjL8A.mjs} +2 -2
  115. package/dist/{repair-skills-CJ-NMRQu.mjs → repair-skills-CE-cFHgC.mjs} +2 -2
  116. package/dist/repair-skills-CfNnIkaz.mjs +1 -0
  117. package/dist/{server-lock-Byfibur-.mjs → server-lock-BmwIVWMl.mjs} +2 -2
  118. package/dist/server-lock-e6dYuoeq.mjs +1 -0
  119. package/dist/{skill-teardown-B1lwZmlf.mjs → skill-teardown-v6hvkG1K.mjs} +2 -2
  120. package/dist/src-9IAMlZMA.mjs +1 -0
  121. package/dist/{src-CmpfpfEi.mjs → src-B8XCBdBS.mjs} +1 -1
  122. package/dist/{src-CT4EwQCO.mjs → src-Bpb4g0qR.mjs} +2 -2
  123. package/dist/{src-FmS9CDpL.mjs → src-BxdlvOrw.mjs} +70 -70
  124. package/dist/{src-BT7INQqO.mjs → src-C9i4ShN8.mjs} +385 -385
  125. package/dist/start-BxHXWnk6.mjs +1 -0
  126. package/dist/{start-B-f10j4K.mjs → start-D30YXVSL.mjs} +4 -4
  127. package/dist/{ui-D2lnU4d-.mjs → ui-Dasu2qV2.mjs} +3 -3
  128. package/dist/{write-project-skill-C9GKlPPQ.mjs → write-project-skill-Dx5URYrZ.mjs} +2 -2
  129. package/package.json +5 -5
  130. package/dist/constants-BmoWT5bP.mjs +0 -2
  131. package/dist/git-handle-Dcxr9x-u.mjs +0 -1
  132. package/dist/init-DFoMqisd.mjs +0 -1
  133. package/dist/loader--f9B5VZN.mjs +0 -1
  134. package/dist/md-manager-CX0MhX6j.mjs +0 -2
  135. package/dist/preview-fTZE8DWJ.mjs +0 -1
  136. package/dist/public/assets/CodeMirrorPropInput-DNcdooLt.js +0 -3
  137. package/dist/public/assets/FeedbackForm-BSl61r2U.js +0 -1
  138. package/dist/public/assets/ManagedArtifactProperties-BcNn8cQq.js +0 -1
  139. package/dist/public/assets/ManagedArtifactProperties-X6LSQOTj.js +0 -1
  140. package/dist/public/assets/auth-state-cache-Dsjv88YE.js +0 -11
  141. package/dist/public/assets/client-version-DDQ9xEIT.js +0 -1
  142. package/dist/public/assets/follow-file-Cjy5mh1A.js +0 -4
  143. package/dist/public/assets/i18n-CmVxos8c.js +0 -1
  144. package/dist/public/assets/messages-Blg7g8Ju.js +0 -1
  145. package/dist/public/assets/messages-CIPlCf8s.js +0 -1
  146. package/dist/public/assets/messages-C_-VdsDg.js +0 -1
  147. package/dist/public/assets/messages-ClA8sILa.js +0 -1
  148. package/dist/public/assets/messages-CmInz6Aj.js +0 -1
  149. package/dist/public/assets/messages-CqcZjYtT.js +0 -1
  150. package/dist/public/assets/messages-Cx5WvPRN.js +0 -1
  151. package/dist/public/assets/messages-D7I7ELHW.js +0 -1
  152. package/dist/public/assets/messages-DeViATgA.js +0 -1
  153. package/dist/public/assets/messages-JmG6V61v.js +0 -1
  154. package/dist/public/assets/messages-jIDdZeWu.js +0 -1
  155. package/dist/public/assets/messages-y4F5w3ou.js +0 -1
  156. package/dist/public/assets/navigation-targets-BVHBxGSt.js +0 -1
  157. package/dist/public/assets/skills-api-qBhseQS2.js +0 -1
  158. package/dist/public/assets/use-timeline-entry-diff-CmXkzb1O.js +0 -6
  159. package/dist/repair-skills-jQbaNzET.mjs +0 -1
  160. package/dist/server-lock-BKQMhJAd.mjs +0 -1
  161. package/dist/src-DK0akukL.mjs +0 -1
  162. package/dist/start-XjuC5cJ7.mjs +0 -1
@@ -94,7 +94,7 @@
94
94
  -->
95
95
  <script>(() => { try { const raw = localStorage.getItem('ok-language-v1'); if (!raw) return; const o = JSON.parse(raw); if (typeof o?.locale !== 'string' || !/^[a-zA-Z]{2,8}(-[a-zA-Z0-9]{2,8})*$/.test(o.locale)) return; document.documentElement.lang = o.locale; document.documentElement.dir = o.dir === 'rtl' ? 'rtl' : 'ltr'; } catch {} })();</script>
96
96
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
97
- <script type="module" crossorigin src="./assets/index-Bs1jwA4d.js"></script>
97
+ <script type="module" crossorigin src="./assets/index-DfrYusq_.js"></script>
98
98
  <link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
99
99
  <link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
100
100
  <link rel="modulepreload" crossorigin href="./assets/react-dom-DPxgxlDT.js">
@@ -128,13 +128,13 @@
128
128
  <link rel="modulepreload" crossorigin href="./assets/lib-B5SpBbcO.js">
129
129
  <link rel="modulepreload" crossorigin href="./assets/lib-C0Wr4O8I.js">
130
130
  <link rel="modulepreload" crossorigin href="./assets/markdownit-C1Squg6O.js">
131
- <link rel="modulepreload" crossorigin href="./assets/dist-B2PYdf6L.js">
131
+ <link rel="modulepreload" crossorigin href="./assets/dist-DGemBD_J.js">
132
132
  <link rel="modulepreload" crossorigin href="./assets/dist-D81TFAXh.js">
133
- <link rel="modulepreload" crossorigin href="./assets/client-version-DDQ9xEIT.js">
134
- <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-BFjYwtG_.js">
135
- <link rel="modulepreload" crossorigin href="./assets/messages-CqcZjYtT.js">
136
- <link rel="modulepreload" crossorigin href="./assets/i18n-CmVxos8c.js">
137
- <link rel="modulepreload" crossorigin href="./assets/config-provider-Bbv6VafV.js">
133
+ <link rel="modulepreload" crossorigin href="./assets/client-version-D7sx1Rjr.js">
134
+ <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-DZRctrdg.js">
135
+ <link rel="modulepreload" crossorigin href="./assets/messages-CxUlt8sa.js">
136
+ <link rel="modulepreload" crossorigin href="./assets/i18n-OKq2zgJD.js">
137
+ <link rel="modulepreload" crossorigin href="./assets/config-provider-BfPKv7D_.js">
138
138
  <link rel="modulepreload" crossorigin href="./assets/dist-DsLZcVyZ.js">
139
139
  <link rel="modulepreload" crossorigin href="./assets/dist-DX6BuR0m.js">
140
140
  <link rel="modulepreload" crossorigin href="./assets/dist-DmTWt7nC.js">
@@ -155,7 +155,7 @@
155
155
  <link rel="modulepreload" crossorigin href="./assets/cursor-Dp3I7a4x.js">
156
156
  <link rel="modulepreload" crossorigin href="./assets/copilot-yXSa3JY-.js">
157
157
  <link rel="modulepreload" crossorigin href="./assets/badge-BHNK6NBf.js">
158
- <link rel="modulepreload" crossorigin href="./assets/terminal-cli-display-CXprjqVX.js">
158
+ <link rel="modulepreload" crossorigin href="./assets/terminal-cli-display-w0URjEKX.js">
159
159
  <link rel="modulepreload" crossorigin href="./assets/x-DddVxTPq.js">
160
160
  <link rel="modulepreload" crossorigin href="./assets/dialog-HdfR4WGm.js">
161
161
  <link rel="modulepreload" crossorigin href="./assets/dist-83_CVK0Y.js">
@@ -166,22 +166,22 @@
166
166
  <link rel="modulepreload" crossorigin href="./assets/switch-CXMMdHyn.js">
167
167
  <link rel="modulepreload" crossorigin href="./assets/folder-open-BapQa7r-.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/trash-2-Co21mefL.js">
169
- <link rel="modulepreload" crossorigin href="./assets/file-tree-utils-D07uWuBD.js">
170
- <link rel="modulepreload" crossorigin href="./assets/doc-paths-BzBsdgOF.js">
171
- <link rel="modulepreload" crossorigin href="./assets/skill-scope-CLmSkL31.js">
172
- <link rel="modulepreload" crossorigin href="./assets/navigation-targets-BVHBxGSt.js">
169
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-utils-CzXn1zjH.js">
170
+ <link rel="modulepreload" crossorigin href="./assets/doc-paths-BkpejoFL.js">
171
+ <link rel="modulepreload" crossorigin href="./assets/skill-scope-gUkJkFRO.js">
172
+ <link rel="modulepreload" crossorigin href="./assets/navigation-targets-saCskzOA.js">
173
173
  <link rel="modulepreload" crossorigin href="./assets/asset-dispatch-KsnhYIM1.js">
174
174
  <link rel="modulepreload" crossorigin href="./assets/external-link-B0bVg1hn.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/documents-fetch-B1PtbYbS.js">
176
- <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-DNcdooLt.js">
176
+ <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-Bj9YNHN0.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/git-branch-CCnsAeFH.js">
178
178
  <link rel="modulepreload" crossorigin href="./assets/triangle-alert-CRXAJBn4.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/Mermaid-B3SF6uX9.js">
180
180
  <link rel="modulepreload" crossorigin href="./assets/CopyButton-CKyZY1PL.js">
181
- <link rel="modulepreload" crossorigin href="./assets/documents-events-B3aHqHDU.js">
181
+ <link rel="modulepreload" crossorigin href="./assets/documents-events-B2g_1xMi.js">
182
182
  <link rel="modulepreload" crossorigin href="./assets/parse-api-error-DsopQ8yv.js">
183
183
  <link rel="modulepreload" crossorigin href="./assets/startup-marks-BBwl9PAL.js">
184
- <link rel="modulepreload" crossorigin href="./assets/prop-types-CzTU66xx.js">
184
+ <link rel="modulepreload" crossorigin href="./assets/prop-types-efgXxLQK.js">
185
185
  <link rel="modulepreload" crossorigin href="./assets/eye-DmhHKPNd.js">
186
186
  <link rel="modulepreload" crossorigin href="./assets/hash-Du9SGD0J.js">
187
187
  <link rel="modulepreload" crossorigin href="./assets/info-DmvKnBgp.js">
@@ -192,13 +192,13 @@
192
192
  <link rel="modulepreload" crossorigin href="./assets/local-menu-action-bus-CIYp0C2E.js">
193
193
  <link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-CVcZpNDF.js">
194
194
  <link rel="modulepreload" crossorigin href="./assets/input-lp6-d0mX.js">
195
- <link rel="modulepreload" crossorigin href="./assets/use-collab-url-VdWHbtIf.js">
196
- <link rel="modulepreload" crossorigin href="./assets/skills-api-qBhseQS2.js">
197
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-DEIQsbJW.js">
198
- <link rel="modulepreload" crossorigin href="./assets/use-skills-BOcl-P7c.js">
199
- <link rel="modulepreload" crossorigin href="./assets/use-open-skill-D4gF_c3G.js">
195
+ <link rel="modulepreload" crossorigin href="./assets/use-collab-url-cmMNtL6Q.js">
196
+ <link rel="modulepreload" crossorigin href="./assets/skills-api-DriOKSSy.js">
197
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-DkWkOb2l.js">
198
+ <link rel="modulepreload" crossorigin href="./assets/use-skills-DJ009sMa.js">
199
+ <link rel="modulepreload" crossorigin href="./assets/use-open-skill-NgEIqB9-.js">
200
200
  <link rel="modulepreload" crossorigin href="./assets/mascot-outline-CtS592mc.js">
201
- <link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-DDpaGouF.js">
201
+ <link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-CTC2zZsI.js">
202
202
  <link rel="modulepreload" crossorigin href="./assets/checkbox-hfBCQ901.js">
203
203
  <link rel="modulepreload" crossorigin href="./assets/label-B5yNUINo.js">
204
204
  <link rel="modulepreload" crossorigin href="./assets/radio-group--UnhPoMH.js">
@@ -206,26 +206,26 @@
206
206
  <link rel="modulepreload" crossorigin href="./assets/toggle-group-BhPXEnmq.js">
207
207
  <link rel="modulepreload" crossorigin href="./assets/useQuery-ZeEDLtxh.js">
208
208
  <link rel="modulepreload" crossorigin href="./assets/workspace-paths-CKUFX0v6.js">
209
- <link rel="modulepreload" crossorigin href="./assets/follow-file-Cjy5mh1A.js">
209
+ <link rel="modulepreload" crossorigin href="./assets/follow-file-DZjqgOif.js">
210
210
  <link rel="modulepreload" crossorigin href="./assets/format-I3YtNHrv.js">
211
211
  <link rel="modulepreload" crossorigin href="./assets/braces-CJEjDc1f.js">
212
- <link rel="modulepreload" crossorigin href="./assets/PropertyDisplayRow-BHfWjWFh.js">
213
- <link rel="modulepreload" crossorigin href="./assets/folder-config-api-DWUKYOic.js">
214
- <link rel="modulepreload" crossorigin href="./assets/comment-chips-UOlMv5tO.js">
215
- <link rel="modulepreload" crossorigin href="./assets/SkillCostValue-DP0KhVX6.js">
212
+ <link rel="modulepreload" crossorigin href="./assets/PropertyDisplayRow-Di_FqHjH.js">
213
+ <link rel="modulepreload" crossorigin href="./assets/folder-config-api-DPWmRi8a.js">
214
+ <link rel="modulepreload" crossorigin href="./assets/comment-chips-TnONx2o_.js">
215
+ <link rel="modulepreload" crossorigin href="./assets/SkillCostValue-6xiHOBnl.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/textarea-dRxJ8TN6.js">
217
- <link rel="modulepreload" crossorigin href="./assets/selection-context-CwVqjIBq.js">
218
- <link rel="modulepreload" crossorigin href="./assets/lint-config-client-uz0JfQyM.js">
219
- <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-BcNn8cQq.js">
220
- <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-CWnWseMW.js">
217
+ <link rel="modulepreload" crossorigin href="./assets/selection-context-BIrUkkRy.js">
218
+ <link rel="modulepreload" crossorigin href="./assets/lint-config-client-sK38eqbj.js">
219
+ <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-RI0RIpfn.js">
220
+ <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-VBfYxggq.js">
221
221
  <link rel="modulepreload" crossorigin href="./assets/arrow-up-right-CGe6dTck.js">
222
222
  <link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-CP1iDML-.js">
223
223
  <link rel="modulepreload" crossorigin href="./assets/list-plus-CT84Vd_h.js">
224
- <link rel="modulepreload" crossorigin href="./assets/use-settings-route-BCNil7dn.js">
224
+ <link rel="modulepreload" crossorigin href="./assets/use-settings-route-BrzzIll2.js">
225
225
  <link rel="modulepreload" crossorigin href="./assets/platform-labels-B2q9roOE.js">
226
226
  <link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-DqemxSWT.js">
227
- <link rel="modulepreload" crossorigin href="./assets/use-workspace-DtniUxsw.js">
228
- <link rel="modulepreload" crossorigin href="./assets/skill-actions-B0Lfx1Jp.js">
227
+ <link rel="modulepreload" crossorigin href="./assets/use-workspace-8Sxb8Z6Q.js">
228
+ <link rel="modulepreload" crossorigin href="./assets/skill-actions-CGiiNBa2.js">
229
229
  <link rel="modulepreload" crossorigin href="./assets/case-sensitive-CE1B0vR4.js">
230
230
  <link rel="modulepreload" crossorigin href="./assets/chevron-left-UUhIKmW4.js">
231
231
  <link rel="modulepreload" crossorigin href="./assets/lint-plugin-meta-24C-xIZB.js">
@@ -233,40 +233,40 @@
233
233
  <link rel="modulepreload" crossorigin href="./assets/wrench-Pum_Z20m.js">
234
234
  <link rel="modulepreload" crossorigin href="./assets/panel-DzcaKH-k.js">
235
235
  <link rel="modulepreload" crossorigin href="./assets/skeleton-D4wPMdlV.js">
236
- <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-CAgWYZ8p.js">
236
+ <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-C9ot8C0H.js">
237
237
  <link rel="modulepreload" crossorigin href="./assets/download-Dn5ulvxm.js">
238
238
  <link rel="modulepreload" crossorigin href="./assets/field-BZySvRxx.js">
239
- <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-Dsjv88YE.js">
239
+ <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-cIXBAj7o.js">
240
240
  <link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-CveL5d4F.js">
241
- <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-ChrCVFhp.js">
242
- <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-Z3qsc-3y.js">
241
+ <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-ONj5lhiT.js">
242
+ <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-CQRrvMAa.js">
243
243
  <link rel="modulepreload" crossorigin href="./assets/history-DnsnwPsA.js">
244
- <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-wTk-jvFI.js">
245
- <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-CBFoMPQn.js">
244
+ <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-ENQgQOde.js">
245
+ <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-D5bWItau.js">
246
246
  <link rel="modulepreload" crossorigin href="./assets/panel-right-open-DjTdbkpr.js">
247
- <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-DQrbXVOu.js">
247
+ <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-CLm4Tujb.js">
248
248
  <link rel="modulepreload" crossorigin href="./assets/square-pen-NShYDQ74.js">
249
249
  <link rel="modulepreload" crossorigin href="./assets/undo-2-DAbhEXY-.js">
250
250
  <link rel="modulepreload" crossorigin href="./assets/form-C2vo2-_o.js">
251
251
  <link rel="modulepreload" crossorigin href="./assets/text-viewer-languages-B0r5kVWT.js">
252
- <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-BY9m0wjZ.js">
252
+ <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-Cewar40S.js">
253
253
  <link rel="modulepreload" crossorigin href="./assets/ConfigSharingInfoTooltip-DjzTrJv7.js">
254
254
  <link rel="modulepreload" crossorigin href="./assets/project-paths-DWofrp-d.js">
255
255
  <link rel="modulepreload" crossorigin href="./assets/SkillModeBanner-CFrx5Bz6.js">
256
256
  <link rel="modulepreload" crossorigin href="./assets/app-menubar-gate-CVNDuMMQ.js">
257
- <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-C-_sBtIk.js">
257
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-BAEEzFBR.js">
258
258
  <link rel="modulepreload" crossorigin href="./assets/terminal-command-events-CwHEMoPz.js">
259
- <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-DIc_2bm6.js">
260
- <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-DqXV-fD-.js">
259
+ <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-DtNUPAuc.js">
260
+ <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-C1EtEd_i.js">
261
261
  <link rel="modulepreload" crossorigin href="./assets/input-group-4bFGj8B8.js">
262
262
  <link rel="modulepreload" crossorigin href="./assets/use-installed-clis-DZ3aSVtd.js">
263
- <link rel="modulepreload" crossorigin href="./assets/use-skill-origin-DZ48Ce5_.js">
264
- <link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-Cg19bGQH.js">
263
+ <link rel="modulepreload" crossorigin href="./assets/use-skill-origin-Bpi6sqBq.js">
264
+ <link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-Bwit7Ew2.js">
265
265
  <link rel="modulepreload" crossorigin href="./assets/agent-presence-BymGPyOl.js">
266
266
  <link rel="modulepreload" crossorigin href="./assets/auth-prompt-store-B25Qo1Wd.js">
267
267
  <link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-Ngwhy1qL.js">
268
268
  <link rel="modulepreload" crossorigin href="./assets/overlay-layers-Bj-TVfKw.js">
269
- <link rel="modulepreload" crossorigin href="./assets/receive-store-BNb1QM5F.js">
269
+ <link rel="modulepreload" crossorigin href="./assets/receive-store-D0DFBX0k.js">
270
270
  <link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-DnRthkM7.js">
271
271
  <link rel="stylesheet" crossorigin href="./assets/globals-ungA9FjT.css">
272
272
  <link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
@@ -32,7 +32,7 @@
32
32
  script above.
33
33
  -->
34
34
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
35
- <script type="module" crossorigin src="./assets/uninstall-BHLZOGk6.js"></script>
35
+ <script type="module" crossorigin src="./assets/uninstall-LCcNjUXD.js"></script>
36
36
  <link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
37
37
  <link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
38
38
  <link rel="modulepreload" crossorigin href="./assets/react-dom-DPxgxlDT.js">
@@ -44,7 +44,7 @@
44
44
  <link rel="modulepreload" crossorigin href="./assets/lib-C0Wr4O8I.js">
45
45
  <link rel="modulepreload" crossorigin href="./assets/markdownit-C1Squg6O.js">
46
46
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-Bw5giFqP.js">
47
- <link rel="modulepreload" crossorigin href="./assets/dist-B2PYdf6L.js">
47
+ <link rel="modulepreload" crossorigin href="./assets/dist-DGemBD_J.js">
48
48
  <link rel="modulepreload" crossorigin href="./assets/dist-XgwTV-oh2.js">
49
49
  <link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
50
50
  <link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
@@ -68,8 +68,8 @@
68
68
  <link rel="modulepreload" crossorigin href="./assets/badge-BHNK6NBf.js">
69
69
  <link rel="modulepreload" crossorigin href="./assets/input-lp6-d0mX.js">
70
70
  <link rel="modulepreload" crossorigin href="./assets/textarea-dRxJ8TN6.js">
71
- <link rel="modulepreload" crossorigin href="./assets/messages-CqcZjYtT.js">
72
- <link rel="modulepreload" crossorigin href="./assets/i18n-CmVxos8c.js">
71
+ <link rel="modulepreload" crossorigin href="./assets/messages-CxUlt8sa.js">
72
+ <link rel="modulepreload" crossorigin href="./assets/i18n-OKq2zgJD.js">
73
73
  <link rel="stylesheet" crossorigin href="./assets/globals-ungA9FjT.css">
74
74
  </head>
75
75
 
@@ -1,2 +1,2 @@
1
- import{t as e}from"./launch-json-removal-CFgiLXcA.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
- //# sourceMappingURL=repair-launch-json-Hx8_cm6Y.mjs.map
1
+ import{t as e}from"./launch-json-removal-CdBxmBgo.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
+ //# sourceMappingURL=repair-launch-json-BkUd6kHr.mjs.map
@@ -1,2 +1,2 @@
1
- import{ps as e}from"./src-FmS9CDpL.mjs";import{i as t,o as n,p as r}from"./write-project-skill-C9GKlPPQ.mjs";import{d as i,v as a}from"./init-DlPmbtVI.mjs";import{t as o}from"./mcp-migrate-event-B1gJf6bG.mjs";import{homedir as s}from"node:os";function c(e){let r=e.logger??d,i=e.home??s(),a=[];if(e.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=n[o],s=l(()=>t.configPath(``,i));if(s!==null&&a.push(u({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),t.projectConfigPath){let n=t.projectConfigPath,i=l(()=>n(e.projectDir));i!==null&&a.push(u({scope:`project`,editorId:o,target:t,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function l(e){try{return e()}catch{return null}}function u(t){let n={scope:t.scope,editorId:t.editorId,configPath:t.configPath},s=i(t.target,t.cwd,t.home,t.configPathOverride);if(s===null)return{...n,outcome:`no-entry`};if(t.editorId===`pi`){if(r(s))return{...n,outcome:`canonical`}}else{let r=e(s);if(r.kind===`recognized`&&r.disposition===`keep`)return{...n,outcome:`canonical`};if(r.kind===`declined`&&t.scope===`project`)return t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:r.reason}),{...n,outcome:`declined`,reason:r.reason}}t.logger(o({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:s}));let c=a(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(c.action===`failed`){let e=c.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...n,outcome:`write-failed`,error:e}}return c.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:c.declineReason}),{...n,outcome:`declined`}):{...n,outcome:`repaired`}}function d(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{c as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-BVGE_9cU.mjs.map
1
+ import{ps as e}from"./src-BxdlvOrw.mjs";import{i as t,o as n,p as r}from"./write-project-skill-Dx5URYrZ.mjs";import{d as i,v as a}from"./init-DAhyRxDw.mjs";import{t as o}from"./mcp-migrate-event-B1gJf6bG.mjs";import{homedir as s}from"node:os";function c(e){let r=e.logger??d,i=e.home??s(),a=[];if(e.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=n[o],s=l(()=>t.configPath(``,i));if(s!==null&&a.push(u({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),t.projectConfigPath){let n=t.projectConfigPath,i=l(()=>n(e.projectDir));i!==null&&a.push(u({scope:`project`,editorId:o,target:t,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function l(e){try{return e()}catch{return null}}function u(t){let n={scope:t.scope,editorId:t.editorId,configPath:t.configPath},s=i(t.target,t.cwd,t.home,t.configPathOverride);if(s===null)return{...n,outcome:`no-entry`};if(t.editorId===`pi`){if(r(s))return{...n,outcome:`canonical`}}else{let r=e(s);if(r.kind===`recognized`&&r.disposition===`keep`)return{...n,outcome:`canonical`};if(r.kind===`declined`&&t.scope===`project`)return t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:r.reason}),{...n,outcome:`declined`,reason:r.reason}}t.logger(o({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:s}));let c=a(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(c.action===`failed`){let e=c.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...n,outcome:`write-failed`,error:e}}return c.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:c.declineReason}),{...n,outcome:`declined`}):{...n,outcome:`repaired`}}function d(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{c as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-DwWSjL8A.mjs.map
@@ -1,4 +1,4 @@
1
- import{Ms as e,W as t}from"./src-FmS9CDpL.mjs";import{Er as n,Or as r,Sr as i,_r as a,br as o,dr as s,fr as c,gr as l,hr as u}from"./src-BT7INQqO.mjs";import{o as d,s as f,t as p,v as m}from"./write-project-skill-C9GKlPPQ.mjs";import{n as h,s as g,t as _}from"./colors-BsmVIwfM.mjs";import{n as v,r as y,t as b}from"./skill-teardown-B1lwZmlf.mjs";import{dirname as x,join as S,relative as C,resolve as w}from"node:path";import{existsSync as T,mkdirSync as E,readFileSync as D,readdirSync as O,rmSync as k,statSync as A,writeFileSync as j}from"node:fs";import{homedir as M}from"node:os";import{createInterface as N}from"node:readline/promises";const P={existsSync:e=>T(e),isDirectory:e=>{try{return A(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>O(e),readFileSync:e=>D(e),writeFileSync:(e,t)=>{j(e,t)},mkdirSync:(e,t)=>{E(e,t)},rmSync:(e,t)=>{k(e,t)}},F={resolveProjectBundledSkillDir:()=>i(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>i(e,{checkDesktop:!1}),readBundledVersion:()=>c(),readRecordedVersion:e=>u(e,`cli-hosts`),writeRecordedVersion:(e,t)=>a(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>o(e),readBundleDecision:(e,t)=>s(e,t),writeBundleDecision:(e,t,n)=>l(e,t,n),removeBundleFromDisk:(e,t)=>y(e,t)};function I(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function L(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(x(t),{recursive:!0}),R(e,t,n)}function R(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=S(e,r),a=S(t,r);n.isDirectory(i)?R(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function z(t,n,r){return r.existsSync(S(t,`.agents`,`skills`,n))||e.some(e=>r.existsSync(S(t,e.skillsRoot,n)))}function B(t,n,r,i,a,o){let s=[],c=S(t,`.agents`,`skills`,n);if(z(t,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of e){let e=S(t,r.skillsRoot,n);if(e!==c){if(!i.existsSync(S(t,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-host-absent`});continue}i.existsSync(e)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(S(t,`.agents`));if(l&&i.existsSync(c))s.push({kind:`central`,path:c,outcome:`skipped-present`});else if(l)try{L(r,c,i),s.push({kind:`central`,path:c,outcome:`written`}),a({event:`user-skill-reclaim-central-written`,scope:`user`,path:c,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`central`,path:c,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-central-failed`,scope:`user`,path:c,error:t})}for(let l of e){let e=S(t,l.hostDir),u=S(t,l.skillsRoot,n);if(u===c){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!i.existsSync(e)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(i.existsSync(u)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-present`});continue}try{L(r,u,i),s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`written`}),a({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,error:t})}}return{entries:s,anyWritten:s.some(e=>e.outcome===`written`),anyDestinationSucceeded:s.some(e=>e.outcome===`written`||e.outcome===`skipped-present`)}}function V(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function H(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of f){let o=S(e,t.hostDir,`skills`,`open-knowledge`),s=S(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=d[t.editorId]?.projectConfigPath?.(e);if(!V(c,n)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{p(o,e),L(i,o,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`created`}),r({event:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function U(e,i,a,o){let s=e=>{i.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await i.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await i.readRecordedVersion(e)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of r)try{d.push({id:e,sourceDir:i.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let r of d){let s=n[r.id],c=z(e,s,a),l=await i.readBundleDecision(e,s).catch(()=>null);if(!t(l,{installedOnDisk:c})){if(c)try{i.removeBundleFromDisk(e,r.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:r.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await i.writeBundleDecision(e,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}p.push(r)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(t=>z(e,n[t.id],a));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===r.length,_=[];for(let{id:t,sourceDir:r}of p){let i=B(e,n[t],r,a,o,l);h.push(...i.entries),_.push({id:t,anyWritten:i.anyWritten,landed:i.anyDestinationSucceeded,centralFailed:i.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:i.entries.some(e=>e.kind===`host`&&e.outcome===`failed`)})}let v=_.some(e=>e.centralFailed),y=_.every(e=>e.landed);if(g&&y&&!v){let t=null;try{await i.writeRecordedVersion(e,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(e){t=e instanceof Error?e.message:String(e),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:t})}for(let{id:e,anyWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:t===null?n?`installed`:`skip-current`:`failed`,version:l,...t===null?{}:{reason:`state-write-failed:${t}`}})}else{g||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:`bundle-unresolved`});for(let{id:e,centralFailed:t,hostFailed:n}of _)!t&&!n||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:`failed`,version:l,reason:n?`all-writes-failed`:`central-write-failed`})}return{outcome:`done`,version:l,entries:h}}async function W(e){let t=e.logger??I,n=e.fs??P,r=e.home??M(),i={...F,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=H(e.projectDir,i,n,t),o=await U(r,i,n,t),s=v(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=b(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function G(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function K(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`present`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-present`).length,i=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,a=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} present, ${i} skipped, ${a} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
1
+ import{Ms as e,W as t}from"./src-BxdlvOrw.mjs";import{Er as n,Or as r,Sr as i,_r as a,br as o,dr as s,fr as c,gr as l,hr as u}from"./src-C9i4ShN8.mjs";import{o as d,s as f,t as p,v as m}from"./write-project-skill-Dx5URYrZ.mjs";import{n as h,s as g,t as _}from"./colors-BsmVIwfM.mjs";import{n as v,r as y,t as b}from"./skill-teardown-v6hvkG1K.mjs";import{dirname as x,join as S,relative as C,resolve as w}from"node:path";import{existsSync as T,mkdirSync as E,readFileSync as D,readdirSync as O,rmSync as k,statSync as A,writeFileSync as j}from"node:fs";import{homedir as M}from"node:os";import{createInterface as N}from"node:readline/promises";const P={existsSync:e=>T(e),isDirectory:e=>{try{return A(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>O(e),readFileSync:e=>D(e),writeFileSync:(e,t)=>{j(e,t)},mkdirSync:(e,t)=>{E(e,t)},rmSync:(e,t)=>{k(e,t)}},F={resolveProjectBundledSkillDir:()=>i(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>i(e,{checkDesktop:!1}),readBundledVersion:()=>c(),readRecordedVersion:e=>u(e,`cli-hosts`),writeRecordedVersion:(e,t)=>a(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>o(e),readBundleDecision:(e,t)=>s(e,t),writeBundleDecision:(e,t,n)=>l(e,t,n),removeBundleFromDisk:(e,t)=>y(e,t)};function I(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function L(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(x(t),{recursive:!0}),R(e,t,n)}function R(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=S(e,r),a=S(t,r);n.isDirectory(i)?R(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function z(t,n,r){return r.existsSync(S(t,`.agents`,`skills`,n))||e.some(e=>r.existsSync(S(t,e.skillsRoot,n)))}function B(t,n,r,i,a,o){let s=[],c=S(t,`.agents`,`skills`,n);if(z(t,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of e){let e=S(t,r.skillsRoot,n);if(e!==c){if(!i.existsSync(S(t,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-host-absent`});continue}i.existsSync(e)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(S(t,`.agents`));if(l&&i.existsSync(c))s.push({kind:`central`,path:c,outcome:`skipped-present`});else if(l)try{L(r,c,i),s.push({kind:`central`,path:c,outcome:`written`}),a({event:`user-skill-reclaim-central-written`,scope:`user`,path:c,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`central`,path:c,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-central-failed`,scope:`user`,path:c,error:t})}for(let l of e){let e=S(t,l.hostDir),u=S(t,l.skillsRoot,n);if(u===c){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!i.existsSync(e)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(i.existsSync(u)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-present`});continue}try{L(r,u,i),s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`written`}),a({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,error:t})}}return{entries:s,anyWritten:s.some(e=>e.outcome===`written`),anyDestinationSucceeded:s.some(e=>e.outcome===`written`||e.outcome===`skipped-present`)}}function V(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function H(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of f){let o=S(e,t.hostDir,`skills`,`open-knowledge`),s=S(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=d[t.editorId]?.projectConfigPath?.(e);if(!V(c,n)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{p(o,e),L(i,o,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`created`}),r({event:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function U(e,i,a,o){let s=e=>{i.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await i.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await i.readRecordedVersion(e)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of r)try{d.push({id:e,sourceDir:i.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let r of d){let s=n[r.id],c=z(e,s,a),l=await i.readBundleDecision(e,s).catch(()=>null);if(!t(l,{installedOnDisk:c})){if(c)try{i.removeBundleFromDisk(e,r.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:r.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await i.writeBundleDecision(e,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}p.push(r)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(t=>z(e,n[t.id],a));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===r.length,_=[];for(let{id:t,sourceDir:r}of p){let i=B(e,n[t],r,a,o,l);h.push(...i.entries),_.push({id:t,anyWritten:i.anyWritten,landed:i.anyDestinationSucceeded,centralFailed:i.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:i.entries.some(e=>e.kind===`host`&&e.outcome===`failed`)})}let v=_.some(e=>e.centralFailed),y=_.every(e=>e.landed);if(g&&y&&!v){let t=null;try{await i.writeRecordedVersion(e,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(e){t=e instanceof Error?e.message:String(e),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:t})}for(let{id:e,anyWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:t===null?n?`installed`:`skip-current`:`failed`,version:l,...t===null?{}:{reason:`state-write-failed:${t}`}})}else{g||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:`bundle-unresolved`});for(let{id:e,centralFailed:t,hostFailed:n}of _)!t&&!n||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:`failed`,version:l,reason:n?`all-writes-failed`:`central-write-failed`})}return{outcome:`done`,version:l,entries:h}}async function W(e){let t=e.logger??I,n=e.fs??P,r=e.home??M(),i={...F,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=H(e.projectDir,i,n,t),o=await U(r,i,n,t),s=v(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=b(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function G(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function K(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`present`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-present`).length,i=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,a=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} present, ${i} skipped, ${a} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
2
2
  `)}function q(){return new m(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").option(`-y, --yes`,`Skip the confirmation prompt for removing directories left by a pre-0.42 install.`).action(async e=>{let t=await W({projectDir:w(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null,confirmLegacyCleanup:t=>J(t,{yes:e.yes===!0})});process.stdout.write(`${K(t)}\n`),process.exitCode=G(t)})}async function J(e,t){let n=M(),r=e=>`~/${C(n,e)}`,i=t.input??process.stdin,a=[``,_(`A previous version of OpenKnowledge installed its skill into agent tools you may never have used.`),h(`(Versions before 0.42 wrote to every host a third-party installer knew about — see issue #820.)`)];if(e.skillDirs.length>0&&a.push(``,`${_(`Remove OpenKnowledge skills:`)} ${e.skillDirs.length}`,...e.skillDirs.map(e=>` ${r(e)}`)),e.emptyDirs.length>0){let t=e.skillDirs.length>0?`Then remove these, which hold nothing else once the above are gone:`:`Remove these empty directories, left behind by that install:`;a.push(``,`${_(t)} ${e.emptyDirs.length}`,...e.emptyDirs.map(e=>` ${r(e)}`))}if(a.push(``,h(`Nothing outside these paths is touched. A directory that still holds anything is kept.`)),process.stdout.write(`${a.join(`
3
3
  `)}\n`),t.yes)return!0;if(!i.isTTY)return process.stdout.write(`${g("Not a terminal — skipping cleanup. Re-run with `ok repair-skills --yes` to remove these.")}\n`),!1;let o=N({input:i,output:process.stdout});try{let e=(await o.question(`\n${_(`Remove them?`)} ${h(`[y/N] `)}`)).trim().toLowerCase();return e===`y`||e===`yes`}finally{o.close()}}export{q as n,W as t};
4
- //# sourceMappingURL=repair-skills-CJ-NMRQu.mjs.map
4
+ //# sourceMappingURL=repair-skills-CE-cFHgC.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-CE-cFHgC.mjs";export{e as repairSkills};
@@ -1,2 +1,2 @@
1
- import"./src-FmS9CDpL.mjs";import{r as e}from"./logger-DFxEUjvj.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const y=v(),b=1;function x(e){return new URL(e.url??``,`http://localhost`).searchParams}function S(e){let t=e?.code;return typeof t==`string`?t:void 0}const C=/^[A-Za-z0-9-]{8,64}$/;let w=null;function T(e){return n(e??p(),`.ok`,`machine-id`)}function E(n){if(n===void 0&&w!==null)return w;let r=T(n),i=null;try{let e=l(r,`utf-8`).trim();C.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(w=i),i}const D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===E():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==E()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:E(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??y},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(S(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){S(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e,t){q({lockName:`server`,lockDir:e,...t})}function $(e){U({lockName:`server`,lockDir:e})}function ee(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,E as _,Q as a,y as b,O as c,k as d,U as f,H as g,q as h,Z as i,R as l,G as m,Y as n,X as o,W as p,$ as r,ee as s,J as t,V as u,S as v,b as x,x as y};
2
- //# sourceMappingURL=server-lock-Byfibur-.mjs.map
1
+ import"./src-BxdlvOrw.mjs";import{r as e}from"./logger-DFxEUjvj.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const y=v(),b=1;function x(e){return new URL(e.url??``,`http://localhost`).searchParams}function S(e){let t=e?.code;return typeof t==`string`?t:void 0}const C=/^[A-Za-z0-9-]{8,64}$/;let w=null;function T(e){return n(e??p(),`.ok`,`machine-id`)}function E(n){if(n===void 0&&w!==null)return w;let r=T(n),i=null;try{let e=l(r,`utf-8`).trim();C.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(w=i),i}const D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===E():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==E()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:E(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??y},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(S(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){S(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e,t){q({lockName:`server`,lockDir:e,...t})}function $(e){U({lockName:`server`,lockDir:e})}function ee(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,E as _,Q as a,y as b,O as c,k as d,U as f,H as g,q as h,Z as i,R as l,G as m,Y as n,X as o,W as p,$ as r,ee as s,J as t,V as u,S as v,b as x,x as y};
2
+ //# sourceMappingURL=server-lock-BmwIVWMl.mjs.map
@@ -0,0 +1 @@
1
+ import{a as e,o as t,r as n}from"./server-lock-BmwIVWMl.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
@@ -1,2 +1,2 @@
1
- import{Ms as e}from"./src-FmS9CDpL.mjs";import{Er as t,Or as n}from"./src-BT7INQqO.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...n.map(e=>t[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of n){let n=t[r];o.push({path:a(i,`.agents`,`skills`,n),bundleId:r,scope:`central`});for(let t of e)o.push({path:a(i,t.skillsRoot,n),bundleId:r,scope:`host`,hostDir:t.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
- //# sourceMappingURL=skill-teardown-B1lwZmlf.mjs.map
1
+ import{Ms as e}from"./src-BxdlvOrw.mjs";import{Er as t,Or as n}from"./src-C9i4ShN8.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...n.map(e=>t[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of n){let n=t[r];o.push({path:a(i,`.agents`,`skills`,n),bundleId:r,scope:`central`});for(let t of e)o.push({path:a(i,t.skillsRoot,n),bundleId:r,scope:`host`,hostDir:t.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
+ //# sourceMappingURL=skill-teardown-v6hvkG1K.mjs.map
@@ -0,0 +1 @@
1
+ import"./src-BxdlvOrw.mjs";import"./write-project-skill-Dx5URYrZ.mjs";import"./src-Bpb4g0qR.mjs";import"./acp-harness-probe-BV29NJeb.mjs";import"./init-DAhyRxDw.mjs";import{n as e}from"./loader-5k0QB7UD.mjs";import"./skill-teardown-v6hvkG1K.mjs";import"./preview-rnbZQhXd.mjs";import"./mcp-migrate-event-B1gJf6bG.mjs";export{e as loadConfig};
@@ -1 +1 @@
1
- import{B as e,Cc as t,Fs as n,Ls as r,W as i,_s as a,g as o,ms as s,qs as c,v as l,vs as u}from"./src-FmS9CDpL.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Bt as w,C as T,Ca as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Ht as ne,I as re,Ii as ie,In as ae,Ir as oe,It as se,J as ce,Ji as le,Jn as ue,Jr as de,Jt as fe,K as pe,Ki as me,Kn as he,Kr as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lr as xe,Lt as Se,M as Ce,Mi as we,Mn as Te,Mr as Ee,Mt as De,N as Oe,Ni as ke,Nn as Ae,Nr as je,Nt as Me,O as Ne,Oi as Pe,On as Fe,Or as Ie,Ot as Le,P as Re,Pi as ze,Pn as Be,Pr as Ve,Pt as He,Q as Ue,Qi as We,Qn as Ge,Qr as Ke,Qt as qe,R as Je,Ri as Ye,Rn as Xe,Rr as Ze,Rt as Qe,S as $e,Sa as et,Si as tt,Sn as nt,Sr as rt,St as it,T as at,Ta as ot,Tn as st,Tr as ct,Tt as lt,U as ut,Ui as dt,Un as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vt as _t,W as vt,Wi as yt,Wn as bt,Wt as xt,X as St,Xi as Ct,Xn as wt,Xr as Tt,Xt as Et,Y as Dt,Yi as Ot,Yn as kt,Yr as At,Yt as jt,Z as Mt,Zi as Nt,Zn as Pt,Zr as Ft,Zt as It,_ as Lt,_a as Rt,_i as zt,_n as Bt,_r as Vt,_t as Ht,a as Ut,aa as Wt,ai as Gt,an as Kt,ar as qt,at as Jt,b as Yt,ba as Xt,bi as Zt,bn as Qt,br as $t,bt as en,c as tn,ca as nn,ci as rn,cn as an,cr as on,ct as sn,d as cn,da as ln,di as un,dn,dr as fn,ea as pn,ei as mn,en as hn,er as gn,et as _n,f as vn,fa as yn,fi as bn,fn as xn,fr as Sn,g as Cn,ga as wn,gi as Tn,gn as En,gr as Dn,gt as On,h as kn,ha as An,hi as jn,hn as Mn,hr as Nn,i as Pn,ia as Fn,ii as In,in as Ln,ir as Rn,it as zn,j as Bn,ji as Vn,jn as Hn,jr as Un,jt as Wn,k as Gn,ki as Kn,kn as qn,kr as Jn,kt as Yn,l as Xn,la as Zn,li as Qn,ln as $n,lr as er,lt as tr,m as nr,ma as rr,mi as ir,mn as ar,mr as or,n as sr,na as cr,ni as lr,nn as ur,nr as dr,nt as fr,o as pr,oa as mr,oi as hr,on as gr,or as _r,ot as vr,p as yr,pa as br,pi as xr,pn as Sr,pr as Cr,q as wr,qi as Tr,qn as Er,qr as Dr,qt as Or,r as kr,ra as Ar,ri as jr,rn as Mr,rr as Nr,rt as Pr,s as Fr,sa as Ir,si as Lr,sn as Rr,sr as zr,st as Br,t as Vr,ta as Hr,ti as Ur,tn as Wr,tr as Gr,tt as Kr,u as qr,ua as Jr,ui as Yr,un as Xr,ur as Zr,v as Qr,va as $r,vi as ei,vn as ti,vr as ni,vt as ri,w as ii,wa as ai,wi as oi,wn as si,wr as ci,wt as li,x as ui,xa as di,xi as fi,xn as pi,xr as mi,xt as hi,y as gi,ya as _i,yi as vi,yn as yi,yr as bi,yt as xi,z as Si,zi as Ci,zn as wi,zr as Ti,zt as Ei}from"./src-BT7INQqO.mjs";import{C as Di,E as Oi,T as ki,_ as Ai,b as ji,c as Mi,d as Ni,g as Pi,i as Fi,l as Ii,m as Li,n as Ri,p as zi,s as Bi,t as Vi,u as Hi,v as Ui,w as Wi,x as Gi,y as Ki}from"./fs-traced-CJ0NSnI0.mjs";import{a as qi,d as Ji,f as Yi,i as Xi,l as Zi,n as Qi,r as $i,t as ea,u as ta}from"./logger-DFxEUjvj.mjs";import{C as na,S as ra,_ as ia,a as aa,b as oa,c as sa,d as ca,g as la,h as ua,i as da,l as fa,m as pa,n as ma,o as ha,p as ga,r as _a,s as va,t as ya,u as ba,x as xa}from"./server-lock-Byfibur-.mjs";export{$r as AGENT_ID_MAX_LEN,_i as AGENT_ID_RE,ze as AGENT_WRITE_ORIGIN,ot as AcpPermissionStore,et as AcpRegistry,Kn as AcpThreadManager,N as AgentFocusBroadcaster,z as AgentPresenceBroadcaster,W as AgentSessionCapacityError,ie as AgentSessionManager,Ht as AutoStartDisabledError,ci as BUNDLE_IDS,ct as BUNDLE_SCOPE,V as BUNDLE_SKILL_NAME,Nr as BacklinkIndex,me as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Bt as CONFIG_FILENAME,Pt as CONFLICT_MARKER_RE,Dr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Lt as ConfigSchema,We as DEFAULT_CHECKPOINT_RETENTION,bn as DEFAULT_EMBEDDINGS_DIMENSIONS,ne as DEFAULT_PACK_ID,mt as DocumentDurabilityState,xr as EMBEDDINGS_API_KEY_ENV,st as ExposureConsentError,E as FEATURED_AGENT_IDS,f as FILE_SYSTEM_WRITER,Gr as FILE_WATCHER_ORIGIN,hr as FileEmbeddingsBackend,Ln as GIT_PREFLIGHT_FAIL_SPAN_NAME,pn as GIT_UPSTREAM_WRITER,R as GitDirAccessError,gr as GitNotAvailableError,Rr as GitTooOldError,ri as HOCUSPOCUS_AUTH_REJECTION_REASONS,xi as HocuspocusAuthRejection,en as HocuspocusAuthTokenSchema,m as INSTALLED_AGENTS_SCHEMES,sn as JSON_SCHEMA_DIALECT_2020_12,n as LINEAGE_EPOCH_KEY,Je as LIVE_DERIVED_INDEX_DEBOUNCE_MS,pt as LOG_MD_TEMPLATE,I as MANAGED_RENAME_ORIGIN,_ as MAX_ACP_THREADS,ye as MAX_AGENT_SESSIONS,we as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Ye as MIN_EVICTABLE_IDLE_MS,an as MIN_GIT_VERSION,$ as MISSING_OK_CONFIG_MESSAGE,M as MalformedGitPointerError,_n as McpLogger,ut as MissingOkConfigError,S as OBSERVER_SYNC_ORIGIN,ti as OK_OKIGNORE_TEMPLATE,F as ONBOARDING_BUNDLE_IDS,a as ORPHAN_MODES,t as PROTOCOL_VERSION,ea as PinoLogger,sa as ProcessLockCollisionError,Xn as ProjectGitInitError,Le as ROLLBACK_ORIGIN,yi as ROOT_GITIGNORE_TEMPLATE,oa as RUNTIME_VERSION,Hr as SERVICE_WRITER,bi as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,xt as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,_e as STARTER_PACKS,Or as STARTER_PACK_IDS,fe as STARTER_TEMPLATES,at as STATE_MANIFEST_FILENAME,xa as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,hn as SeedPrerequisiteError,Wr as SeedRootDirError,ya as ServerLockCollisionError,Vr as SingleFileNotAFileError,sr as SingleFileNotFoundError,kr as SingleFileNotMarkdownError,L as StateManifestError,dr as TagIndex,Ie as USER_GLOBAL_BUNDLE_IDS,He as UiLockCollisionError,Yn as __getShowAllWalkStatsForTesting,b as __resetShowAllWalkStatsForTesting,fa as acquireProcessLock,ma as acquireServerLock,q as acquireUiLock,Ci as applyAgentMarkdownWrite,kt as applyExternalChange,_t as applySeed,j as assertCompatibleStateManifest,$n as assertGitAvailable,be as assertNeverDiskEvent,Pe as attachAcpThreadSocket,On as attachIdleShutdown,Qr as bootServer,qt as buildAndOpenSkill,Qt as buildConfigYmlContent,Dt as buildExecResult,B as buildIngressPolicy,Vn as buildOkMcpStdioCommand,mi as buildSkillZip,jt as buildStarterFolderFrontmatterYaml,cr as buildWipTree,Jn as bundleSkillMdPath,Lr as canonicalProjectKey,Xe as classifyEvents,Vi as classifyFsPath,rn as clearAllEmbeddingsKeys,jn as clearContributors,Et as coercePackId,o as colorFromSeed,Ar as commitUpstreamImport,Fn as commitWip,Wt as commitWipFromTree,Xr as compareSemver,Ee as composeEffectiveLinterConfig,je as composeFrontmatterSchemasConfig,Ge as containsConflictMarkers,wi as contentHash,Tn as contributorCount,Re as countShadowObjects,U as countStaleAgentWipRefs,re as countWipRefs,Wn as createApiExtension,H as createAssetServeMiddleware,J as createCollaborationHost,Z as createContentFilter,ge as createContentFilterAsync,Qn as createEmbeddingsSecretStore,Pn as createEphemeralProjectDir,wt as createExternalChangeHandler,vn as createFileLogger,Si as createLiveDerivedIndexExtension,wr as createMcpHttpHandler,mn as createOsProbe,Oe as createPersistenceExtension,T as createServer,Bn as createServerObserverExtension,dt as createStreamingErrorWriter,Qi as createTestLogger,Yr as describeStoredEmbeddingsKey,Cn as detectClaudeDesktopPresence,dn as detectGit,Ne as detectProjectShape,_r as detectUserSkillHosts,Pr as discoverLockDirs,oe as discoverMarkdownlintConfig,Kt as emitPreflightFailureSpan,St as encodeDocName,Mt as encodeFolderRoute,Ue as encodeSkillRoute,qr as ensureProjectGit,pi as ensureProjectSkillGitignore,yt as errorResponse,C as evictStaleTrackerEntries,De as extractHeadings,zn as extractOkBinaryPath,Rn as extractWikiLinksFromMarkdown,xn as fallbackPaths,cn as findEnclosingGitRoot,G as findEnclosingProjectRoot,xe as findNativeMarkdownlintFile,yr as flushFileLogger,hi as formatAuthRejectionWire,zt as formatContributors,ei as formatContributorsFrom,Ei as formatPackRationale,mr as gcCheckpointRefs,Kr as getCurrentMcpLogger,P as getIngressContext,tt as getLocalDir,nr as getLogFilePath,$i as getLogger,kn as getLogsDir,ia as getMachineId,Ki as getMeter,br as getMetrics,ji as getTracer,rr as handleCollabSocketError,de as handleSpawnCursor,Fe as hasForwardingHeaders,ve as hasGcLogLatch,l as iconFromClientName,An as incrementCollabSocketFilteredError,wn as incrementServerObserverFire,nt as initContent,Ir as initShadowRepo,Gi as initTelemetry,Yt as initToleranceTelemetryWriter,tr as installJsonSchemaDialect,Br as installPrettyZodErrors,Xi as installTestLoggers,zr as installUserSkill,Be as isAllowedApiOrigin,Te as isAllowedWorkspaceHostHeader,Tr as isConfigDoc,it as isHocuspocusAuthRejectionReason,qn as isHostAdmitted,It as isKnownPackId,le as isLinkIndexExcludedDoc,Ae as isLoopbackAddress,Ot as isManagedArtifactDoc,v as isOriginAdmitted,u as isOrphanMode,ht as isPairedWriteOrigin,At as isPathWithinDir,Hn as isPeerAdmitted,ra as isProcessAlive,ae as isProjectRoot,Ct as isReservedForUserTree,gt as isSelfWrite,Nt as isSystemDoc,ui as isToleranceTelemetryEnabled,na as isValidLockPid,te as lastKnownHash,nn as listRescueCheckpoints,qe as listStarterPacks,ai as loadCustomAgents,Ce as loadPrincipal,ba as lockBaseUrl,ca as lockFilePath,qi as loggerFactory,Zi as logsCurrentPath,ta as logsPreviousPath,un as makeLazyEmbeddingsKeyStore,_a as markServerLockDraining,vt as mountMcpAndApi,Ri as normalizeFsPath,y as originGitHubHost,O as packageVersionMajorMinor,A as parseAuthRejectionWire,Sr as parseGitVersion,li as parseHocuspocusAuthToken,pe as parseKeepaliveConnectionId,ft as pathToDocName,w as planSeed,Ut as prepareSingleFileOpen,Jt as processCommand,vr as processUsage,Zr as readAllTargets,fn as readBundleDecision,Ze as readOwnNativeRules,ga as readProcessLock,pa as readProcessLockDetailed,x as readProjectHeadState,Gt as readProjectLocalSemanticConfig,da as readServerLock,Sn as readServerPackageVersion,Cr as readSkillInstallStateSnapshot,Gn as readStateManifest,or as readTargetRecordedAt,Nn as readTargetVersion,se as readUiLock,p as reconcile,vi as recordContributor,$t as recordSkillInstallEvent,ce as registerAllTools,bt as registerWrite,ua as releaseProcessLock,aa as releaseServerLock,Se as releaseUiLock,X as removeLastKnownHash,er as reportSkillInstall,Rt as resetMetrics,on as resolveBuiltinSkillHosts,i as resolveBundleEnabled,rt as resolveBundledSkillDir,D as resolveContentDir,Tt as resolveCursorBinaryDefault,Ft as resolveCursorSpawnInvocation,Ve as resolveEffectiveLinterConfig,ir as resolveEmbeddingsCredential,oi as resolveLockDir,K as resolveNativeConfigForDoc,Ti as resolveNativeMarkdownlintConfig,h as resolvePack,Fr as resolvePackageVersion,ni as resolveSkillInstallReportSettings,d as resolveUiInfo,Zt as restoreContributors,gi as restoreLifecycleFromConflictsJson,jr as rewriteMarkdownLinksForDocumentRename,In as rewriteWikiLinksForDocumentRename,ar as runAuthReposSubprocess,Mn as runAuthStatusSubprocess,ur as runCloneSubprocess,En as runDeviceFlowSubprocess,fr as runWithMcpLogger,lr as safeContentPath,Me as safeSubdir,Zn as safetyCheckpoint,ke as sanitizeClientName,Jr as saveInMemoryCheckpoint,ln as saveVersion,lt as seedBasenameIndex,pr as serializeError,Di as setActiveSpanAttributes,ee as setupServerObservers,yn as shadowGit,Wi as shutdownTelemetry,Ji as spansCurrentPath,Yi as spansPreviousPath,Ke as spawnDetached,gn as splitMarkdownBlocks,he as startWatcher,Y as streamingProblemEvent,fi as swapContributors,$e as teardownToleranceTelemetryWriter,Xt as toBroadcasterKey,Fi as tracedAppendFileSync,Bi as tracedLinkSync,Mi as tracedMkdir,Ii as tracedMkdirSync,Hi as tracedRename,Ni as tracedRenameSync,zi as tracedRmSync,Li as tracedRmdirSync,Pi as tracedUnlinkSync,Ai as tracedWriteFile,Ui as tracedWriteFileSync,ii as trustSystemCertificates,tn as untrackTrackedProjectSkillProjection,Er as updateLastKnownHash,la as updateProcessLockPort,ha as updateServerLockPort,Qe as updateUiLockPort,di as validateAgentId,Mr as validateCloneInputs,k as validateSkillZip,va as waitForServerLockDrain,Ur as withHiddenWindowsConsole,ki as withSpan,Oi as withSpanSync,Dn as writeBundleDecision,Un as writeMarkdownlintRule,si as writeRootGitignoreForNewRepo,g as writeStateManifest,Vt as writeTargetVersion,ue as writeTracker};
1
+ import{B as e,Cc as t,Fs as n,Ls as r,W as i,_s as a,g as o,ms as s,qs as c,v as l,vs as u}from"./src-BxdlvOrw.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Bt as w,C as T,Ca as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Ht as ne,I as re,Ii as ie,In as ae,Ir as oe,It as se,J as ce,Ji as le,Jn as ue,Jr as de,Jt as fe,K as pe,Ki as me,Kn as he,Kr as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lr as xe,Lt as Se,M as Ce,Mi as we,Mn as Te,Mr as Ee,Mt as De,N as Oe,Ni as ke,Nn as Ae,Nr as je,Nt as Me,O as Ne,Oi as Pe,On as Fe,Or as Ie,Ot as Le,P as Re,Pi as ze,Pn as Be,Pr as Ve,Pt as He,Q as Ue,Qi as We,Qn as Ge,Qr as Ke,Qt as qe,R as Je,Ri as Ye,Rn as Xe,Rr as Ze,Rt as Qe,S as $e,Sa as et,Si as tt,Sn as nt,Sr as rt,St as it,T as at,Ta as ot,Tn as st,Tr as ct,Tt as lt,U as ut,Ui as dt,Un as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vt as _t,W as vt,Wi as yt,Wn as bt,Wt as xt,X as St,Xi as Ct,Xn as wt,Xr as Tt,Xt as Et,Y as Dt,Yi as Ot,Yn as kt,Yr as At,Yt as jt,Z as Mt,Zi as Nt,Zn as Pt,Zr as Ft,Zt as It,_ as Lt,_a as Rt,_i as zt,_n as Bt,_r as Vt,_t as Ht,a as Ut,aa as Wt,ai as Gt,an as Kt,ar as qt,at as Jt,b as Yt,ba as Xt,bi as Zt,bn as Qt,br as $t,bt as en,c as tn,ca as nn,ci as rn,cn as an,cr as on,ct as sn,d as cn,da as ln,di as un,dn,dr as fn,ea as pn,ei as mn,en as hn,er as gn,et as _n,f as vn,fa as yn,fi as bn,fn as xn,fr as Sn,g as Cn,ga as wn,gi as Tn,gn as En,gr as Dn,gt as On,h as kn,ha as An,hi as jn,hn as Mn,hr as Nn,i as Pn,ia as Fn,ii as In,in as Ln,ir as Rn,it as zn,j as Bn,ji as Vn,jn as Hn,jr as Un,jt as Wn,k as Gn,ki as Kn,kn as qn,kr as Jn,kt as Yn,l as Xn,la as Zn,li as Qn,ln as $n,lr as er,lt as tr,m as nr,ma as rr,mi as ir,mn as ar,mr as or,n as sr,na as cr,ni as lr,nn as ur,nr as dr,nt as fr,o as pr,oa as mr,oi as hr,on as gr,or as _r,ot as vr,p as yr,pa as br,pi as xr,pn as Sr,pr as Cr,q as wr,qi as Tr,qn as Er,qr as Dr,qt as Or,r as kr,ra as Ar,ri as jr,rn as Mr,rr as Nr,rt as Pr,s as Fr,sa as Ir,si as Lr,sn as Rr,sr as zr,st as Br,t as Vr,ta as Hr,ti as Ur,tn as Wr,tr as Gr,tt as Kr,u as qr,ua as Jr,ui as Yr,un as Xr,ur as Zr,v as Qr,va as $r,vi as ei,vn as ti,vr as ni,vt as ri,w as ii,wa as ai,wi as oi,wn as si,wr as ci,wt as li,x as ui,xa as di,xi as fi,xn as pi,xr as mi,xt as hi,y as gi,ya as _i,yi as vi,yn as yi,yr as bi,yt as xi,z as Si,zi as Ci,zn as wi,zr as Ti,zt as Ei}from"./src-C9i4ShN8.mjs";import{C as Di,E as Oi,T as ki,_ as Ai,b as ji,c as Mi,d as Ni,g as Pi,i as Fi,l as Ii,m as Li,n as Ri,p as zi,s as Bi,t as Vi,u as Hi,v as Ui,w as Wi,x as Gi,y as Ki}from"./fs-traced-CJ0NSnI0.mjs";import{a as qi,d as Ji,f as Yi,i as Xi,l as Zi,n as Qi,r as $i,t as ea,u as ta}from"./logger-DFxEUjvj.mjs";import{C as na,S as ra,_ as ia,a as aa,b as oa,c as sa,d as ca,g as la,h as ua,i as da,l as fa,m as pa,n as ma,o as ha,p as ga,r as _a,s as va,t as ya,u as ba,x as xa}from"./server-lock-BmwIVWMl.mjs";export{$r as AGENT_ID_MAX_LEN,_i as AGENT_ID_RE,ze as AGENT_WRITE_ORIGIN,ot as AcpPermissionStore,et as AcpRegistry,Kn as AcpThreadManager,N as AgentFocusBroadcaster,z as AgentPresenceBroadcaster,W as AgentSessionCapacityError,ie as AgentSessionManager,Ht as AutoStartDisabledError,ci as BUNDLE_IDS,ct as BUNDLE_SCOPE,V as BUNDLE_SKILL_NAME,Nr as BacklinkIndex,me as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Bt as CONFIG_FILENAME,Pt as CONFLICT_MARKER_RE,Dr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Lt as ConfigSchema,We as DEFAULT_CHECKPOINT_RETENTION,bn as DEFAULT_EMBEDDINGS_DIMENSIONS,ne as DEFAULT_PACK_ID,mt as DocumentDurabilityState,xr as EMBEDDINGS_API_KEY_ENV,st as ExposureConsentError,E as FEATURED_AGENT_IDS,f as FILE_SYSTEM_WRITER,Gr as FILE_WATCHER_ORIGIN,hr as FileEmbeddingsBackend,Ln as GIT_PREFLIGHT_FAIL_SPAN_NAME,pn as GIT_UPSTREAM_WRITER,R as GitDirAccessError,gr as GitNotAvailableError,Rr as GitTooOldError,ri as HOCUSPOCUS_AUTH_REJECTION_REASONS,xi as HocuspocusAuthRejection,en as HocuspocusAuthTokenSchema,m as INSTALLED_AGENTS_SCHEMES,sn as JSON_SCHEMA_DIALECT_2020_12,n as LINEAGE_EPOCH_KEY,Je as LIVE_DERIVED_INDEX_DEBOUNCE_MS,pt as LOG_MD_TEMPLATE,I as MANAGED_RENAME_ORIGIN,_ as MAX_ACP_THREADS,ye as MAX_AGENT_SESSIONS,we as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Ye as MIN_EVICTABLE_IDLE_MS,an as MIN_GIT_VERSION,$ as MISSING_OK_CONFIG_MESSAGE,M as MalformedGitPointerError,_n as McpLogger,ut as MissingOkConfigError,S as OBSERVER_SYNC_ORIGIN,ti as OK_OKIGNORE_TEMPLATE,F as ONBOARDING_BUNDLE_IDS,a as ORPHAN_MODES,t as PROTOCOL_VERSION,ea as PinoLogger,sa as ProcessLockCollisionError,Xn as ProjectGitInitError,Le as ROLLBACK_ORIGIN,yi as ROOT_GITIGNORE_TEMPLATE,oa as RUNTIME_VERSION,Hr as SERVICE_WRITER,bi as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,xt as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,_e as STARTER_PACKS,Or as STARTER_PACK_IDS,fe as STARTER_TEMPLATES,at as STATE_MANIFEST_FILENAME,xa as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,hn as SeedPrerequisiteError,Wr as SeedRootDirError,ya as ServerLockCollisionError,Vr as SingleFileNotAFileError,sr as SingleFileNotFoundError,kr as SingleFileNotMarkdownError,L as StateManifestError,dr as TagIndex,Ie as USER_GLOBAL_BUNDLE_IDS,He as UiLockCollisionError,Yn as __getShowAllWalkStatsForTesting,b as __resetShowAllWalkStatsForTesting,fa as acquireProcessLock,ma as acquireServerLock,q as acquireUiLock,Ci as applyAgentMarkdownWrite,kt as applyExternalChange,_t as applySeed,j as assertCompatibleStateManifest,$n as assertGitAvailable,be as assertNeverDiskEvent,Pe as attachAcpThreadSocket,On as attachIdleShutdown,Qr as bootServer,qt as buildAndOpenSkill,Qt as buildConfigYmlContent,Dt as buildExecResult,B as buildIngressPolicy,Vn as buildOkMcpStdioCommand,mi as buildSkillZip,jt as buildStarterFolderFrontmatterYaml,cr as buildWipTree,Jn as bundleSkillMdPath,Lr as canonicalProjectKey,Xe as classifyEvents,Vi as classifyFsPath,rn as clearAllEmbeddingsKeys,jn as clearContributors,Et as coercePackId,o as colorFromSeed,Ar as commitUpstreamImport,Fn as commitWip,Wt as commitWipFromTree,Xr as compareSemver,Ee as composeEffectiveLinterConfig,je as composeFrontmatterSchemasConfig,Ge as containsConflictMarkers,wi as contentHash,Tn as contributorCount,Re as countShadowObjects,U as countStaleAgentWipRefs,re as countWipRefs,Wn as createApiExtension,H as createAssetServeMiddleware,J as createCollaborationHost,Z as createContentFilter,ge as createContentFilterAsync,Qn as createEmbeddingsSecretStore,Pn as createEphemeralProjectDir,wt as createExternalChangeHandler,vn as createFileLogger,Si as createLiveDerivedIndexExtension,wr as createMcpHttpHandler,mn as createOsProbe,Oe as createPersistenceExtension,T as createServer,Bn as createServerObserverExtension,dt as createStreamingErrorWriter,Qi as createTestLogger,Yr as describeStoredEmbeddingsKey,Cn as detectClaudeDesktopPresence,dn as detectGit,Ne as detectProjectShape,_r as detectUserSkillHosts,Pr as discoverLockDirs,oe as discoverMarkdownlintConfig,Kt as emitPreflightFailureSpan,St as encodeDocName,Mt as encodeFolderRoute,Ue as encodeSkillRoute,qr as ensureProjectGit,pi as ensureProjectSkillGitignore,yt as errorResponse,C as evictStaleTrackerEntries,De as extractHeadings,zn as extractOkBinaryPath,Rn as extractWikiLinksFromMarkdown,xn as fallbackPaths,cn as findEnclosingGitRoot,G as findEnclosingProjectRoot,xe as findNativeMarkdownlintFile,yr as flushFileLogger,hi as formatAuthRejectionWire,zt as formatContributors,ei as formatContributorsFrom,Ei as formatPackRationale,mr as gcCheckpointRefs,Kr as getCurrentMcpLogger,P as getIngressContext,tt as getLocalDir,nr as getLogFilePath,$i as getLogger,kn as getLogsDir,ia as getMachineId,Ki as getMeter,br as getMetrics,ji as getTracer,rr as handleCollabSocketError,de as handleSpawnCursor,Fe as hasForwardingHeaders,ve as hasGcLogLatch,l as iconFromClientName,An as incrementCollabSocketFilteredError,wn as incrementServerObserverFire,nt as initContent,Ir as initShadowRepo,Gi as initTelemetry,Yt as initToleranceTelemetryWriter,tr as installJsonSchemaDialect,Br as installPrettyZodErrors,Xi as installTestLoggers,zr as installUserSkill,Be as isAllowedApiOrigin,Te as isAllowedWorkspaceHostHeader,Tr as isConfigDoc,it as isHocuspocusAuthRejectionReason,qn as isHostAdmitted,It as isKnownPackId,le as isLinkIndexExcludedDoc,Ae as isLoopbackAddress,Ot as isManagedArtifactDoc,v as isOriginAdmitted,u as isOrphanMode,ht as isPairedWriteOrigin,At as isPathWithinDir,Hn as isPeerAdmitted,ra as isProcessAlive,ae as isProjectRoot,Ct as isReservedForUserTree,gt as isSelfWrite,Nt as isSystemDoc,ui as isToleranceTelemetryEnabled,na as isValidLockPid,te as lastKnownHash,nn as listRescueCheckpoints,qe as listStarterPacks,ai as loadCustomAgents,Ce as loadPrincipal,ba as lockBaseUrl,ca as lockFilePath,qi as loggerFactory,Zi as logsCurrentPath,ta as logsPreviousPath,un as makeLazyEmbeddingsKeyStore,_a as markServerLockDraining,vt as mountMcpAndApi,Ri as normalizeFsPath,y as originGitHubHost,O as packageVersionMajorMinor,A as parseAuthRejectionWire,Sr as parseGitVersion,li as parseHocuspocusAuthToken,pe as parseKeepaliveConnectionId,ft as pathToDocName,w as planSeed,Ut as prepareSingleFileOpen,Jt as processCommand,vr as processUsage,Zr as readAllTargets,fn as readBundleDecision,Ze as readOwnNativeRules,ga as readProcessLock,pa as readProcessLockDetailed,x as readProjectHeadState,Gt as readProjectLocalSemanticConfig,da as readServerLock,Sn as readServerPackageVersion,Cr as readSkillInstallStateSnapshot,Gn as readStateManifest,or as readTargetRecordedAt,Nn as readTargetVersion,se as readUiLock,p as reconcile,vi as recordContributor,$t as recordSkillInstallEvent,ce as registerAllTools,bt as registerWrite,ua as releaseProcessLock,aa as releaseServerLock,Se as releaseUiLock,X as removeLastKnownHash,er as reportSkillInstall,Rt as resetMetrics,on as resolveBuiltinSkillHosts,i as resolveBundleEnabled,rt as resolveBundledSkillDir,D as resolveContentDir,Tt as resolveCursorBinaryDefault,Ft as resolveCursorSpawnInvocation,Ve as resolveEffectiveLinterConfig,ir as resolveEmbeddingsCredential,oi as resolveLockDir,K as resolveNativeConfigForDoc,Ti as resolveNativeMarkdownlintConfig,h as resolvePack,Fr as resolvePackageVersion,ni as resolveSkillInstallReportSettings,d as resolveUiInfo,Zt as restoreContributors,gi as restoreLifecycleFromConflictsJson,jr as rewriteMarkdownLinksForDocumentRename,In as rewriteWikiLinksForDocumentRename,ar as runAuthReposSubprocess,Mn as runAuthStatusSubprocess,ur as runCloneSubprocess,En as runDeviceFlowSubprocess,fr as runWithMcpLogger,lr as safeContentPath,Me as safeSubdir,Zn as safetyCheckpoint,ke as sanitizeClientName,Jr as saveInMemoryCheckpoint,ln as saveVersion,lt as seedBasenameIndex,pr as serializeError,Di as setActiveSpanAttributes,ee as setupServerObservers,yn as shadowGit,Wi as shutdownTelemetry,Ji as spansCurrentPath,Yi as spansPreviousPath,Ke as spawnDetached,gn as splitMarkdownBlocks,he as startWatcher,Y as streamingProblemEvent,fi as swapContributors,$e as teardownToleranceTelemetryWriter,Xt as toBroadcasterKey,Fi as tracedAppendFileSync,Bi as tracedLinkSync,Mi as tracedMkdir,Ii as tracedMkdirSync,Hi as tracedRename,Ni as tracedRenameSync,zi as tracedRmSync,Li as tracedRmdirSync,Pi as tracedUnlinkSync,Ai as tracedWriteFile,Ui as tracedWriteFileSync,ii as trustSystemCertificates,tn as untrackTrackedProjectSkillProjection,Er as updateLastKnownHash,la as updateProcessLockPort,ha as updateServerLockPort,Qe as updateUiLockPort,di as validateAgentId,Mr as validateCloneInputs,k as validateSkillZip,va as waitForServerLockDrain,Ur as withHiddenWindowsConsole,ki as withSpan,Oi as withSpanSync,Dn as writeBundleDecision,Un as writeMarkdownlintRule,si as writeRootGitignoreForNewRepo,g as writeStateManifest,Vt as writeTargetVersion,ue as writeTracker};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sleep-B416PNUo.mjs";import{bc as i,ho as a,it as o,rt as s,yc as c}from"./src-FmS9CDpL.mjs";import{Fn as l,at as u,it as d,ot as f,rt as p,ti as m,wi as h}from"./src-BT7INQqO.mjs";import{D as g,F as _,I as v,k as y}from"./fs-traced-CJ0NSnI0.mjs";import{C as b,S as x,_ as S,d as C}from"./server-lock-Byfibur-.mjs";import{t as w}from"./yazl-DZr4PyKA.mjs";import{m as T,p as E,v as D}from"./write-project-skill-C9GKlPPQ.mjs";import{c as ee}from"./colors-BsmVIwfM.mjs";import{n as te}from"./acp-harness-probe-xgy7rAnp.mjs";import{D as O,E as k,S as ne,T as A,_ as j,b as M,o as N}from"./init-DlPmbtVI.mjs";import{n as re}from"./constants-BmoWT5bP.mjs";import{t as P}from"./is-object-ByG7RnjH.mjs";import"./loader-DBn8SlY0.mjs";import"./skill-teardown-B1lwZmlf.mjs";import"./preview-Cl30UkIA.mjs";import{execSync as ie,spawnSync as ae}from"node:child_process";import{basename as F,dirname as I,join as L,relative as oe,resolve as R,sep as se}from"node:path";import{cpSync as ce,createWriteStream as le,existsSync as z,lstatSync as ue,mkdirSync as B,mkdtempSync as de,readFileSync as V,readdirSync as H,readlinkSync as fe,rmSync as U,statSync as pe,writeFileSync as W}from"node:fs";import{arch as me,freemem as he,homedir as G,hostname as ge,platform as _e,release as ve,tmpdir as ye,totalmem as be,type as xe,uptime as Se}from"node:os";import"node:fs/promises";import{createHash as Ce}from"node:crypto";var we=n();const Te=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Ee(e,t,n=l){if(e!==void 0&&!Te.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let De=null;function Oe(e){De=e}function ke(){return De??process.cwd()}function Ae(){return L(G(),`.ok`,`bug-reports`)}function je(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Ae(),r=`${t}-bugreport`,i=L(n,`${r}.zip`);for(let e=2;z(i);e+=1)i=L(n,`${r}-${e}.zip`);return i}function Me(e,t){let n=L(e,`.ok`,`config.yml`);if(z(n))try{let e=V(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return z(L(e,`.ok`))?Ce(`sha256`).update(R(e)).digest(`hex`).slice(0,12):null}function Ne(){let e={timestamp:new Date().toISOString(),platform:_e(),osType:xe(),osRelease:ve(),hostname:`[redacted]`,uptime:Se(),freeMem:he(),totalMem:be(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ie(`sw_vers -productVersion 2>/dev/null`,m({encoding:`utf8`})).trim()}catch{}try{let t=L(__dirname,`..`,`..`,`package.json`);z(t)&&(e.okVersion=JSON.parse(V(t,`utf8`)).version)}catch{}return e}const Pe=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Fe(e){let t=F(e);return Pe.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Ie(e,t){return ze(e,t).files}const Le=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Re(e,t=te){let n=L(e,`${t}.ShipIt`);return z(n)?Le.map(e=>L(n,e)).filter(e=>z(e)):[]}function ze(e,t){if(!z(t))return{files:[],excludedByProjectSlug:0};let n=H(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>L(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Fe),i=[],a=r.filter(t=>{try{return V(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!Fe(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Be(e){let t=L(e,`.ok`,`local`);return z(t)?{files:[`server.lock`,`last-spawn-error.log`,s].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function Ve(e){let t=L(e,`.ok`,`local`,`logs`);return z(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=i(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function Ue(e){for(let t of e.files)try{He({zipfile:e.zipfile,name:`${e.prefix}/${F(t)}`,content:V(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function We(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??L(G(),`.ok`,`logs`),o=t.projectDir?Me(t.projectDir,i):null;B(I(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Ne();s.desktop=t.desktop??null,s.language=t.language??null;let{files:l,excludedByProjectSlug:u}=ze(o,a),{files:d}=t.projectDir?Be(t.projectDir):{files:[]},{files:f}=t.projectDir?Ve(t.projectDir):{files:[]},p=t.shipItLogFiles??[];i?.info({logFileCount:l.length,logFilesExcludedByProjectSlug:u,lockFileCount:d.length,localSinkFileCount:f.length,shipItLogFileCount:p.length},`files collected`);let m=[],h=[],{ZipFile:g}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),_=new g;Ue({zipfile:_,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:i}),Ue({zipfile:_,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:i}),Ue({zipfile:_,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=V(e.sourcePath),n=`extra/${e.zipName??F(e.sourcePath)}`;_.addBuffer(t,n),h.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:_,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let v=JSON.stringify(s,null,2);_.addBuffer(Buffer.from(v,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let y={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:h,redactions:m,sysinfo:s};_.addBuffer(Buffer.from(JSON.stringify(y,null,2),`utf8`),`MANIFEST.json`);let b=m.reduce((e,t)=>e+t.lineCount,0),x=new Set(p.map(e=>`logs/${F(e)}`)),S=h.filter(e=>x.has(e)),C=o?h.filter(e=>e.startsWith(`logs/`)&&!Fe(e)&&!x.has(e)):[],w=[`# Bug Report Bundle`,``,`Generated: ${y.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${y.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...C.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...C.map(e=>`- ${e}`),``]:[],...S.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...S.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${c.join(`, `)}`,b>0?`${b} line(s) were scrubbed across ${m.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
1
+ import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sleep-B416PNUo.mjs";import{bc as i,ho as a,it as o,rt as s,yc as c}from"./src-BxdlvOrw.mjs";import{Fn as l,at as u,it as d,ot as f,rt as p,ti as m,wi as h}from"./src-C9i4ShN8.mjs";import{D as g,F as _,I as v,k as y}from"./fs-traced-CJ0NSnI0.mjs";import{C as b,S as x,_ as S,d as C}from"./server-lock-BmwIVWMl.mjs";import{t as w}from"./yazl-DZr4PyKA.mjs";import{m as T,p as E,v as D}from"./write-project-skill-Dx5URYrZ.mjs";import{c as ee}from"./colors-BsmVIwfM.mjs";import{n as te}from"./acp-harness-probe-BV29NJeb.mjs";import{D as O,E as k,S as ne,T as A,_ as j,b as M,o as N}from"./init-DAhyRxDw.mjs";import{n as re}from"./constants-Df9TN5Iy.mjs";import{t as P}from"./is-object-ByG7RnjH.mjs";import"./loader-5k0QB7UD.mjs";import"./skill-teardown-v6hvkG1K.mjs";import"./preview-rnbZQhXd.mjs";import{execSync as ie,spawnSync as ae}from"node:child_process";import{basename as F,dirname as I,join as L,relative as oe,resolve as R,sep as se}from"node:path";import{cpSync as ce,createWriteStream as le,existsSync as z,lstatSync as ue,mkdirSync as B,mkdtempSync as de,readFileSync as V,readdirSync as H,readlinkSync as fe,rmSync as U,statSync as pe,writeFileSync as W}from"node:fs";import{arch as me,freemem as he,homedir as G,hostname as ge,platform as _e,release as ve,tmpdir as ye,totalmem as be,type as xe,uptime as Se}from"node:os";import"node:fs/promises";import{createHash as Ce}from"node:crypto";var we=n();const Te=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Ee(e,t,n=l){if(e!==void 0&&!Te.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let De=null;function Oe(e){De=e}function ke(){return De??process.cwd()}function Ae(){return L(G(),`.ok`,`bug-reports`)}function je(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Ae(),r=`${t}-bugreport`,i=L(n,`${r}.zip`);for(let e=2;z(i);e+=1)i=L(n,`${r}-${e}.zip`);return i}function Me(e,t){let n=L(e,`.ok`,`config.yml`);if(z(n))try{let e=V(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return z(L(e,`.ok`))?Ce(`sha256`).update(R(e)).digest(`hex`).slice(0,12):null}function Ne(){let e={timestamp:new Date().toISOString(),platform:_e(),osType:xe(),osRelease:ve(),hostname:`[redacted]`,uptime:Se(),freeMem:he(),totalMem:be(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ie(`sw_vers -productVersion 2>/dev/null`,m({encoding:`utf8`})).trim()}catch{}try{let t=L(__dirname,`..`,`..`,`package.json`);z(t)&&(e.okVersion=JSON.parse(V(t,`utf8`)).version)}catch{}return e}const Pe=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Fe(e){let t=F(e);return Pe.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Ie(e,t){return ze(e,t).files}const Le=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Re(e,t=te){let n=L(e,`${t}.ShipIt`);return z(n)?Le.map(e=>L(n,e)).filter(e=>z(e)):[]}function ze(e,t){if(!z(t))return{files:[],excludedByProjectSlug:0};let n=H(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>L(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Fe),i=[],a=r.filter(t=>{try{return V(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!Fe(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Be(e){let t=L(e,`.ok`,`local`);return z(t)?{files:[`server.lock`,`last-spawn-error.log`,s].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function Ve(e){let t=L(e,`.ok`,`local`,`logs`);return z(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=i(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function Ue(e){for(let t of e.files)try{He({zipfile:e.zipfile,name:`${e.prefix}/${F(t)}`,content:V(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function We(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??L(G(),`.ok`,`logs`),o=t.projectDir?Me(t.projectDir,i):null;B(I(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Ne();s.desktop=t.desktop??null,s.language=t.language??null;let{files:l,excludedByProjectSlug:u}=ze(o,a),{files:d}=t.projectDir?Be(t.projectDir):{files:[]},{files:f}=t.projectDir?Ve(t.projectDir):{files:[]},p=t.shipItLogFiles??[];i?.info({logFileCount:l.length,logFilesExcludedByProjectSlug:u,lockFileCount:d.length,localSinkFileCount:f.length,shipItLogFileCount:p.length},`files collected`);let m=[],h=[],{ZipFile:g}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),_=new g;Ue({zipfile:_,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:i}),Ue({zipfile:_,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:i}),Ue({zipfile:_,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=V(e.sourcePath),n=`extra/${e.zipName??F(e.sourcePath)}`;_.addBuffer(t,n),h.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:_,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let v=JSON.stringify(s,null,2);_.addBuffer(Buffer.from(v,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let y={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:h,redactions:m,sysinfo:s};_.addBuffer(Buffer.from(JSON.stringify(y,null,2),`utf8`),`MANIFEST.json`);let b=m.reduce((e,t)=>e+t.lineCount,0),x=new Set(p.map(e=>`logs/${F(e)}`)),S=h.filter(e=>x.has(e)),C=o?h.filter(e=>e.startsWith(`logs/`)&&!Fe(e)&&!x.has(e)):[],w=[`# Bug Report Bundle`,``,`Generated: ${y.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${y.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...C.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...C.map(e=>`- ${e}`),``]:[],...S.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...S.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${c.join(`, `)}`,b>0?`${b} line(s) were scrubbed across ${m.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
2
2
  `);_.addBuffer(Buffer.from(w,`utf8`),`README.md`),_.end();let T=le(r);return _.outputStream.pipe(T),await new Promise((e,t)=>{T.on(`close`,e),T.on(`error`,t)}),i?.info({bundlePath:r,fileCount:h.length,redactionCount:b},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:h,redactions:m,redactedLineCount:b,generatedAt:y.generatedAt}}}var Ge=e(w(),1),K=e(ee(),1);function Ke(e){return v({absPath:y(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function qe({home:e=G(),env:n=process.env}={}){let i=Ke(e),{override:o,preferenceList:s}=g(n),{locale:c,source:l}=a({override:o,storedPreference:i,supportedLocales:r,preferenceList:s,autoDetectableLocales:t});return{preference:i,locale:c,source:l,systemLanguages:s}}function Je(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ye(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e,t){if(typeof e==`string`)return Je(e,t.contentDir);if(Array.isArray(e))return e.map(e=>q(e,t));if(!Ye(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=q(i,t);return n}function Xe(e,t){let n=V(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
3
3
  `),i=n.split(`
4
4
  `),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=q(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}W(e,r?`${a.join(`
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sle
17
17
  `).replace(/\n/g,`\r
18
18
  `));let u=`${i?``:``}${l}`;return u!==r&&_(e,u,{mode:A(e)}),{kind:`removed`}}function ln(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function un(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function dn(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:d(r),command:r,isDesktop:ln(r)}}function fn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&fn(e)?`ui-orphan`:`stale`}const pn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function mn(e){switch(e){case`running`:return K.default.green(e);case`desktop`:return K.default.blue(e);case`foreign`:return K.default.cyan(e);case`ui-orphan`:return K.default.magenta(e);case`stale`:return K.default.yellow(e)}}function hn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function gn(e){return`${hn(e.server.usage)} | ${hn(e.ui?.usage??null)}`}function _n(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function vn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,_n(e),gn(e),t,String(n),un(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=mn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=K.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
19
19
  `)}async function yn(e={}){let t=e.discover??p,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??u,a=e.resolveUsage??f,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=dn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&s.push(o)}if(e.json){let e=s.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(vn(e.all?s:s.filter(e=>pn.has(Q(e)))))}function bn(){return new D(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await yn({all:t.all===!0||e===`all`,json:t.json===!0})})}function xn(e,t,n={}){let r=n.isAlive??x,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function Sn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=xn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function Cn(e,t=x){let n=await p(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function wn(e){let t=Sn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Tn(e){return new D(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=Sn({lockDir:h(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await yn({});return}if(n===`all`){let e=await p();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,x)&&!$(r,x)||(wn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await Cn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}wn(t);return}wn(h(R(ke(),n)))})}export{ke as _,Xt as a,$t as c,Z as d,qt as f,Ae as g,je as h,an as i,en as l,Wt as m,Tn as n,tn as o,Ut as p,bn as r,Zt as s,Sn as t,Yt as u,Oe as v,Ee as y};
20
- //# sourceMappingURL=src-CT4EwQCO.mjs.map
20
+ //# sourceMappingURL=src-Bpb4g0qR.mjs.map