@inkeep/open-knowledge 0.62.0-beta.8 → 0.62.0

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 (167) hide show
  1. package/dist/{acp-harness-probe-DS_1snlG.mjs → acp-harness-probe-BnSnid-d.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-CCu5CN27.mjs +2 -0
  4. package/dist/index.d.mts +18 -0
  5. package/dist/index.mjs +1 -1
  6. package/dist/init-BNXQrjsM.mjs +1 -0
  7. package/dist/{init-D53VmdHm.mjs → init-D42n1RRR.mjs} +3 -3
  8. package/dist/{launch-json-removal-DwjhIdI7.mjs → launch-json-removal-DTRkPCPD.mjs} +2 -2
  9. package/dist/{loader-nsH_hdbs.mjs → loader-BzR-5zEN.mjs} +2 -2
  10. package/dist/loader-Cm0Hgy20.mjs +1 -0
  11. package/dist/{open-browser-CqoTUuyv.mjs → open-browser-CQV4BpIk.mjs} +2 -2
  12. package/dist/preview-CcaikVau.mjs +1 -0
  13. package/dist/{preview-83eThwUX.mjs → preview-De4WKmOX.mjs} +2 -2
  14. package/dist/public/assets/{ActivityModeContent-DkTQxKSH.js → ActivityModeContent-CgpNhDzY.js} +1 -1
  15. package/dist/public/assets/{AgentDiffPane-q59j25HN.js → AgentDiffPane-DBWmsx4P.js} +1 -1
  16. package/dist/public/assets/{AgentThreadClientBinder-r_vwrkS8.js → AgentThreadClientBinder-CLBvT9Nq.js} +1 -1
  17. package/dist/public/assets/{BugReportHistory-BpVVcA5z.js → BugReportHistory-BpNPpnsE.js} +1 -1
  18. package/dist/public/assets/{BugReportHistoryDialog-1jJf6SqH.js → BugReportHistoryDialog-6xa9_qbx.js} +1 -1
  19. package/dist/public/assets/CodeMirrorPropInput-DgFn7x1r.js +3 -0
  20. package/dist/public/assets/{ConsentDialogBody-BI66aSep.js → ConsentDialogBody-DHPaGsIM.js} +1 -1
  21. package/dist/public/assets/DocumentContext-BtfwcPLA.js +38 -0
  22. package/dist/public/assets/{EditorModeToggle-CWgtrWJu.js → EditorModeToggle-CDhUVUBg.js} +1 -1
  23. package/dist/public/assets/{EnableSyncConfirmDialog-DNw1ACIK.js → EnableSyncConfirmDialog-C9Ic_XvY.js} +1 -1
  24. package/dist/public/assets/{ExcalidrawDocEditor-D9RIMLLE.js → ExcalidrawDocEditor-BZ6hp6g-.js} +1 -1
  25. package/dist/public/assets/FeedbackForm-pvODZeiu.js +1 -0
  26. package/dist/public/assets/{GraphPanel-fkZRWaBc.js → GraphPanel-0HQWV49m.js} +2 -2
  27. package/dist/public/assets/{ImportSkillDialog-DxlQ_a05.js → ImportSkillDialog-DP28KtGQ.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-C7ui8Eo-.js → LintConfigEditor-B0UaKKq_.js} +1 -1
  29. package/dist/public/assets/{ManagedArtifactProperties-CSBBIAdm.js → ManagedArtifactProperties-DA5oGdwa.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-_kY6l_vm.js +1 -0
  31. package/dist/public/assets/{McpConsentDialogBody-Br5W9Pss.js → McpConsentDialogBody-Dv0o4Jcn.js} +1 -1
  32. package/dist/public/assets/{MermaidDocEditor-8nUao94a.js → MermaidDocEditor-lkyb7So2.js} +1 -1
  33. package/dist/public/assets/{PropertyDisplayRow-Byp1IIUE.js → PropertyDisplayRow-CGVpcpLj.js} +1 -1
  34. package/dist/public/assets/{ReportBugDialogBody-BCldEkeI.js → ReportBugDialogBody-Dym5hJVE.js} +1 -1
  35. package/dist/public/assets/{SchemaConfigEditor-BwwZgItz.js → SchemaConfigEditor-oSGOYGKJ.js} +1 -1
  36. package/dist/public/assets/SessionsHost-BuxUB0gY.js +2 -0
  37. package/dist/public/assets/{SettingsDialogBody-BmMhT_2k.js → SettingsDialogBody-PBVFrymR.js} +5 -5
  38. package/dist/public/assets/{ShareBranchSwitchDialog-D3iwikBy.js → ShareBranchSwitchDialog-CA-s3WM5.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveDialog-BPmOaV0V.js → ShareReceiveDialog-CMNEHbmf.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveMissDialog-Coy5-oRH.js → ShareReceiveMissDialog-hQzHTOba.js} +1 -1
  41. package/dist/public/assets/{SkillCostValue-B6TVsf2o.js → SkillCostValue-CzBrynJR.js} +1 -1
  42. package/dist/public/assets/{SkillEditBanner-B9pszjmf.js → SkillEditBanner-CN23WL35.js} +1 -1
  43. package/dist/public/assets/{SkillInstallMenu-CJzrDX6L.js → SkillInstallMenu-Bq35tbgf.js} +1 -1
  44. package/dist/public/assets/{SkillOriginInline-CZey0-WI.js → SkillOriginInline-2bCdgxP8.js} +1 -1
  45. package/dist/public/assets/{SkillToolbarControls-zTTB_G6l.js → SkillToolbarControls-IrJrSqoz.js} +1 -1
  46. package/dist/public/assets/{SlidesToolbarControls-Cee-YLUn.js → SlidesToolbarControls-LNyn37DA.js} +1 -1
  47. package/dist/public/assets/{SourceEditor-D-u3wvTQ.js → SourceEditor-DM9VYqhV.js} +1 -1
  48. package/dist/public/assets/{TerminalPanel-Cf-vSSrN.js → TerminalPanel-BjH3lk7d.js} +3 -3
  49. package/dist/public/assets/{TerminalWindowApp-BXC4QUF2.js → TerminalWindowApp-CixXB6ef.js} +1 -1
  50. package/dist/public/assets/{TextDocEditor-BLCKy42N.js → TextDocEditor-0vohEoCu.js} +1 -1
  51. package/dist/public/assets/ThreadView-CmyGhjSB.js +14 -0
  52. package/dist/public/assets/{TimelineDiffPane-BKVxf8dW.js → TimelineDiffPane-CDdFvFdm.js} +1 -1
  53. package/dist/public/assets/{agent-diff-store-9VJa6-5g.js → agent-diff-store-CDsscMHA.js} +1 -1
  54. package/dist/public/assets/alert-dialog-C8E8SkhJ.js +7 -0
  55. package/dist/public/assets/auth-state-cache-Lokz3iU3.js +11 -0
  56. package/dist/public/assets/{bug-report-send-manager-CWQo74xi.js → bug-report-send-manager-gz_CJ5k7.js} +1 -1
  57. package/dist/public/assets/client-version-DjHfUEtS.js +1 -0
  58. package/dist/public/assets/{comment-chips-BWksZgYB.js → comment-chips-BGaq35rw.js} +1 -1
  59. package/dist/public/assets/{config-provider-D2BCGlLV.js → config-provider-vC3VC3i7.js} +5 -5
  60. package/dist/public/assets/dialog-BH80AfFt.js +5 -0
  61. package/dist/public/assets/{dist-BkQJ7mnd2.js → dist-Au27GgPD2.js} +56 -56
  62. package/dist/public/assets/{doc-paths-vtzfxIAt.js → doc-paths-CVTdL1-B.js} +1 -1
  63. package/dist/public/assets/{documents-events-DyFOLelu.js → documents-events-R20cDmIc.js} +1 -1
  64. package/dist/public/assets/{file-tree-adapter-HHvj2nNS.js → file-tree-adapter-BxSl0yjg.js} +1 -1
  65. package/dist/public/assets/{file-tree-utils-D-D8igMV.js → file-tree-utils-BIFoH2gy.js} +1 -1
  66. package/dist/public/assets/{folder-config-api-B3yv7aJY.js → folder-config-api-Be8G-jCi.js} +1 -1
  67. package/dist/public/assets/globals-C5EyCd0I.css +1 -0
  68. package/dist/public/assets/i18n-DyVwFHDt.js +1 -0
  69. package/dist/public/assets/index-Be4vywEO.js +2150 -0
  70. package/dist/public/assets/{lint-config-client-CTfcCpXV.js → lint-config-client-C1IoEDsf.js} +1 -1
  71. package/dist/public/assets/{markdownlint-rule-browser-CoxOkILA.js → markdownlint-rule-browser-DpLhI_0M.js} +1 -1
  72. package/dist/public/assets/messages-AmqdyBHA.js +1 -0
  73. package/dist/public/assets/messages-BdbH6a-l.js +1 -0
  74. package/dist/public/assets/messages-BuiohaEI.js +1 -0
  75. package/dist/public/assets/messages-C0vBLfSN.js +1 -0
  76. package/dist/public/assets/messages-CzBGxal3.js +1 -0
  77. package/dist/public/assets/messages-DD5HTx_V.js +1 -0
  78. package/dist/public/assets/messages-DDi_2Hlw.js +1 -0
  79. package/dist/public/assets/messages-DeOajOQU.js +1 -0
  80. package/dist/public/assets/messages-DhZ6lpPP.js +1 -0
  81. package/dist/public/assets/messages-Dtx_ELFy.js +1 -0
  82. package/dist/public/assets/messages-PReMTqJg.js +1 -0
  83. package/dist/public/assets/messages-vcbXTfRl.js +1 -0
  84. package/dist/public/assets/navigation-targets-DJDMKeRU.js +1 -0
  85. package/dist/public/assets/{open-managed-artifact-tab-dBJBwk0w.js → open-managed-artifact-tab-CpPOT7Iy.js} +1 -1
  86. package/dist/public/assets/{pending-receive-nav-store-B5aLXTYw.js → pending-receive-nav-store-DqR4JIs3.js} +1 -1
  87. package/dist/public/assets/progress-B2alca0m.js +9 -0
  88. package/dist/public/assets/prop-types-B5K7SyBF.js +1 -0
  89. package/dist/public/assets/{receive-store-cbtGGZ9i.js → receive-store-Dy2lXJBW.js} +1 -1
  90. package/dist/public/assets/{selection-context-BcabMCnT.js → selection-context-DUde2DwZ.js} +1 -1
  91. package/dist/public/assets/skill-actions-CwMYImH9.js +1 -0
  92. package/dist/public/assets/{skill-scope-C0mo2HZh.js → skill-scope-lsPMXpYJ.js} +1 -1
  93. package/dist/public/assets/{skills-api-C_StP2ff.js → skills-api-CJg3RYWH.js} +1 -1
  94. package/dist/public/assets/{src-D3LmPlv1.js → src-Cb7rZkAU.js} +1 -1
  95. package/dist/public/assets/{tag-pill-input-DOK3Iwu7.js → tag-pill-input-B5jruNIQ.js} +1 -1
  96. package/dist/public/assets/{target-navigation-intent-iE_o5AFg.js → target-navigation-intent-DOVXDKLI.js} +1 -1
  97. package/dist/public/assets/{terminal-cli-display-BZQS2rOc.js → terminal-cli-display-D8nQE2mj.js} +1 -1
  98. package/dist/public/assets/{terminal-launch-events-DT_27wCG.js → terminal-launch-events-DhhaDUqz.js} +1 -1
  99. package/dist/public/assets/{terminal-telemetry-Zge_t1pH.js → terminal-telemetry-BCCN5ilX.js} +1 -1
  100. package/dist/public/assets/typing-burst-detector-Cl63NukZ.js +8 -0
  101. package/dist/public/assets/{uninstall-CDEBm9fT.js → uninstall-CIheoK4-.js} +1 -1
  102. package/dist/public/assets/{use-activity-panel-xYBxx5c3.js → use-activity-panel-ISBpF5B2.js} +1 -1
  103. package/dist/public/assets/{use-apply-config-color-theme-C0gjDHWs.js → use-apply-config-color-theme-VPLz6Mxc.js} +1 -1
  104. package/dist/public/assets/{use-collab-url-BBo_k1TT.js → use-collab-url-D3Pm4EW9.js} +1 -1
  105. package/dist/public/assets/{use-live-xterm-theme-DRqvSsHA.js → use-live-xterm-theme-CCEiCmHz.js} +1 -1
  106. package/dist/public/assets/{use-open-skill-CtcxRltp.js → use-open-skill-BygGs4PY.js} +1 -1
  107. package/dist/public/assets/{use-popular-skills-C8nnGJxp.js → use-popular-skills-DLGsQq-p.js} +1 -1
  108. package/dist/public/assets/{use-settings-route-BLvEoiJR.js → use-settings-route-BLVf3fNR.js} +1 -1
  109. package/dist/public/assets/{use-skill-origin-DX_4jInC.js → use-skill-origin-llurzM6S.js} +1 -1
  110. package/dist/public/assets/{use-terminal-enabled-PblA9Ksh.js → use-terminal-enabled-DaNAteOq.js} +1 -1
  111. package/dist/public/assets/use-timeline-entry-diff-D7zAtd8N.js +6 -0
  112. package/dist/public/assets/{use-workspace-BCxdx59D.js → use-workspace-6-HDvG9b.js} +1 -1
  113. package/dist/public/index.html +51 -51
  114. package/dist/public/uninstall.html +6 -6
  115. package/dist/{repair-launch-json-CtwUv4CE.mjs → repair-launch-json-Cba9A2ee.mjs} +2 -2
  116. package/dist/{repair-mcp-configs-CSIhiWby.mjs → repair-mcp-configs-BZ8Sbg4s.mjs} +2 -2
  117. package/dist/{repair-skills-D26UpUq7.mjs → repair-skills-B9KF6HMH.mjs} +2 -2
  118. package/dist/repair-skills-Kd_Yg4iC.mjs +1 -0
  119. package/dist/{resolve-project-root-C94rZ_5O.mjs → resolve-project-root-C74NWxWO.mjs} +2 -2
  120. package/dist/{skill-teardown-CbmpKJso.mjs → skill-teardown-Byb0Eg2k.mjs} +2 -2
  121. package/dist/{src-BqEF6smt.mjs → src-DHEqjDrK.mjs} +1 -1
  122. package/dist/src-DzuFrTJZ.mjs +2029 -0
  123. package/dist/src-J7PR0UbN.mjs +1 -0
  124. package/dist/{src-8l-H1eWN.mjs → src-NGM5kXuN.mjs} +2 -2
  125. package/dist/start-BdCdOX8P.mjs +1 -0
  126. package/dist/{start-CC_nXyuU.mjs → start-CaXbrQKj.mjs} +3 -3
  127. package/package.json +4 -4
  128. package/dist/constants-M3x5gx4s.mjs +0 -2
  129. package/dist/init-Bk8FhVWX.mjs +0 -1
  130. package/dist/loader-CMYX8gbo.mjs +0 -1
  131. package/dist/preview-p5ZsiV5H.mjs +0 -1
  132. package/dist/public/assets/CodeMirrorPropInput-D0vkBW6L.js +0 -3
  133. package/dist/public/assets/DocumentContext-nI82_Ey9.js +0 -38
  134. package/dist/public/assets/FeedbackForm-DtFjotdd.js +0 -1
  135. package/dist/public/assets/ManagedArtifactProperties-RWJ-WT5I.js +0 -1
  136. package/dist/public/assets/SessionsHost-Bm3gL2DW.js +0 -2
  137. package/dist/public/assets/ThreadView-BRSCN73i.js +0 -14
  138. package/dist/public/assets/alert-dialog-Cx4P6Ih4.js +0 -7
  139. package/dist/public/assets/auth-state-cache-BGdHT3yJ.js +0 -11
  140. package/dist/public/assets/client-version-DD4hGHyX.js +0 -1
  141. package/dist/public/assets/dialog-CNGLHo4Y.js +0 -5
  142. package/dist/public/assets/globals-Bg7TE4FR.css +0 -1
  143. package/dist/public/assets/i18n-UJBgk95d.js +0 -1
  144. package/dist/public/assets/index-UY97Q8v-.js +0 -2098
  145. package/dist/public/assets/messages-B7csyV27.js +0 -1
  146. package/dist/public/assets/messages-BcR8jLMO.js +0 -1
  147. package/dist/public/assets/messages-Bg0RMNN1.js +0 -1
  148. package/dist/public/assets/messages-Bg1eGvm2.js +0 -1
  149. package/dist/public/assets/messages-CZE1y4NZ.js +0 -1
  150. package/dist/public/assets/messages-C_pdrnaV.js +0 -1
  151. package/dist/public/assets/messages-C_ximtJ3.js +0 -1
  152. package/dist/public/assets/messages-CmkoIyvq.js +0 -1
  153. package/dist/public/assets/messages-DDcoa_2T.js +0 -1
  154. package/dist/public/assets/messages-DeIEbqwd.js +0 -1
  155. package/dist/public/assets/messages-Dv8wA9Ym.js +0 -1
  156. package/dist/public/assets/messages-S7GnIPsZ.js +0 -1
  157. package/dist/public/assets/navigation-targets-CMeQ2nTj.js +0 -1
  158. package/dist/public/assets/progress-DDXDWJkv.js +0 -9
  159. package/dist/public/assets/prop-types-Dw4i5Pzf.js +0 -1
  160. package/dist/public/assets/skill-actions-dNZISPM-.js +0 -1
  161. package/dist/public/assets/typing-burst-detector-9a9I_C3E.js +0 -8
  162. package/dist/public/assets/use-timeline-entry-diff-BbdgaWhQ.js +0 -6
  163. package/dist/repair-skills-BxzzWVm-.mjs +0 -1
  164. package/dist/src-BHDHmhMl.mjs +0 -2029
  165. package/dist/src-CohGVfRj.mjs +0 -1
  166. package/dist/start-BjZWHsvR.mjs +0 -1
  167. /package/dist/public/assets/{globals-Dad_9qHk.js → globals-BRu8eHw9.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{bs as e}from"./src-tR2kRwXj.mjs";import{a as t,m as n,s as r}from"./resolve-project-root-C94rZ_5O.mjs";import{d as i,v as a}from"./init-D53VmdHm.mjs";import{t as o}from"./mcp-migrate-event-9DFnNzHa.mjs";import{homedir as s}from"node:os";function c(e){let n=e.logger??d,i=e.home??s(),a=[];if(e.reclaimDisableEnv===`1`)return n({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=r[o],s=l(()=>t.configPath(``,i));if(s!==null&&a.push(u({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:n})),t.projectConfigPath){let r=t.projectConfigPath,i=l(()=>r(e.projectDir));i!==null&&a.push(u({scope:`project`,editorId:o,target:t,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:n}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function l(e){try{return e()}catch{return null}}function u(t){let r={scope:t.scope,editorId:t.editorId,configPath:t.configPath},s=i(t.target,t.cwd,t.home,t.configPathOverride);if(s===null)return{...r,outcome:`no-entry`};if(t.editorId===`pi`){if(n(s))return{...r,outcome:`canonical`}}else{let n=e(s);if(n.kind===`recognized`&&n.disposition===`keep`)return{...r,outcome:`canonical`};if(n.kind===`declined`&&t.scope===`project`)return t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:n.reason}),{...r,outcome:`declined`,reason:n.reason}}t.logger(o({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:s}));let c=a(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(c.action===`failed`){let e=c.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...r,outcome:`write-failed`,error:e}}return c.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:c.declineReason}),{...r,outcome:`declined`}):{...r,outcome:`repaired`}}function d(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{c as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-CSIhiWby.mjs.map
1
+ import{bs as e}from"./src-tR2kRwXj.mjs";import{a as t,m as n,s as r}from"./resolve-project-root-C74NWxWO.mjs";import{d as i,v as a}from"./init-D42n1RRR.mjs";import{t as o}from"./mcp-migrate-event-9DFnNzHa.mjs";import{homedir as s}from"node:os";function c(e){let n=e.logger??d,i=e.home??s(),a=[];if(e.reclaimDisableEnv===`1`)return n({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=r[o],s=l(()=>t.configPath(``,i));if(s!==null&&a.push(u({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:n})),t.projectConfigPath){let r=t.projectConfigPath,i=l(()=>r(e.projectDir));i!==null&&a.push(u({scope:`project`,editorId:o,target:t,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:n}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function l(e){try{return e()}catch{return null}}function u(t){let r={scope:t.scope,editorId:t.editorId,configPath:t.configPath},s=i(t.target,t.cwd,t.home,t.configPathOverride);if(s===null)return{...r,outcome:`no-entry`};if(t.editorId===`pi`){if(n(s))return{...r,outcome:`canonical`}}else{let n=e(s);if(n.kind===`recognized`&&n.disposition===`keep`)return{...r,outcome:`canonical`};if(n.kind===`declined`&&t.scope===`project`)return t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:n.reason}),{...r,outcome:`declined`,reason:n.reason}}t.logger(o({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:s}));let c=a(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(c.action===`failed`){let e=c.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...r,outcome:`write-failed`,error:e}}return c.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:c.declineReason}),{...r,outcome:`declined`}):{...r,outcome:`repaired`}}function d(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{c as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-BZ8Sbg4s.mjs.map
@@ -1,4 +1,4 @@
1
- import{q as e,zs as t}from"./src-tR2kRwXj.mjs";import{ar as n,cr as r,gn as i,hr as a,ir as o,lr as s,pr as c,ur as l,xr as u,yr as d}from"./src-BHDHmhMl.mjs";import{c as f,n as p,s as m,x as h}from"./resolve-project-root-C94rZ_5O.mjs";import{n as g,s as _,t as v}from"./colors-DSyAT9Cz.mjs";import{n as y,r as b,t as x}from"./skill-teardown-CbmpKJso.mjs";import{basename as S,dirname as C,join as w,relative as T,resolve as E}from"node:path";import{existsSync as D,mkdirSync as O,readFileSync as k,readdirSync as A,rmSync as j,statSync as M,writeFileSync as N}from"node:fs";import{homedir as P}from"node:os";import{createInterface as F}from"node:readline/promises";const I={existsSync:e=>D(e),isDirectory:e=>{try{return M(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>A(e),readFileSync:e=>k(e),writeFileSync:(e,t)=>{N(e,t)},mkdirSync:(e,t)=>{O(e,t)},rmSync:(e,t)=>{j(e,t)}},L={resolveProjectBundledSkillDir:()=>a(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>a(e,{checkDesktop:!1}),readBundledVersion:()=>n(),readRecordedVersion:e=>r(e,`cli-hosts`),writeRecordedVersion:(e,t)=>l(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>c(e),readBundleDecision:(e,t)=>o(e,t),writeBundleDecision:(e,t,n)=>s(e,t,n),removeBundleFromDisk:(e,t)=>b(e,t)};function R(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function z(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(C(t),{recursive:!0}),B(e,t,n)}function B(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=w(e,r),a=w(t,r);n.isDirectory(i)?B(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function V(e,n,r){return r.existsSync(w(e,`.agents`,`skills`,n))||t.some(t=>r.existsSync(w(e,t.skillsRoot,n)))}function H(e,n,r,i,a,o){let s=[],c=w(e,`.agents`,`skills`,n);if(V(e,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of t){let t=w(e,r.skillsRoot,n);if(t!==c){if(!i.existsSync(w(e,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-host-absent`});continue}i.existsSync(t)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(w(e,`.agents`));if(l&&i.existsSync(c))s.push({kind:`central`,path:c,outcome:`skipped-present`});else if(l)try{z(r,c,i),s.push({kind:`central`,path:c,outcome:`written`}),a({event:`user-skill-reclaim-central-written`,scope:`user`,path:c,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`central`,path:c,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-central-failed`,scope:`user`,path:c,error:t})}for(let l of t){let t=w(e,l.hostDir),u=w(e,l.skillsRoot,n);if(u===c){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!i.existsSync(t)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(i.existsSync(u)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-present`});continue}try{z(r,u,i),s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`written`}),a({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,error:t})}}return{entries:s,anyWritten:s.some(e=>e.outcome===`written`),anyDestinationSucceeded:s.some(e=>e.outcome===`written`||e.outcome===`skipped-present`)}}function U(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function W(e,t,n,r){if(!e||!t)return!1;let a;try{a=e.configPath(n,r)}catch{return!1}let o=e=>w(i(C(e)),S(e));return o(t)===o(a)}function G(e,t,n,r,i){let a;try{a=n.resolveProjectBundledSkillDir()}catch(e){return i({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let o=[];for(let n of f){let s=w(e,n.hostDir,`skills`,`open-knowledge`),c=w(s,`SKILL.md`);if(r.existsSync(c)){o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`present`});continue}let l=m[n.editorId],u=l?.projectConfigPath?.(e);if(W(l,u,e,t)){o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`skipped-global-collision`}),i({event:`project-skill-reclaim-skipped-global-collision`,scope:`project`,editorId:n.editorId,path:s});continue}if(!U(u,r)){o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`no-token`}),i({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:n.editorId,path:s});continue}try{p(s,e),z(a,s,r),o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`created`}),i({event:`project-skill-reclaim-created`,scope:`project`,editorId:n.editorId,path:s})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`failed`,error:t}),i({event:`project-skill-reclaim-failed`,scope:`project`,editorId:n.editorId,path:s,error:t})}}return{outcome:`done`,entries:o}}async function K(t,n,r,i){let a=e=>{n.recordEvent(e).catch(()=>{})},o=()=>new Date().toISOString(),s;try{s=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),a({ts:o(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let c;try{c=await n.readRecordedVersion(t)}catch(e){i({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),c=null}let l=[],f=null;for(let e of u)try{l.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(l.length===0)return i({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),a({ts:o(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let a of l){let o=d[a.id],s=V(t,o,r),c=await n.readBundleDecision(t,o).catch(()=>null);if(!e(c,{installedOnDisk:s})){if(s)try{n.removeBundleFromDisk(t,a.id),i({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:a.id})}catch(e){i({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}continue}if(c===null&&s)try{await n.writeBundleDecision(t,o,!0)}catch(e){i({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}p.push(a)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>V(t,d[e.id],r));if(c!==null&&c===s&&m)return i({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:s}),{outcome:`skipped`,reason:`version-current`};let h=[],g=l.length===u.length,_=[];for(let{id:e,sourceDir:n}of p){let a=H(t,d[e],n,r,i,s);h.push(...a.entries),_.push({id:e,anyWritten:a.anyWritten,landed:a.anyDestinationSucceeded,centralFailed:a.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:a.entries.some(e=>e.kind===`host`&&e.outcome===`failed`)})}let v=_.some(e=>e.centralFailed),y=_.every(e=>e.landed);if(g&&y&&!v){let e=null;try{await n.writeRecordedVersion(t,s),i({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:s})}catch(t){e=t instanceof Error?t.message:String(t),i({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:s,error:e})}for(let{id:t,anyWritten:n}of _)a({ts:o(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:s,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{g||a({ts:o(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:s,reason:`bundle-unresolved`});for(let{id:e,centralFailed:t,hostFailed:n}of _)!t&&!n||a({ts:o(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:`failed`,version:s,reason:n?`all-writes-failed`:`central-write-failed`})}return{outcome:`done`,version:s,entries:h}}async function q(e){let t=e.logger??R,n=e.fs??I,r=e.home??P(),i={...L,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=G(e.projectDir,r,i,n,t),o=await K(r,i,n,t),s=y(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=x(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 J(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 Y(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,o=e.project.entries.filter(e=>e.outcome===`skipped-global-collision`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`),o>0&&t.push(` Skipped ${o} host(s) whose project config path is their user-global config (not a project directory).`)}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{q as e,zs as t}from"./src-tR2kRwXj.mjs";import{ar as n,cr as r,gn as i,hr as a,ir as o,lr as s,pr as c,ur as l,xr as u,yr as d}from"./src-DzuFrTJZ.mjs";import{c as f,n as p,s as m,x as h}from"./resolve-project-root-C74NWxWO.mjs";import{n as g,s as _,t as v}from"./colors-DSyAT9Cz.mjs";import{n as y,r as b,t as x}from"./skill-teardown-Byb0Eg2k.mjs";import{basename as S,dirname as C,join as w,relative as T,resolve as E}from"node:path";import{existsSync as D,mkdirSync as O,readFileSync as k,readdirSync as A,rmSync as j,statSync as M,writeFileSync as N}from"node:fs";import{homedir as P}from"node:os";import{createInterface as F}from"node:readline/promises";const I={existsSync:e=>D(e),isDirectory:e=>{try{return M(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>A(e),readFileSync:e=>k(e),writeFileSync:(e,t)=>{N(e,t)},mkdirSync:(e,t)=>{O(e,t)},rmSync:(e,t)=>{j(e,t)}},L={resolveProjectBundledSkillDir:()=>a(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>a(e,{checkDesktop:!1}),readBundledVersion:()=>n(),readRecordedVersion:e=>r(e,`cli-hosts`),writeRecordedVersion:(e,t)=>l(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>c(e),readBundleDecision:(e,t)=>o(e,t),writeBundleDecision:(e,t,n)=>s(e,t,n),removeBundleFromDisk:(e,t)=>b(e,t)};function R(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function z(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(C(t),{recursive:!0}),B(e,t,n)}function B(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=w(e,r),a=w(t,r);n.isDirectory(i)?B(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function V(e,n,r){return r.existsSync(w(e,`.agents`,`skills`,n))||t.some(t=>r.existsSync(w(e,t.skillsRoot,n)))}function H(e,n,r,i,a,o){let s=[],c=w(e,`.agents`,`skills`,n);if(V(e,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of t){let t=w(e,r.skillsRoot,n);if(t!==c){if(!i.existsSync(w(e,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-host-absent`});continue}i.existsSync(t)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:t,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(w(e,`.agents`));if(l&&i.existsSync(c))s.push({kind:`central`,path:c,outcome:`skipped-present`});else if(l)try{z(r,c,i),s.push({kind:`central`,path:c,outcome:`written`}),a({event:`user-skill-reclaim-central-written`,scope:`user`,path:c,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`central`,path:c,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-central-failed`,scope:`user`,path:c,error:t})}for(let l of t){let t=w(e,l.hostDir),u=w(e,l.skillsRoot,n);if(u===c){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!i.existsSync(t)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(i.existsSync(u)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-present`});continue}try{z(r,u,i),s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`written`}),a({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,preexisting:!1,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`failed`,error:t}),a({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:l.editorId,hostDir:l.hostDir,path:u,error:t})}}return{entries:s,anyWritten:s.some(e=>e.outcome===`written`),anyDestinationSucceeded:s.some(e=>e.outcome===`written`||e.outcome===`skipped-present`)}}function U(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function W(e,t,n,r){if(!e||!t)return!1;let a;try{a=e.configPath(n,r)}catch{return!1}let o=e=>w(i(C(e)),S(e));return o(t)===o(a)}function G(e,t,n,r,i){let a;try{a=n.resolveProjectBundledSkillDir()}catch(e){return i({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let o=[];for(let n of f){let s=w(e,n.hostDir,`skills`,`open-knowledge`),c=w(s,`SKILL.md`);if(r.existsSync(c)){o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`present`});continue}let l=m[n.editorId],u=l?.projectConfigPath?.(e);if(W(l,u,e,t)){o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`skipped-global-collision`}),i({event:`project-skill-reclaim-skipped-global-collision`,scope:`project`,editorId:n.editorId,path:s});continue}if(!U(u,r)){o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`no-token`}),i({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:n.editorId,path:s});continue}try{p(s,e),z(a,s,r),o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`created`}),i({event:`project-skill-reclaim-created`,scope:`project`,editorId:n.editorId,path:s})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({editorId:n.editorId,hostDir:n.hostDir,path:s,outcome:`failed`,error:t}),i({event:`project-skill-reclaim-failed`,scope:`project`,editorId:n.editorId,path:s,error:t})}}return{outcome:`done`,entries:o}}async function K(t,n,r,i){let a=e=>{n.recordEvent(e).catch(()=>{})},o=()=>new Date().toISOString(),s;try{s=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),a({ts:o(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let c;try{c=await n.readRecordedVersion(t)}catch(e){i({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),c=null}let l=[],f=null;for(let e of u)try{l.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(l.length===0)return i({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),a({ts:o(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let a of l){let o=d[a.id],s=V(t,o,r),c=await n.readBundleDecision(t,o).catch(()=>null);if(!e(c,{installedOnDisk:s})){if(s)try{n.removeBundleFromDisk(t,a.id),i({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:a.id})}catch(e){i({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}continue}if(c===null&&s)try{await n.writeBundleDecision(t,o,!0)}catch(e){i({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}p.push(a)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>V(t,d[e.id],r));if(c!==null&&c===s&&m)return i({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:s}),{outcome:`skipped`,reason:`version-current`};let h=[],g=l.length===u.length,_=[];for(let{id:e,sourceDir:n}of p){let a=H(t,d[e],n,r,i,s);h.push(...a.entries),_.push({id:e,anyWritten:a.anyWritten,landed:a.anyDestinationSucceeded,centralFailed:a.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:a.entries.some(e=>e.kind===`host`&&e.outcome===`failed`)})}let v=_.some(e=>e.centralFailed),y=_.every(e=>e.landed);if(g&&y&&!v){let e=null;try{await n.writeRecordedVersion(t,s),i({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:s})}catch(t){e=t instanceof Error?t.message:String(t),i({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:s,error:e})}for(let{id:t,anyWritten:n}of _)a({ts:o(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:s,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{g||a({ts:o(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:s,reason:`bundle-unresolved`});for(let{id:e,centralFailed:t,hostFailed:n}of _)!t&&!n||a({ts:o(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:`failed`,version:s,reason:n?`all-writes-failed`:`central-write-failed`})}return{outcome:`done`,version:s,entries:h}}async function q(e){let t=e.logger??R,n=e.fs??I,r=e.home??P(),i={...L,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=G(e.projectDir,r,i,n,t),o=await K(r,i,n,t),s=y(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=x(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 J(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 Y(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,o=e.project.entries.filter(e=>e.outcome===`skipped-global-collision`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`),o>0&&t.push(` Skipped ${o} host(s) whose project config path is their user-global config (not a project directory).`)}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 X(){return new h(`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 q({projectDir:E(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null,confirmLegacyCleanup:t=>Z(t,{yes:e.yes===!0})});process.stdout.write(`${Y(t)}\n`),process.exitCode=J(t)})}async function Z(e,t){let n=P(),r=e=>`~/${T(n,e)}`,i=t.input??process.stdin,a=[``,v(`A previous version of OpenKnowledge installed its skill into agent tools you may never have used.`),g(`(Versions before 0.42 wrote to every host a third-party installer knew about — see issue #820.)`)];if(e.skillDirs.length>0&&a.push(``,`${v(`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(``,`${v(t)} ${e.emptyDirs.length}`,...e.emptyDirs.map(e=>` ${r(e)}`))}if(a.push(``,g(`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(`${_("Not a terminal — skipping cleanup. Re-run with `ok repair-skills --yes` to remove these.")}\n`),!1;let o=F({input:i,output:process.stdout});try{let e=(await o.question(`\n${v(`Remove them?`)} ${g(`[y/N] `)}`)).trim().toLowerCase();return e===`y`||e===`yes`}finally{o.close()}}export{X as n,q as t};
4
- //# sourceMappingURL=repair-skills-D26UpUq7.mjs.map
4
+ //# sourceMappingURL=repair-skills-B9KF6HMH.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-B9KF6HMH.mjs";export{e as repairSkills};
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{As as r,Ps as i,Rs as a,ks as o,xs as s}from"./src-tR2kRwXj.mjs";import{Ir as c,Pi as l,gn as u,hr as d,kn as f}from"./src-BHDHmhMl.mjs";import{execFileSync as p}from"node:child_process";import{basename as m,dirname as h,isAbsolute as g,join as _,posix as v,relative as y,resolve as b,sep as x,win32 as S}from"node:path";import{cpSync as ee,existsSync as C,lstatSync as te,mkdirSync as ne,readFileSync as re,realpathSync as w,rmSync as ie,statSync as ae}from"node:fs";import{homedir as T}from"node:os";var E=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),D=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),O=n((e=>{let{humanReadableArgName:t}=D();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
1
+ import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{As as r,Ps as i,Rs as a,ks as o,xs as s}from"./src-tR2kRwXj.mjs";import{Ir as c,Pi as l,gn as u,hr as d,kn as f}from"./src-DzuFrTJZ.mjs";import{execFileSync as p}from"node:child_process";import{basename as m,dirname as h,isAbsolute as g,join as _,posix as v,relative as y,resolve as b,sep as x,win32 as S}from"node:path";import{cpSync as ee,existsSync as C,lstatSync as te,mkdirSync as ne,readFileSync as re,realpathSync as w,rmSync as ie,statSync as ae}from"node:fs";import{homedir as T}from"node:os";var E=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),D=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),O=n((e=>{let{humanReadableArgName:t}=D();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
2
2
  `)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
3
3
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
4
4
  `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),k=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
@@ -53,4 +53,4 @@ foreach ($d in $dirs) {
53
53
  }
54
54
  [Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g @inkeep/open-knowledge), then restart your editor')
55
55
  exit 127`,I=`// ok-pi-bridge`,L=`${I}-v1`,be=`ok-pi-managed-extension`;function xe(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(L)}return!1}function R(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=b(e);if(m(t)===`cli.mjs`&&m(h(t))===`dist`)return t;let n=t.split(x),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return _(i.length===0?x:i.join(x),`packages`,`cli`,`dist`,`cli.mjs`)}function z(e={}){return e.mode===`dev`?{command:M,args:[R(),`mcp`],env:{...N}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{command:`/bin/sh`,args:[`-l`,`-c`,P]}}function Se(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[M,R(),`mcp`],environment:{...N}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,P]}}function Ce(e){if(typeof e!=`object`||!e)return!1;let t=e;return B(t,z({mode:`published`,platformName:`darwin`}))||B(t,z({mode:`published`,platformName:`win32`}))}function B(e,t){return Object.keys(e).length===Object.keys(t).length?we(e,t):!1}function we(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function V(e,t){let n=e=>typeof e==`string`&&e.includes(`# ok-mcp`);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`?e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3]):!1}function Te(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:V(t.args,t.command)}function Ee(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&V(r,n)}function H(e){return e===`win32`?S:v}function De(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA||i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME||i.join(n,`.config`)}function Oe(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.claude.json`)}function U(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env;if(t===`darwin`)return v.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??S.join(n,`AppData`,`Roaming`);return S.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.cursor`,`mcp.json`)}function ke(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).CODEX_HOME??H(t).join(n,`.codex`)}function G(e={}){return H(e.platformName??process.platform).join(ke(e),`config.toml`)}function K(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=(e.env??process.env).COPILOT_HOME??H(t).join(n,`.copilot`);return H(t).join(r,`mcp-config.json`)}function Ae(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function q(e={}){return H(e.platformName??process.platform).join(Ae(e),`opencode.json`)}function je(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.openclaw`,`openclaw.json`)}function Me(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.hermes`,`config.yaml`)}function J(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).PI_CODING_AGENT_DIR??H(t).join(n,`.pi`,`agent`)}function Ne(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function Pe(e,t){let n=H(t),r=n.join(e,`.lmstudio`,`mcp.json`),i=n.join(e,`.cache`,`lm-studio`,`mcp.json`);return t===`darwin`?[i,r]:[r,i]}function Y(e={}){let t=e.platformName??process.platform,n=Pe(e.home??T(),t);return n.find(e=>C(e))||n.find(e=>C(h(e)))||n[0]}const X={claude:{id:`claude`,label:j.claude,configPath:(e,t)=>Oe({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.claude`),projectConfigPath:e=>_(e,`.mcp.json`),projectSkillPath:e=>_(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:j[`claude-desktop`],configPath:(e,t)=>U({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(U({home:t}))},cursor:{id:`cursor`,label:j.cursor,configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(W({home:t})),projectConfigPath:e=>_(e,`.cursor`,`mcp.json`),projectSkillPath:e=>_(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:j.codex,configPath:(e,t)=>G({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(G({home:t})),projectConfigPath:e=>_(e,`.codex`,`config.toml`),projectSkillPath:e=>_(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:j.copilot,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(K({home:t})),projectSkillPath:e=>_(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:j.opencode,configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>s,buildEntry:(e,t)=>Se(t),scope:`global`,detectPath:(e,t)=>h(q({home:t})),projectConfigPath:e=>_(e,`opencode.json`),projectSkillPath:e=>_(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:j.openclaw,configPath:(e,t)=>je({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:j.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>J({home:t}),projectConfigPath:e=>_(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>_(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:j.antigravity,configPath:(e,t)=>Ne({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:j[`lm-studio`],configPath:(e,t)=>Y({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(Y({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:j.hermes,configPath:(e,t)=>Me({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.hermes`),offerOnlyWhenDetected:!0}};function Fe(e){let t=e.filter(e=>!Object.hasOwn(X,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${A.join(`, `)}`);return e.map(e=>X[e])}function Z(e,t){let n;try{n=te(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Q(e,t)}function Ie(e,t){Q(e,t)}function Q(e,t){let n;try{n=w(t)}catch{n=b(t)}let r=h(e);for(;r.length>1&&r!==x;){let t;try{t=w(r)}catch(e){if(e.code===`ENOENT`){r=h(r);continue}throw e}let i=y(n,t);if(i===``||!i.startsWith(`..`)&&!g(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Le(e,t,n){try{if(ae(n).size>10485760)return!1}catch{return!1}let r;try{r=re(n,`utf-8`)}catch{return!1}let i=[],a=c(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!$(a))return!1;let o=a[e.topLevelKey];if(!$(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return $(s)?$(s[e.serverName(t)]):!1}function Re(e,t,n={}){if(!a.includes(e.id))return!0;try{return Le(e,t,e.configPath(t,n.home))}catch{return!1}}function ze(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!Re(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=d(`project`,{checkDesktop:!0}),i=h(r);Z(i,t);let a=C(r)?`overwritten`:`written`;return ie(i,{recursive:!0,force:!0}),ne(h(i),{recursive:!0}),ee(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function Be(e,t){let n=y(u(t),u(e));return n.length>0&&!n.startsWith(`..`)&&!g(n)}const Ve=e=>{try{let t=p(`git`,[`rev-parse`,`--show-toplevel`],l({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function He(e,t={}){let n=t.homeDir??T(),r=t.gitTopLevel??Ve,i=b(e),a;try{a=w(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(f(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=h(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&Be(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}export{_e as C,pe as S,H as _,A as a,J as b,ye as c,be as d,z as f,Ee as g,Ce as h,ze as i,I as l,xe as m,Z as n,j as o,Te as p,Ie as r,X as s,He as t,L as u,De as v,he as x,Fe as y};
56
- //# sourceMappingURL=resolve-project-root-C94rZ_5O.mjs.map
56
+ //# sourceMappingURL=resolve-project-root-C74NWxWO.mjs.map
@@ -1,2 +1,2 @@
1
- import{zs as e}from"./src-tR2kRwXj.mjs";import{xr as t,yr as n}from"./src-BHDHmhMl.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...t.map(e=>n[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of t){let t=n[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let n of e)o.push({path:a(i,n.skillsRoot,t),bundleId:r,scope:`host`,hostDir:n.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
- //# sourceMappingURL=skill-teardown-CbmpKJso.mjs.map
1
+ import{zs as e}from"./src-tR2kRwXj.mjs";import{xr as t,yr as n}from"./src-DzuFrTJZ.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...t.map(e=>n[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of t){let t=n[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let n of e)o.push({path:a(i,n.skillsRoot,t),bundleId:r,scope:`host`,hostDir:n.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
+ //# sourceMappingURL=skill-teardown-Byb0Eg2k.mjs.map
@@ -1 +1 @@
1
- import{Ac as e,Hs as t,Ts as n,U as r,Ws as i,ec as a,q as o,ws as s,x as c,xs as l,y as u}from"./src-tR2kRwXj.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Ci as O,Cn as k,Cr as A,Ct as j,D as M,Da as N,Di as P,Dn as F,Dr as I,Dt as L,E as R,Ea as z,Ei as B,En as V,Er as H,Et as U,F as W,Fi as G,Fn as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Hr as ne,Ht as re,I as ie,Ii as ae,In as oe,It as se,J as ce,Ji as le,Jn as ue,Jr as de,Jt as fe,K as pe,Ki as me,Kn as he,Kr as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lt as xe,M as Se,Mi as Ce,Mn as we,Mr as Te,Mt as Ee,N as De,Ni as Oe,Nn as ke,Nt as Ae,O as je,Oa as Me,Oi as Ne,On as Pe,Or as Fe,Ot as Ie,P as Le,Pi as Re,Pn as ze,Pt as Be,Q as Ve,Qi as He,Qn as Ue,Qr as We,Qt as Ge,R as Ke,Ri as qe,Rn as Je,Rr as Ye,Rt as Xe,S as Ze,Sa as Qe,Si as $e,Sn as et,Sr as tt,St as nt,T as rt,Ta as it,Ti as at,Tn as ot,Tr as st,Tt as ct,U as lt,Ui as ut,Un as dt,Ur as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vr as _t,Vt as vt,W as yt,Wi as bt,Wn as xt,Wr as St,Wt as Ct,X as wt,Xi as Tt,Xn as Et,Xr as Dt,Xt as Ot,Y as kt,Yi as At,Yn as jt,Yr as Mt,Yt as Nt,Z as Pt,Zi as Ft,Zn as It,Zr as Lt,Zt as Rt,_ as zt,_a as Bt,_n as Vt,_r as Ht,a as Ut,aa as Wt,ai as Gt,an as Kt,ar as qt,at as Jt,b as Yt,ba as Xt,bi as Zt,bn as Qt,br as $t,bt as en,c as tn,ca as nn,ci as rn,cn as an,cr as on,ct as sn,d as cn,da as ln,di as un,dn,dr as fn,dt as pn,ea as mn,ei as hn,en as gn,er as _n,et as vn,f as yn,fa as bn,fi as xn,fn as Sn,fr as Cn,g as wn,ga as Tn,gi as En,gn as Dn,gr as On,h as kn,ha as An,hi as jn,hn as Mn,hr as Nn,i as Pn,ia as Fn,ii as In,in as Ln,ir as Rn,it as zn,j as Bn,ji as Vn,jn as Hn,jr as Un,jt as Wn,k as Gn,ki as Kn,kn as qn,kr as Jn,kt as Yn,l as Xn,la as Zn,li as Qn,ln as $n,lr as er,lt as tr,m as nr,ma as rr,mi as ir,mn as ar,mr as or,n as sr,na as cr,ni as lr,nn as ur,nr as dr,nt as fr,o as pr,oa as mr,oi as hr,on as gr,or as _r,ot as vr,p as yr,pa as br,pi as xr,pn as Sr,pr as Cr,q as wr,qi as Tr,qn as Er,qr as Dr,qt as Or,r as kr,ra as Ar,ri as jr,rn as Mr,rr as Nr,rt as Pr,s as Fr,sa as Ir,si as Lr,sn as Rr,sr as zr,st as Br,t as Vr,ta as Hr,ti as Ur,tn as Wr,tr as Gr,tt as Kr,u as qr,ua as Jr,ui as Yr,un as Xr,ur as Zr,ut as Qr,v as $r,va as ei,vi as ti,vn as ni,vr as ri,vt as ii,w as ai,wa as oi,wi as si,wn as ci,wr as li,wt as ui,x as di,xa as fi,xi as pi,xn as mi,xr as hi,xt as gi,y as _i,ya as vi,yi,yn as bi,yr as xi,yt as Si,z as Ci,zi as wi,zn as Ti,zr as Ei,zt as Di}from"./src-BHDHmhMl.mjs";import{C as Oi,E as ki,T as Ai,_ as ji,b as Mi,c as Ni,d as Pi,g as Fi,i as Ii,l as Li,m as Ri,n as zi,p as Bi,s as Vi,t as Hi,u as Ui,v as Wi,w as Gi,x as Ki,y as qi}from"./fs-traced-2B_-YK-g.mjs";import{a as Ji,d as Yi,f as Xi,i as Zi,l as Qi,n as $i,r as ea,t as ta,u as na}from"./logger-Dq-cRhcP.mjs";import{C as ra,S as ia,_ as aa,a as oa,b as sa,c as ca,d as la,f as ua,g as da,h as fa,i as pa,l as ma,m as ha,n as ga,o as _a,p as va,r as ya,s as ba,t as xa,u as Sa,x as Ca}from"./server-lock-Dngwkd_U.mjs";export{vi as AGENT_ID_MAX_LEN,Xt as AGENT_ID_RE,G as AGENT_WRITE_ORIGIN,z as AcpPermissionStore,D as AcpRegistry,pi as AcpThreadManager,yi as AgentFocusBroadcaster,ti as AgentPresenceBroadcaster,ae as AgentSessionCapacityError,ye as AgentSessionManager,Si as AutoStartDisabledError,Ht as BUNDLE_IDS,ri as BUNDLE_SCOPE,xi as BUNDLE_SKILL_NAME,Et as BacklinkIndex,Tr as CC1Broadcaster,i as CC1_CONTRACT_VERSION,gr as CONFIG_FILENAME,xt as CONFLICT_MARKER_RE,w as CURSOR_BUNDLE_PATHS_BY_PLATFORM,_i as ConfigSchema,f as DEFAULT_CHECKPOINT_RETENTION,In as DEFAULT_EMBEDDINGS_DIMENSIONS,Di as DEFAULT_PACK_ID,lt as DocumentDurabilityState,Gt as EMBEDDINGS_API_KEY_ENV,Vr as EPHEMERAL_PROJECT_DIR_PREFIX,ni as ExposureConsentError,oi as FEATURED_AGENT_IDS,mn as FILE_SYSTEM_WRITER,ue as FILE_WATCHER_ORIGIN,We as FileEmbeddingsBackend,Wr as GIT_PREFLIGHT_FAIL_SPAN_NAME,Hr as GIT_UPSTREAM_WRITER,N as GitDirAccessError,B as GitNotAvailableError,P as GitTooOldError,en as HOCUSPOCUS_AUTH_REJECTION_REASONS,gi as HocuspocusAuthRejection,nt as HocuspocusAuthTokenSchema,ar as HomeProjectRootError,ge as INSTALLED_AGENTS_SCHEMES,Qr as JSON_SCHEMA_DIALECT_2020_12,t as LINEAGE_EPOCH_KEY,x as LIVE_DERIVED_INDEX_DEBOUNCE_MS,T as LOG_MD_TEMPLATE,Yn as MANAGED_RENAME_ORIGIN,$e as MAX_ACP_THREADS,qe as MAX_AGENT_SESSIONS,si as MCP_CONNECTION_ID_HEADER,l as MCP_SERVER_NAME,wi as MIN_EVICTABLE_IDLE_MS,Ne as MIN_GIT_VERSION,yt as MISSING_OK_CONFIG_MESSAGE,Me as MalformedGitPointerError,fr as McpLogger,J as MissingOkConfigError,ht as OBSERVER_SYNC_ORIGIN,Rr as OK_OKIGNORE_TEMPLATE,$t as ONBOARDING_BUNDLE_IDS,s as ORPHAN_MODES,e as PROTOCOL_VERSION,ta as PinoLogger,ma as ProcessLockCollisionError,cn as ProjectGitInitError,b as ROLLBACK_ORIGIN,an as ROOT_GITIGNORE_TEMPLATE,sa as RUNTIME_VERSION,cr as SERVICE_WRITER,Cn as SKILL_INSTALL_EVENTS_FILE_REL,r as SKILL_STATE_TARGETS,vt as STARTER_FOLDERS,re as STARTER_FOLDER_FRONTMATTER_FILENAME,pt as STARTER_PACKS,Ct as STARTER_PACK_IDS,Q as STARTER_TEMPLATES,M as STATE_MANIFEST_FILENAME,Ca as STATE_SCHEMA_VERSION,a as SYSTEM_DOC_NAME,Rt as SeedPrerequisiteError,Ge as SeedRootDirError,xa as ServerLockCollisionError,sr as SingleFileNotAFileError,kr as SingleFileNotFoundError,Pn as SingleFileNotMarkdownError,je as StateManifestError,jt as TagIndex,hi as USER_GLOBAL_BUNDLE_IDS,Wn as __getShowAllWalkStatsForTesting,Ee as __resetShowAllWalkStatsForTesting,Sa as acquireProcessLock,ga as acquireServerLock,S as applyAgentMarkdownWrite,te as applyExternalChange,Xe as applySeed,Gn as assertCompatibleStateManifest,Kn as assertGitAvailable,v as assertNeverDiskEvent,Mn as assertNotHomeProjectRoot,Zt as attachAcpThreadSocket,ii as attachIdleShutdown,Yt as bootServer,Ue as buildAndOpenSkill,$n as buildConfigYmlContent,Pt as buildExecResult,bi as buildIngressPolicy,O as buildOkMcpStdioCommand,or as buildSkillZip,_e as buildStarterFolderFrontmatterYaml,Ar as buildWipTree,tt as bundleSkillMdPath,m as canonicalProjectKey,Dn as canonicalizeForCompare,Hn as classifyEvents,Hi as classifyFsPath,hn as clearAllEmbeddingsKeys,Lr as clearContributors,Or as coercePackId,u as colorFromSeed,Fn as commitUpstreamImport,Wt as commitWip,mr as commitWipFromTree,_ as compareSemver,st as composeEffectiveLinterConfig,H as composeFrontmatterSchemasConfig,X as containsConflictMarkers,we as contentHash,rn as contributorCount,ie as countShadowObjects,ve as countStaleAgentWipRefs,Ke as countWipRefs,Ae as createApiExtension,Ie as createAssetServeMiddleware,wr as createCollaborationHost,Ye as createContentFilter,Ei as createContentFilterAsync,Ur as createEmbeddingsSecretStore,Ut as createEphemeralProjectDir,dt as createExternalChangeHandler,nr as createFileLogger,mt as createLiveDerivedIndexExtension,kt as createMcpHttpHandler,Dr as createOsProbe,W as createPersistenceExtension,rt as createServer,De as createServerObserverExtension,bt as createStreamingErrorWriter,$i as createTestLogger,lr as describeStoredEmbeddingsKey,$r as detectClaudeDesktopPresence,Vn as detectGit,g as detectProjectShape,p as detectUserSkillHosts,Jt as discoverLockDirs,Jn as discoverMarkdownlintConfig,ur as emitPreflightFailureSpan,Ve as encodeDocName,d as encodeFolderRoute,vn as encodeSkillRoute,yn as ensureProjectGit,Xr as ensureProjectSkillGitignore,Y as errorResponse,ke as evictStaleTrackerEntries,Be as extractHeadings,vr as extractOkBinaryPath,It as extractWikiLinksFromMarkdown,Ce as fallbackPaths,yr as findEnclosingGitRoot,Pe as findEnclosingProjectRoot,y as findNativeMarkdownlintFile,kn as flushFileLogger,j as formatAuthRejectionWire,Qn as formatContributors,Yr as formatContributorsFrom,se as formatPackRationale,Ir as gcCheckpointRefs,Pr as getCurrentMcpLogger,Qt as getIngressContext,ir as getLocalDir,wn as getLogFilePath,ea as getLogger,zt as getLogsDir,aa as getMachineId,qi as getMeter,rr as getMetrics,Mi as getTracer,An as handleCollabSocketError,_t as handleSpawnCursor,mi as hasForwardingHeaders,Ci as hasGcLogLatch,c as iconFromClientName,Tn as incrementCollabSocketFilteredError,Bt as incrementServerObserverFire,dn as initContent,nn as initShadowRepo,Ki as initTelemetry,Ze as initToleranceTelemetryWriter,pn as installJsonSchemaDialect,tr as installPrettyZodErrors,Zi as installTestLoggers,_n as installUserSkill,F as isAllowedApiOrigin,ot as isAllowedWorkspaceHostHeader,le as isConfigDoc,ui as isHocuspocusAuthRejectionReason,Vt as isHomeDir,et as isHostAdmitted,fe as isKnownPackId,At as isLinkIndexExcludedDoc,V as isLoopbackAddress,Tt as isManagedArtifactDoc,k as isOriginAdmitted,n as isOrphanMode,ee as isPairedWriteOrigin,ne as isPathWithinDir,ci as isPeerAdmitted,ia as isProcessAlive,qn as isProjectRoot,Ft as isReservedForUserTree,ze as isSelfWrite,He as isSystemDoc,E as isToleranceTelemetryEnabled,ra as isValidLockPid,K as lastKnownHash,Zn as listRescueCheckpoints,Nt as listStarterPacks,it as loadCustomAgents,Le as loadPrincipal,ya as lockAdvertisesUi,la as lockBaseUrl,ua as lockFilePath,Ji as loggerFactory,Qi as logsCurrentPath,na as logsPreviousPath,jr as makeLazyEmbeddingsKeyStore,pa as markServerLockDraining,pe as mountMcpAndApi,zi as normalizeFsPath,A as originGitHubHost,Sn as packageVersionMajorMinor,ct as parseAuthRejectionWire,Oe as parseGitVersion,U as parseHocuspocusAuthToken,ce as parseKeepaliveConnectionId,oe as pathToDocName,xe as planSeed,pr as prepareSingleFileOpen,Br as processCommand,sn as processUsage,Nr as readAllTargets,Rn as readBundleDecision,Un as readOwnNativeRules,va as readProcessLock,ha as readProcessLockDetailed,$ as readProjectHeadState,Lt as readProjectLocalSemanticConfig,oa as readServerLock,qt as readServerPackageVersion,_r as readSkillInstallStateSnapshot,Bn as readStateManifest,zr as readTargetRecordedAt,on as readTargetVersion,he as reconcile,un as recordContributor,Cr as recordSkillInstallEvent,wt as registerAllTools,be as registerWrite,fa as releaseProcessLock,_a as releaseServerLock,Je as removeLastKnownHash,dr as reportSkillInstall,ei as resetMetrics,Gr as resolveBuiltinSkillHosts,o as resolveBundleEnabled,Nn as resolveBundledSkillDir,jn as resolveContentDir,ft as resolveCursorBinaryDefault,St as resolveCursorSpawnInvocation,I as resolveEffectiveLinterConfig,hr as resolveEmbeddingsCredential,En as resolveLockDir,Fe as resolveNativeConfigForDoc,Te as resolveNativeMarkdownlintConfig,Ot as resolvePack,Xn as resolvePackageVersion,fn as resolveSkillInstallReportSettings,Kr as resolveUiInfo,xn as restoreContributors,di as restoreLifecycleFromConflictsJson,Mt as rewriteMarkdownLinksForDocumentRename,Dt as rewriteWikiLinksForDocumentRename,Mr as runAuthReposSubprocess,Ln as runAuthStatusSubprocess,h as runCloneSubprocess,Kt as runDeviceFlowSubprocess,zn as runWithMcpLogger,de as safeContentPath,q as safeSubdir,Jr as safetyCheckpoint,at as sanitizeClientName,ln as saveInMemoryCheckpoint,bn as saveVersion,L as seedBasenameIndex,Fr as seedEphemeralProjectDir,tn as serializeError,Oi as setActiveSpanAttributes,ut as setupServerObservers,br as shadowGit,Gi as shutdownTelemetry,Yi as spansCurrentPath,Xi as spansPreviousPath,Z as spawnDetached,Er as splitMarkdownBlocks,Ti as startWatcher,me as streamingProblemEvent,xr as swapContributors,ai as teardownToleranceTelemetryWriter,fi as toBroadcasterKey,Ii as tracedAppendFileSync,Vi as tracedLinkSync,Ni as tracedMkdir,Li as tracedMkdirSync,Ui as tracedRename,Pi as tracedRenameSync,Bi as tracedRmSync,Ri as tracedRmdirSync,Fi as tracedUnlinkSync,ji as tracedWriteFile,Wi as tracedWriteFileSync,R as trustSystemCertificates,qr as untrackTrackedProjectSkillProjection,C as updateLastKnownHash,da as updateProcessLockPort,ba as updateServerLockPort,Qe as validateAgentId,gn as validateCloneInputs,On as validateSkillZip,ca as waitForServerLockDrain,Re as withHiddenWindowsConsole,Ai as withSpan,ki as withSpanSync,er as writeBundleDecision,li as writeMarkdownlintRule,Sr as writeRootGitignoreForNewRepo,Se as writeStateManifest,Zr as writeTargetVersion,gt as writeTracker};
1
+ import{Ac as e,Hs as t,Ts as n,U as r,Ws as i,ec as a,q as o,ws as s,x as c,xs as l,y as u}from"./src-tR2kRwXj.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Ci as O,Cn as k,Cr as A,Ct as j,D as M,Da as N,Di as P,Dn as F,Dr as I,Dt as L,E as R,Ea as z,Ei as B,En as V,Er as H,Et as U,F as W,Fi as G,Fn as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Hr as ne,Ht as re,I as ie,Ii as ae,In as oe,It as se,J as ce,Ji as le,Jn as ue,Jr as de,Jt as fe,K as pe,Ki as me,Kn as he,Kr as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lt as xe,M as Se,Mi as Ce,Mn as we,Mr as Te,Mt as Ee,N as De,Ni as Oe,Nn as ke,Nt as Ae,O as je,Oa as Me,Oi as Ne,On as Pe,Or as Fe,Ot as Ie,P as Le,Pi as Re,Pn as ze,Pt as Be,Q as Ve,Qi as He,Qn as Ue,Qr as We,Qt as Ge,R as Ke,Ri as qe,Rn as Je,Rr as Ye,Rt as Xe,S as Ze,Sa as Qe,Si as $e,Sn as et,Sr as tt,St as nt,T as rt,Ta as it,Ti as at,Tn as ot,Tr as st,Tt as ct,U as lt,Ui as ut,Un as dt,Ur as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vr as _t,Vt as vt,W as yt,Wi as bt,Wn as xt,Wr as St,Wt as Ct,X as wt,Xi as Tt,Xn as Et,Xr as Dt,Xt as Ot,Y as kt,Yi as At,Yn as jt,Yr as Mt,Yt as Nt,Z as Pt,Zi as Ft,Zn as It,Zr as Lt,Zt as Rt,_ as zt,_a as Bt,_n as Vt,_r as Ht,a as Ut,aa as Wt,ai as Gt,an as Kt,ar as qt,at as Jt,b as Yt,ba as Xt,bi as Zt,bn as Qt,br as $t,bt as en,c as tn,ca as nn,ci as rn,cn as an,cr as on,ct as sn,d as cn,da as ln,di as un,dn,dr as fn,dt as pn,ea as mn,ei as hn,en as gn,er as _n,et as vn,f as yn,fa as bn,fi as xn,fn as Sn,fr as Cn,g as wn,ga as Tn,gi as En,gn as Dn,gr as On,h as kn,ha as An,hi as jn,hn as Mn,hr as Nn,i as Pn,ia as Fn,ii as In,in as Ln,ir as Rn,it as zn,j as Bn,ji as Vn,jn as Hn,jr as Un,jt as Wn,k as Gn,ki as Kn,kn as qn,kr as Jn,kt as Yn,l as Xn,la as Zn,li as Qn,ln as $n,lr as er,lt as tr,m as nr,ma as rr,mi as ir,mn as ar,mr as or,n as sr,na as cr,ni as lr,nn as ur,nr as dr,nt as fr,o as pr,oa as mr,oi as hr,on as gr,or as _r,ot as vr,p as yr,pa as br,pi as xr,pn as Sr,pr as Cr,q as wr,qi as Tr,qn as Er,qr as Dr,qt as Or,r as kr,ra as Ar,ri as jr,rn as Mr,rr as Nr,rt as Pr,s as Fr,sa as Ir,si as Lr,sn as Rr,sr as zr,st as Br,t as Vr,ta as Hr,ti as Ur,tn as Wr,tr as Gr,tt as Kr,u as qr,ua as Jr,ui as Yr,un as Xr,ur as Zr,ut as Qr,v as $r,va as ei,vi as ti,vn as ni,vr as ri,vt as ii,w as ai,wa as oi,wi as si,wn as ci,wr as li,wt as ui,x as di,xa as fi,xi as pi,xn as mi,xr as hi,xt as gi,y as _i,ya as vi,yi,yn as bi,yr as xi,yt as Si,z as Ci,zi as wi,zn as Ti,zr as Ei,zt as Di}from"./src-DzuFrTJZ.mjs";import{C as Oi,E as ki,T as Ai,_ as ji,b as Mi,c as Ni,d as Pi,g as Fi,i as Ii,l as Li,m as Ri,n as zi,p as Bi,s as Vi,t as Hi,u as Ui,v as Wi,w as Gi,x as Ki,y as qi}from"./fs-traced-2B_-YK-g.mjs";import{a as Ji,d as Yi,f as Xi,i as Zi,l as Qi,n as $i,r as ea,t as ta,u as na}from"./logger-Dq-cRhcP.mjs";import{C as ra,S as ia,_ as aa,a as oa,b as sa,c as ca,d as la,f as ua,g as da,h as fa,i as pa,l as ma,m as ha,n as ga,o as _a,p as va,r as ya,s as ba,t as xa,u as Sa,x as Ca}from"./server-lock-Dngwkd_U.mjs";export{vi as AGENT_ID_MAX_LEN,Xt as AGENT_ID_RE,G as AGENT_WRITE_ORIGIN,z as AcpPermissionStore,D as AcpRegistry,pi as AcpThreadManager,yi as AgentFocusBroadcaster,ti as AgentPresenceBroadcaster,ae as AgentSessionCapacityError,ye as AgentSessionManager,Si as AutoStartDisabledError,Ht as BUNDLE_IDS,ri as BUNDLE_SCOPE,xi as BUNDLE_SKILL_NAME,Et as BacklinkIndex,Tr as CC1Broadcaster,i as CC1_CONTRACT_VERSION,gr as CONFIG_FILENAME,xt as CONFLICT_MARKER_RE,w as CURSOR_BUNDLE_PATHS_BY_PLATFORM,_i as ConfigSchema,f as DEFAULT_CHECKPOINT_RETENTION,In as DEFAULT_EMBEDDINGS_DIMENSIONS,Di as DEFAULT_PACK_ID,lt as DocumentDurabilityState,Gt as EMBEDDINGS_API_KEY_ENV,Vr as EPHEMERAL_PROJECT_DIR_PREFIX,ni as ExposureConsentError,oi as FEATURED_AGENT_IDS,mn as FILE_SYSTEM_WRITER,ue as FILE_WATCHER_ORIGIN,We as FileEmbeddingsBackend,Wr as GIT_PREFLIGHT_FAIL_SPAN_NAME,Hr as GIT_UPSTREAM_WRITER,N as GitDirAccessError,B as GitNotAvailableError,P as GitTooOldError,en as HOCUSPOCUS_AUTH_REJECTION_REASONS,gi as HocuspocusAuthRejection,nt as HocuspocusAuthTokenSchema,ar as HomeProjectRootError,ge as INSTALLED_AGENTS_SCHEMES,Qr as JSON_SCHEMA_DIALECT_2020_12,t as LINEAGE_EPOCH_KEY,x as LIVE_DERIVED_INDEX_DEBOUNCE_MS,T as LOG_MD_TEMPLATE,Yn as MANAGED_RENAME_ORIGIN,$e as MAX_ACP_THREADS,qe as MAX_AGENT_SESSIONS,si as MCP_CONNECTION_ID_HEADER,l as MCP_SERVER_NAME,wi as MIN_EVICTABLE_IDLE_MS,Ne as MIN_GIT_VERSION,yt as MISSING_OK_CONFIG_MESSAGE,Me as MalformedGitPointerError,fr as McpLogger,J as MissingOkConfigError,ht as OBSERVER_SYNC_ORIGIN,Rr as OK_OKIGNORE_TEMPLATE,$t as ONBOARDING_BUNDLE_IDS,s as ORPHAN_MODES,e as PROTOCOL_VERSION,ta as PinoLogger,ma as ProcessLockCollisionError,cn as ProjectGitInitError,b as ROLLBACK_ORIGIN,an as ROOT_GITIGNORE_TEMPLATE,sa as RUNTIME_VERSION,cr as SERVICE_WRITER,Cn as SKILL_INSTALL_EVENTS_FILE_REL,r as SKILL_STATE_TARGETS,vt as STARTER_FOLDERS,re as STARTER_FOLDER_FRONTMATTER_FILENAME,pt as STARTER_PACKS,Ct as STARTER_PACK_IDS,Q as STARTER_TEMPLATES,M as STATE_MANIFEST_FILENAME,Ca as STATE_SCHEMA_VERSION,a as SYSTEM_DOC_NAME,Rt as SeedPrerequisiteError,Ge as SeedRootDirError,xa as ServerLockCollisionError,sr as SingleFileNotAFileError,kr as SingleFileNotFoundError,Pn as SingleFileNotMarkdownError,je as StateManifestError,jt as TagIndex,hi as USER_GLOBAL_BUNDLE_IDS,Wn as __getShowAllWalkStatsForTesting,Ee as __resetShowAllWalkStatsForTesting,Sa as acquireProcessLock,ga as acquireServerLock,S as applyAgentMarkdownWrite,te as applyExternalChange,Xe as applySeed,Gn as assertCompatibleStateManifest,Kn as assertGitAvailable,v as assertNeverDiskEvent,Mn as assertNotHomeProjectRoot,Zt as attachAcpThreadSocket,ii as attachIdleShutdown,Yt as bootServer,Ue as buildAndOpenSkill,$n as buildConfigYmlContent,Pt as buildExecResult,bi as buildIngressPolicy,O as buildOkMcpStdioCommand,or as buildSkillZip,_e as buildStarterFolderFrontmatterYaml,Ar as buildWipTree,tt as bundleSkillMdPath,m as canonicalProjectKey,Dn as canonicalizeForCompare,Hn as classifyEvents,Hi as classifyFsPath,hn as clearAllEmbeddingsKeys,Lr as clearContributors,Or as coercePackId,u as colorFromSeed,Fn as commitUpstreamImport,Wt as commitWip,mr as commitWipFromTree,_ as compareSemver,st as composeEffectiveLinterConfig,H as composeFrontmatterSchemasConfig,X as containsConflictMarkers,we as contentHash,rn as contributorCount,ie as countShadowObjects,ve as countStaleAgentWipRefs,Ke as countWipRefs,Ae as createApiExtension,Ie as createAssetServeMiddleware,wr as createCollaborationHost,Ye as createContentFilter,Ei as createContentFilterAsync,Ur as createEmbeddingsSecretStore,Ut as createEphemeralProjectDir,dt as createExternalChangeHandler,nr as createFileLogger,mt as createLiveDerivedIndexExtension,kt as createMcpHttpHandler,Dr as createOsProbe,W as createPersistenceExtension,rt as createServer,De as createServerObserverExtension,bt as createStreamingErrorWriter,$i as createTestLogger,lr as describeStoredEmbeddingsKey,$r as detectClaudeDesktopPresence,Vn as detectGit,g as detectProjectShape,p as detectUserSkillHosts,Jt as discoverLockDirs,Jn as discoverMarkdownlintConfig,ur as emitPreflightFailureSpan,Ve as encodeDocName,d as encodeFolderRoute,vn as encodeSkillRoute,yn as ensureProjectGit,Xr as ensureProjectSkillGitignore,Y as errorResponse,ke as evictStaleTrackerEntries,Be as extractHeadings,vr as extractOkBinaryPath,It as extractWikiLinksFromMarkdown,Ce as fallbackPaths,yr as findEnclosingGitRoot,Pe as findEnclosingProjectRoot,y as findNativeMarkdownlintFile,kn as flushFileLogger,j as formatAuthRejectionWire,Qn as formatContributors,Yr as formatContributorsFrom,se as formatPackRationale,Ir as gcCheckpointRefs,Pr as getCurrentMcpLogger,Qt as getIngressContext,ir as getLocalDir,wn as getLogFilePath,ea as getLogger,zt as getLogsDir,aa as getMachineId,qi as getMeter,rr as getMetrics,Mi as getTracer,An as handleCollabSocketError,_t as handleSpawnCursor,mi as hasForwardingHeaders,Ci as hasGcLogLatch,c as iconFromClientName,Tn as incrementCollabSocketFilteredError,Bt as incrementServerObserverFire,dn as initContent,nn as initShadowRepo,Ki as initTelemetry,Ze as initToleranceTelemetryWriter,pn as installJsonSchemaDialect,tr as installPrettyZodErrors,Zi as installTestLoggers,_n as installUserSkill,F as isAllowedApiOrigin,ot as isAllowedWorkspaceHostHeader,le as isConfigDoc,ui as isHocuspocusAuthRejectionReason,Vt as isHomeDir,et as isHostAdmitted,fe as isKnownPackId,At as isLinkIndexExcludedDoc,V as isLoopbackAddress,Tt as isManagedArtifactDoc,k as isOriginAdmitted,n as isOrphanMode,ee as isPairedWriteOrigin,ne as isPathWithinDir,ci as isPeerAdmitted,ia as isProcessAlive,qn as isProjectRoot,Ft as isReservedForUserTree,ze as isSelfWrite,He as isSystemDoc,E as isToleranceTelemetryEnabled,ra as isValidLockPid,K as lastKnownHash,Zn as listRescueCheckpoints,Nt as listStarterPacks,it as loadCustomAgents,Le as loadPrincipal,ya as lockAdvertisesUi,la as lockBaseUrl,ua as lockFilePath,Ji as loggerFactory,Qi as logsCurrentPath,na as logsPreviousPath,jr as makeLazyEmbeddingsKeyStore,pa as markServerLockDraining,pe as mountMcpAndApi,zi as normalizeFsPath,A as originGitHubHost,Sn as packageVersionMajorMinor,ct as parseAuthRejectionWire,Oe as parseGitVersion,U as parseHocuspocusAuthToken,ce as parseKeepaliveConnectionId,oe as pathToDocName,xe as planSeed,pr as prepareSingleFileOpen,Br as processCommand,sn as processUsage,Nr as readAllTargets,Rn as readBundleDecision,Un as readOwnNativeRules,va as readProcessLock,ha as readProcessLockDetailed,$ as readProjectHeadState,Lt as readProjectLocalSemanticConfig,oa as readServerLock,qt as readServerPackageVersion,_r as readSkillInstallStateSnapshot,Bn as readStateManifest,zr as readTargetRecordedAt,on as readTargetVersion,he as reconcile,un as recordContributor,Cr as recordSkillInstallEvent,wt as registerAllTools,be as registerWrite,fa as releaseProcessLock,_a as releaseServerLock,Je as removeLastKnownHash,dr as reportSkillInstall,ei as resetMetrics,Gr as resolveBuiltinSkillHosts,o as resolveBundleEnabled,Nn as resolveBundledSkillDir,jn as resolveContentDir,ft as resolveCursorBinaryDefault,St as resolveCursorSpawnInvocation,I as resolveEffectiveLinterConfig,hr as resolveEmbeddingsCredential,En as resolveLockDir,Fe as resolveNativeConfigForDoc,Te as resolveNativeMarkdownlintConfig,Ot as resolvePack,Xn as resolvePackageVersion,fn as resolveSkillInstallReportSettings,Kr as resolveUiInfo,xn as restoreContributors,di as restoreLifecycleFromConflictsJson,Mt as rewriteMarkdownLinksForDocumentRename,Dt as rewriteWikiLinksForDocumentRename,Mr as runAuthReposSubprocess,Ln as runAuthStatusSubprocess,h as runCloneSubprocess,Kt as runDeviceFlowSubprocess,zn as runWithMcpLogger,de as safeContentPath,q as safeSubdir,Jr as safetyCheckpoint,at as sanitizeClientName,ln as saveInMemoryCheckpoint,bn as saveVersion,L as seedBasenameIndex,Fr as seedEphemeralProjectDir,tn as serializeError,Oi as setActiveSpanAttributes,ut as setupServerObservers,br as shadowGit,Gi as shutdownTelemetry,Yi as spansCurrentPath,Xi as spansPreviousPath,Z as spawnDetached,Er as splitMarkdownBlocks,Ti as startWatcher,me as streamingProblemEvent,xr as swapContributors,ai as teardownToleranceTelemetryWriter,fi as toBroadcasterKey,Ii as tracedAppendFileSync,Vi as tracedLinkSync,Ni as tracedMkdir,Li as tracedMkdirSync,Ui as tracedRename,Pi as tracedRenameSync,Bi as tracedRmSync,Ri as tracedRmdirSync,Fi as tracedUnlinkSync,ji as tracedWriteFile,Wi as tracedWriteFileSync,R as trustSystemCertificates,qr as untrackTrackedProjectSkillProjection,C as updateLastKnownHash,da as updateProcessLockPort,ba as updateServerLockPort,Qe as validateAgentId,gn as validateCloneInputs,On as validateSkillZip,ca as waitForServerLockDrain,Re as withHiddenWindowsConsole,Ai as withSpan,ki as withSpanSync,er as writeBundleDecision,li as writeMarkdownlintRule,Sr as writeRootGitignoreForNewRepo,Se as writeStateManifest,Zr as writeTargetVersion,gt as writeTracker};