@inkeep/open-knowledge 0.57.1 → 0.57.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/{acp-harness-probe-AXjbH2Dd.mjs → acp-harness-probe-z0kwtWNz.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-BU7Q80Kc.mjs +2 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/{init-BFGSwaTJ.mjs → init-CuxgCZK8.mjs} +3 -3
  6. package/dist/init-icHkVUwe.mjs +1 -0
  7. package/dist/{launch-json-removal-De-I9sH-.mjs → launch-json-removal-YpPZRaoj.mjs} +2 -2
  8. package/dist/loader-BP4vfYMD.mjs +1 -0
  9. package/dist/{loader-B817Pqik.mjs → loader-CpDf5eCy.mjs} +2 -2
  10. package/dist/{open-browser-CXZADc20.mjs → open-browser-DKdJEb2P.mjs} +2 -2
  11. package/dist/{preview-DH3THFT-.mjs → preview-B9-lbB2r.mjs} +2 -2
  12. package/dist/preview-BGOmXIgS.mjs +1 -0
  13. package/dist/public/assets/{ActivityModeContent-DROmRA_I.js → ActivityModeContent-DtoUWb1c.js} +1 -1
  14. package/dist/public/assets/{AgentDiffPane-CvWiYddh.js → AgentDiffPane-0NV8wGXH.js} +1 -1
  15. package/dist/public/assets/{AgentThreadClientBinder-ChxqWHn_.js → AgentThreadClientBinder-B7BMwPdk.js} +1 -1
  16. package/dist/public/assets/{CodeMirrorPropInput-CNS_dH9E.js → CodeMirrorPropInput-DRIXyyO3.js} +1 -1
  17. package/dist/public/assets/DocumentContext-BzOkOcsd.js +38 -0
  18. package/dist/public/assets/{EditorModeToggle-CoLPtq1t.js → EditorModeToggle-B_J4DJWs.js} +1 -1
  19. package/dist/public/assets/{EnableSyncConfirmDialog-CFRlwXGj.js → EnableSyncConfirmDialog-CFk3AHnv.js} +1 -1
  20. package/dist/public/assets/FeedbackForm-srcVmSOs.js +1 -0
  21. package/dist/public/assets/{GraphPanel-COPEU9QX.js → GraphPanel-9WkmeASt.js} +1 -1
  22. package/dist/public/assets/{ImportSkillDialog-B-044E9U.js → ImportSkillDialog-DVl5vnNu.js} +1 -1
  23. package/dist/public/assets/{LintConfigEditor-BDyWMcfJ.js → LintConfigEditor-MWJgrpYU.js} +1 -1
  24. package/dist/public/assets/{ManagedArtifactProperties-BJP4yaVI.js → ManagedArtifactProperties-E_X-hSBL.js} +1 -1
  25. package/dist/public/assets/ManagedArtifactProperties-WUogeRZ9.js +1 -0
  26. package/dist/public/assets/{MermaidDocEditor-FEc-P0jz.js → MermaidDocEditor-CMojAadB.js} +1 -1
  27. package/dist/public/assets/{PropertyDisplayRow-DY1BaofT.js → PropertyDisplayRow-nYf3Nzvv.js} +1 -1
  28. package/dist/public/assets/{SchemaConfigEditor-BQjnFuKU.js → SchemaConfigEditor-COUOzPXp.js} +1 -1
  29. package/dist/public/assets/{SessionsHost-4D2Mbd-A.js → SessionsHost-BgY2S9NG.js} +2 -2
  30. package/dist/public/assets/{SettingsDialogBody-B3oPGBV1.js → SettingsDialogBody-NFfs-Exd.js} +1 -1
  31. package/dist/public/assets/{ShareReceiveMissDialog-DdivT93v.js → ShareReceiveMissDialog-CX3klyil.js} +1 -1
  32. package/dist/public/assets/{SkillInstallMenu-DCMvhkCb.js → SkillInstallMenu-CT53ITFp.js} +1 -1
  33. package/dist/public/assets/{SkillToolbarControls-CeCtqBof.js → SkillToolbarControls-D3v2Hs4j.js} +1 -1
  34. package/dist/public/assets/{SourceEditor-C-lO6m19.js → SourceEditor-CN-TUPAh.js} +1 -1
  35. package/dist/public/assets/{TerminalPanel-CyjfYWsq.js → TerminalPanel-DxL20Rgf.js} +1 -1
  36. package/dist/public/assets/{TerminalWindowApp-B9ooLvmD.js → TerminalWindowApp-BZemj599.js} +1 -1
  37. package/dist/public/assets/{TextDocEditor-CGuw2g_W.js → TextDocEditor-CbRGs1HT.js} +1 -1
  38. package/dist/public/assets/{ThreadView-CYPQu2y5.js → ThreadView-BQPg9S8A.js} +8 -5
  39. package/dist/public/assets/{TimelineDiffPane-cCUc_t8r.js → TimelineDiffPane-U-Xtvkw6.js} +1 -1
  40. package/dist/public/assets/{agent-diff-store-Zkmej99r.js → agent-diff-store-iABbjLTR.js} +1 -1
  41. package/dist/public/assets/{auth-state-cache-BlR0q_vY.js → auth-state-cache-ZDnOSM98.js} +1 -1
  42. package/dist/public/assets/{comment-chips-CCQnz4uo.js → comment-chips-DTsOTJH8.js} +1 -1
  43. package/dist/public/assets/{config-provider-DE1EpoHY.js → config-provider-CFTiAtpH.js} +3 -3
  44. package/dist/public/assets/{file-tree-adapter-BaT9ZAI6.js → file-tree-adapter-BFt5lrJf.js} +1 -1
  45. package/dist/public/assets/{follow-file-CRlvy8S7.js → follow-file-BvKFjLSz.js} +1 -1
  46. package/dist/public/assets/i18n-B1dD_x6I.js +1 -0
  47. package/dist/public/assets/index-DAEjqhX2.js +2095 -0
  48. package/dist/public/assets/messages-31YqY4SS.js +1 -0
  49. package/dist/public/assets/messages-BVHIx_qK.js +1 -0
  50. package/dist/public/assets/messages-C7nddMWQ.js +1 -0
  51. package/dist/public/assets/messages-CL4xikKQ.js +1 -0
  52. package/dist/public/assets/messages-C_8WTeHE.js +1 -0
  53. package/dist/public/assets/messages-CrwpWrRW.js +1 -0
  54. package/dist/public/assets/messages-Cs6jyHNU.js +1 -0
  55. package/dist/public/assets/messages-D2XUrFhu.js +1 -0
  56. package/dist/public/assets/messages-DPWJimCT.js +1 -0
  57. package/dist/public/assets/messages-VnNooCHl.js +1 -0
  58. package/dist/public/assets/messages-e1iGNZ1R.js +1 -0
  59. package/dist/public/assets/messages-f9-p4BhX.js +1 -0
  60. package/dist/public/assets/{navigation-targets-BlmF0SDc.js → navigation-targets-DKOMUIlH.js} +1 -1
  61. package/dist/public/assets/{pending-receive-nav-store-hMEGGslQ.js → pending-receive-nav-store-CMgNWqay.js} +1 -1
  62. package/dist/public/assets/{prop-types-x3L5Ba9q.js → prop-types-CpmiBFCU.js} +1 -1
  63. package/dist/public/assets/{selection-context-DjLg9MOr.js → selection-context-BajeGoV5.js} +1 -1
  64. package/dist/public/assets/{skill-actions-l-Yck4br.js → skill-actions-Dg0c2EFw.js} +1 -1
  65. package/dist/public/assets/{src-BS4G3eAC.js → src-CJl_A7Op.js} +1 -1
  66. package/dist/public/assets/{target-navigation-intent-Cq4g4MwT.js → target-navigation-intent-DJRGhwM3.js} +1 -1
  67. package/dist/public/assets/thread-client-CfT0-9Kx.js +1 -0
  68. package/dist/public/assets/{typing-burst-detector-DcwBV9VB.js → typing-burst-detector-DBj9oKSQ.js} +1 -1
  69. package/dist/public/assets/{uninstall-DQiMrABF.js → uninstall-Cvh4Iu4I.js} +1 -1
  70. package/dist/public/assets/{use-activity-panel-CuhtOxWX.js → use-activity-panel-Bh3C3n8-.js} +1 -1
  71. package/dist/public/assets/{use-open-skill-JYSDAN3f.js → use-open-skill-C9ju-IL1.js} +1 -1
  72. package/dist/public/assets/{use-popular-skills-DSQmPB6s.js → use-popular-skills-DHiWi3V2.js} +1 -1
  73. package/dist/public/assets/{use-terminal-enabled-DRFMuFx0.js → use-terminal-enabled-Dh008W1x.js} +1 -1
  74. package/dist/public/assets/{use-timeline-entry-diff-V2QKxb7W.js → use-timeline-entry-diff-ooVH_oUf.js} +1 -1
  75. package/dist/public/index.html +25 -25
  76. package/dist/public/uninstall.html +3 -3
  77. package/dist/{repair-launch-json-DMUJT4j2.mjs → repair-launch-json-BRgTZeMm.mjs} +2 -2
  78. package/dist/{repair-mcp-configs-lO-3P7oN.mjs → repair-mcp-configs-CYBY9hkz.mjs} +2 -2
  79. package/dist/repair-skills-Cw6FhG82.mjs +1 -0
  80. package/dist/{repair-skills-B1yLGVCl.mjs → repair-skills-DbvWHh50.mjs} +2 -2
  81. package/dist/{skill-teardown-CJl8M28h.mjs → skill-teardown-sZPAAcyi.mjs} +2 -2
  82. package/dist/{src-BcAdFCgQ.mjs → src-B9IqHTFZ.mjs} +2 -2
  83. package/dist/src-BgAHj6S9.mjs +1 -0
  84. package/dist/{src-C6s1YGEs.mjs → src-BnJNsU3L.mjs} +2 -2
  85. package/dist/{src--C17TQmO.mjs → src-BsTo_BQp.mjs} +1 -1
  86. package/dist/start-B1c9LmyX.mjs +1 -0
  87. package/dist/{start-CMGmgkGZ.mjs → start-DA0DLWF1.mjs} +4 -4
  88. package/dist/{ui-CSid4Ybi.mjs → ui-CTtklN4L.mjs} +3 -3
  89. package/dist/{write-project-skill-G2p_hc1u.mjs → write-project-skill-CpzPK3Kr.mjs} +2 -2
  90. package/package.json +5 -5
  91. package/dist/constants-y3PKfNG8.mjs +0 -2
  92. package/dist/init-D2EUM42h.mjs +0 -1
  93. package/dist/loader-CUsJshod.mjs +0 -1
  94. package/dist/preview-gQrDzFRZ.mjs +0 -1
  95. package/dist/public/assets/DocumentContext-CDu_2y-Y.js +0 -38
  96. package/dist/public/assets/FeedbackForm-CMA0iKdX.js +0 -1
  97. package/dist/public/assets/ManagedArtifactProperties-CT6HkE78.js +0 -1
  98. package/dist/public/assets/i18n-C-GzCn3p.js +0 -1
  99. package/dist/public/assets/index-BQO6vJ-L.js +0 -2095
  100. package/dist/public/assets/messages-AeBLaR0m.js +0 -1
  101. package/dist/public/assets/messages-B2eEA6Eu.js +0 -1
  102. package/dist/public/assets/messages-BNVZJyDD.js +0 -1
  103. package/dist/public/assets/messages-Cc-y5Qm7.js +0 -1
  104. package/dist/public/assets/messages-CuB-3U4F.js +0 -1
  105. package/dist/public/assets/messages-D4ZMaS59.js +0 -1
  106. package/dist/public/assets/messages-DDp8k2cy.js +0 -1
  107. package/dist/public/assets/messages-DE2yRe7p.js +0 -1
  108. package/dist/public/assets/messages-DmcPLWJb.js +0 -1
  109. package/dist/public/assets/messages-DwQQdLmE.js +0 -1
  110. package/dist/public/assets/messages-Svp7hzk5.js +0 -1
  111. package/dist/public/assets/messages-xE4lQcWR.js +0 -1
  112. package/dist/public/assets/thread-client-B1jXINMp.js +0 -1
  113. package/dist/repair-skills-nLLLv3za.mjs +0 -1
  114. package/dist/src-BqF-eCAb.mjs +0 -1
  115. package/dist/start-HINl5_ql.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-BQO6vJ-L.js"></script>
97
+ <script type="module" crossorigin src="./assets/index-DAEjqhX2.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">
@@ -132,9 +132,9 @@
132
132
  <link rel="modulepreload" crossorigin href="./assets/dist-BLaUOTRG.js">
133
133
  <link rel="modulepreload" crossorigin href="./assets/client-version-CvdpPTtb.js">
134
134
  <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-B1zL7AB7.js">
135
- <link rel="modulepreload" crossorigin href="./assets/messages-xE4lQcWR.js">
136
- <link rel="modulepreload" crossorigin href="./assets/i18n-C-GzCn3p.js">
137
- <link rel="modulepreload" crossorigin href="./assets/config-provider-DE1EpoHY.js">
135
+ <link rel="modulepreload" crossorigin href="./assets/messages-VnNooCHl.js">
136
+ <link rel="modulepreload" crossorigin href="./assets/i18n-B1dD_x6I.js">
137
+ <link rel="modulepreload" crossorigin href="./assets/config-provider-CFTiAtpH.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">
@@ -170,11 +170,11 @@
170
170
  <link rel="modulepreload" crossorigin href="./assets/file-tree-utils-BnMWB0rN.js">
171
171
  <link rel="modulepreload" crossorigin href="./assets/doc-paths-7BigDJzU.js">
172
172
  <link rel="modulepreload" crossorigin href="./assets/skill-scope-Dvl0F_Nc.js">
173
- <link rel="modulepreload" crossorigin href="./assets/navigation-targets-BlmF0SDc.js">
173
+ <link rel="modulepreload" crossorigin href="./assets/navigation-targets-DKOMUIlH.js">
174
174
  <link rel="modulepreload" crossorigin href="./assets/asset-dispatch-D3iE-ozy.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/external-link-D2rJDkPo.js">
176
176
  <link rel="modulepreload" crossorigin href="./assets/documents-fetch-BEnELRVW.js">
177
- <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-CNS_dH9E.js">
177
+ <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-DRIXyyO3.js">
178
178
  <link rel="modulepreload" crossorigin href="./assets/git-branch-JnfmLuHd.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/triangle-alert-ClSA-HUV.js">
180
180
  <link rel="modulepreload" crossorigin href="./assets/Mermaid-DbOd2zw_.js">
@@ -182,7 +182,7 @@
182
182
  <link rel="modulepreload" crossorigin href="./assets/documents-events-BG9v7ZR8.js">
183
183
  <link rel="modulepreload" crossorigin href="./assets/parse-api-error-DfesE4Y7.js">
184
184
  <link rel="modulepreload" crossorigin href="./assets/startup-marks-DDrQR_dN.js">
185
- <link rel="modulepreload" crossorigin href="./assets/prop-types-x3L5Ba9q.js">
185
+ <link rel="modulepreload" crossorigin href="./assets/prop-types-CpmiBFCU.js">
186
186
  <link rel="modulepreload" crossorigin href="./assets/eye-CMnjY3GY.js">
187
187
  <link rel="modulepreload" crossorigin href="./assets/hash-CKHBJOuo.js">
188
188
  <link rel="modulepreload" crossorigin href="./assets/info-zDdm_H80.js">
@@ -193,11 +193,11 @@
193
193
  <link rel="modulepreload" crossorigin href="./assets/input-BOZIAwC9.js">
194
194
  <link rel="modulepreload" crossorigin href="./assets/use-collab-url-CBEaRBLp.js">
195
195
  <link rel="modulepreload" crossorigin href="./assets/skills-api-D3yktqw_.js">
196
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-CDu_2y-Y.js">
196
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-BzOkOcsd.js">
197
197
  <link rel="modulepreload" crossorigin href="./assets/use-skills-RGrgR7Ae.js">
198
- <link rel="modulepreload" crossorigin href="./assets/use-open-skill-JYSDAN3f.js">
198
+ <link rel="modulepreload" crossorigin href="./assets/use-open-skill-C9ju-IL1.js">
199
199
  <link rel="modulepreload" crossorigin href="./assets/mascot-outline-CtS592mc.js">
200
- <link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-DCMvhkCb.js">
200
+ <link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-CT53ITFp.js">
201
201
  <link rel="modulepreload" crossorigin href="./assets/checkbox-DY9S-mld.js">
202
202
  <link rel="modulepreload" crossorigin href="./assets/label-B5yNUINo.js">
203
203
  <link rel="modulepreload" crossorigin href="./assets/radio-group-BSCe7mNt.js">
@@ -205,17 +205,17 @@
205
205
  <link rel="modulepreload" crossorigin href="./assets/toggle-group-CZcn-1gX.js">
206
206
  <link rel="modulepreload" crossorigin href="./assets/useQuery-ZeEDLtxh.js">
207
207
  <link rel="modulepreload" crossorigin href="./assets/workspace-paths-C2pS_Pbn.js">
208
- <link rel="modulepreload" crossorigin href="./assets/follow-file-CRlvy8S7.js">
208
+ <link rel="modulepreload" crossorigin href="./assets/follow-file-BvKFjLSz.js">
209
209
  <link rel="modulepreload" crossorigin href="./assets/format-C7y0e043.js">
210
210
  <link rel="modulepreload" crossorigin href="./assets/braces-B2tgJ4cu.js">
211
- <link rel="modulepreload" crossorigin href="./assets/PropertyDisplayRow-DY1BaofT.js">
211
+ <link rel="modulepreload" crossorigin href="./assets/PropertyDisplayRow-nYf3Nzvv.js">
212
212
  <link rel="modulepreload" crossorigin href="./assets/folder-config-api-CspTyRPC.js">
213
- <link rel="modulepreload" crossorigin href="./assets/comment-chips-CCQnz4uo.js">
213
+ <link rel="modulepreload" crossorigin href="./assets/comment-chips-DTsOTJH8.js">
214
214
  <link rel="modulepreload" crossorigin href="./assets/textarea-CziWBFvC.js">
215
- <link rel="modulepreload" crossorigin href="./assets/selection-context-DjLg9MOr.js">
215
+ <link rel="modulepreload" crossorigin href="./assets/selection-context-BajeGoV5.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/lint-config-client-D4Gin48u.js">
217
- <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-BJP4yaVI.js">
218
- <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-CFRlwXGj.js">
217
+ <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-E_X-hSBL.js">
218
+ <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-CFk3AHnv.js">
219
219
  <link rel="modulepreload" crossorigin href="./assets/arrow-up-right-D_WN0VGP.js">
220
220
  <link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-ljYuKfOS.js">
221
221
  <link rel="modulepreload" crossorigin href="./assets/list-plus-D42L1B7w.js">
@@ -223,7 +223,7 @@
223
223
  <link rel="modulepreload" crossorigin href="./assets/platform-labels-B2CH4Bk2.js">
224
224
  <link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-C4L1qX1X.js">
225
225
  <link rel="modulepreload" crossorigin href="./assets/use-workspace-CTox7-Ea.js">
226
- <link rel="modulepreload" crossorigin href="./assets/skill-actions-l-Yck4br.js">
226
+ <link rel="modulepreload" crossorigin href="./assets/skill-actions-Dg0c2EFw.js">
227
227
  <link rel="modulepreload" crossorigin href="./assets/case-sensitive-Cz58rAyi.js">
228
228
  <link rel="modulepreload" crossorigin href="./assets/chevron-left-CiNweXA3.js">
229
229
  <link rel="modulepreload" crossorigin href="./assets/lint-plugin-meta-BKj52sEc.js">
@@ -231,30 +231,30 @@
231
231
  <link rel="modulepreload" crossorigin href="./assets/wrench-flodMG_Q.js">
232
232
  <link rel="modulepreload" crossorigin href="./assets/panel-DtO2k15O.js">
233
233
  <link rel="modulepreload" crossorigin href="./assets/skeleton-ColtBPsg.js">
234
- <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-DcwBV9VB.js">
234
+ <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-DBj9oKSQ.js">
235
235
  <link rel="modulepreload" crossorigin href="./assets/download-DsoYCSHe.js">
236
236
  <link rel="modulepreload" crossorigin href="./assets/field-DzXuvrJb.js">
237
- <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-BlR0q_vY.js">
237
+ <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-ZDnOSM98.js">
238
238
  <link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-DbO2b6tB.js">
239
- <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-hMEGGslQ.js">
240
- <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-Cq4g4MwT.js">
239
+ <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-CMgNWqay.js">
240
+ <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-DJRGhwM3.js">
241
241
  <link rel="modulepreload" crossorigin href="./assets/history-CP_k8cer.js">
242
242
  <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-DyQLDLZu.js">
243
- <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-DSQmPB6s.js">
243
+ <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-DHiWi3V2.js">
244
244
  <link rel="modulepreload" crossorigin href="./assets/panel-right-open--rQd7ynU.js">
245
245
  <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-mKO9oOVx.js">
246
246
  <link rel="modulepreload" crossorigin href="./assets/square-pen-pe_91ZjU.js">
247
247
  <link rel="modulepreload" crossorigin href="./assets/undo-2-BRf2z7UC.js">
248
248
  <link rel="modulepreload" crossorigin href="./assets/form-dlFqxdSN.js">
249
249
  <link rel="modulepreload" crossorigin href="./assets/text-viewer-languages-6Ne07IiK.js">
250
- <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-CoLPtq1t.js">
250
+ <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-B_J4DJWs.js">
251
251
  <link rel="modulepreload" crossorigin href="./assets/ConfigSharingInfoTooltip-Ce-0nOfG.js">
252
252
  <link rel="modulepreload" crossorigin href="./assets/project-paths-rKjGTUhn.js">
253
253
  <link rel="modulepreload" crossorigin href="./assets/SkillModeBanner-d0ZDkWTk.js">
254
254
  <link rel="modulepreload" crossorigin href="./assets/app-menubar-gate-D9mWjBDd.js">
255
- <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-BaT9ZAI6.js">
255
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-BFt5lrJf.js">
256
256
  <link rel="modulepreload" crossorigin href="./assets/terminal-command-events-DXmeHtnk.js">
257
- <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-Zkmej99r.js">
257
+ <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-iABbjLTR.js">
258
258
  <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-Bg0pl-eA.js">
259
259
  <link rel="modulepreload" crossorigin href="./assets/input-group-D6f-9HF9.js">
260
260
  <link rel="modulepreload" crossorigin href="./assets/use-installed-clis-DmyaQmU9.js">
@@ -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-DQiMrABF.js"></script>
35
+ <script type="module" crossorigin src="./assets/uninstall-Cvh4Iu4I.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">
@@ -68,8 +68,8 @@
68
68
  <link rel="modulepreload" crossorigin href="./assets/badge-I_vhU4ix.js">
69
69
  <link rel="modulepreload" crossorigin href="./assets/input-BOZIAwC9.js">
70
70
  <link rel="modulepreload" crossorigin href="./assets/textarea-CziWBFvC.js">
71
- <link rel="modulepreload" crossorigin href="./assets/messages-xE4lQcWR.js">
72
- <link rel="modulepreload" crossorigin href="./assets/i18n-C-GzCn3p.js">
71
+ <link rel="modulepreload" crossorigin href="./assets/messages-VnNooCHl.js">
72
+ <link rel="modulepreload" crossorigin href="./assets/i18n-B1dD_x6I.js">
73
73
  <link rel="stylesheet" crossorigin href="./assets/globals-DpnoEwqx.css">
74
74
  </head>
75
75
 
@@ -1,2 +1,2 @@
1
- import{t as e}from"./launch-json-removal-De-I9sH-.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-DMUJT4j2.mjs.map
1
+ import{t as e}from"./launch-json-removal-YpPZRaoj.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-BRgTZeMm.mjs.map
@@ -1,2 +1,2 @@
1
- import{i as e,o as t,p as n}from"./write-project-skill-G2p_hc1u.mjs";import{d as r,v as i}from"./init-BFGSwaTJ.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-lO-3P7oN.mjs.map
1
+ import{i as e,o as t,p as n}from"./write-project-skill-CpzPK3Kr.mjs";import{d as r,v as i}from"./init-CuxgCZK8.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-CYBY9hkz.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-DbvWHh50.mjs";export{e as repairSkills};
@@ -1,4 +1,4 @@
1
- import{Os as e,W as t}from"./src-DMi2O7yV.mjs";import{Cr as n,_r as r,cr as i,fr as a,lr as o,mr as s,pr as c,wr as l,yr as u}from"./src-C6s1YGEs.mjs";import{o as d,s as f,t as p,v as m}from"./write-project-skill-G2p_hc1u.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-CJl8M28h.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:()=>u(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>u(e,{checkDesktop:!1}),readBundledVersion:()=>o(),readRecordedVersion:e=>a(e,`cli-hosts`),writeRecordedVersion:(e,t)=>s(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>r(e),readBundleDecision:(e,t)=>i(e,t),writeBundleDecision:(e,t,n)=>c(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),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,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 u;try{u=await r.readRecordedVersion(e)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of l)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=n[o.id],c=z(e,s,i),l=await r.readBundleDecision(e,s).catch(()=>null);if(!t(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(e,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(e,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(t=>z(e,n[t.id],i));if(u!==null&&u===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===l.length,_=[];for(let{id:t,sourceDir:r}of p){let o=B(e,n[t],r,i,a,c);h.push(...o.entries),_.push({id:t,anyWritten:o.anyWritten,landed:o.anyDestinationSucceeded,centralFailed:o.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:o.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 r.writeRecordedVersion(e,c),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:c})}catch(e){t=e instanceof Error?e.message:String(e),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:c,error:t})}for(let{id:e,anyWritten:n}of _)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:t===null?n?`installed`:`skip-current`:`failed`,version:c,...t===null?{}:{reason:`state-write-failed:${t}`}})}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{Os as e,W as t}from"./src-DMi2O7yV.mjs";import{Cr as n,_r as r,cr as i,fr as a,lr as o,mr as s,pr as c,wr as l,yr as u}from"./src-BnJNsU3L.mjs";import{o as d,s as f,t as p,v as m}from"./write-project-skill-CpzPK3Kr.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-sZPAAcyi.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:()=>u(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>u(e,{checkDesktop:!1}),readBundledVersion:()=>o(),readRecordedVersion:e=>a(e,`cli-hosts`),writeRecordedVersion:(e,t)=>s(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>r(e),readBundleDecision:(e,t)=>i(e,t),writeBundleDecision:(e,t,n)=>c(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),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,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 u;try{u=await r.readRecordedVersion(e)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of l)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=n[o.id],c=z(e,s,i),l=await r.readBundleDecision(e,s).catch(()=>null);if(!t(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(e,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(e,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(t=>z(e,n[t.id],i));if(u!==null&&u===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===l.length,_=[];for(let{id:t,sourceDir:r}of p){let o=B(e,n[t],r,i,a,c);h.push(...o.entries),_.push({id:t,anyWritten:o.anyWritten,landed:o.anyDestinationSucceeded,centralFailed:o.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:o.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 r.writeRecordedVersion(e,c),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:c})}catch(e){t=e instanceof Error?e.message:String(e),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:c,error:t})}for(let{id:e,anyWritten:n}of _)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:t===null?n?`installed`:`skip-current`:`failed`,version:c,...t===null?{}:{reason:`state-write-failed:${t}`}})}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(`
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-B1yLGVCl.mjs.map
4
+ //# sourceMappingURL=repair-skills-DbvWHh50.mjs.map
@@ -1,2 +1,2 @@
1
- import{Os as e}from"./src-DMi2O7yV.mjs";import{Cr as t,wr as n}from"./src-C6s1YGEs.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-CJl8M28h.mjs.map
1
+ import{Os as e}from"./src-DMi2O7yV.mjs";import{Cr as t,wr as n}from"./src-BnJNsU3L.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-sZPAAcyi.mjs.map
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,ft as n,q as r}from"./sleep-D_nNc7T_.mjs";import{gc as i,hc as a,nt as o,po as s,rt as c}from"./src-DMi2O7yV.mjs";import{Nn as l,Zr as u,at as d,bi as f,it as p,ot as m,rt as h}from"./src-C6s1YGEs.mjs";import{D as ee,F as g,I as _,k as v}from"./fs-traced-xJfl5Rxd.mjs";import{C as y,S as b,d as x,y as S}from"./server-lock-BHY1C3dW.mjs";import{t as C}from"./yazl-DZr4PyKA.mjs";import{m as w,p as te,v as T}from"./write-project-skill-G2p_hc1u.mjs";import{c as ne}from"./colors-BsmVIwfM.mjs";import{n as re}from"./acp-harness-probe-AXjbH2Dd.mjs";import{E,T as D,_ as ie,o as O,w as k,x as ae,y as oe}from"./init-BFGSwaTJ.mjs";import{n as se}from"./constants-y3PKfNG8.mjs";import{t as A}from"./is-object-ByG7RnjH.mjs";import"./loader-B817Pqik.mjs";import"./skill-teardown-CJl8M28h.mjs";import"./preview-DH3THFT-.mjs";import{execSync as ce,spawnSync as j}from"node:child_process";import{basename as M,dirname as N,join as P,relative as le,resolve as F,sep as ue}from"node:path";import{cpSync as de,createWriteStream as fe,existsSync as I,lstatSync as pe,mkdirSync as L,mkdtempSync as me,readFileSync as R,readdirSync as z,readlinkSync as he,rmSync as B,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 U=n();const De=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Oe(e,t,n=l){if(e!==void 0&&!De.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let ke=null;function Ae(e){ke=e}function je(){return ke??process.cwd()}function Me(){return P(H(),`.ok`,`bug-reports`)}function Ne(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Me(),r=`${t}-bugreport`,i=P(n,`${r}.zip`);for(let e=2;I(i);e+=1)i=P(n,`${r}-${e}.zip`);return i}function Pe(e,t){let n=P(e,`.ok`,`config.yml`);if(I(n))try{let e=R(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 I(P(e,`.ok`))?Ee(`sha256`).update(F(e)).digest(`hex`).slice(0,12):null}function Fe(){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=ce(`sw_vers -productVersion 2>/dev/null`,u({encoding:`utf8`})).trim()}catch{}try{let t=P(__dirname,`..`,`..`,`package.json`);I(t)&&(e.okVersion=JSON.parse(R(t,`utf8`)).version)}catch{}return e}const Ie=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function W(e){let t=M(e);return Ie.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Le(e,t){return Be(e,t).files}const Re=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function ze(e,t=re){let n=P(e,`${t}.ShipIt`);return I(n)?Re.map(e=>P(n,e)).filter(e=>I(e)):[]}function Be(e,t){if(!I(t))return{files:[],excludedByProjectSlug:0};let n=z(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>P(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(W),i=[],a=r.filter(t=>{try{return R(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=>!W(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ve(e){let t=P(e,`.ok`,`local`);return I(t)?{files:[`server.lock`,`last-spawn-error.log`,o].map(e=>P(t,e)).filter(e=>I(e))}:{files:[]}}function He(e){let t=P(e,`.ok`,`local`,`logs`);return I(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>P(t,e)).filter(e=>I(e))}:{files:[]}}function Ue(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 G(e){for(let t of e.files)try{Ue({zipfile:e.zipfile,name:`${e.prefix}/${M(t)}`,content:R(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,o=t.userLogsDir??P(H(),`.ok`,`logs`),s=t.projectDir?Pe(t.projectDir,i):null;L(N(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let c=Fe();c.desktop=t.desktop??null,c.language=t.language??null;let{files:l,excludedByProjectSlug:u}=Be(s,o),{files:d}=t.projectDir?Ve(t.projectDir):{files:[]},{files:f}=t.projectDir?He(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:ee}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),g=new ee;G({zipfile:g,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:i}),G({zipfile:g,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:i}),G({zipfile:g,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=R(e.sourcePath),n=`extra/${e.zipName??M(e.sourcePath)}`;g.addBuffer(t,n),h.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Ue({zipfile:g,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let _=JSON.stringify(c,null,2);g.addBuffer(Buffer.from(_,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let v={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:h,redactions:m,sysinfo:c};g.addBuffer(Buffer.from(JSON.stringify(v,null,2),`utf8`),`MANIFEST.json`);let y=m.reduce((e,t)=>e+t.lineCount,0),b=new Set(p.map(e=>`logs/${M(e)}`)),x=h.filter(e=>b.has(e)),S=s?h.filter(e=>e.startsWith(`logs/`)&&!W(e)&&!b.has(e)):[],C=[`# Bug Report Bundle`,``,`Generated: ${v.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${v.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...S.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:`,...S.map(e=>`- ${e}`),``]:[],...x.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:`,...x.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${a.join(`, `)}`,y>0?`${y} 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,ft as n,q as r}from"./sleep-D_nNc7T_.mjs";import{gc as i,hc as a,nt as o,po as s,rt as c}from"./src-DMi2O7yV.mjs";import{Nn as l,Zr as u,at as d,bi as f,it as p,ot as m,rt as h}from"./src-BnJNsU3L.mjs";import{D as ee,F as g,I as _,k as v}from"./fs-traced-xJfl5Rxd.mjs";import{C as y,S as b,d as x,y as S}from"./server-lock-BHY1C3dW.mjs";import{t as C}from"./yazl-DZr4PyKA.mjs";import{m as w,p as te,v as T}from"./write-project-skill-CpzPK3Kr.mjs";import{c as ne}from"./colors-BsmVIwfM.mjs";import{n as re}from"./acp-harness-probe-z0kwtWNz.mjs";import{E,T as D,_ as ie,o as O,w as k,x as ae,y as oe}from"./init-CuxgCZK8.mjs";import{n as se}from"./constants-BU7Q80Kc.mjs";import{t as A}from"./is-object-ByG7RnjH.mjs";import"./loader-CpDf5eCy.mjs";import"./skill-teardown-sZPAAcyi.mjs";import"./preview-B9-lbB2r.mjs";import{execSync as ce,spawnSync as j}from"node:child_process";import{basename as M,dirname as N,join as P,relative as le,resolve as F,sep as ue}from"node:path";import{cpSync as de,createWriteStream as fe,existsSync as I,lstatSync as pe,mkdirSync as L,mkdtempSync as me,readFileSync as R,readdirSync as z,readlinkSync as he,rmSync as B,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 U=n();const De=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Oe(e,t,n=l){if(e!==void 0&&!De.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let ke=null;function Ae(e){ke=e}function je(){return ke??process.cwd()}function Me(){return P(H(),`.ok`,`bug-reports`)}function Ne(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Me(),r=`${t}-bugreport`,i=P(n,`${r}.zip`);for(let e=2;I(i);e+=1)i=P(n,`${r}-${e}.zip`);return i}function Pe(e,t){let n=P(e,`.ok`,`config.yml`);if(I(n))try{let e=R(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 I(P(e,`.ok`))?Ee(`sha256`).update(F(e)).digest(`hex`).slice(0,12):null}function Fe(){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=ce(`sw_vers -productVersion 2>/dev/null`,u({encoding:`utf8`})).trim()}catch{}try{let t=P(__dirname,`..`,`..`,`package.json`);I(t)&&(e.okVersion=JSON.parse(R(t,`utf8`)).version)}catch{}return e}const Ie=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function W(e){let t=M(e);return Ie.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Le(e,t){return Be(e,t).files}const Re=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function ze(e,t=re){let n=P(e,`${t}.ShipIt`);return I(n)?Re.map(e=>P(n,e)).filter(e=>I(e)):[]}function Be(e,t){if(!I(t))return{files:[],excludedByProjectSlug:0};let n=z(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>P(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(W),i=[],a=r.filter(t=>{try{return R(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=>!W(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ve(e){let t=P(e,`.ok`,`local`);return I(t)?{files:[`server.lock`,`last-spawn-error.log`,o].map(e=>P(t,e)).filter(e=>I(e))}:{files:[]}}function He(e){let t=P(e,`.ok`,`local`,`logs`);return I(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>P(t,e)).filter(e=>I(e))}:{files:[]}}function Ue(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 G(e){for(let t of e.files)try{Ue({zipfile:e.zipfile,name:`${e.prefix}/${M(t)}`,content:R(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,o=t.userLogsDir??P(H(),`.ok`,`logs`),s=t.projectDir?Pe(t.projectDir,i):null;L(N(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let c=Fe();c.desktop=t.desktop??null,c.language=t.language??null;let{files:l,excludedByProjectSlug:u}=Be(s,o),{files:d}=t.projectDir?Ve(t.projectDir):{files:[]},{files:f}=t.projectDir?He(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:ee}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),g=new ee;G({zipfile:g,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:i}),G({zipfile:g,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:i}),G({zipfile:g,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=R(e.sourcePath),n=`extra/${e.zipName??M(e.sourcePath)}`;g.addBuffer(t,n),h.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Ue({zipfile:g,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let _=JSON.stringify(c,null,2);g.addBuffer(Buffer.from(_,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let v={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:h,redactions:m,sysinfo:c};g.addBuffer(Buffer.from(JSON.stringify(v,null,2),`utf8`),`MANIFEST.json`);let y=m.reduce((e,t)=>e+t.lineCount,0),b=new Set(p.map(e=>`logs/${M(e)}`)),x=h.filter(e=>b.has(e)),S=s?h.filter(e=>e.startsWith(`logs/`)&&!W(e)&&!b.has(e)):[],C=[`# Bug Report Bundle`,``,`Generated: ${v.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${v.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...S.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:`,...S.map(e=>`- ${e}`),``]:[],...x.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:`,...x.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${a.join(`, `)}`,y>0?`${y} 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
  `);g.addBuffer(Buffer.from(C,`utf8`),`README.md`),g.end();let w=fe(r);return g.outputStream.pipe(w),await new Promise((e,t)=>{w.on(`close`,e),w.on(`error`,t)}),i?.info({bundlePath:r,fileCount:h.length,redactionCount:y},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:h,redactions:m,redactedLineCount:y,generatedAt:v.generatedAt}}}var Ge=e(C(),1),K=e(ne(),1);function Ke(e){return _({absPath:v(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function qe({home:e=H(),env:n=process.env}={}){let i=Ke(e),{override:a,preferenceList:o}=ee(n),{locale:c,source:l}=s({override:a,storedPreference:i,supportedLocales:r,preferenceList:o,autoDetectableLocales:t});return{preference:i,locale:c,source:l,systemLanguages:o}}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=R(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)}}}V(e,r?`${a.join(`
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,ft as n,q as r}from"./sle
17
17
  `).replace(/\n/g,`\r
18
18
  `));let u=`${i?``:``}${l}`;return u!==r&&g(e,u,{mode:k(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:p(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??h,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??d,a=e.resolveUsage??m,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 T(`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??b,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=b){let n=await h(),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 T(`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:f(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 h();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,b)&&!$(r,b)||(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(f(F(je(),n)))})}export{je as _,Xt as a,$t as c,Z as d,qt as f,Me as g,Ne 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,Ae as v,Oe as y};
20
- //# sourceMappingURL=src-BcAdFCgQ.mjs.map
20
+ //# sourceMappingURL=src-B9IqHTFZ.mjs.map
@@ -0,0 +1 @@
1
+ import"./src-DMi2O7yV.mjs";import"./write-project-skill-CpzPK3Kr.mjs";import"./src-B9IqHTFZ.mjs";import"./acp-harness-probe-z0kwtWNz.mjs";import"./init-CuxgCZK8.mjs";import{n as e}from"./loader-CpDf5eCy.mjs";import"./skill-teardown-sZPAAcyi.mjs";import"./preview-B9-lbB2r.mjs";import"./mcp-migrate-event-B1gJf6bG.mjs";export{e as loadConfig};