@inkeep/open-knowledge 0.58.0-beta.13 → 0.58.0-beta.15

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 (115) hide show
  1. package/dist/{acp-harness-probe-Dfv_uQNP.mjs → acp-harness-probe-DS_7zIK_.mjs} +2 -2
  2. package/dist/cli.mjs +62 -62
  3. package/dist/constants-BIeVtBfo.mjs +2 -0
  4. package/dist/index.d.mts +17 -17
  5. package/dist/index.mjs +1 -1
  6. package/dist/{init-FvfqNSOd.mjs → init-DpK4E47u.mjs} +11 -11
  7. package/dist/init-iZIn7AB8.mjs +1 -0
  8. package/dist/{launch-json-removal-B6WDLjiv.mjs → launch-json-removal-CKKETfkd.mjs} +2 -2
  9. package/dist/{loader-ShWmrYui.mjs → loader-DNYUnJfz.mjs} +2 -2
  10. package/dist/loader-DnW-i20_.mjs +1 -0
  11. package/dist/{open-browser-XCXpL8oR.mjs → open-browser-CqPwNS9p.mjs} +2 -2
  12. package/dist/preview-BHCrM7Ai.mjs +1 -0
  13. package/dist/{preview-2-v6P1hO.mjs → preview-CIC9NRPO.mjs} +2 -2
  14. package/dist/public/assets/{ActivityModeContent-D7_xgv7P.js → ActivityModeContent-Cd1OAYzL.js} +1 -1
  15. package/dist/public/assets/{AgentDiffPane-DHKJVpBK.js → AgentDiffPane-DZVN97i1.js} +1 -1
  16. package/dist/public/assets/{CodeMirrorPropInput-DXR5-JFo.js → CodeMirrorPropInput-DNcdooLt.js} +1 -1
  17. package/dist/public/assets/{DocumentContext-Br_dSI9H.js → DocumentContext-DEIQsbJW.js} +6 -6
  18. package/dist/public/assets/{EditorModeToggle-CANd5c2J.js → EditorModeToggle-BY9m0wjZ.js} +1 -1
  19. package/dist/public/assets/{EnableSyncConfirmDialog-BAOzmcZq.js → EnableSyncConfirmDialog-CWnWseMW.js} +1 -1
  20. package/dist/public/assets/{ExcalidrawDocEditor-Cvc6wabb.js → ExcalidrawDocEditor-CKiXFy_x.js} +1 -1
  21. package/dist/public/assets/FeedbackForm-BSl61r2U.js +1 -0
  22. package/dist/public/assets/{ImportSkillDialog-B6tXjot5.js → ImportSkillDialog-09UPINAA.js} +1 -1
  23. package/dist/public/assets/{LintConfigEditor-Cw_PGYRz.js → LintConfigEditor-Duz9fAR3.js} +1 -1
  24. package/dist/public/assets/ManagedArtifactProperties-BcNn8cQq.js +1 -0
  25. package/dist/public/assets/ManagedArtifactProperties-X6LSQOTj.js +1 -0
  26. package/dist/public/assets/{MermaidDocEditor-3FqhD9lF.js → MermaidDocEditor-CtpHpbxE.js} +1 -1
  27. package/dist/public/assets/{PropertyDisplayRow-CtBxU1Ak.js → PropertyDisplayRow-BHfWjWFh.js} +1 -1
  28. package/dist/public/assets/{SchemaConfigEditor-DhyxzCmv.js → SchemaConfigEditor-D9PYCPqf.js} +1 -1
  29. package/dist/public/assets/{SessionsHost-CB0yLBVw.js → SessionsHost-Cgxgg5Xm.js} +2 -2
  30. package/dist/public/assets/{SettingsDialogBody-DZR4EUUX.js → SettingsDialogBody-DQWb0J5d.js} +3 -3
  31. package/dist/public/assets/{ShareReceiveMissDialog-bQE-yeQ6.js → ShareReceiveMissDialog-CdtJGmHs.js} +1 -1
  32. package/dist/public/assets/SkillInstallMenu-DDpaGouF.js +8 -0
  33. package/dist/public/assets/{SkillToolbarControls-DhzDa8xm.js → SkillToolbarControls-Uh_M-Nv9.js} +1 -1
  34. package/dist/public/assets/{SourceEditor-DAiuKGfG.js → SourceEditor-CNDJTbpc.js} +1 -1
  35. package/dist/public/assets/{TerminalWindowApp-BtmxrE8e.js → TerminalWindowApp-CnLQLW3I.js} +1 -1
  36. package/dist/public/assets/{TextDocEditor-CE4yndXU.js → TextDocEditor-5mUdtOMw.js} +1 -1
  37. package/dist/public/assets/{ThreadView-CweBhNmN.js → ThreadView-P-PiPS1h.js} +5 -5
  38. package/dist/public/assets/{TimelineDiffPane-DDdiKvM5.js → TimelineDiffPane-BQaKTpx8.js} +1 -1
  39. package/dist/public/assets/{agent-diff-store-pclUz0aI.js → agent-diff-store-DIc_2bm6.js} +1 -1
  40. package/dist/public/assets/{auth-state-cache-D6Tks0Xw.js → auth-state-cache-Dsjv88YE.js} +3 -3
  41. package/dist/public/assets/{comment-chips-dIt1vXQ_.js → comment-chips-UOlMv5tO.js} +1 -1
  42. package/dist/public/assets/{config-provider-tHkdYhw-.js → config-provider-Bbv6VafV.js} +3 -3
  43. package/dist/public/assets/{follow-file-JEQI8xw4.js → follow-file-Cjy5mh1A.js} +1 -1
  44. package/dist/public/assets/globals-ungA9FjT.css +1 -0
  45. package/dist/public/assets/i18n-CmVxos8c.js +1 -0
  46. package/dist/public/assets/index-Bs1jwA4d.js +2096 -0
  47. package/dist/public/assets/messages-Blg7g8Ju.js +1 -0
  48. package/dist/public/assets/messages-CIPlCf8s.js +1 -0
  49. package/dist/public/assets/messages-C_-VdsDg.js +1 -0
  50. package/dist/public/assets/messages-ClA8sILa.js +1 -0
  51. package/dist/public/assets/messages-CmInz6Aj.js +1 -0
  52. package/dist/public/assets/messages-CqcZjYtT.js +1 -0
  53. package/dist/public/assets/messages-Cx5WvPRN.js +1 -0
  54. package/dist/public/assets/messages-D7I7ELHW.js +1 -0
  55. package/dist/public/assets/messages-DeViATgA.js +1 -0
  56. package/dist/public/assets/messages-JmG6V61v.js +1 -0
  57. package/dist/public/assets/messages-jIDdZeWu.js +1 -0
  58. package/dist/public/assets/messages-y4F5w3ou.js +1 -0
  59. package/dist/public/assets/{pending-receive-nav-store-CD1tgq0g.js → pending-receive-nav-store-ChrCVFhp.js} +1 -1
  60. package/dist/public/assets/{selection-context-D2Mghtd2.js → selection-context-CwVqjIBq.js} +1 -1
  61. package/dist/public/assets/{skill-actions-XyB8ZE4l.js → skill-actions-B0Lfx1Jp.js} +1 -1
  62. package/dist/public/assets/{src-CVjDuNGv.js → src-BC9Ot14T.js} +1 -1
  63. package/dist/public/assets/{typing-burst-detector-DAuaPW3s.js → typing-burst-detector-CAgWYZ8p.js} +2 -2
  64. package/dist/public/assets/{uninstall-DqWW2ke7.js → uninstall-BHLZOGk6.js} +1 -1
  65. package/dist/public/assets/{use-activity-panel-BQS8YgFm.js → use-activity-panel-BOsrrNzx.js} +1 -1
  66. package/dist/public/assets/{use-open-skill-BN_i8Eku.js → use-open-skill-D4gF_c3G.js} +1 -1
  67. package/dist/public/assets/{use-popular-skills-BAd04Q2w.js → use-popular-skills-CBFoMPQn.js} +1 -1
  68. package/dist/public/assets/{use-terminal-enabled-DCAIeUQs.js → use-terminal-enabled-mEDq_d4f.js} +1 -1
  69. package/dist/public/assets/use-timeline-entry-diff-CmXkzb1O.js +6 -0
  70. package/dist/public/index.html +23 -23
  71. package/dist/public/uninstall.html +5 -5
  72. package/dist/{repair-launch-json-BYSX4lZ4.mjs → repair-launch-json-CBdzInqd.mjs} +2 -2
  73. package/dist/{repair-mcp-configs-BXIuvoqd.mjs → repair-mcp-configs-BkdYQCB5.mjs} +2 -2
  74. package/dist/repair-skills-DZYRwlOA.mjs +1 -0
  75. package/dist/{repair-skills-DltCY6z2.mjs → repair-skills-dfeOpqoD.mjs} +2 -2
  76. package/dist/{skill-teardown-DhZjMVeU.mjs → skill-teardown-DMHte1Ul.mjs} +2 -2
  77. package/dist/src-BZYY4rMh.mjs +20 -0
  78. package/dist/src-CfZQlksq.mjs +1 -0
  79. package/dist/{src-DVlcBUL2.mjs → src-D1B-8GA1.mjs} +289 -289
  80. package/dist/src-mrqXaTi8.mjs +1 -0
  81. package/dist/{start-D1YfTqhe.mjs → start-D8fnkCvw.mjs} +4 -4
  82. package/dist/start-F9zFpCUi.mjs +1 -0
  83. package/dist/{ui-CNdWjnA7.mjs → ui-CtfzlLI1.mjs} +3 -3
  84. package/dist/{write-project-skill-GQSmUhGW.mjs → write-project-skill-_XCsfJhR.mjs} +3 -3
  85. package/package.json +5 -5
  86. package/dist/constants-e1BSt71N.mjs +0 -2
  87. package/dist/init-cfMv0WeA.mjs +0 -1
  88. package/dist/loader-CZpJwuV6.mjs +0 -1
  89. package/dist/preview-DFgeB8zI.mjs +0 -1
  90. package/dist/public/assets/FeedbackForm-D2mhxqam.js +0 -1
  91. package/dist/public/assets/ManagedArtifactProperties-BInM0KSe.js +0 -1
  92. package/dist/public/assets/ManagedArtifactProperties-jmbtLGDS.js +0 -1
  93. package/dist/public/assets/SkillInstallMenu-Df58OcE7.js +0 -8
  94. package/dist/public/assets/globals-tRU8O5cm.css +0 -1
  95. package/dist/public/assets/i18n-C2uEep4d.js +0 -1
  96. package/dist/public/assets/index-627Ovxlz.js +0 -2096
  97. package/dist/public/assets/messages-BHDcBKgv.js +0 -1
  98. package/dist/public/assets/messages-BJnM3Dga.js +0 -1
  99. package/dist/public/assets/messages-BUGfzfF2.js +0 -1
  100. package/dist/public/assets/messages-BaKdNrlr.js +0 -1
  101. package/dist/public/assets/messages-BzpyYTFC.js +0 -1
  102. package/dist/public/assets/messages-C972mg8q.js +0 -1
  103. package/dist/public/assets/messages-CuqqiR9b.js +0 -1
  104. package/dist/public/assets/messages-D81XOcCT.js +0 -1
  105. package/dist/public/assets/messages-DAEEmDbT.js +0 -1
  106. package/dist/public/assets/messages-DX5v9pJd.js +0 -1
  107. package/dist/public/assets/messages-DagLatIQ.js +0 -1
  108. package/dist/public/assets/messages-z-ne5Pbu.js +0 -1
  109. package/dist/public/assets/use-timeline-entry-diff-Dhao_9vO.js +0 -6
  110. package/dist/repair-skills-CS14x_hO.mjs +0 -1
  111. package/dist/src-5XnFzMUO.mjs +0 -1
  112. package/dist/src-B4cqEhZL.mjs +0 -1
  113. package/dist/src-OuxJ-RtG.mjs +0 -20
  114. package/dist/start-CScrvLcu.mjs +0 -1
  115. /package/dist/public/assets/{globals-B6ItdNTJ.js → globals-D0MkEylX.js} +0 -0
