@inkeep/open-knowledge 0.50.0-beta.7 → 0.50.0-beta.9

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 (172) hide show
  1. package/dist/{acp-harness-probe-DknlAQmM.mjs → acp-harness-probe-Bl1wO1jG.mjs} +2 -2
  2. package/dist/cli.mjs +18 -18
  3. package/dist/config-schema.json +6 -33
  4. package/dist/config.user.schema.json +6 -33
  5. package/dist/constants-WesqvVEb.mjs +2 -0
  6. package/dist/fs-traced-B2GMd7hO.mjs +12 -0
  7. package/dist/fs-traced-Bkh7Uqka.mjs +1 -0
  8. package/dist/{git-handle-D48CPnbp.mjs → git-handle-C_J8Il_Y.mjs} +2 -2
  9. package/dist/git-handle-k-1cd6rA.mjs +1 -0
  10. package/dist/index.d.mts +20 -47
  11. package/dist/index.mjs +170 -170
  12. package/dist/init-B17jtLEt.mjs +1 -0
  13. package/dist/{init-LDlpt5v5.mjs → init-Cs060ZhU.mjs} +5 -5
  14. package/dist/{launch-json-removal-BsTgc5gY.mjs → launch-json-removal-D0Z9HiC6.mjs} +2 -2
  15. package/dist/loader-C2IzfV23.mjs +1 -0
  16. package/dist/loader-C_U6y8K2.mjs +2 -0
  17. package/dist/md-manager-CmcPG20v.mjs +2 -0
  18. package/dist/{open-browser-CzSvhfe-.mjs → open-browser-BVRsx4UD.mjs} +2 -2
  19. package/dist/parse-worker.mjs +1 -1
  20. package/dist/{preview-DfsV8cng.mjs → preview-1BHwOzN5.mjs} +2 -2
  21. package/dist/preview-BOmw4Npa.mjs +1 -0
  22. package/dist/public/assets/{ActivityModeContent-c7Ng5dOt.js → ActivityModeContent-DFgZy7oE.js} +1 -1
  23. package/dist/public/assets/{AgentDiffPane-CdvdlrTA.js → AgentDiffPane-CWxNDLJy.js} +1 -1
  24. package/dist/public/assets/{AgentThreadClientBinder-CvHvukLZ.js → AgentThreadClientBinder-BO7zX8GD.js} +1 -1
  25. package/dist/public/assets/{ChangedOutsideBadge-Bu8uPTJS.js → ChangedOutsideBadge-B4qPknqp.js} +1 -1
  26. package/dist/public/assets/CodeMirrorPropInput-CQzidEcb.js +3 -0
  27. package/dist/public/assets/{DocumentContext-sNpqhUlI.js → DocumentContext-CNSuvcIw.js} +18 -18
  28. package/dist/public/assets/{EditorModeToggle-D4871FSZ.js → EditorModeToggle-DkQghTpa.js} +1 -1
  29. package/dist/public/assets/{EnableSyncConfirmDialog-cBuI6coM.js → EnableSyncConfirmDialog-Btif19hJ.js} +1 -1
  30. package/dist/public/assets/FeedbackForm-sQ4Muu3U.js +1 -0
  31. package/dist/public/assets/{GraphPanel-CAMYjjtr.js → GraphPanel-CNCFVViE.js} +2 -2
  32. package/dist/public/assets/{ImportSkillDialog-BepHDHz6.js → ImportSkillDialog-CiRpJ3T5.js} +1 -1
  33. package/dist/public/assets/{LintConfigEditor-DRA7zDJD.js → LintConfigEditor-5XRvqcql.js} +1 -1
  34. package/dist/public/assets/ManagedArtifactProperties-CIqNGD9N.js +2 -0
  35. package/dist/public/assets/ManagedArtifactProperties-D1vyOCad.js +1 -0
  36. package/dist/public/assets/{McpConsentDialogBody-ONRUf-u9.js → McpConsentDialogBody-C02gJb5g.js} +1 -1
  37. package/dist/public/assets/{MermaidDocEditor-DC95RR-G.js → MermaidDocEditor-D2cBfG9r.js} +1 -1
  38. package/dist/public/assets/{ReportBugDialogBody-7VaenClj.js → ReportBugDialogBody-CrlxwAm_.js} +1 -1
  39. package/dist/public/assets/{SchemaConfigEditor-B2VRQNhY.js → SchemaConfigEditor-B7a503PZ.js} +1 -1
  40. package/dist/public/assets/{SessionsHost-CJM2wXx0.js → SessionsHost-CpLvCqvs.js} +2 -2
  41. package/dist/public/assets/SettingsDialogBody-C7DVY6B-.js +12 -0
  42. package/dist/public/assets/{ShareBranchSwitchDialog-DD7xybfa.js → ShareBranchSwitchDialog-BUEkE4LA.js} +1 -1
  43. package/dist/public/assets/{ShareReceiveDialog-Bz3zpKKF.js → ShareReceiveDialog-XWYS81GX.js} +1 -1
  44. package/dist/public/assets/{ShareReceiveMissDialog-DqXylco3.js → ShareReceiveMissDialog-MPUr0dv1.js} +1 -1
  45. package/dist/public/assets/{SkillEditBanner-BwzPIxd8.js → SkillEditBanner-SWeBUR9w.js} +1 -1
  46. package/dist/public/assets/{SkillOriginInline-BFCXo8sI.js → SkillOriginInline-BG4CIOQu.js} +1 -1
  47. package/dist/public/assets/{SkillToolbarControls-DF0m8f6g.js → SkillToolbarControls-CaHitAH1.js} +1 -1
  48. package/dist/public/assets/{SlidesToolbarControls-DJXDoZdd.js → SlidesToolbarControls-qIPApX9s.js} +1 -1
  49. package/dist/public/assets/SourceEditor-DKEUL0BH.js +1 -0
  50. package/dist/public/assets/{TerminalPanel-BlK8X0ar.js → TerminalPanel-BY_O1gj3.js} +2 -2
  51. package/dist/public/assets/{TerminalWindowApp-Cy9Ov0_z.js → TerminalWindowApp-DLh-TT_A.js} +1 -1
  52. package/dist/public/assets/{TextDocEditor-D3Hjb2Vu.js → TextDocEditor-0dFDtMs6.js} +1 -1
  53. package/dist/public/assets/ThreadView-CHmtUGoi.js +10 -0
  54. package/dist/public/assets/{TimelineDiffPane-CGiWI4cl.js → TimelineDiffPane-Ba7SXNWn.js} +1 -1
  55. package/dist/public/assets/{agent-diff-store-CEeOURzl.js → agent-diff-store-DbDYdvOw.js} +1 -1
  56. package/dist/public/assets/auth-state-cache-BF6Z4GtZ.js +11 -0
  57. package/dist/public/assets/{client-version-B0MkkJjB.js → client-version-BM5nu9rX.js} +1 -1
  58. package/dist/public/assets/{comment-chips-CmSdX8nJ.js → comment-chips-pQK8zh5P.js} +1 -1
  59. package/dist/public/assets/config-provider-Dz54I9YH.js +5 -0
  60. package/dist/public/assets/{dist-Cy5lktAQ2.js → dist-D6d8jhW_2.js} +184 -184
  61. package/dist/public/assets/{doc-paths-CBKXYveW.js → doc-paths-B610Q5eD.js} +1 -1
  62. package/dist/public/assets/{documents-events-DNLLVEPR.js → documents-events-DQ-lmKb8.js} +1 -1
  63. package/dist/public/assets/{file-tree-adapter-BQ9idF-F.js → file-tree-adapter-Bmhiw8ek.js} +1 -1
  64. package/dist/public/assets/{file-tree-utils-DrTcSGTj.js → file-tree-utils-bTlUKR2h.js} +1 -1
  65. package/dist/public/assets/{folder-config-api-Cf3ca6iE.js → folder-config-api-BFi_uZNT.js} +1 -1
  66. package/dist/public/assets/{follow-file-Ctr47jtP.js → follow-file-CjlmJwxJ.js} +1 -1
  67. package/dist/public/assets/globals-Bq7QmnDv.css +1 -0
  68. package/dist/public/assets/i18n-DWCqmgsa.js +1 -0
  69. package/dist/public/assets/index-gC7cHSmk.js +2097 -0
  70. package/dist/public/assets/{lint-config-client-DzdtSJp-.js → lint-config-client-DTg6epjB.js} +1 -1
  71. package/dist/public/assets/{markdownlint-rule-browser-DMQXiRek.js → markdownlint-rule-browser-BG8UPutR.js} +1 -1
  72. package/dist/public/assets/messages-B12ABuMo.js +1 -0
  73. package/dist/public/assets/messages-BUufFcK8.js +1 -0
  74. package/dist/public/assets/messages-BV-Jgai1.js +1 -0
  75. package/dist/public/assets/messages-B_u6thtp.js +1 -0
  76. package/dist/public/assets/messages-CS-CWF8r.js +1 -0
  77. package/dist/public/assets/messages-CwQGRPEE.js +1 -0
  78. package/dist/public/assets/messages-Cwceyxby.js +1 -0
  79. package/dist/public/assets/messages-DGpodehZ.js +1 -0
  80. package/dist/public/assets/messages-DHl_AYzv.js +1 -0
  81. package/dist/public/assets/messages-DbRvxOAn.js +1 -0
  82. package/dist/public/assets/messages-DdKkPWw3.js +1 -0
  83. package/dist/public/assets/navigation-targets-Ch69zMGC.js +1 -0
  84. package/dist/public/assets/{open-managed-artifact-tab-B84Y6EsP.js → open-managed-artifact-tab-CY_LAv2n.js} +1 -1
  85. package/dist/public/assets/{pending-receive-nav-store-DosIhFkt.js → pending-receive-nav-store-B4qUnaqd.js} +1 -1
  86. package/dist/public/assets/{prop-types-BxhIEdp4.js → prop-types-C-BAUUTo.js} +1 -1
  87. package/dist/public/assets/{receive-store-DO5w93VK.js → receive-store-CbFpknqD.js} +1 -1
  88. package/dist/public/assets/{selection-context-DAl-Wxy6.js → selection-context-BPfggRPr.js} +1 -1
  89. package/dist/public/assets/{skill-actions-1VvTttnO.js → skill-actions-BIlEExO7.js} +2 -2
  90. package/dist/public/assets/{skill-scope-uWACL-4X.js → skill-scope-BpzNeizS.js} +1 -1
  91. package/dist/public/assets/{skills-api-S9b1zvZ6.js → skills-api-CnFnvcRc.js} +1 -1
  92. package/dist/public/assets/{src-CVA7Dtfv.js → src-DFsYGwxw.js} +2 -2
  93. package/dist/public/assets/{tag-pill-input-er0MqvFK.js → tag-pill-input-BMvx5BmV.js} +1 -1
  94. package/dist/public/assets/{target-navigation-intent-DBvgpA7l.js → target-navigation-intent-C776WObz.js} +1 -1
  95. package/dist/public/assets/{terminal-cli-display-CBMTYLbQ.js → terminal-cli-display-DOg7CEcR.js} +1 -1
  96. package/dist/public/assets/{terminal-launch-events-CbqKUJ57.js → terminal-launch-events-BIj1IHuR.js} +1 -1
  97. package/dist/public/assets/{terminal-telemetry-BRNk9k9Y.js → terminal-telemetry-DRwNgR5W.js} +1 -1
  98. package/dist/public/assets/{typing-burst-detector-D114TNgO.js → typing-burst-detector-CWZPjxCH.js} +2 -2
  99. package/dist/public/assets/{uninstall-B7OIrc24.js → uninstall-DhJ_Rklh.js} +1 -1
  100. package/dist/public/assets/{use-activity-panel-DnpzFXIs.js → use-activity-panel-BkEUKYpF.js} +1 -1
  101. package/dist/public/assets/use-apply-config-color-theme-DA6djYET.js +1 -0
  102. package/dist/public/assets/{use-collab-url-CjkHphlr.js → use-collab-url-DCLqu1UG.js} +1 -1
  103. package/dist/public/assets/{use-live-xterm-theme-CVQrPooY.js → use-live-xterm-theme-Br4z4FVs.js} +1 -1
  104. package/dist/public/assets/{use-open-skill-DImLrKgY.js → use-open-skill-DqKBpu6s.js} +1 -1
  105. package/dist/public/assets/{use-popular-skills-Dj_DcxJ4.js → use-popular-skills-DUCqHl15.js} +1 -1
  106. package/dist/public/assets/{use-settings-route-DEoOHvHf.js → use-settings-route-C0dQSoJu.js} +1 -1
  107. package/dist/public/assets/{use-skill-origin-Bj3wYKq2.js → use-skill-origin-Dsa-uKgK.js} +1 -1
  108. package/dist/public/assets/{use-skills-k_NyqOb0.js → use-skills-CFPPlRb6.js} +1 -1
  109. package/dist/public/assets/{use-terminal-enabled-D2ShR7ZJ.js → use-terminal-enabled-B3TJxcey.js} +1 -1
  110. package/dist/public/assets/{use-timeline-entry-diff-CjhWQfrw.js → use-timeline-entry-diff-BNIl-plH.js} +4 -4
  111. package/dist/public/assets/{use-workspace-D0EhHpoU.js → use-workspace-ow-NJpFl.js} +1 -1
  112. package/dist/public/index.html +57 -54
  113. package/dist/public/uninstall.html +6 -6
  114. package/dist/{repair-launch-json-B74_k_CB.mjs → repair-launch-json-Cd_Vv1Ki.mjs} +2 -2
  115. package/dist/{repair-mcp-configs-DLcs5mOV.mjs → repair-mcp-configs-wnLWp4-Q.mjs} +2 -2
  116. package/dist/repair-skills-6sP48q4r.mjs +1 -0
  117. package/dist/{repair-skills-DUqnCrnn.mjs → repair-skills-B3DXhSuF.mjs} +2 -2
  118. package/dist/schemas/v0/config.user.schema.json +6 -33
  119. package/dist/{server-lock-V3bg8zL0.mjs → server-lock-BOsuOHaz.mjs} +2 -2
  120. package/dist/server-lock-SvEBQb4s.mjs +1 -0
  121. package/dist/{skill-teardown-BjKuJDgu.mjs → skill-teardown-DpitP3Vs.mjs} +2 -2
  122. package/dist/{sleep-DVOInM4H.mjs → sleep-Dj1Ck0gp.mjs} +6 -5
  123. package/dist/src-3pZWeowR.mjs +2032 -0
  124. package/dist/src-Bcg8O-xQ.mjs +1 -0
  125. package/dist/src-CO4cFiT1.mjs +1 -0
  126. package/dist/{src-IM6msWeV.mjs → src-DS92rBYx.mjs} +131 -131
  127. package/dist/{src-BtRlmozK.mjs → src-s5E_Y9Xd.mjs} +3 -3
  128. package/dist/{start-DMyot_xR.mjs → start-C5ud_ElN.mjs} +3 -3
  129. package/dist/start-gNbMBnlE.mjs +1 -0
  130. package/dist/{write-project-skill-CM5uu_kY.mjs → write-project-skill-BIyatqdb.mjs} +3 -3
  131. package/package.json +4 -4
  132. package/dist/constants-FqYgjf01.mjs +0 -2
  133. package/dist/fs-traced-DVpoNaQJ.mjs +0 -12
  134. package/dist/fs-traced-_QGcVmcb.mjs +0 -1
  135. package/dist/git-handle-B24ZRv9k.mjs +0 -1
  136. package/dist/init-BX4KzM5O.mjs +0 -1
  137. package/dist/loader-BJnkY5sq.mjs +0 -2
  138. package/dist/loader-sVkz35uc.mjs +0 -1
  139. package/dist/md-manager-DLcJdRDn.mjs +0 -2
  140. package/dist/preview-AblVr_fw.mjs +0 -1
  141. package/dist/public/assets/CodeMirrorPropInput-fWbdlCkS.js +0 -3
  142. package/dist/public/assets/FeedbackForm-BFd0ubqI.js +0 -1
  143. package/dist/public/assets/ManagedArtifactProperties-CLh5T0qS.js +0 -2
  144. package/dist/public/assets/ManagedArtifactProperties-Ct_XfVJo.js +0 -1
  145. package/dist/public/assets/SettingsDialogBody-LwuRFjnU.js +0 -12
  146. package/dist/public/assets/SourceEditor-CBToWgb8.js +0 -1
  147. package/dist/public/assets/ThreadView-YWeuTsL5.js +0 -10
  148. package/dist/public/assets/auth-state-cache-kFk2nWdi.js +0 -11
  149. package/dist/public/assets/config-provider-BkvKKK43.js +0 -5
  150. package/dist/public/assets/globals-B-lWUzDu.css +0 -1
  151. package/dist/public/assets/i18n-CC8DkJXO.js +0 -1
  152. package/dist/public/assets/index-DrqV8949.js +0 -2097
  153. package/dist/public/assets/messages-BNq0JS1I.js +0 -1
  154. package/dist/public/assets/messages-C1QZwdEx.js +0 -1
  155. package/dist/public/assets/messages-CAevTmZQ.js +0 -1
  156. package/dist/public/assets/messages-CG-GHBB9.js +0 -1
  157. package/dist/public/assets/messages-CIxg-v3C.js +0 -1
  158. package/dist/public/assets/messages-CKi8pZ4Q.js +0 -1
  159. package/dist/public/assets/messages-Cv5HHzZF.js +0 -1
  160. package/dist/public/assets/messages-DTRz3g9F.js +0 -1
  161. package/dist/public/assets/messages-DWBpIisU.js +0 -1
  162. package/dist/public/assets/messages-XzeH2iOB.js +0 -1
  163. package/dist/public/assets/messages-bBtIkGs7.js +0 -1
  164. package/dist/public/assets/navigation-targets-Ce74CisT.js +0 -1
  165. package/dist/public/assets/use-apply-config-color-theme-DLZre1dS.js +0 -1
  166. package/dist/repair-skills-CiQl2WaL.mjs +0 -1
  167. package/dist/server-lock-Dy_yO6Nk.mjs +0 -1
  168. package/dist/src-DJld4DjV.mjs +0 -2032
  169. package/dist/src-D_WOo8A_.mjs +0 -1
  170. package/dist/src-KzlEeO27.mjs +0 -1
  171. package/dist/start-jl_w5kPf.mjs +0 -1
  172. /package/dist/public/assets/{globals-CZJtsuL5.js → globals-B8Za6o5Q.js} +0 -0