@@ -94,11 +94,11 @@
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-627Ovxlz.js"></script>
97
+ <script type="module" crossorigin src="./assets/index-Bs1jwA4d.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">
101
- <link rel="modulepreload" crossorigin href="./assets/globals-B6ItdNTJ.js">
101
+ <link rel="modulepreload" crossorigin href="./assets/globals-D0MkEylX.js">
102
102
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-Chd9yIcd.js">
103
103
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-Bw5giFqP.js">
104
104
  <link rel="modulepreload" crossorigin href="./assets/dist-D9pOpWzq.js">
@@ -132,9 +132,9 @@
132
132
  <link rel="modulepreload" crossorigin href="./assets/dist-D81TFAXh.js">
133
133
  <link rel="modulepreload" crossorigin href="./assets/client-version-DDQ9xEIT.js">
134
134
  <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-BFjYwtG_.js">
135
- <link rel="modulepreload" crossorigin href="./assets/messages-BHDcBKgv.js">
136
- <link rel="modulepreload" crossorigin href="./assets/i18n-C2uEep4d.js">
137
- <link rel="modulepreload" crossorigin href="./assets/config-provider-tHkdYhw-.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">
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">
@@ -173,7 +173,7 @@
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-DXR5-JFo.js">
176
+ <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-DNcdooLt.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">
@@ -194,11 +194,11 @@
194
194
  <link rel="modulepreload" crossorigin href="./assets/input-lp6-d0mX.js">
195
195
  <link rel="modulepreload" crossorigin href="./assets/use-collab-url-VdWHbtIf.js">
196
196
  <link rel="modulepreload" crossorigin href="./assets/skills-api-qBhseQS2.js">
197
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-Br_dSI9H.js">
197
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-DEIQsbJW.js">
198
198
  <link rel="modulepreload" crossorigin href="./assets/use-skills-BOcl-P7c.js">
199
- <link rel="modulepreload" crossorigin href="./assets/use-open-skill-BN_i8Eku.js">
199
+ <link rel="modulepreload" crossorigin href="./assets/use-open-skill-D4gF_c3G.js">
200
200
  <link rel="modulepreload" crossorigin href="./assets/mascot-outline-CtS592mc.js">
201
- <link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-Df58OcE7.js">
201
+ <link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-DDpaGouF.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,18 +206,18 @@
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-JEQI8xw4.js">
209
+ <link rel="modulepreload" crossorigin href="./assets/follow-file-Cjy5mh1A.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-CtBxU1Ak.js">
212
+ <link rel="modulepreload" crossorigin href="./assets/PropertyDisplayRow-BHfWjWFh.js">
213
213
  <link rel="modulepreload" crossorigin href="./assets/folder-config-api-DWUKYOic.js">
214
- <link rel="modulepreload" crossorigin href="./assets/comment-chips-dIt1vXQ_.js">
214
+ <link rel="modulepreload" crossorigin href="./assets/comment-chips-UOlMv5tO.js">
215
215
  <link rel="modulepreload" crossorigin href="./assets/SkillCostValue-DP0KhVX6.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/textarea-dRxJ8TN6.js">
217
- <link rel="modulepreload" crossorigin href="./assets/selection-context-D2Mghtd2.js">
217
+ <link rel="modulepreload" crossorigin href="./assets/selection-context-CwVqjIBq.js">
218
218
  <link rel="modulepreload" crossorigin href="./assets/lint-config-client-uz0JfQyM.js">
219
- <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-BInM0KSe.js">
220
- <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-BAOzmcZq.js">
219
+ <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-BcNn8cQq.js">
220
+ <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-CWnWseMW.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">
@@ -225,7 +225,7 @@
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
227
  <link rel="modulepreload" crossorigin href="./assets/use-workspace-DtniUxsw.js">