@@ -45,7 +45,7 @@
45
45
 
46
46
  The IDE color palette comes from `ok-color-theme-pair-v1`, which holds one
47
47
  palette per mode plus the mode preference that chooses between them:
48
- `{ pref, light: { id, dark }, dark: { id, dark } }`. The script resolves
48
+ `{ pref, light: { id, dark, css? }, dark: { id, dark, css? } }`. The script resolves
49
49
  `pref` (asking the OS for `system`), reads that slot, applies its `id` as
50
50
  the `data-color-theme` attribute consumed by `color-themes.generated.css`,
51
51
  and takes the `dark` class straight from the slot's own flag — a palette
@@ -58,17 +58,20 @@
58
58
  that key as soon as it writes the pair, so this branch runs at most once
59
59
  per install.
60
60
 
61
- The `custom` palette is replayed from `ok-custom-theme-v1`
62
- (`{ css, dark }`): its prebuilt stylesheet is injected as a `<style>` and
63
- its `dark` flag drives the class. Paired consumer:
61
+ Runtime palettes (`custom` and `saved-*`) carry their prebuilt stylesheet
62
+ on each pair-cache slot as `css`. The active slot's stylesheet is injected
63
+ before paint; a missing stylesheet drops that runtime palette instead of
64
+ borrowing the other slot's CSS. For one upgrade, a `custom` slot written by
65
+ the preceding cache format may recover its stylesheet and mode from
66
+ `ok-custom-theme-v1`; the current writer deletes that legacy key. Paired consumer:
64
67
  `src/lib/use-apply-config-color-theme.ts` — it writes the