228
- <link rel="modulepreload" crossorigin href="./assets/skill-actions-XyB8ZE4l.js">
228
+ <link rel="modulepreload" crossorigin href="./assets/skill-actions-B0Lfx1Jp.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,30 +233,30 @@
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-DAuaPW3s.js">
236
+ <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-CAgWYZ8p.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-D6Tks0Xw.js">
239
+ <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-Dsjv88YE.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-CD1tgq0g.js">
241
+ <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-ChrCVFhp.js">
242
242
  <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-Z3qsc-3y.js">
243
243
  <link rel="modulepreload" crossorigin href="./assets/history-DnsnwPsA.js">
244
244
  <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-wTk-jvFI.js">
245
- <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-BAd04Q2w.js">
245
+ <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-CBFoMPQn.js">
246
246
  <link rel="modulepreload" crossorigin href="./assets/panel-right-open-DjTdbkpr.js">
247
247
  <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-DQrbXVOu.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-CANd5c2J.js">
252
+ <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-BY9m0wjZ.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
257
  <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-C-_sBtIk.js">
258
258
  <link rel="modulepreload" crossorigin href="./assets/terminal-command-events-CwHEMoPz.js">
259
- <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-pclUz0aI.js">
259
+ <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-DIc_2bm6.js">
260
260
  <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-DqXV-fD-.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">
@@ -268,7 +268,7 @@
268
268
  <link rel="modulepreload" crossorigin href="./assets/overlay-layers-Bj-TVfKw.js">
269
269
  <link rel="modulepreload" crossorigin href="./assets/receive-store-BNb1QM5F.js">
270
270
  <link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-DnRthkM7.js">
271
- <link rel="stylesheet" crossorigin href="./assets/globals-tRU8O5cm.css">
271
+ <link rel="stylesheet" crossorigin href="./assets/globals-ungA9FjT.css">
272
272
  <link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
273
273
  <link rel="stylesheet" crossorigin href="./assets/index-CDpJ2gXn.css">
274
274
  </head>
@@ -32,11 +32,11 @@
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-DqWW2ke7.js"></script>
35
+ <script type="module" crossorigin src="./assets/uninstall-BHLZOGk6.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">
39
- <link rel="modulepreload" crossorigin href="./assets/globals-B6ItdNTJ.js">
39
+ <link rel="modulepreload" crossorigin href="./assets/globals-D0MkEylX.js">
40
40
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-Chd9yIcd.js">
41
41
  <link rel="modulepreload" crossorigin href="./assets/trace-api-18gcBe0u.js">
42
42
  <link rel="modulepreload" crossorigin href="./assets/html-void-elements-C35FEqss.js">
@@ -68,9 +68,9 @@
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-BHDcBKgv.js">
72
- <link rel="modulepreload" crossorigin href="./assets/i18n-C2uEep4d.js">
73
- <link rel="stylesheet" crossorigin href="./assets/globals-tRU8O5cm.css">
71
+ <link rel="modulepreload" crossorigin href="./assets/messages-CqcZjYtT.js">
72
+ <link rel="modulepreload" crossorigin href="./assets/i18n-CmVxos8c.js">
73
+ <link rel="stylesheet" crossorigin href="./assets/globals-ungA9FjT.css">
74
74
  </head>
75
75
 
76
76
  <body class="antialiased">
@@ -1,2 +1,2 @@
1
- import{t as e}from"./launch-json-removal-B6WDLjiv.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`||o.kind===`removed-file`;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-BYSX4lZ4.mjs.map
1
+ import{t as e}from"./launch-json-removal-CKKETfkd.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`||o.kind===`removed-file`;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-CBdzInqd.mjs.map
@@ -1,2 +1,2 @@
1
- import{i as e,o as t,p as n}from"./write-project-skill-GQSmUhGW.mjs";import{d as r,v as i}from"./init-FvfqNSOd.mjs";import{t as a}from"./mcp-migrate-event-B1gJf6bG.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of e){let e=t[o],s=c(()=>e.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:e,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),e.projectConfigPath){let t=e.projectConfigPath,i=c(()=>t(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:e,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-BXIuvoqd.mjs.map
1
+ import{i as e,o as t,p as n}from"./write-project-skill-_XCsfJhR.mjs";import{d as r,v as i}from"./init-DpK4E47u.mjs";import{t as a}from"./mcp-migrate-event-B1gJf6bG.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of e){let e=t[o],s=c(()=>e.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:e,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),e.projectConfigPath){let t=e.projectConfigPath,i=c(()=>t(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:e,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-BkdYQCB5.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-dfeOpqoD.mjs";export{e as repairSkills};
@@ -1,4 +1,4 @@
1
- import{W as e,js as t}from"./src-C1ipB-PD.mjs";import{Er as n,br as r,hr as i,lr as a,mr as o,pr as s,ur as c,vr as l,wr as u}from"./src-DVlcBUL2.mjs";import{o as d,s as f,t as p,v as m}from"./write-project-skill-GQSmUhGW.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-DhZjMVeU.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:()=>r(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>r(e,{checkDesktop:!1}),readBundledVersion:()=>c(),readRecordedVersion:e=>s(e,`cli-hosts`),writeRecordedVersion:(e,t)=>i(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>l(e),readBundleDecision:(e,t)=>a(e,t),writeBundleDecision:(e,t,n)=>o(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(e,n,r){return r.existsSync(S(e,`.agents`,`skills`,n))||t.some(t=>r.existsSync(S(e,t.skillsRoot,n)))}function B(e,n,r,i,a,o){let s=[],c=S(e,`.agents`,`skills`,n);if(z(e,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of t){let t=S(e,r.skillsRoot,n);if(t!==c){if(!i.existsSync(S(e,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-host-absent`});continue}i.existsSync(t)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(S(e,`.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 t){let t=S(e,l.hostDir),u=S(e,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(t)){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(t,r,i,a){let o=e=>{r.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),c;try{c=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return a({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let l;try{l=await r.readRecordedVersion(t)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),l=null}let d=[],f=null;for(let e of n)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let n of d){let o=u[n.id],s=z(t,o,i),c=await r.readBundleDecision(t,o).catch(()=>null);if(!e(c,{installedOnDisk:s})){if(s)try{r.removeBundleFromDisk(t,n.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:n.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:n.id,error:e instanceof Error?e.message:String(e)})}continue}if(c===null&&s)try{await r.writeBundleDecision(t,o,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:n.id,error:e instanceof Error?e.message:String(e)})}p.push(n)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>z(t,u[e.id],i));if(l!==null&&l===c&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:c}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===n.length,_=[];for(let{id:e,sourceDir:n}of p){let r=B(t,u[e],n,i,a,c);h.push(...r.entries),_.push({id:e,anyWritten:r.anyWritten,landed:r.anyDestinationSucceeded,centralFailed:r.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:r.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 e=null;try{await r.writeRecordedVersion(t,c),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:c})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:c,error:e})}for(let{id:t,anyWritten:n}of _)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:c,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{g||o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:c,reason:`bundle-unresolved`});for(let{id:e,centralFailed:t,hostFailed:n}of _)!t&&!n||o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:`failed`,version:c,reason:n?`all-writes-failed`:`central-write-failed`})}return{outcome:`done`,version:c,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{W as e,js as t}from"./src-C1ipB-PD.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-D1B-8GA1.mjs";import{o as d,s as f,t as p,v as m}from"./write-project-skill-_XCsfJhR.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-DMHte1Ul.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(e,n,r){return r.existsSync(S(e,`.agents`,`skills`,n))||t.some(t=>r.existsSync(S(e,t.skillsRoot,n)))}function B(e,n,r,i,a,o){let s=[],c=S(e,`.agents`,`skills`,n);if(z(e,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of t){let t=S(e,r.skillsRoot,n);if(t!==c){if(!i.existsSync(S(e,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-host-absent`});continue}i.existsSync(t)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(S(e,`.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 t){let t=S(e,l.hostDir),u=S(e,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(t)){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(t,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(t)}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(t,s,a),l=await i.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{i.removeBundleFromDisk(t,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(t,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(e=>z(t,n[e.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:e,sourceDir:r}of p){let i=B(t,n[e],r,a,o,l);h.push(...i.entries),_.push({id:e,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 e=null;try{await i.writeRecordedVersion(t,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t,anyWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}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-DltCY6z2.mjs.map
4
+ //# sourceMappingURL=repair-skills-dfeOpqoD.mjs.map
@@ -1,2 +1,2 @@
1
- import{js as e}from"./src-C1ipB-PD.mjs";import{Er as t,wr as n}from"./src-DVlcBUL2.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=[...t.map(e=>n[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 t){let t=n[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let n of e)o.push({path:a(i,n.skillsRoot,t),bundleId:r,scope:`host`,hostDir:n.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-DhZjMVeU.mjs.map
1
+ import{js as e}from"./src-C1ipB-PD.mjs";import{Er as t,Or as n}from"./src-D1B-8GA1.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-DMHte1Ul.mjs.map
@@ -0,0 +1,20 @@
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{ho as i,it as a,rt as o,vc as s,yc as c}from"./src-C1ipB-PD.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-D1B-8GA1.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-CnbGjeVA.mjs";import{t as w}from"./yazl-DZr4PyKA.mjs";import{m as T,p as E,v as D}from"./write-project-skill-_XCsfJhR.mjs";import{c as ee}from"./colors-BsmVIwfM.mjs";import{n as te}from"./acp-harness-probe-DS_7zIK_.mjs";import{E as O,T as k,_ as ne,o as re,w as A,x as j,y as ie}from"./init-DpK4E47u.mjs";import{n as ae}from"./constants-BIeVtBfo.mjs";import{t as M}from"./is-object-ByG7RnjH.mjs";import"./loader-DNYUnJfz.mjs";import"./skill-teardown-DMHte1Ul.mjs";import"./preview-CIC9NRPO.mjs";import{execSync as oe,spawnSync as N}from"node:child_process";import{basename as P,dirname as F,join as I,relative as se,resolve as L,sep as ce}from"node:path";import{cpSync as le,createWriteStream as ue,existsSync as R,lstatSync as de,mkdirSync as z,mkdtempSync as fe,readFileSync as B,readdirSync as pe,readlinkSync as me,rmSync as he,statSync as ge,writeFileSync as V}from"node:fs";import{arch as _e,freemem as ve,homedir as H,hostname as ye,platform as be,release as xe,tmpdir as Se,totalmem as Ce,type as we,uptime as Te}from"node:os";import"node:fs/promises";import{createHash as Ee}from"node:crypto";var De=n();const Oe=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function ke(e,t,n=l){if(e!==void 0&&!Oe.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Ae=null;function je(e){Ae=e}function Me(){return Ae??process.cwd()}function Ne(){return I(H(),`.ok`,`bug-reports`)}function Pe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Ne(),r=`${t}-bugreport`,i=I(n,`${r}.zip`);for(let e=2;R(i);e+=1)i=I(n,`${r}-${e}.zip`);return i}function Fe(e,t){let n=I(e,`.ok`,`config.yml`);if(R(n))try{let e=B(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 R(I(e,`.ok`))?Ee(`sha256`).update(L(e)).digest(`hex`).slice(0,12):null}function Ie(){let e={timestamp:new Date().toISOString(),platform:be(),osType:we(),osRelease:xe(),hostname:`[redacted]`,uptime:Te(),freeMem:ve(),totalMem:Ce(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=oe(`sw_vers -productVersion 2>/dev/null`,m({encoding:`utf8`})).trim()}catch{}try{let t=I(__dirname,`..`,`..`,`package.json`);R(t)&&(e.okVersion=JSON.parse(B(t,`utf8`)).version)}catch{}return e}const Le=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function U(e){let t=P(e);return Le.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Re(e,t){return Ve(e,t).files}const ze=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Be(e,t=te){let n=I(e,`${t}.ShipIt`);return R(n)?ze.map(e=>I(n,e)).filter(e=>R(e)):[]}function Ve(e,t){if(!R(t))return{files:[],excludedByProjectSlug:0};let n=pe(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>I(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(U),i=[],a=r.filter(t=>{try{return B(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=>!U(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function He(e){let t=I(e,`.ok`,`local`);return R(t)?{files:[`server.lock`,`last-spawn-error.log`,o].map(e=>I(t,e)).filter(e=>R(e))}:{files:[]}}function Ue(e){let t=I(e,`.ok`,`local`,`logs`);return R(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>I(t,e)).filter(e=>R(e))}:{files:[]}}function We(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=c(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 W(e){for(let t of e.files)try{We({zipfile:e.zipfile,name:`${e.prefix}/${P(t)}`,content:B(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 Ge(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??I(H(),`.ok`,`logs`),o=t.projectDir?Fe(t.projectDir,i):null;z(F(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let c=Ie();c.desktop=t.desktop??null,c.language=t.language??null;let{files:l,excludedByProjectSlug:u}=Ve(o,a),{files:d}=t.projectDir?He(t.projectDir):{files:[]},{files:f}=t.projectDir?Ue(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;W({zipfile:_,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:i}),W({zipfile:_,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:i}),W({zipfile:_,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=B(e.sourcePath),n=`extra/${e.zipName??P(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&&We({zipfile:_,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let v=JSON.stringify(c,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:c};_.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/${P(e)}`)),S=h.filter(e=>x.has(e)),C=o?h.filter(e=>e.startsWith(`logs/`)&&!U(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: ${s.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
+ `);_.addBuffer(Buffer.from(w,`utf8`),`README.md`),_.end();let T=ue(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 Ke=e(w(),1),G=e(ee(),1);function qe(e){return v({absPath:y(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function Je({home:e=H(),env:n=process.env}={}){let a=qe(e),{override:o,preferenceList:s}=g(n),{locale:c,source:l}=i({override:o,storedPreference:a,supportedLocales:r,preferenceList:s,autoDetectableLocales:t});return{preference:a,locale:c,source:l,systemLanguages:s}}function K(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 K(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=B(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
3
+ `),i=n.split(`
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)}}}V(e,r?`${a.join(`
5
+ `)}\n`:a.join(`
6
+ `))}function Ze(e,t){let n=B(e,`utf-8`);if(n.trim().length!==0)try{let r=q(JSON.parse(n),t),i=n.endsWith(`
7
+ `)?`
8
+ `:``;V(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=K(n,t.contentDir);r!==n&&V(e,r)}}function Qe(e,t){let n=B(e,`utf-8`),r=K(n,t.contentDir);r!==n&&V(e,r)}function $e(e){try{return pe(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>I(e,t.name))}catch{return[]}}const et=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function tt(e){return/\.log\.\d+$/.test(e)}function nt(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||tt(e)}function rt(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of $e(I(e.stagingDir,n)))nt(r)?Xe(r,t):r.endsWith(`.json`)?Ze(r,t):Qe(r,t);for(let n of $e(I(e.stagingDir,`state`))){let e=P(n);n.endsWith(`.jsonl`)?Xe(n,t):et.has(e)?Ze(n,t):Qe(n,t)}}const it=[`.ok`,`local`,`telemetry`],at=[`.ok`,`local`,`logs`],ot=[`.ok`,`local`,`loss-capture`],st=`spans-current.jsonl`,ct=`spans-prev.jsonl`,lt=`server-current.jsonl`,ut=`server-prev.jsonl`,dt=`loss-current.jsonl`,ft=`loss-prev.jsonl`;function pt(e){return I(e,...it,st)}function mt(e){return I(e,...it,ct)}function ht(e){return I(e,...at,lt)}function gt(e){return I(e,...at,ut)}function _t(e){return I(e,...ot,dt)}function vt(e){return I(e,...ot,ft)}const yt=1e3;async function bt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(yt)});return t.ok?await t.text():null}catch{return null}}async function xt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(yt)});return t.ok?await t.text():null}catch{return null}}async function St(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(yt)});return t.ok?await t.text():null}catch{return null}}function Ct(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
9
+ `)}\n`:null}catch{return null}}function wt(e){let t=I(e,`.git`,`ok`);if(!R(t))return null;let n=N(`git`,[`-C`,t,`log`,`--oneline`,`-50`],m({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Tt(e){let t=I(e,`.git`,`ok`);if(!R(t))return null;let n=N(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],m({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Et(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Dt(){return{nodeVersion:process.version,platform:be(),arch:_e()}}function Ot(){return process.env.OTEL_SDK_DISABLED===`false`}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kt(e){if(!R(e))return{};let t;try{t=(0,De.parse)(B(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!J(t))return{};let n=t.telemetry;if(!J(n))return{};let r=n.localSink;return J(r)?r:{}}function At(e){return typeof e==`boolean`?e:void 0}function jt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y(e){if(J(e))return jt(e.maxBytes)}function Mt(e){let t=kt(y(`project`,e)),n=kt(y(`project-local`,e));return{enabled:At(n.enabled)??At(t.enabled)??!0,spansMaxBytes:Y(n.spans)??Y(t.spans)??52428800,logsMaxBytes:Y(n.logs)??Y(t.logs)??26214400}}function Nt(e){return Ee(`sha256`).update(e).digest(`hex`)}function Pt(e){let t=B(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Ft(e){let t=B(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X(e,t){if(!R(e))return!1;try{return z(F(t),{recursive:!0}),le(e,t),!0}catch{return!1}}function It(e){let t=[],n=e=>{let r=pe(e,{withFileTypes:!0});for(let i of r){let r=I(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Lt=new Set([`.jsonl`]);function Rt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Lt.has(e.slice(t))}const zt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Bt(e){if(tt(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:zt.has(e.slice(t))}function Vt(e){let t=[];for(let n of It(e)){let r=Ht(e,n);if(!Bt(r))continue;let{redacted:i,patterns:a,lineCount:o}=c(B(n,`utf-8`));a.length!==0&&(V(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Ht(e,t){return se(e,t).split(ce).join(`/`)}async function Ut(e){let t=L(e.contentDir),n=L(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??bt,s=r.fetchAgentEffects??xt,c=r.fetchWatcherRecent??St,l=r.readShadowHead??wt,u=r.readCheckpointRefs??Tt,d=r.now??(()=>new Date),f=r.okVersion??(()=>ae),p=r.readDesktopEnv??Et,m=r.readLanguage??Je,h=r.readRuntime??Dt,g=r.isOtlpPushEnabled??Ot,_=fe(I(Se(),`ok-bundle-`));try{z(I(_,`telemetry`),{recursive:!0}),z(I(_,`logs`),{recursive:!0}),z(I(_,`state`),{recursive:!0}),X(pt(n),I(_,`telemetry`,st)),X(mt(n),I(_,`telemetry`,ct)),X(ht(n),I(_,`logs`,lt)),X(gt(n),I(_,`logs`,ut));for(let t of e.userLogFiles??[])X(t,I(_,`logs`,P(t)));let v=I(n,`.ok`,`local`),y=I(v,`server.lock`),b=`not-running`,x=`no server.lock`,S=null;if(R(y)){X(y,I(_,`state`,`server.lock`));try{let e=B(y,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?S=t.port:x=`lock present but no port`}catch{x=`lock present but unparseable`}}if(S!==null){let e=await i(S);e===null?x=`agent-presence endpoint at :${S} unreachable`:(V(I(_,`state`,`agent-presence.json`),e),b=`running`,x=``);let t=await s(S);t!==null&&V(I(_,`state`,`agent-effects.json`),t);let n=await c(S);if(n!==null){let e=Ct(n);e!==null&&V(I(_,`state`,`watcher-recent.jsonl`),e)}}let C=l(t);C!==null&&V(I(_,`state`,`shadow-head.txt`),C);let w=u(t);w!==null&&V(I(_,`state`,`checkpoint-refs.txt`),w),X(_t(n),I(_,`state`,dt)),X(vt(n),I(_,`state`,ft)),X(I(v,`last-spawn-error.log`),I(_,`state`,`last-spawn-error.log`)),X(I(v,a),I(_,`state`,a)),X(I(v,o),I(_,`state`,o));let T=h(),E=p(),D=m(),ee={ok:{version:f(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D}};V(I(_,`state`,`runtime.json`),`${JSON.stringify(ee,null,2)}\n`);let te=b===`running`?`running
10
+ `:`not-running (${x})\n`;if(V(I(_,`state`,`server-status.txt`),te),e.processDir&&R(e.processDir)){let t=I(_,`process`);z(t,{recursive:!0}),le(e.processDir,t,{recursive:!0})}let O=e.redact===!0;O&&rt({stagingDir:_,contentDir:t}),e.note&&V(I(_,`note.txt`),e.note);let k=null;e.scrubSecrets===!0&&(k=Vt(_));for(let t of e.extraFiles??[])X(t.sourcePath,I(_,`extra`,t.zipName??P(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ne=Mt(n),re=It(_),A=[],j=0,ie=0;for(let e of re){let t=Ht(_,e),n=ge(e).size,r=Rt(t)?Pt(e):0;A.push({path:t,bytes:n,lines:r}),j+=n,t.startsWith(`telemetry/`)&&Rt(t)&&(ie+=Ft(e))}let ae={applied:O};k!==null&&(ae.secretScrub=k);let M={schemaVersion:2,createdAt:d().toISOString(),ok:{version:f(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D},contentDir:{pathSha256:Nt(t),absolutePath:O?`<CONTENT_DIR>`:t},telemetry:{localSink:ne,otlpPushEnabled:g()},redaction:ae,serverStatus:b,files:A};V(I(_,`manifest.json`),`${JSON.stringify(M,null,2)}\n`);let oe=re.some(e=>{try{return B(e,`utf-8`).includes(t)}catch{return!1}}),N={totalBytes:j,fileCount:A.length,docNameCount:ie,contentDirVisible:oe,redacted:O},F=!1;return{stagingDir:_,manifest:M,summary:N,cleanup:()=>{F||(F=!0,he(_,{recursive:!0,force:!0}))}}}catch(e){throw he(_,{recursive:!0,force:!0}),e}}async function Wt(e){let{collected:t,outputPath:n}=e,r=F(n);if(!R(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Ke.ZipFile,a=It(t.stagingDir);for(let e of a){let n=Ht(t.stagingDir,e);i.addFile(e,n)}i.end();let o=ue(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function Gt(e,t){let n=I(e,`.ok`,`config.yml`);if(R(n))try{let t=(0,De.parse)(B(n,`utf-8`)),r=M(t)?t.content:void 0,i=M(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return L(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return L(e)}async function Kt(e,t,n,r){let i=Fe(t,e.logger),a=await Ut({contentDir:Gt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...Re(i,e.userLogsDir??I(H(),`.ok`,`logs`)),...Be(e.cachesDir??I(H(),`Library`,`Caches`))],deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{z(F(e.outputPath),{recursive:!0}),await Wt({collected:a,outputPath:e.outputPath});let t=a.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:i,files:a.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:a.manifest.createdAt}}}finally{a.cleanup()}}async function qt(e){let{projectDir:t}=e,n=e.readDesktopEnv??Et,r=e.readLanguage??Je;if(e.level===`full`&&t!==void 0)return Kt(e,t,n,r);let{zipPath:i,summary:a}=await Ge({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:Be(e.cachesDir??I(H(),`Library`,`Caches`)),logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:i,summary:{level:e.level,systemWide:t===void 0,projectSlug:a.projectSlug,files:a.files,redactions:a.redactions,redactedLineCount:a.redactedLineCount,generatedAt:a.generatedAt}}}function Z(e,t,n={}){let r=C(e,t);if(!R(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(B(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!b(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??x)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??S())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??ye();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function Jt(e){return e.replace(/:\d+$/,``)}function Yt(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Jt(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Jt(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Jt(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}const Xt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Zt(e){return I(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const Qt={existsSync:e=>R(e),readFileSync:(e,t)=>B(e,t),lstatSync:e=>de(e),readlinkSync:e=>me(e)};function $t(e,t=Qt){let n=Zt(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function en(e){let t=e.replace(Xt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function tn(e,t,n=Qt){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function nn(e){return E(e)||T(e)||j(e)}const rn=10*1024*1024;function an(e,t,n,r){let i=re(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!nn(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);return e.format===`file`?(he(a,{force:!0}),{kind:`removed`}):e.format===`toml`?cn(a,o):e.format===`yaml`?sn(a,e.topLevelKey,o):on(a,e.topLevelKey,e.serverMapSubKey,o)}function on(e,t,n,r){let i;try{i=B(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=O(i,ne(t,n,r));return o?(_(e,a,{mode:A(e)}),{kind:`removed`}):{kind:`not-present`}}function sn(e,t,n){let r;try{r=B(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,De.parseDocument)(a);if(o.errors.length>0)return{kind:`declined`,reason:`unparseable`};let s=[t,n];if(!o.hasIn(s))return{kind:`not-present`};o.deleteIn(s);let c=o.toString(),l=k(a);a.trim()===``||a.endsWith(`
11
+ `)?c.endsWith(`
12
+ `)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
13
+ `).replace(/\n/g,`\r
14
+ `));let u=`${i?``:``}${c}`;return u!==r&&_(e,u,{mode:A(e)}),{kind:`removed`}}function cn(e,t){let n=ie();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=B(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=k(a),s=a.trim()===``||a.endsWith(`
15
+ `),c;try{c=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!c.existed)return{kind:`not-present`};let l=c.text;s?l.endsWith(`
16
+ `)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
17
+ `).replace(/\n/g,`\r
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 G.default.green(e);case`desktop`:return G.default.blue(e);case`foreign`:return G.default.cyan(e);case`ui-orphan`:return G.default.magenta(e);case`stale`:return G.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=G.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
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(L(Me(),n)))})}export{Me as _,Xt as a,$t as c,Z as d,qt as f,Ne as g,Pe 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,je as v,ke as y};
20
+ //# sourceMappingURL=src-BZYY4rMh.mjs.map
@@ -0,0 +1 @@
1
+ import"./src-C1ipB-PD.mjs";import"./write-project-skill-_XCsfJhR.mjs";import"./src-BZYY4rMh.mjs";import"./acp-harness-probe-DS_7zIK_.mjs";import"./init-DpK4E47u.mjs";import{n as e}from"./loader-DNYUnJfz.mjs";import"./skill-teardown-DMHte1Ul.mjs";import"./preview-CIC9NRPO.mjs";import"./mcp-migrate-event-B1gJf6bG.mjs";export{e as loadConfig};