65
- `ok-color-theme-pair-v1` and `ok-custom-theme-v1` caches and clears the legacy
66
- `ok-color-theme-v1`; `ok-theme-v1` is next-themes' (see above).
68
+ `ok-color-theme-pair-v1` cache and clears the legacy `ok-color-theme-v1` and
69
+ `ok-custom-theme-v1` caches; `ok-theme-v1` is next-themes' (see above).
67
70
 
68
71
  Single-line script body — same biome HTML-formatter constraint as
69
72
  the editor-mode FOUC above.
70
73
  -->
71
- <script>(() => { const isMode = (v) => v === 'light' || v === 'dark' || v === 'system'; const isThemeId = (v) => typeof v === 'string' && /^[a-z0-9-]{1,32}$/.test(v); let pref = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (isMode(r)) pref = r; } catch {} let slots = null; try { const raw = localStorage.getItem('ok-color-theme-pair-v1'); if (raw) { const o = JSON.parse(raw); if (o?.light && o?.dark) { slots = o; if (isMode(o.pref)) pref = o.pref; } } } catch {} let dark = pref === 'dark'; if (pref === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let ct = null; if (slots) { const slot = dark ? slots.dark : slots.light; if (isThemeId(slot?.id)) { dark = !!slot.dark; if (slot.id !== 'default') ct = slot.id; } } else { try { const c = localStorage.getItem('ok-color-theme-v1'); if (isThemeId(c) && c !== 'default') ct = c; } catch {} } let customCss = null; if (ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (o?.css) { customCss = o.css; dark = !!o.dark; } } } catch {} if (!customCss) ct = null; } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (customCss) { const s = document.createElement('style'); s.id = 'ok-custom-theme'; s.textContent = customCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
74
+ <script>(() => { const isMode = (v) => v === 'light' || v === 'dark' || v === 'system'; const isThemeId = (v) => typeof v === 'string' && /^[a-z0-9-]{1,32}$/.test(v); let pref = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (isMode(r)) pref = r; } catch {} let slots = null; try { const raw = localStorage.getItem('ok-color-theme-pair-v1'); if (raw) { const o = JSON.parse(raw); if (o?.light && o?.dark) { slots = o; if (isMode(o.pref)) pref = o.pref; } } } catch {} let dark = pref === 'dark'; if (pref === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let ct = null; let slot = null; if (slots) { slot = dark ? slots.dark : slots.light; if (isThemeId(slot?.id)) { dark = !!slot.dark; if (slot.id !== 'default') ct = slot.id; } } else { try { const c = localStorage.getItem('ok-color-theme-v1'); if (isThemeId(c) && c !== 'default') ct = c; } catch {} } let runtimeCss = null; if (ct === 'custom' || ct?.startsWith('saved-')) { if (typeof slot?.css === 'string' && slot.css) runtimeCss = slot.css; if (!runtimeCss && slots && ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (typeof o?.css === 'string' && o.css) { runtimeCss = o.css; dark = !!o.dark; } } } catch {} } if (!runtimeCss) ct = null; } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (runtimeCss) { const s = document.createElement('style'); s.id = ct === 'custom' ? 'ok-custom-theme' : 'ok-saved-theme'; s.textContent = runtimeCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
72
75
  <!--
73
76
  Language FOUC prevention. Reads the persisted interface language
74
77
  synchronously before React mounts so the first painted frame carries the
@@ -91,11 +94,11 @@
91
94
  -->
92
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>
93
96
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
94
- <script type="module" crossorigin src="./assets/index-DrqV8949.js"></script>
97
+ <script type="module" crossorigin src="./assets/index-gC7cHSmk.js"></script>
95
98
  <link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
96
99
  <link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
97
100
  <link rel="modulepreload" crossorigin href="./assets/react-dom-DPxgxlDT.js">
98
- <link rel="modulepreload" crossorigin href="./assets/globals-CZJtsuL5.js">
101
+ <link rel="modulepreload" crossorigin href="./assets/globals-B8Za6o5Q.js">
99
102
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-Chd9yIcd.js">
100
103
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-hgmz1BF7.js">
101
104
  <link rel="modulepreload" crossorigin href="./assets/dist-B0Beym3_.js">
@@ -125,13 +128,13 @@
125
128
  <link rel="modulepreload" crossorigin href="./assets/lib-DcrRfjuF.js">
126
129
  <link rel="modulepreload" crossorigin href="./assets/lib-BHGXbMkc.js">
127
130
  <link rel="modulepreload" crossorigin href="./assets/markdownit-CIgVFnWs.js">
128
- <link rel="modulepreload" crossorigin href="./assets/dist-Cy5lktAQ2.js">
131
+ <link rel="modulepreload" crossorigin href="./assets/dist-D6d8jhW_2.js">
129
132
  <link rel="modulepreload" crossorigin href="./assets/dist-Bkx5dDHT2.js">
130
- <link rel="modulepreload" crossorigin href="./assets/client-version-B0MkkJjB.js">
131
- <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-DLZre1dS.js">
132
- <link rel="modulepreload" crossorigin href="./assets/messages-C1QZwdEx.js">
133
- <link rel="modulepreload" crossorigin href="./assets/i18n-CC8DkJXO.js">
134
- <link rel="modulepreload" crossorigin href="./assets/config-provider-BkvKKK43.js">
133
+ <link rel="modulepreload" crossorigin href="./assets/client-version-BM5nu9rX.js">
134
+ <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-DA6djYET.js">
135
+ <link rel="modulepreload" crossorigin href="./assets/messages-CS-CWF8r.js">
136
+ <link rel="modulepreload" crossorigin href="./assets/i18n-DWCqmgsa.js">
137
+ <link rel="modulepreload" crossorigin href="./assets/config-provider-Dz54I9YH.js">
135
138
  <link rel="modulepreload" crossorigin href="./assets/dist-Bi80hc1t.js">
136
139
  <link rel="modulepreload" crossorigin href="./assets/dist-CR6aO28t.js">
137
140
  <link rel="modulepreload" crossorigin href="./assets/dist-DpaqLIPT.js">
@@ -168,22 +171,22 @@
168
171
  <link rel="modulepreload" crossorigin href="./assets/switch-0kSGDL9E.js">
169
172
  <link rel="modulepreload" crossorigin href="./assets/folder-open-CB-trByC.js">
170
173
  <link rel="modulepreload" crossorigin href="./assets/trash-2-CSpv7np3.js">
171
- <link rel="modulepreload" crossorigin href="./assets/file-tree-utils-DrTcSGTj.js">
172
- <link rel="modulepreload" crossorigin href="./assets/doc-paths-CBKXYveW.js">
173
- <link rel="modulepreload" crossorigin href="./assets/skill-scope-uWACL-4X.js">
174
- <link rel="modulepreload" crossorigin href="./assets/navigation-targets-Ce74CisT.js">
174
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-utils-bTlUKR2h.js">
175
+ <link rel="modulepreload" crossorigin href="./assets/doc-paths-B610Q5eD.js">
176
+ <link rel="modulepreload" crossorigin href="./assets/skill-scope-BpzNeizS.js">
177
+ <link rel="modulepreload" crossorigin href="./assets/navigation-targets-Ch69zMGC.js">
175
178
  <link rel="modulepreload" crossorigin href="./assets/asset-dispatch-DsHoHhCG.js">
176
179
  <link rel="modulepreload" crossorigin href="./assets/external-link-CHCx4FXC.js">
177
180
  <link rel="modulepreload" crossorigin href="./assets/documents-fetch-I34CgFeh.js">
178
- <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-fWbdlCkS.js">
181
+ <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-CQzidEcb.js">
179
182
  <link rel="modulepreload" crossorigin href="./assets/git-branch-JnfmLuHd.js">
180
183
  <link rel="modulepreload" crossorigin href="./assets/triangle-alert-xKPljhlK.js">
181
184
  <link rel="modulepreload" crossorigin href="./assets/Mermaid-D-pcyGRV.js">
182
185
  <link rel="modulepreload" crossorigin href="./assets/CopyButton-DhHoiQJR.js">
183
- <link rel="modulepreload" crossorigin href="./assets/documents-events-DNLLVEPR.js">
186
+ <link rel="modulepreload" crossorigin href="./assets/documents-events-DQ-lmKb8.js">
184
187
  <link rel="modulepreload" crossorigin href="./assets/parse-api-error-Mgtc4OJu.js">
185
188
  <link rel="modulepreload" crossorigin href="./assets/startup-marks-BYurBbnW.js">
186
- <link rel="modulepreload" crossorigin href="./assets/prop-types-BxhIEdp4.js">
189
+ <link rel="modulepreload" crossorigin href="./assets/prop-types-C-BAUUTo.js">
187
190
  <link rel="modulepreload" crossorigin href="./assets/eye-j_4QS15C.js">
188
191
  <link rel="modulepreload" crossorigin href="./assets/hash-DKiwvmF3.js">
189
192
  <link rel="modulepreload" crossorigin href="./assets/info-CsTy513y.js">
@@ -192,33 +195,33 @@
192
195
  <link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-DEuNOzhg.js">
193
196
  <link rel="modulepreload" crossorigin href="./assets/badge-zHd29IKW.js">
194
197
  <link rel="modulepreload" crossorigin href="./assets/input-VnbFvuKd.js">
195
- <link rel="modulepreload" crossorigin href="./assets/use-collab-url-CjkHphlr.js">
196
- <link rel="modulepreload" crossorigin href="./assets/skills-api-S9b1zvZ6.js">
197
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-sNpqhUlI.js">
198
+ <link rel="modulepreload" crossorigin href="./assets/use-collab-url-DCLqu1UG.js">
199
+ <link rel="modulepreload" crossorigin href="./assets/skills-api-CnFnvcRc.js">
200
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-CNSuvcIw.js">
198
201
  <link rel="modulepreload" crossorigin href="./assets/format-Dx1Bv63R.js">
199
202
  <link rel="modulepreload" crossorigin href="./assets/braces-B2tgJ4cu.js">
200
- <link rel="modulepreload" crossorigin href="./assets/folder-config-api-Cf3ca6iE.js">
201
- <link rel="modulepreload" crossorigin href="./assets/comment-chips-CmSdX8nJ.js">
203
+ <link rel="modulepreload" crossorigin href="./assets/folder-config-api-BFi_uZNT.js">
204
+ <link rel="modulepreload" crossorigin href="./assets/comment-chips-pQK8zh5P.js">
202
205
  <link rel="modulepreload" crossorigin href="./assets/textarea-D59GB_Zy.js">
203
- <link rel="modulepreload" crossorigin href="./assets/selection-context-DAl-Wxy6.js">
204
- <link rel="modulepreload" crossorigin href="./assets/lint-config-client-DzdtSJp-.js">
205
- <link rel="modulepreload" crossorigin href="./assets/use-skills-k_NyqOb0.js">
206
- <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-CLh5T0qS.js">
207
- <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-cBuI6coM.js">
206
+ <link rel="modulepreload" crossorigin href="./assets/selection-context-BPfggRPr.js">
207
+ <link rel="modulepreload" crossorigin href="./assets/lint-config-client-DTg6epjB.js">
208
+ <link rel="modulepreload" crossorigin href="./assets/use-skills-CFPPlRb6.js">
209
+ <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-CIqNGD9N.js">
210
+ <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-Btif19hJ.js">
208
211
  <link rel="modulepreload" crossorigin href="./assets/cursor-CUtcHGV-.js">
209
212
  <link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-BgDInKA9.js">
210
213
  <link rel="modulepreload" crossorigin href="./assets/folder-C8rE1Soy.js">
211
214
  <link rel="modulepreload" crossorigin href="./assets/copilot-BdGxiVpg.js">
212
- <link rel="modulepreload" crossorigin href="./assets/terminal-cli-display-CBMTYLbQ.js">
215
+ <link rel="modulepreload" crossorigin href="./assets/terminal-cli-display-DOg7CEcR.js">
213
216
  <link rel="modulepreload" crossorigin href="./assets/mascot-outline-CtS592mc.js">
214
- <link rel="modulepreload" crossorigin href="./assets/ChangedOutsideBadge-Bu8uPTJS.js">
217
+ <link rel="modulepreload" crossorigin href="./assets/ChangedOutsideBadge-B4qPknqp.js">
215
218
  <link rel="modulepreload" crossorigin href="./assets/list-plus-ByOuGBSE.js">
216
- <link rel="modulepreload" crossorigin href="./assets/use-open-skill-DImLrKgY.js">
217
- <link rel="modulepreload" crossorigin href="./assets/use-settings-route-DEoOHvHf.js">
219
+ <link rel="modulepreload" crossorigin href="./assets/use-open-skill-DqKBpu6s.js">
220
+ <link rel="modulepreload" crossorigin href="./assets/use-settings-route-C0dQSoJu.js">
218
221
  <link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-DEJxizFj.js">
219
- <link rel="modulepreload" crossorigin href="./assets/use-workspace-D0EhHpoU.js">
222
+ <link rel="modulepreload" crossorigin href="./assets/use-workspace-ow-NJpFl.js">
220
223
  <link rel="modulepreload" crossorigin href="./assets/workspace-paths-C2pS_Pbn.js">
221
- <link rel="modulepreload" crossorigin href="./assets/skill-actions-1VvTttnO.js">
224
+ <link rel="modulepreload" crossorigin href="./assets/skill-actions-BIlEExO7.js">
222
225
  <link rel="modulepreload" crossorigin href="./assets/arrow-up-right-D_WN0VGP.js">
223
226
  <link rel="modulepreload" crossorigin href="./assets/case-sensitive-Cz58rAyi.js">
224
227
  <link rel="modulepreload" crossorigin href="./assets/chevron-left-CiNweXA3.js">
@@ -227,42 +230,42 @@
227
230
  <link rel="modulepreload" crossorigin href="./assets/lint-plugin-meta-FPoTE-0t.js">
228
231
  <link rel="modulepreload" crossorigin href="./assets/panel-9S5Pf2VO.js">
229
232
  <link rel="modulepreload" crossorigin href="./assets/skeleton-BOVIbSHk.js">
230
- <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-D114TNgO.js">
233
+ <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-CWZPjxCH.js">
231
234
  <link rel="modulepreload" crossorigin href="./assets/download-btG_KeFQ.js">
232
235
  <link rel="modulepreload" crossorigin href="./assets/field-9eXIpxzl.js">
233
- <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-kFk2nWdi.js">
236
+ <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-BF6Z4GtZ.js">
234
237
  <link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-DKfFwAsF.js">
235
- <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-DosIhFkt.js">
238
+ <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-B4qUnaqd.js">
236
239
  <link rel="modulepreload" crossorigin href="./assets/history-eaFgPZWX.js">
237
- <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-B84Y6EsP.js">
238
- <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-Dj_DcxJ4.js">
240
+ <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-CY_LAv2n.js">
241
+ <link rel="modulepreload" crossorigin href="./assets/use-popular-skills-DUCqHl15.js">
239
242
  <link rel="modulepreload" crossorigin href="./assets/panel-right-open-JxkSMPMb.js">
240
- <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-CbqKUJ57.js">
241
- <link rel="modulepreload" crossorigin href="./assets/follow-file-Ctr47jtP.js">
243
+ <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-BIj1IHuR.js">
244
+ <link rel="modulepreload" crossorigin href="./assets/follow-file-CjlmJwxJ.js">
242
245
  <link rel="modulepreload" crossorigin href="./assets/square-pen-hwoIfi3M.js">
243
246
  <link rel="modulepreload" crossorigin href="./assets/undo-2-D5cqFzyJ.js">
244
247
  <link rel="modulepreload" crossorigin href="./assets/form-_Bm7VdZa.js">
245
248
  <link rel="modulepreload" crossorigin href="./assets/text-viewer-languages-BmEIetCD.js">
246
- <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-D4871FSZ.js">
249
+ <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-DkQghTpa.js">
247
250
  <link rel="modulepreload" crossorigin href="./assets/ConfigSharingInfoTooltip-BPA8HEYl.js">
248
251
  <link rel="modulepreload" crossorigin href="./assets/project-paths-DC6bWLUQ.js">
249
252
  <link rel="modulepreload" crossorigin href="./assets/SkillModeBanner-d0ZDkWTk.js">
250
- <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-BQ9idF-F.js">
253
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-Bmhiw8ek.js">
251
254
  <link rel="modulepreload" crossorigin href="./assets/terminal-command-events-mSM3ArSl.js">
252
- <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-CEeOURzl.js">
253
- <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-DBvgpA7l.js">
254
- <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-CVQrPooY.js">
255
+ <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-DbDYdvOw.js">
256
+ <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-C776WObz.js">
257
+ <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-Br4z4FVs.js">
255
258
  <link rel="modulepreload" crossorigin href="./assets/input-group-BA2Li4LU.js">
256
259
  <link rel="modulepreload" crossorigin href="./assets/use-installed-clis-CdB0ME5s.js">
257
- <link rel="modulepreload" crossorigin href="./assets/use-skill-origin-Bj3wYKq2.js">
258
- <link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-BRNk9k9Y.js">
260
+ <link rel="modulepreload" crossorigin href="./assets/use-skill-origin-Dsa-uKgK.js">
261
+ <link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-DRwNgR5W.js">
259
262
  <link rel="modulepreload" crossorigin href="./assets/agent-presence-DK_W4GTa.js">
260
263
  <link rel="modulepreload" crossorigin href="./assets/auth-prompt-store-CyiGTt3C.js">
261
264
  <link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-CBPF1Ll9.js">
262
265
  <link rel="modulepreload" crossorigin href="./assets/overlay-layers-C1Y78Wu8.js">
263
- <link rel="modulepreload" crossorigin href="./assets/receive-store-DO5w93VK.js">
266
+ <link rel="modulepreload" crossorigin href="./assets/receive-store-CbFpknqD.js">
264
267
  <link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-cCBpDgND.js">
265
- <link rel="stylesheet" crossorigin href="./assets/globals-B-lWUzDu.css">
268
+ <link rel="stylesheet" crossorigin href="./assets/globals-Bq7QmnDv.css">
266
269
  <link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
267
270
  <link rel="stylesheet" crossorigin href="./assets/index-CDpJ2gXn.css">
268
271
  </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-B7OIrc24.js"></script>
35
+ <script type="module" crossorigin src="./assets/uninstall-DhJ_Rklh.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-CZJtsuL5.js">
39
+ <link rel="modulepreload" crossorigin href="./assets/globals-B8Za6o5Q.js">
40
40
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-Chd9yIcd.js">
41
41
  <link rel="modulepreload" crossorigin href="./assets/trace-api-DH580DYm.js">
42
42
  <link rel="modulepreload" crossorigin href="./assets/html-void-elements-Bkr32DGT.js">
@@ -44,7 +44,7 @@
44
44
  <link rel="modulepreload" crossorigin href="./assets/lib-BHGXbMkc.js">
45
45
  <link rel="modulepreload" crossorigin href="./assets/markdownit-CIgVFnWs.js">
46
46
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-hgmz1BF7.js">
47
- <link rel="modulepreload" crossorigin href="./assets/dist-Cy5lktAQ2.js">
47
+ <link rel="modulepreload" crossorigin href="./assets/dist-D6d8jhW_2.js">
48
48
  <link rel="modulepreload" crossorigin href="./assets/dist-DoS8xGN6.js">
49
49
  <link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
50
50
  <link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
@@ -68,9 +68,9 @@
68
68
  <link rel="modulepreload" crossorigin href="./assets/badge-zHd29IKW.js">
69
69
  <link rel="modulepreload" crossorigin href="./assets/input-VnbFvuKd.js">
70
70
  <link rel="modulepreload" crossorigin href="./assets/textarea-D59GB_Zy.js">
71
- <link rel="modulepreload" crossorigin href="./assets/messages-C1QZwdEx.js">
72
- <link rel="modulepreload" crossorigin href="./assets/i18n-CC8DkJXO.js">
73
- <link rel="stylesheet" crossorigin href="./assets/globals-B-lWUzDu.css">
71
+ <link rel="modulepreload" crossorigin href="./assets/messages-CS-CWF8r.js">
72
+ <link rel="modulepreload" crossorigin href="./assets/i18n-DWCqmgsa.js">
73
+ <link rel="stylesheet" crossorigin href="./assets/globals-Bq7QmnDv.css">
74
74
  </head>
75
75
 
76
76
  <body class="antialiased">
@@ -1,2 +1,2 @@
1
- import{t as e}from"./launch-json-removal-BsTgc5gY.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-B74_k_CB.mjs.map
1
+ import{t as e}from"./launch-json-removal-D0Z9HiC6.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-Cd_Vv1Ki.mjs.map
@@ -1,2 +1,2 @@
1
- import{i as e,o as t,p as n}from"./write-project-skill-CM5uu_kY.mjs";import{d as r,v as i}from"./init-LDlpt5v5.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-DLcs5mOV.mjs.map
1
+ import{i as e,o as t,p as n}from"./write-project-skill-BIyatqdb.mjs";import{d as r,v as i}from"./init-Cs060ZhU.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-wnLWp4-Q.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-B3DXhSuF.mjs";export{e as repairSkills};
@@ -1,4 +1,4 @@
1
- import{R as e}from"./src-IM6msWeV.mjs";import{ar as t,br as n,dr as r,gr as i,lr as a,mr as o,or as s,ur as c,xr as l}from"./src-DJld4DjV.mjs";import{o as u,s as d,t as f,v as p}from"./write-project-skill-CM5uu_kY.mjs";import{n as m,s as h,t as g}from"./colors-BsmVIwfM.mjs";import{n as _,r as v,t as y}from"./skill-teardown-BjKuJDgu.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>i(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>i(e,{checkDesktop:!1}),readBundledVersion:()=>s(),readRecordedVersion:e=>a(e,`cli-hosts`),writeRecordedVersion:(e,t)=>r(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>o(e),readBundleDecision:(e,n)=>t(e,n),writeBundleDecision:(e,t,n)=>c(e,t,n),removeBundleFromDisk:(e,t)=>v(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=!1;if(r.existsSync(s))o.push({kind:`central`,path:s,outcome:`skipped-present`});else try{I(n,s,r),c=!0,o.push({kind:`central`,path:s,outcome:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of d){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(r.existsSync(u)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-present`});continue}try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:c}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(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 d){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=u[t.editorId]?.projectConfigPath?.(e);if(!z(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{f(o,e),I(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 V(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 u;try{u=await r.readRecordedVersion(t)}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=i.existsSync(x(t,`.agents`,`skills`,s)),l=await r.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(t,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(t,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(e=>i.existsSync(x(t,`.agents`,`skills`,n[e.id])));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:e,sourceDir:r}of p){let o=R(t,n[e],r,i,a,c);h.push(...o.entries),_.push({id:e,centralWritten:o.centralWritten})}let v=h.some(e=>e.kind===`central`&&e.outcome===`failed`);if(g&&!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,centralWritten: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{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:c,reason:g?e?`all-writes-failed`:`central-write-failed`:`bundle-unresolved`})}return{outcome:`done`,version:c,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=_(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=y(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 U(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 W(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{R as e}from"./src-DS92rBYx.mjs";import{ar as t,br as n,dr as r,gr as i,lr as a,mr as o,or as s,ur as c,xr as l}from"./src-3pZWeowR.mjs";import{o as u,s as d,t as f,v as p}from"./write-project-skill-BIyatqdb.mjs";import{n as m,s as h,t as g}from"./colors-BsmVIwfM.mjs";import{n as _,r as v,t as y}from"./skill-teardown-DpitP3Vs.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>i(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>i(e,{checkDesktop:!1}),readBundledVersion:()=>s(),readRecordedVersion:e=>a(e,`cli-hosts`),writeRecordedVersion:(e,t)=>r(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>o(e),readBundleDecision:(e,n)=>t(e,n),writeBundleDecision:(e,t,n)=>c(e,t,n),removeBundleFromDisk:(e,t)=>v(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=!1;if(r.existsSync(s))o.push({kind:`central`,path:s,outcome:`skipped-present`});else try{I(n,s,r),c=!0,o.push({kind:`central`,path:s,outcome:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of d){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(r.existsSync(u)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-present`});continue}try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:c}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(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 d){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=u[t.editorId]?.projectConfigPath?.(e);if(!z(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{f(o,e),I(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 V(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 u;try{u=await r.readRecordedVersion(t)}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=i.existsSync(x(t,`.agents`,`skills`,s)),l=await r.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(t,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(t,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(e=>i.existsSync(x(t,`.agents`,`skills`,n[e.id])));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:e,sourceDir:r}of p){let o=R(t,n[e],r,i,a,c);h.push(...o.entries),_.push({id:e,centralWritten:o.centralWritten})}let v=h.some(e=>e.kind===`central`&&e.outcome===`failed`);if(g&&!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,centralWritten: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{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:c,reason:g?e?`all-writes-failed`:`central-write-failed`:`bundle-unresolved`})}return{outcome:`done`,version:c,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=_(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=y(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 U(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 W(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 G(){return new p(`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 H({projectDir:C(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null,confirmLegacyCleanup:t=>K(t,{yes:e.yes===!0})});process.stdout.write(`${W(t)}\n`),process.exitCode=U(t)})}async function K(e,t){let n=j(),r=e=>`~/${S(n,e)}`,i=t.input??process.stdin,a=[``,g(`A previous version of OpenKnowledge installed its skill into agent tools you may never have used.`),m(`(Versions before 0.42 wrote to every host a third-party installer knew about — see issue #820.)`)];if(e.skillDirs.length>0&&a.push(``,`${g(`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(``,`${g(t)} ${e.emptyDirs.length}`,...e.emptyDirs.map(e=>` ${r(e)}`))}if(a.push(``,m(`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(`${h("Not a terminal — skipping cleanup. Re-run with `ok repair-skills --yes` to remove these.")}\n`),!1;let o=M({input:i,output:process.stdout});try{let e=(await o.question(`\n${g(`Remove them?`)} ${m(`[y/N] `)}`)).trim().toLowerCase();return e===`y`||e===`yes`}finally{o.close()}}export{G as n,H as t};
4
- //# sourceMappingURL=repair-skills-DUqnCrnn.mjs.map
4
+ //# sourceMappingURL=repair-skills-B3DXhSuF.mjs.map
@@ -45,54 +45,27 @@
45
45
  },
46
46
  "colorThemeLight": {
47
47
  "type": "string",
48
- "enum": [
49
- "default",
50
- "dracula",
51
- "catppuccin-frappe",
52
- "catppuccin-latte",
53
- "monokai",
54
- "gruvbox",
55
- "solarized",
56
- "custom"
57
- ],
48
+ "pattern": "^[a-z0-9-]{1,32}$",
58
49
  "scope": "user",
59
50
  "agentSettable": false,
60
51
  "defaultScope": "user",
61
- "description": "IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), or one of 'dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized'. A personal preference (user scope) — not shared with the project."
52
+ "description": "IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of 'dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project."
62
53
  },
63
54
  "colorThemeDark": {
64
55
  "type": "string",
65
- "enum": [
66
- "default",
67
- "dracula",
68
- "catppuccin-frappe",
69
- "catppuccin-latte",
70
- "monokai",
71
- "gruvbox",
72
- "solarized",
73
- "custom"
74
- ],
56
+ "pattern": "^[a-z0-9-]{1,32}$",
75
57
  "scope": "user",
76
58
  "agentSettable": false,
77
59
  "defaultScope": "user",
78
- "description": "IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), or one of 'dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized'. A personal preference (user scope) — not shared with the project."
60
+ "description": "IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of 'dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project."
79
61
  },
80
62
  "colorTheme": {
81
63
  "type": "string",
82
- "enum": [
83
- "default",
84
- "dracula",
85
- "catppuccin-frappe",
86
- "catppuccin-latte",
87
- "monokai",
88
- "gruvbox",
89
- "solarized",
90
- "custom"
91
- ],
64
+ "pattern": "^[a-z0-9-]{1,32}$",
92
65
  "scope": "user",
93
66
  "agentSettable": false,
94
67
  "defaultScope": "user",
95
- "description": "Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A personal preference (user scope) — not shared with the project."
68
+ "description": "Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project."
96
69
  },
97
70
  "colorThemeEnabled": {
98
71
  "type": "boolean",
@@ -1,2 +1,2 @@
1
- import"./src-IM6msWeV.mjs";import{r as e}from"./logger-DFxEUjvj.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(e){return new URL(e.url??``,`http://localhost`).searchParams}function y(e){let t=e?.code;return typeof t==`string`?t:void 0}const b=/^[A-Za-z0-9-]{8,64}$/;let x=null;function S(e){return n(e??p(),`.ok`,`machine-id`)}function C(n){if(n===void 0&&x!==null)return x;let r=S(n),i=null;try{let e=l(r,`utf-8`).trim();b.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(x=i),i}function w(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const T=w(),E=1,D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===C():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==C()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:C(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??T},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(y(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){y(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e,t){q({lockName:`server`,lockDir:e,...t})}function $(e){U({lockName:`server`,lockDir:e})}function ee(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,T as _,Q as a,y as b,O as c,k as d,U as f,H as g,q as h,Z as i,R as l,G as m,Y as n,X as o,W as p,$ as r,ee as s,J as t,V as u,E as v,v as x,C as y};
2
- //# sourceMappingURL=server-lock-V3bg8zL0.mjs.map
1
+ import"./src-DS92rBYx.mjs";import{r as e}from"./logger-DFxEUjvj.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(e){return new URL(e.url??``,`http://localhost`).searchParams}function y(e){let t=e?.code;return typeof t==`string`?t:void 0}const b=/^[A-Za-z0-9-]{8,64}$/;let x=null;function S(e){return n(e??p(),`.ok`,`machine-id`)}function C(n){if(n===void 0&&x!==null)return x;let r=S(n),i=null;try{let e=l(r,`utf-8`).trim();b.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(x=i),i}function w(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const T=w(),E=1,D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===C():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==C()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:C(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??T},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(y(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){y(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e,t){q({lockName:`server`,lockDir:e,...t})}function $(e){U({lockName:`server`,lockDir:e})}function ee(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,T as _,Q as a,y as b,O as c,k as d,U as f,H as g,q as h,Z as i,R as l,G as m,Y as n,X as o,W as p,$ as r,ee as s,J as t,V as u,E as v,v as x,C as y};
2
+ //# sourceMappingURL=server-lock-BOsuOHaz.mjs.map
@@ -0,0 +1 @@
1
+ import{a as e,o as t,r as n}from"./server-lock-BOsuOHaz.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
@@ -1,2 +1,2 @@
1
- import{br as e,xr as t}from"./src-DJld4DjV.mjs";import{s as n}from"./write-project-skill-CM5uu_kY.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(t=>e[t]),`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=e[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let e of n)o.push({path:a(i,e.hostDir,`skills`,t),bundleId:r,scope:`host`,hostDir:e.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-BjKuJDgu.mjs.map
1
+ import{br as e,xr as t}from"./src-3pZWeowR.mjs";import{s as n}from"./write-project-skill-BIyatqdb.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(t=>e[t]),`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=e[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let e of n)o.push({path:a(i,e.hostDir,`skills`,t),bundleId:r,scope:`host`,hostDir:e.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-DpitP3Vs.mjs.map