@inkeep/open-knowledge 0.52.0-beta.6 → 0.52.0-beta.7

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 (137) hide show
  1. package/dist/{acp-harness-probe-Oco-vzbb.mjs → acp-harness-probe-BLW7TG44.mjs} +2 -2
  2. package/dist/assets/skills/project/references/linking.md +1 -1
  3. package/dist/cli.mjs +62 -62
  4. package/dist/constants-WNkLKsdC.mjs +2 -0
  5. package/dist/git-handle-CEoe8TIl.mjs +1 -0
  6. package/dist/{git-handle-CH1DpBYP.mjs → git-handle-VuHcNtS4.mjs} +2 -2
  7. package/dist/index.mjs +1 -1
  8. package/dist/{init-3ynssnTV.mjs → init-DFqv4VXb.mjs} +4 -4
  9. package/dist/init-DRqidFTq.mjs +1 -0
  10. package/dist/{launch-json-removal-CPurK0jD.mjs → launch-json-removal-DThHl9wH.mjs} +2 -2
  11. package/dist/loader-DJ8CWiSo.mjs +1 -0
  12. package/dist/{loader-DAruuWzH.mjs → loader-wzkezGJ8.mjs} +2 -2
  13. package/dist/md-manager-45eVlaBq.mjs +2 -0
  14. package/dist/{open-browser-CtVpc_8x.mjs → open-browser-BA50pLLQ.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/{preview-CC6sojTR.mjs → preview-B5WQN0UF.mjs} +2 -2
  17. package/dist/preview-Bh7vu-ai.mjs +1 -0
  18. package/dist/public/assets/{ActivityModeContent-BrdwpjRB.js → ActivityModeContent-BmQRzJZw.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-D56wAlnw.js → AgentDiffPane-DCXp5E1P.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-Bq0gVhV7.js → AgentThreadClientBinder-B7pwGsKU.js} +1 -1
  21. package/dist/public/assets/{ChangedOutsideBadge-6xW5IDHL.js → ChangedOutsideBadge-J6l1plFR.js} +1 -1
  22. package/dist/public/assets/CodeMirrorPropInput-DiDkBTg6.js +3 -0
  23. package/dist/public/assets/DocumentContext-J495RUh0.js +38 -0
  24. package/dist/public/assets/{EditorModeToggle-Big-nZpB.js → EditorModeToggle-BsFjeEn4.js} +1 -1
  25. package/dist/public/assets/{EnableSyncConfirmDialog-Dnl12e_9.js → EnableSyncConfirmDialog-DNDI39lu.js} +1 -1
  26. package/dist/public/assets/FeedbackForm-BwQovorQ.js +1 -0
  27. package/dist/public/assets/{GraphPanel-BxgcJTL5.js → GraphPanel-CsRKre3D.js} +1 -1
  28. package/dist/public/assets/{ImportSkillDialog-Dxe9uGaK.js → ImportSkillDialog-DNZi7-O6.js} +1 -1
  29. package/dist/public/assets/{LintConfigEditor-3U8aK9da.js → LintConfigEditor-nq2Ekm-O.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-CeSsPfJA.js +2 -0
  31. package/dist/public/assets/ManagedArtifactProperties-D5Q8gGkr.js +1 -0
  32. package/dist/public/assets/{McpConsentDialogBody-Dt3X7boO.js → McpConsentDialogBody-DEhSeOSg.js} +1 -1
  33. package/dist/public/assets/{MermaidDocEditor-d-Wp_Ka_.js → MermaidDocEditor-DceTAjtX.js} +1 -1
  34. package/dist/public/assets/{ReportBugDialogBody-w6ZUZtd9.js → ReportBugDialogBody-DO7eotFd.js} +1 -1
  35. package/dist/public/assets/{SchemaConfigEditor-FYNlbIie.js → SchemaConfigEditor-D23bGRYq.js} +1 -1
  36. package/dist/public/assets/{SessionsHost-BUC4h4T5.js → SessionsHost-BD8Io20F.js} +2 -2
  37. package/dist/public/assets/{SettingsDialogBody-BAUPvgPO.js → SettingsDialogBody-D_2SfOcL.js} +4 -4
  38. package/dist/public/assets/{ShareBranchSwitchDialog-BMXRhCIc.js → ShareBranchSwitchDialog-B7Bl6qR0.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveDialog-D8o-97rY.js → ShareReceiveDialog-BmMkjWTr.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveMissDialog-DPKorVX0.js → ShareReceiveMissDialog-BDYU64bD.js} +1 -1
  41. package/dist/public/assets/{SkillEditBanner-BpiKPrLW.js → SkillEditBanner-B2U7UdOB.js} +1 -1
  42. package/dist/public/assets/{SkillOriginInline-C1YncGFC.js → SkillOriginInline-B3wOLT3t.js} +1 -1
  43. package/dist/public/assets/{SkillToolbarControls-DMHQY-lw.js → SkillToolbarControls-BP8iught.js} +1 -1
  44. package/dist/public/assets/{SlidesToolbarControls-DNGGM8G-.js → SlidesToolbarControls-56-P71vE.js} +1 -1
  45. package/dist/public/assets/{SourceEditor-Bt93LccY.js → SourceEditor-8vj7fGo1.js} +1 -1
  46. package/dist/public/assets/{TerminalPanel-c_g1B919.js → TerminalPanel-Clr6j-jo.js} +3 -3
  47. package/dist/public/assets/{TerminalWindowApp-QRDsxPvH.js → TerminalWindowApp-Bzu1XJoP.js} +1 -1
  48. package/dist/public/assets/{TextDocEditor-CGo9TVsr.js → TextDocEditor-Kaj3NBL9.js} +1 -1
  49. package/dist/public/assets/{ThreadView-D4m34cEL.js → ThreadView-C0oxDyxf.js} +1 -1
  50. package/dist/public/assets/{TimelineDiffPane-DLergBgi.js → TimelineDiffPane-CG6Z1uma.js} +1 -1
  51. package/dist/public/assets/{agent-diff-store-DvvlIWsW.js → agent-diff-store-DxMs0J9Y.js} +1 -1
  52. package/dist/public/assets/{auth-state-cache-se0_UkK4.js → auth-state-cache-CGY7eNch.js} +3 -3
  53. package/dist/public/assets/client-version-BenFW72U.js +1 -0
  54. package/dist/public/assets/comment-chips-Q0_SZK9C.js +5 -0
  55. package/dist/public/assets/{config-provider-cC1aAoqP.js → config-provider-B6fsarOv.js} +2 -2
  56. package/dist/public/assets/{dist-DPUOICsM.js → dist-ILlrHFKs.js} +183 -183
  57. package/dist/public/assets/{doc-paths-6W3B04qd.js → doc-paths-DAh95jxf.js} +1 -1
  58. package/dist/public/assets/{documents-events-CFb6q7t5.js → documents-events-CCW6R-r2.js} +1 -1
  59. package/dist/public/assets/{file-tree-adapter-DhmmoAjL.js → file-tree-adapter-Bf1ZqkPA.js} +1 -1
  60. package/dist/public/assets/{file-tree-utils-Dua-6LtX.js → file-tree-utils-CgJ4lrP9.js} +1 -1
  61. package/dist/public/assets/{folder-config-api-CrrPk9A0.js → folder-config-api-CKV5STj1.js} +1 -1
  62. package/dist/public/assets/follow-file-D4LD9UAw.js +4 -0
  63. package/dist/public/assets/i18n-C3d0M4ue.js +1 -0
  64. package/dist/public/assets/{index-Bme5x35Q.js → index-Du6HTehY.js} +14 -14
  65. package/dist/public/assets/{lint-config-client-DPwH-VHu.js → lint-config-client-xawAT1mQ.js} +1 -1
  66. package/dist/public/assets/{markdownlint-rule-browser-BdGLlEVb.js → markdownlint-rule-browser-B3UPVPG_.js} +1 -1
  67. package/dist/public/assets/navigation-targets-C1boWExT.js +1 -0
  68. package/dist/public/assets/{open-managed-artifact-tab-Cojj8juW.js → open-managed-artifact-tab-G7xdjHph.js} +1 -1
  69. package/dist/public/assets/{pending-receive-nav-store-wVA1ZjL8.js → pending-receive-nav-store-BZigj_ik.js} +1 -1
  70. package/dist/public/assets/prop-types-BIrEWnOv.js +1 -0
  71. package/dist/public/assets/{receive-store-CFEx5X5f.js → receive-store-BrOspwat.js} +1 -1
  72. package/dist/public/assets/{selection-context-Bq_81z9T.js → selection-context-PgPm0oHr.js} +1 -1
  73. package/dist/public/assets/{skill-actions-BfBwH98z.js → skill-actions-Btw-8DsB.js} +2 -2
  74. package/dist/public/assets/{skill-scope-TY2S7Be7.js → skill-scope-8PP6d5Gw.js} +1 -1
  75. package/dist/public/assets/{skills-api-OBRuLm8a.js → skills-api-DQ0PK-8O.js} +1 -1
  76. package/dist/public/assets/{src-CDup1x-i.js → src-DoCu_Oe2.js} +1 -1
  77. package/dist/public/assets/{tag-pill-input-CIUq78uG.js → tag-pill-input-BHj2SAnj.js} +1 -1
  78. package/dist/public/assets/{target-navigation-intent-TFQElcz0.js → target-navigation-intent-DpIU3fe6.js} +1 -1
  79. package/dist/public/assets/{terminal-cli-display-DphQFt7y.js → terminal-cli-display-CgJpdKCI.js} +1 -1
  80. package/dist/public/assets/{terminal-launch-events-CkYhv0hD.js → terminal-launch-events-DQ0KtteM.js} +1 -1
  81. package/dist/public/assets/{terminal-telemetry-BrUGs0cG.js → terminal-telemetry-CE1yzjKD.js} +1 -1
  82. package/dist/public/assets/{typing-burst-detector-3ZZiF2mv.js → typing-burst-detector-XmZhxL72.js} +3 -3
  83. package/dist/public/assets/{uninstall-ocJf-hjC.js → uninstall-CDJGY7Qx.js} +1 -1
  84. package/dist/public/assets/{use-activity-panel-B8mUHgso.js → use-activity-panel-DeQ1S88x.js} +1 -1
  85. package/dist/public/assets/{use-apply-config-color-theme-C68-iamG.js → use-apply-config-color-theme-BatIDUX7.js} +1 -1
  86. package/dist/public/assets/{use-collab-url-CJzhnqks.js → use-collab-url-7XE2_0_k.js} +1 -1
  87. package/dist/public/assets/{use-live-xterm-theme-BnbloOyE.js → use-live-xterm-theme-DS89T4Os.js} +1 -1
  88. package/dist/public/assets/{use-open-skill-BQ_vHG4k.js → use-open-skill-CgnR7yXa.js} +1 -1
  89. package/dist/public/assets/{use-popular-skills-DOSbQRlG.js → use-popular-skills-BefXxEcp.js} +1 -1
  90. package/dist/public/assets/{use-settings-route-Cv-ibnUF.js → use-settings-route-DN0TWdfX.js} +1 -1
  91. package/dist/public/assets/{use-skill-origin-clrL7XV6.js → use-skill-origin-COh1_mOK.js} +1 -1
  92. package/dist/public/assets/{use-skills-BDWr4yYQ.js → use-skills-C_HuRxth.js} +1 -1
  93. package/dist/public/assets/{use-terminal-enabled-CRhATtRE.js → use-terminal-enabled-DPQRp9bB.js} +1 -1
  94. package/dist/public/assets/use-timeline-entry-diff-Bw_6uLLl.js +6 -0
  95. package/dist/public/assets/{use-workspace-DNFQbKXx.js → use-workspace-CNCW4CS8.js} +1 -1
  96. package/dist/public/index.html +44 -44
  97. package/dist/public/uninstall.html +3 -3
  98. package/dist/{repair-launch-json-mJ3Ye_Mw.mjs → repair-launch-json-C2_MEgOS.mjs} +2 -2
  99. package/dist/{repair-mcp-configs-BeS1bCUD.mjs → repair-mcp-configs-Ceivh0g-.mjs} +2 -2
  100. package/dist/repair-skills-BWNXcIRv.mjs +1 -0
  101. package/dist/{repair-skills-Dn9wtbHi.mjs → repair-skills-Dk0Hee-r.mjs} +2 -2
  102. package/dist/server-lock-CDm0H6LS.mjs +1 -0
  103. package/dist/{server-lock-D8tFCW-G.mjs → server-lock-CeKMy65H.mjs} +2 -2
  104. package/dist/{skill-teardown-riJHlPak.mjs → skill-teardown-DtXC2fAI.mjs} +2 -2
  105. package/dist/{src-CeMQBLDa.mjs → src--XQg-7vm.mjs} +1 -1
  106. package/dist/{src-RGB2pEts.mjs → src-Dj6UxpKM.mjs} +124 -124
  107. package/dist/{src-BVxZYLJj.mjs → src-DvuwJKkU.mjs} +328 -328
  108. package/dist/src-VQFi4saV.mjs +1 -0
  109. package/dist/{src-Dc3F4mTO.mjs → src-WP_osKfx.mjs} +4 -4
  110. package/dist/start-CS7u5aKZ.mjs +12 -0
  111. package/dist/start-DZkQW5RE.mjs +1 -0
  112. package/dist/{ui-CyO6JCpp.mjs → ui-7z12LoCq.mjs} +3 -3
  113. package/dist/{write-project-skill-Bx22NW0a.mjs → write-project-skill-DUj7e5tZ.mjs} +3 -3
  114. package/package.json +4 -4
  115. package/dist/constants-C3LdY4-b.mjs +0 -2
  116. package/dist/git-handle-D_uW8fTU.mjs +0 -1
  117. package/dist/init-Djv0aq5j.mjs +0 -1
  118. package/dist/loader-Cwl2ZS4i.mjs +0 -1
  119. package/dist/md-manager-CUGZ0GRt.mjs +0 -2
  120. package/dist/preview-CYRkVM0P.mjs +0 -1
  121. package/dist/public/assets/CodeMirrorPropInput-D11rfM17.js +0 -3
  122. package/dist/public/assets/DocumentContext-DCB_2FMP.js +0 -38
  123. package/dist/public/assets/FeedbackForm-goeo0WLf.js +0 -1
  124. package/dist/public/assets/ManagedArtifactProperties-Bn-na6ua.js +0 -2
  125. package/dist/public/assets/ManagedArtifactProperties-DQMTHKMr.js +0 -1
  126. package/dist/public/assets/client-version-Cv0iyIKr.js +0 -1
  127. package/dist/public/assets/comment-chips-DTAZbaPZ.js +0 -5
  128. package/dist/public/assets/follow-file-K86Sp_6-.js +0 -4
  129. package/dist/public/assets/i18n-BnkAuR_3.js +0 -1
  130. package/dist/public/assets/navigation-targets-DSqzY6pU.js +0 -1
  131. package/dist/public/assets/prop-types-7a0cKWM0.js +0 -1
  132. package/dist/public/assets/use-timeline-entry-diff-C3vXYWPC.js +0 -6
  133. package/dist/repair-skills-cJ41S9pk.mjs +0 -1
  134. package/dist/server-lock-CTrzO_5l.mjs +0 -1
  135. package/dist/src-DDuAov3v.mjs +0 -1
  136. package/dist/start-B0EAId8s.mjs +0 -1
  137. package/dist/start-Coiq5FC4.mjs +0 -12
@@ -1,2 +1,2 @@
1
- import{t as e}from"./launch-json-removal-CPurK0jD.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
- //# sourceMappingURL=repair-launch-json-mJ3Ye_Mw.mjs.map
1
+ import{t as e}from"./launch-json-removal-DThHl9wH.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
+ //# sourceMappingURL=repair-launch-json-C2_MEgOS.mjs.map
@@ -1,2 +1,2 @@
1
- import{i as e,o as t,p as n}from"./write-project-skill-Bx22NW0a.mjs";import{d as r,v as i}from"./init-3ynssnTV.mjs";import{t as a}from"./mcp-migrate-event-B1gJf6bG.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of e){let e=t[o],s=c(()=>e.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:e,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),e.projectConfigPath){let t=e.projectConfigPath,i=c(()=>t(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:e,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-BeS1bCUD.mjs.map
1
+ import{i as e,o as t,p as n}from"./write-project-skill-DUj7e5tZ.mjs";import{d as r,v as i}from"./init-DFqv4VXb.mjs";import{t as a}from"./mcp-migrate-event-B1gJf6bG.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of e){let e=t[o],s=c(()=>e.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:e,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),e.projectConfigPath){let t=e.projectConfigPath,i=c(()=>t(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:e,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-Ceivh0g-.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-Dk0Hee-r.mjs";export{e as repairSkills};
@@ -1,4 +1,4 @@
1
- import{z as e}from"./src-RGB2pEts.mjs";import{Cr as t,_r as n,cr as r,fr as i,lr as a,mr as o,pr as s,wr as c,yr as l}from"./src-BVxZYLJj.mjs";import{o as u,s as d,t as f,v as p}from"./write-project-skill-Bx22NW0a.mjs";import{n as m,s as h,t as g}from"./colors-BsmVIwfM.mjs";import{n as _,r as v,t as y}from"./skill-teardown-riJHlPak.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>l(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>l(e,{checkDesktop:!1}),readBundledVersion:()=>a(),readRecordedVersion:e=>i(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>n(e),readBundleDecision:(e,t)=>r(e,t),writeBundleDecision:(e,t,n)=>s(e,t,n),removeBundleFromDisk:(e,t)=>v(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=!1;if(r.existsSync(s))o.push({kind:`central`,path:s,outcome:`skipped-present`});else try{I(n,s,r),c=!0,o.push({kind:`central`,path:s,outcome:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of d){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(r.existsSync(u)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-present`});continue}try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:c}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of d){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=u[t.editorId]?.projectConfigPath?.(e);if(!z(c,n)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{f(o,e),I(i,o,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`created`}),r({event:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function V(n,r,i,a){let o=e=>{r.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return a({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await r.readRecordedVersion(n)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of c)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=t[o.id],c=i.existsSync(x(n,`.agents`,`skills`,s)),l=await r.readBundleDecision(n,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(n,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(n,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>i.existsSync(x(n,`.agents`,`skills`,t[e.id])));if(u!==null&&u===l&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===c.length,_=[];for(let{id:e,sourceDir:r}of p){let o=R(n,t[e],r,i,a,l);h.push(...o.entries),_.push({id:e,centralWritten:o.centralWritten})}let v=h.some(e=>e.kind===`central`&&e.outcome===`failed`);if(g&&!v){let e=null;try{await r.writeRecordedVersion(n,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t,centralWritten:n}of _)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:g?e?`all-writes-failed`:`central-write-failed`:`bundle-unresolved`})}return{outcome:`done`,version:l,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=_(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=y(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function U(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function W(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`present`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-present`).length,i=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,a=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} present, ${i} skipped, ${a} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
1
+ import{U as e}from"./src-Dj6UxpKM.mjs";import{Cr as t,_r as n,cr as r,fr as i,lr as a,mr as o,pr as s,wr as c,yr as l}from"./src-DvuwJKkU.mjs";import{o as u,s as d,t as f,v as p}from"./write-project-skill-DUj7e5tZ.mjs";import{n as m,s as h,t as g}from"./colors-BsmVIwfM.mjs";import{n as _,r as v,t as y}from"./skill-teardown-DtXC2fAI.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>l(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>l(e,{checkDesktop:!1}),readBundledVersion:()=>a(),readRecordedVersion:e=>i(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>n(e),readBundleDecision:(e,t)=>r(e,t),writeBundleDecision:(e,t,n)=>s(e,t,n),removeBundleFromDisk:(e,t)=>v(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=!1;if(r.existsSync(s))o.push({kind:`central`,path:s,outcome:`skipped-present`});else try{I(n,s,r),c=!0,o.push({kind:`central`,path:s,outcome:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of d){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(r.existsSync(u)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-present`});continue}try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:c}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of d){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=u[t.editorId]?.projectConfigPath?.(e);if(!z(c,n)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{f(o,e),I(i,o,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`created`}),r({event:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function V(n,r,i,a){let o=e=>{r.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return a({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await r.readRecordedVersion(n)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of c)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=t[o.id],c=i.existsSync(x(n,`.agents`,`skills`,s)),l=await r.readBundleDecision(n,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(n,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(n,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>i.existsSync(x(n,`.agents`,`skills`,t[e.id])));if(u!==null&&u===l&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===c.length,_=[];for(let{id:e,sourceDir:r}of p){let o=R(n,t[e],r,i,a,l);h.push(...o.entries),_.push({id:e,centralWritten:o.centralWritten})}let v=h.some(e=>e.kind===`central`&&e.outcome===`failed`);if(g&&!v){let e=null;try{await r.writeRecordedVersion(n,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t,centralWritten:n}of _)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:g?e?`all-writes-failed`:`central-write-failed`:`bundle-unresolved`})}return{outcome:`done`,version:l,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=_(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=y(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function U(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function W(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`present`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-present`).length,i=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,a=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} present, ${i} skipped, ${a} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
2
2
  `)}function G(){return new p(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").option(`-y, --yes`,`Skip the confirmation prompt for removing directories left by a pre-0.42 install.`).action(async e=>{let t=await H({projectDir:C(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null,confirmLegacyCleanup:t=>K(t,{yes:e.yes===!0})});process.stdout.write(`${W(t)}\n`),process.exitCode=U(t)})}async function K(e,t){let n=j(),r=e=>`~/${S(n,e)}`,i=t.input??process.stdin,a=[``,g(`A previous version of OpenKnowledge installed its skill into agent tools you may never have used.`),m(`(Versions before 0.42 wrote to every host a third-party installer knew about — see issue #820.)`)];if(e.skillDirs.length>0&&a.push(``,`${g(`Remove OpenKnowledge skills:`)} ${e.skillDirs.length}`,...e.skillDirs.map(e=>` ${r(e)}`)),e.emptyDirs.length>0){let t=e.skillDirs.length>0?`Then remove these, which hold nothing else once the above are gone:`:`Remove these empty directories, left behind by that install:`;a.push(``,`${g(t)} ${e.emptyDirs.length}`,...e.emptyDirs.map(e=>` ${r(e)}`))}if(a.push(``,m(`Nothing outside these paths is touched. A directory that still holds anything is kept.`)),process.stdout.write(`${a.join(`
3
3
  `)}\n`),t.yes)return!0;if(!i.isTTY)return process.stdout.write(`${h("Not a terminal — skipping cleanup. Re-run with `ok repair-skills --yes` to remove these.")}\n`),!1;let o=M({input:i,output:process.stdout});try{let e=(await o.question(`\n${g(`Remove them?`)} ${m(`[y/N] `)}`)).trim().toLowerCase();return e===`y`||e===`yes`}finally{o.close()}}export{G as n,H as t};
4
- //# sourceMappingURL=repair-skills-Dn9wtbHi.mjs.map
4
+ //# sourceMappingURL=repair-skills-Dk0Hee-r.mjs.map
@@ -0,0 +1 @@
1
+ import{a as e,o as t,r as n}from"./server-lock-CeKMy65H.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
@@ -1,2 +1,2 @@
1
- import"./src-RGB2pEts.mjs";import{r as e}from"./logger-DFxEUjvj.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(e){return new URL(e.url??``,`http://localhost`).searchParams}function y(e){let t=e?.code;return typeof t==`string`?t:void 0}const b=/^[A-Za-z0-9-]{8,64}$/;let x=null;function S(e){return n(e??p(),`.ok`,`machine-id`)}function C(n){if(n===void 0&&x!==null)return x;let r=S(n),i=null;try{let e=l(r,`utf-8`).trim();b.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(x=i),i}function w(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const T=w(),E=1,D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===C():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==C()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:C(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??T},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(y(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){y(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e,t){q({lockName:`server`,lockDir:e,...t})}function $(e){U({lockName:`server`,lockDir:e})}function ee(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,T as _,Q as a,y as b,O as c,k as d,U as f,H as g,q as h,Z as i,R as l,G as m,Y as n,X as o,W as p,$ as r,ee as s,J as t,V as u,E as v,v as x,C as y};
2
- //# sourceMappingURL=server-lock-D8tFCW-G.mjs.map
1
+ import"./src-Dj6UxpKM.mjs";import{r as e}from"./logger-DFxEUjvj.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(e){return new URL(e.url??``,`http://localhost`).searchParams}function y(e){let t=e?.code;return typeof t==`string`?t:void 0}const b=/^[A-Za-z0-9-]{8,64}$/;let x=null;function S(e){return n(e??p(),`.ok`,`machine-id`)}function C(n){if(n===void 0&&x!==null)return x;let r=S(n),i=null;try{let e=l(r,`utf-8`).trim();b.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(x=i),i}function w(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const T=w(),E=1,D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===C():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==C()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:C(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??T},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(y(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){y(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e,t){q({lockName:`server`,lockDir:e,...t})}function $(e){U({lockName:`server`,lockDir:e})}function ee(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,T as _,Q as a,y as b,O as c,k as d,U as f,H as g,q as h,Z as i,R as l,G as m,Y as n,X as o,W as p,$ as r,ee as s,J as t,V as u,E as v,v as x,C as y};
2
+ //# sourceMappingURL=server-lock-CeKMy65H.mjs.map
@@ -1,2 +1,2 @@
1
- import{Cr as e,wr as t}from"./src-BVxZYLJj.mjs";import{s as n}from"./write-project-skill-Bx22NW0a.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...t.map(t=>e[t]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of t){let t=e[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let e of n)o.push({path:a(i,e.hostDir,`skills`,t),bundleId:r,scope:`host`,hostDir:e.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
- //# sourceMappingURL=skill-teardown-riJHlPak.mjs.map
1
+ import{Cr as e,wr as t}from"./src-DvuwJKkU.mjs";import{s as n}from"./write-project-skill-DUj7e5tZ.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...t.map(t=>e[t]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of t){let t=e[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let e of n)o.push({path:a(i,e.hostDir,`skills`,t),bundleId:r,scope:`host`,hostDir:e.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
+ //# sourceMappingURL=skill-teardown-DtXC2fAI.mjs.map
@@ -1 +1 @@
1
- import{$o as e,F as t,Qo as n,Qs as r,Ts as i,Yo as a,d as o,hs as s,p as c,ps as l,z as u}from"./src-RGB2pEts.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Bt as w,C as T,Ca as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dr as P,Dt as F,E as I,Ei as L,En as R,Er as z,Et as B,F as V,Fi as H,Fn as U,Fr as W,Ft as G,G as K,Gi as q,Gn as J,Gr as Y,Gt as X,H as Z,Hi as Q,Hn as $,Hr as ee,Ht as te,I as ne,Ii as re,In as ie,It as ae,J as oe,Ji as se,Jn as ce,Jr as le,Jt as ue,K as de,Ki as fe,Kn as pe,Kr as me,Kt as he,L as ge,Li as _e,Ln as ve,Lt as ye,M as be,Mi as xe,Mn as Se,Mr as Ce,Mt as we,N as Te,Ni as Ee,Nn as De,Nr as Oe,Nt as ke,O as Ae,Oi as je,On as Me,Or as Ne,Ot as Pe,P as Fe,Pi as Ie,Pn as Le,Pr as Re,Pt as ze,Q as Be,Qi as Ve,Qn as He,Qr as Ue,Qt as We,R as Ge,Ri as Ke,Rn as qe,Rt as Je,S as Ye,Sa as Xe,Si as Ze,Sn as Qe,Sr as $e,St as et,T as tt,Ti as nt,Tn as rt,Tr as it,Tt as at,U as ot,Ui as st,Un as ct,Ur as lt,Ut as ut,V as dt,Vi as ft,Vn as pt,Vr as mt,Vt as ht,W as gt,Wi as _t,Wn as vt,Wr as yt,Wt as bt,X as xt,Xi as St,Xn as Ct,Xr as wt,Xt as Tt,Y as Et,Yi as Dt,Yn as Ot,Yr as kt,Yt as At,Z as jt,Zi as Mt,Zn as Nt,Zr as Pt,Zt as Ft,_ as It,_a as Lt,_i as Rt,_n as zt,_r as Bt,_t as Vt,a as Ht,aa as Ut,ai as Wt,an as Gt,ar as Kt,at as qt,b as Jt,ba as Yt,bi as Xt,bn as Zt,br as Qt,bt as $t,c as en,ca as tn,ci as nn,cn as rn,cr as an,d as on,da as sn,di as cn,dn as ln,dr as un,ea as dn,ei as fn,en as pn,er as mn,et as hn,f as gn,fa as _n,fi as vn,fn as yn,fr as bn,g as xn,ga as Sn,gi as Cn,gn as wn,gr as Tn,gt as En,h as Dn,ha as On,hi as kn,hn as An,hr as jn,ht as Mn,i as Nn,ia as Pn,ii as Fn,in as In,ir as Ln,it as Rn,j as zn,ji as Bn,jn as Vn,jr as Hn,jt as Un,k as Wn,ki as Gn,kn as Kn,kr as qn,kt as Jn,l as Yn,la as Xn,li as Zn,ln as Qn,lr as $n,m as er,ma as tr,mi as nr,mn as rr,mr as ir,mt as ar,n as or,na as sr,ni as cr,nn as lr,nr as ur,nt as dr,o as fr,oa as pr,oi as mr,on as hr,or as gr,ot as _r,p as vr,pa as yr,pi as br,pn as xr,pr as Sr,q as Cr,qi as wr,qn as Tr,qr as Er,qt as Dr,r as Or,ra as kr,ri as Ar,rn as jr,rr as Mr,rt as Nr,s as Pr,sa as Fr,si as Ir,sn as Lr,sr as Rr,st as zr,t as Br,ta as Vr,ti as Hr,tn as Ur,tr as Wr,tt as Gr,u as Kr,ua as qr,ui as Jr,un as Yr,ur as Xr,v as Zr,va as Qr,vi as $r,vn as ei,vr as ti,vt as ni,w as ri,wi as ii,wn as ai,wr as oi,wt as si,x as ci,xa as li,xn as ui,xr as di,xt as fi,y as pi,ya as mi,yi as hi,yn as gi,yr as _i,yt as vi,z as yi,zi as bi,zn as xi,zt as Si}from"./src-BVxZYLJj.mjs";import{C as Ci,E as wi,T as Ti,_ as Ei,b as Di,c as Oi,d as ki,g as Ai,i as ji,l as Mi,m as Ni,n as Pi,p as Fi,s as Ii,t as Li,u as Ri,v as zi,w as Bi,x as Vi,y as Hi}from"./fs-traced-DV9uD41t.mjs";import{a as Ui,d as Wi,f as Gi,i as Ki,l as qi,n as Ji,r as Yi,t as Xi,u as Zi}from"./logger-DFxEUjvj.mjs";import{C as Qi,S as $i,_ as ea,a as ta,c as na,d as ra,g as ia,h as aa,i as oa,l as sa,m as ca,n as la,o as ua,p as da,r as fa,s as pa,t as ma,u as ha,v as ga,y as _a}from"./server-lock-D8tFCW-G.mjs";export{tr as AGENT_ID_MAX_LEN,On as AGENT_ID_RE,_ as AGENT_WRITE_ORIGIN,li as AcpPermissionStore,Qr as AcpRegistry,nt as AcpThreadManager,D as AgentFocusBroadcaster,Ze as AgentPresenceBroadcaster,Bn as AgentSessionCapacityError,xe as AgentSessionManager,Mn as AutoStartDisabledError,di as BUNDLE_IDS,$e as BUNDLE_SCOPE,k as BUNDLE_SKILL_NAME,Wr as BacklinkIndex,Q as CC1Broadcaster,s as CC1_CONTRACT_VERSION,An as CONFIG_FILENAME,Ot as CONFLICT_MARKER_RE,lt as CURSOR_BUNDLE_PATHS_BY_PLATFORM,It as ConfigSchema,se as DEFAULT_CHECKPOINT_RETENTION,nn as DEFAULT_EMBEDDINGS_DIMENSIONS,w as DEFAULT_PACK_ID,dt as DocumentDurabilityState,Zn as EMBEDDINGS_API_KEY_ENV,O as ExposureConsentError,mi as FEATURED_AGENT_IDS,Dt as FILE_SYSTEM_WRITER,p as FILE_WATCHER_ORIGIN,cr as FileEmbeddingsBackend,lr as GIT_PREFLIGHT_FAIL_SPAN_NAME,St as GIT_UPSTREAM_WRITER,Xe as GitDirAccessError,In as GitNotAvailableError,Gt as GitTooOldError,En as HOCUSPOCUS_AUTH_REJECTION_REASONS,Vt as HocuspocusAuthRejection,ni as HocuspocusAuthTokenSchema,kt as INSTALLED_AGENTS_SCHEMES,l as LINEAGE_EPOCH_KEY,Ge as LIVE_DERIVED_INDEX_DEBOUNCE_MS,ht as LOG_MD_TEMPLATE,at as MANAGED_RENAME_ORIGIN,L as MAX_ACP_THREADS,Ee as MAX_AGENT_SESSIONS,je as MCP_CONNECTION_ID_HEADER,a as MCP_SERVER_NAME,Ie as MIN_EVICTABLE_IDLE_MS,hr as MIN_GIT_VERSION,Z as MISSING_OK_CONFIG_MESSAGE,E as MalformedGitPointerError,hn as McpLogger,ot as MissingOkConfigError,re as OBSERVER_SYNC_ORIGIN,wn as OK_OKIGNORE_TEMPLATE,n as ORPHAN_MODES,r as PROTOCOL_VERSION,Xi as PinoLogger,na as ProcessLockCollisionError,Yn as ProjectGitInitError,B as ROLLBACK_ORIGIN,zt as ROOT_GITIGNORE_TEMPLATE,ea as RUNTIME_VERSION,Mt as SERVICE_WRITER,Tn as SKILL_INSTALL_EVENTS_FILE_REL,t as SKILL_STATE_TARGETS,te as STARTER_FOLDERS,ut as STARTER_FOLDER_FRONTMATTER_FILENAME,bt as STARTER_PACKS,X as STARTER_PACK_IDS,he as STARTER_TEMPLATES,tt as STATE_MANIFEST_FILENAME,ga as STATE_SCHEMA_VERSION,i as SYSTEM_DOC_NAME,We as SeedPrerequisiteError,h as SeedRootDirError,ma as ServerLockCollisionError,Br as SingleFileNotAFileError,or as SingleFileNotFoundError,Or as SingleFileNotMarkdownError,I as StateManifestError,mn as TagIndex,oi as USER_GLOBAL_BUNDLE_IDS,we as UiLockCollisionError,F as __getShowAllWalkStatsForTesting,Pe as __resetShowAllWalkStatsForTesting,sa as acquireProcessLock,la as acquireServerLock,ke as acquireUiLock,H as applyAgentMarkdownWrite,Tr as applyExternalChange,Si as applySeed,j as assertCompatibleStateManifest,Lr as assertGitAvailable,U as assertNeverDiskEvent,ii as attachAcpThreadSocket,ar as attachIdleShutdown,Zr as bootServer,Mr as buildAndOpenSkill,ei as buildConfigYmlContent,Et as buildExecResult,ai as buildIngressPolicy,M as buildOkMcpStdioCommand,ti as buildSkillZip,Dr as buildStarterFolderFrontmatterYaml,Ve as buildWipTree,it as bundleSkillMdPath,Ar as canonicalProjectKey,ie as classifyEvents,Li as classifyFsPath,Fn as clearAllEmbeddingsKeys,cn as clearContributors,ue as coercePackId,o as colorFromSeed,f as commitUpstreamImport,dn as commitWip,Vr as commitWipFromTree,rn as compareSemver,Ne as composeEffectiveLinterConfig,qn as composeFrontmatterSchemasConfig,Ct as containsConflictMarkers,ve as contentHash,vn as contributorCount,Fe as countShadowObjects,V as countStaleAgentWipRefs,ne as countWipRefs,Jn as createApiExtension,si as createAssetServeMiddleware,K as createCollaborationHost,mt as createContentFilter,ee as createContentFilterAsync,Wt as createEmbeddingsSecretStore,Nn as createEphemeralProjectDir,ce as createExternalChangeHandler,gn as createFileLogger,yi as createLiveDerivedIndexExtension,Cr as createMcpHttpHandler,wt as createOsProbe,Te as createPersistenceExtension,T as createServer,zn as createServerObserverExtension,bi as createStreamingErrorWriter,Ji as createTestLogger,mr as describeStoredEmbeddingsKey,xn as detectClaudeDesktopPresence,Qn as detectGit,Ae as detectProjectShape,Ln as detectUserSkillHosts,Nr as discoverLockDirs,Ce as discoverMarkdownlintConfig,jr as emitPreflightFailureSpan,xt as encodeDocName,jt as encodeFolderRoute,Be as encodeSkillRoute,Kr as ensureProjectGit,gi as ensureProjectSkillGitignore,S as errorResponse,qe as evictStaleTrackerEntries,b as extractHeadings,Rn as extractOkBinaryPath,ur as extractWikiLinksFromMarkdown,Yr as fallbackPaths,on as findEnclosingGitRoot,De as findEnclosingProjectRoot,Oe as findNativeMarkdownlintFile,vr as flushFileLogger,vi as formatAuthRejectionWire,br as formatContributors,nr as formatContributorsFrom,ye as formatPackRationale,sr as gcCheckpointRefs,Gr as getCurrentMcpLogger,rt as getIngressContext,$r as getLocalDir,er as getLogFilePath,Yi as getLogger,Dn as getLogsDir,_a as getMachineId,Hi as getMeter,Xn as getMetrics,Di as getTracer,qr as handleCollabSocketError,yt as handleSpawnCursor,R as hasForwardingHeaders,ge as hasGcLogLatch,c as iconFromClientName,sn as incrementCollabSocketFilteredError,_n as incrementServerObserverFire,Zt as initContent,kr as initShadowRepo,Vi as initTelemetry,Jt as initToleranceTelemetryWriter,zr as installPrettyZodErrors,Ki as installTestLoggers,Kt as installUserSkill,Se as isAllowedApiOrigin,v as isAllowedWorkspaceHostHeader,st as isConfigDoc,$t as isHocuspocusAuthRejectionReason,N as isHostAdmitted,At as isKnownPackId,_t as isLinkIndexExcludedDoc,Vn as isLoopbackAddress,q as isManagedArtifactDoc,Me as isOriginAdmitted,e as isOrphanMode,_e as isPairedWriteOrigin,Y as isPathWithinDir,Kn as isPeerAdmitted,$i as isProcessAlive,Le as isProjectRoot,fe as isReservedForUserTree,xi as isSelfWrite,wr as isSystemDoc,ci as isToleranceTelemetryEnabled,Qi as isValidLockPid,C as lastKnownHash,Pn as listRescueCheckpoints,Tt as listStarterPacks,Yt as loadCustomAgents,be as loadPrincipal,ha as lockBaseUrl,ra as lockFilePath,Ui as loggerFactory,qi as logsCurrentPath,Zi as logsPreviousPath,Ir as makeLazyEmbeddingsKeyStore,fa as markServerLockDraining,gt as mountMcpAndApi,Pi as normalizeFsPath,z as originGitHubHost,ui as packageVersionMajorMinor,fi as parseAuthRejectionWire,ln as parseGitVersion,et as parseHocuspocusAuthToken,de as parseKeepaliveConnectionId,pt as pathToDocName,Je as planSeed,Ht as prepareSingleFileOpen,qt as processCommand,_r as processUsage,Rr as readAllTargets,an as readBundleDecision,Re as readOwnNativeRules,da as readProcessLock,ca as readProcessLockDetailed,x as readProjectHeadState,Hr as readProjectLocalSemanticConfig,oa as readServerLock,$n as readServerPackageVersion,Xr as readSkillInstallStateSnapshot,Wn as readStateManifest,un as readTargetRecordedAt,bn as readTargetVersion,ze as readUiLock,Nt as reconcile,kn as recordContributor,Bt as recordSkillInstallEvent,oe as registerAllTools,$ as registerWrite,aa as releaseProcessLock,ta as releaseServerLock,G as releaseUiLock,ct as removeLastKnownHash,gr as reportSkillInstall,yr as resetMetrics,u as resolveBundleEnabled,_i as resolveBundledSkillDir,hi as resolveContentDir,me as resolveCursorBinaryDefault,Er as resolveCursorSpawnInvocation,y as resolveEffectiveLinterConfig,Jr as resolveEmbeddingsCredential,Xt as resolveLockDir,Hn as resolveNativeConfigForDoc,W as resolveNativeMarkdownlintConfig,Ft as resolvePack,Pr as resolvePackageVersion,jn as resolveSkillInstallReportSettings,d as resolveUiInfo,Cn as restoreContributors,pi as restoreLifecycleFromConflictsJson,m as rewriteMarkdownLinksForDocumentRename,fn as rewriteWikiLinksForDocumentRename,yn as runAuthReposSubprocess,xr as runAuthStatusSubprocess,pn as runCloneSubprocess,rr as runDeviceFlowSubprocess,dr as runWithMcpLogger,Ue as safeContentPath,Un as safeSubdir,Ut as safetyCheckpoint,Gn as sanitizeClientName,pr as saveInMemoryCheckpoint,Fr as saveVersion,A as seedBasenameIndex,fr as serializeError,Ci as setActiveSpanAttributes,Ke as setupServerObservers,tn as shadowGit,Bi as shutdownTelemetry,Wi as spansCurrentPath,Gi as spansPreviousPath,le as spawnDetached,He as splitMarkdownBlocks,vt as startWatcher,ft as streamingProblemEvent,Rt as swapContributors,Ye as teardownToleranceTelemetryWriter,Sn as toBroadcasterKey,ji as tracedAppendFileSync,Ii as tracedLinkSync,Oi as tracedMkdir,Mi as tracedMkdirSync,Ri as tracedRename,ki as tracedRenameSync,Fi as tracedRmSync,Ni as tracedRmdirSync,Ai as tracedUnlinkSync,Ei as tracedWriteFile,zi as tracedWriteFileSync,ri as trustSystemCertificates,en as untrackTrackedProjectSkillProjection,J as updateLastKnownHash,ia as updateProcessLockPort,ua as updateServerLockPort,ae as updateUiLockPort,Lt as validateAgentId,Ur as validateCloneInputs,Qt as validateSkillZip,pa as waitForServerLockDrain,Pt as withHiddenWindowsConsole,Ti as withSpan,wi as withSpanSync,Sr as writeBundleDecision,P as writeMarkdownlintRule,Qe as writeRootGitignoreForNewRepo,g as writeStateManifest,ir as writeTargetVersion,pe as writeTracker};
1
+ import{$o as e,U as t,_ as n,_s as r,h as i,ks as a,nc as o,ns as s,rs as c,ys as l,z as u}from"./src-Dj6UxpKM.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Bt as w,C as T,Ca as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dr as P,Dt as F,E as I,Ei as L,En as R,Er as z,Et as B,F as V,Fi as H,Fn as U,Fr as W,Ft as G,G as K,Gi as q,Gn as J,Gr as Y,Gt as X,H as Z,Hi as Q,Hn as $,Hr as ee,Ht as te,I as ne,Ii as re,In as ie,It as ae,J as oe,Ji as se,Jn as ce,Jr as le,Jt as ue,K as de,Ki as fe,Kn as pe,Kr as me,Kt as he,L as ge,Li as _e,Ln as ve,Lt as ye,M as be,Mi as xe,Mn as Se,Mr as Ce,Mt as we,N as Te,Ni as Ee,Nn as De,Nr as Oe,Nt as ke,O as Ae,Oi as je,On as Me,Or as Ne,Ot as Pe,P as Fe,Pi as Ie,Pn as Le,Pr as Re,Pt as ze,Q as Be,Qi as Ve,Qn as He,Qr as Ue,Qt as We,R as Ge,Ri as Ke,Rn as qe,Rt as Je,S as Ye,Sa as Xe,Si as Ze,Sn as Qe,Sr as $e,St as et,T as tt,Ti as nt,Tn as rt,Tr as it,Tt as at,U as ot,Ui as st,Un as ct,Ur as lt,Ut as ut,V as dt,Vi as ft,Vn as pt,Vr as mt,Vt as ht,W as gt,Wi as _t,Wn as vt,Wr as yt,Wt as bt,X as xt,Xi as St,Xn as Ct,Xr as wt,Xt as Tt,Y as Et,Yi as Dt,Yn as Ot,Yr as kt,Yt as At,Z as jt,Zi as Mt,Zn as Nt,Zr as Pt,Zt as Ft,_ as It,_a as Lt,_i as Rt,_n as zt,_r as Bt,_t as Vt,a as Ht,aa as Ut,ai as Wt,an as Gt,ar as Kt,at as qt,b as Jt,ba as Yt,bi as Xt,bn as Zt,br as Qt,bt as $t,c as en,ca as tn,ci as nn,cn as rn,cr as an,d as on,da as sn,di as cn,dn as ln,dr as un,ea as dn,ei as fn,en as pn,er as mn,et as hn,f as gn,fa as _n,fi as vn,fn as yn,fr as bn,g as xn,ga as Sn,gi as Cn,gn as wn,gr as Tn,gt as En,h as Dn,ha as On,hi as kn,hn as An,hr as jn,ht as Mn,i as Nn,ia as Pn,ii as Fn,in as In,ir as Ln,it as Rn,j as zn,ji as Bn,jn as Vn,jr as Hn,jt as Un,k as Wn,ki as Gn,kn as Kn,kr as qn,kt as Jn,l as Yn,la as Xn,li as Zn,ln as Qn,lr as $n,m as er,ma as tr,mi as nr,mn as rr,mr as ir,mt as ar,n as or,na as sr,ni as cr,nn as lr,nr as ur,nt as dr,o as fr,oa as pr,oi as mr,on as hr,or as gr,ot as _r,p as vr,pa as yr,pi as br,pn as xr,pr as Sr,q as Cr,qi as wr,qn as Tr,qr as Er,qt as Dr,r as Or,ra as kr,ri as Ar,rn as jr,rr as Mr,rt as Nr,s as Pr,sa as Fr,si as Ir,sn as Lr,sr as Rr,st as zr,t as Br,ta as Vr,ti as Hr,tn as Ur,tr as Wr,tt as Gr,u as Kr,ua as qr,ui as Jr,un as Yr,ur as Xr,v as Zr,va as Qr,vi as $r,vn as ei,vr as ti,vt as ni,w as ri,wi as ii,wn as ai,wr as oi,wt as si,x as ci,xa as li,xn as ui,xr as di,xt as fi,y as pi,ya as mi,yi as hi,yn as gi,yr as _i,yt as vi,z as yi,zi as bi,zn as xi,zt as Si}from"./src-DvuwJKkU.mjs";import{C as Ci,E as wi,T as Ti,_ as Ei,b as Di,c as Oi,d as ki,g as Ai,i as ji,l as Mi,m as Ni,n as Pi,p as Fi,s as Ii,t as Li,u as Ri,v as zi,w as Bi,x as Vi,y as Hi}from"./fs-traced-DV9uD41t.mjs";import{a as Ui,d as Wi,f as Gi,i as Ki,l as qi,n as Ji,r as Yi,t as Xi,u as Zi}from"./logger-DFxEUjvj.mjs";import{C as Qi,S as $i,_ as ea,a as ta,c as na,d as ra,g as ia,h as aa,i as oa,l as sa,m as ca,n as la,o as ua,p as da,r as fa,s as pa,t as ma,u as ha,v as ga,y as _a}from"./server-lock-CeKMy65H.mjs";export{tr as AGENT_ID_MAX_LEN,On as AGENT_ID_RE,_ as AGENT_WRITE_ORIGIN,li as AcpPermissionStore,Qr as AcpRegistry,nt as AcpThreadManager,D as AgentFocusBroadcaster,Ze as AgentPresenceBroadcaster,Bn as AgentSessionCapacityError,xe as AgentSessionManager,Mn as AutoStartDisabledError,di as BUNDLE_IDS,$e as BUNDLE_SCOPE,k as BUNDLE_SKILL_NAME,Wr as BacklinkIndex,Q as CC1Broadcaster,l as CC1_CONTRACT_VERSION,An as CONFIG_FILENAME,Ot as CONFLICT_MARKER_RE,lt as CURSOR_BUNDLE_PATHS_BY_PLATFORM,It as ConfigSchema,se as DEFAULT_CHECKPOINT_RETENTION,nn as DEFAULT_EMBEDDINGS_DIMENSIONS,w as DEFAULT_PACK_ID,dt as DocumentDurabilityState,Zn as EMBEDDINGS_API_KEY_ENV,O as ExposureConsentError,mi as FEATURED_AGENT_IDS,Dt as FILE_SYSTEM_WRITER,p as FILE_WATCHER_ORIGIN,cr as FileEmbeddingsBackend,lr as GIT_PREFLIGHT_FAIL_SPAN_NAME,St as GIT_UPSTREAM_WRITER,Xe as GitDirAccessError,In as GitNotAvailableError,Gt as GitTooOldError,En as HOCUSPOCUS_AUTH_REJECTION_REASONS,Vt as HocuspocusAuthRejection,ni as HocuspocusAuthTokenSchema,kt as INSTALLED_AGENTS_SCHEMES,r as LINEAGE_EPOCH_KEY,Ge as LIVE_DERIVED_INDEX_DEBOUNCE_MS,ht as LOG_MD_TEMPLATE,at as MANAGED_RENAME_ORIGIN,L as MAX_ACP_THREADS,Ee as MAX_AGENT_SESSIONS,je as MCP_CONNECTION_ID_HEADER,e as MCP_SERVER_NAME,Ie as MIN_EVICTABLE_IDLE_MS,hr as MIN_GIT_VERSION,Z as MISSING_OK_CONFIG_MESSAGE,E as MalformedGitPointerError,hn as McpLogger,ot as MissingOkConfigError,re as OBSERVER_SYNC_ORIGIN,wn as OK_OKIGNORE_TEMPLATE,s as ORPHAN_MODES,o as PROTOCOL_VERSION,Xi as PinoLogger,na as ProcessLockCollisionError,Yn as ProjectGitInitError,B as ROLLBACK_ORIGIN,zt as ROOT_GITIGNORE_TEMPLATE,ea as RUNTIME_VERSION,Mt as SERVICE_WRITER,Tn as SKILL_INSTALL_EVENTS_FILE_REL,u as SKILL_STATE_TARGETS,te as STARTER_FOLDERS,ut as STARTER_FOLDER_FRONTMATTER_FILENAME,bt as STARTER_PACKS,X as STARTER_PACK_IDS,he as STARTER_TEMPLATES,tt as STATE_MANIFEST_FILENAME,ga as STATE_SCHEMA_VERSION,a as SYSTEM_DOC_NAME,We as SeedPrerequisiteError,h as SeedRootDirError,ma as ServerLockCollisionError,Br as SingleFileNotAFileError,or as SingleFileNotFoundError,Or as SingleFileNotMarkdownError,I as StateManifestError,mn as TagIndex,oi as USER_GLOBAL_BUNDLE_IDS,we as UiLockCollisionError,F as __getShowAllWalkStatsForTesting,Pe as __resetShowAllWalkStatsForTesting,sa as acquireProcessLock,la as acquireServerLock,ke as acquireUiLock,H as applyAgentMarkdownWrite,Tr as applyExternalChange,Si as applySeed,j as assertCompatibleStateManifest,Lr as assertGitAvailable,U as assertNeverDiskEvent,ii as attachAcpThreadSocket,ar as attachIdleShutdown,Zr as bootServer,Mr as buildAndOpenSkill,ei as buildConfigYmlContent,Et as buildExecResult,ai as buildIngressPolicy,M as buildOkMcpStdioCommand,ti as buildSkillZip,Dr as buildStarterFolderFrontmatterYaml,Ve as buildWipTree,it as bundleSkillMdPath,Ar as canonicalProjectKey,ie as classifyEvents,Li as classifyFsPath,Fn as clearAllEmbeddingsKeys,cn as clearContributors,ue as coercePackId,i as colorFromSeed,f as commitUpstreamImport,dn as commitWip,Vr as commitWipFromTree,rn as compareSemver,Ne as composeEffectiveLinterConfig,qn as composeFrontmatterSchemasConfig,Ct as containsConflictMarkers,ve as contentHash,vn as contributorCount,Fe as countShadowObjects,V as countStaleAgentWipRefs,ne as countWipRefs,Jn as createApiExtension,si as createAssetServeMiddleware,K as createCollaborationHost,mt as createContentFilter,ee as createContentFilterAsync,Wt as createEmbeddingsSecretStore,Nn as createEphemeralProjectDir,ce as createExternalChangeHandler,gn as createFileLogger,yi as createLiveDerivedIndexExtension,Cr as createMcpHttpHandler,wt as createOsProbe,Te as createPersistenceExtension,T as createServer,zn as createServerObserverExtension,bi as createStreamingErrorWriter,Ji as createTestLogger,mr as describeStoredEmbeddingsKey,xn as detectClaudeDesktopPresence,Qn as detectGit,Ae as detectProjectShape,Ln as detectUserSkillHosts,Nr as discoverLockDirs,Ce as discoverMarkdownlintConfig,jr as emitPreflightFailureSpan,xt as encodeDocName,jt as encodeFolderRoute,Be as encodeSkillRoute,Kr as ensureProjectGit,gi as ensureProjectSkillGitignore,S as errorResponse,qe as evictStaleTrackerEntries,b as extractHeadings,Rn as extractOkBinaryPath,ur as extractWikiLinksFromMarkdown,Yr as fallbackPaths,on as findEnclosingGitRoot,De as findEnclosingProjectRoot,Oe as findNativeMarkdownlintFile,vr as flushFileLogger,vi as formatAuthRejectionWire,br as formatContributors,nr as formatContributorsFrom,ye as formatPackRationale,sr as gcCheckpointRefs,Gr as getCurrentMcpLogger,rt as getIngressContext,$r as getLocalDir,er as getLogFilePath,Yi as getLogger,Dn as getLogsDir,_a as getMachineId,Hi as getMeter,Xn as getMetrics,Di as getTracer,qr as handleCollabSocketError,yt as handleSpawnCursor,R as hasForwardingHeaders,ge as hasGcLogLatch,n as iconFromClientName,sn as incrementCollabSocketFilteredError,_n as incrementServerObserverFire,Zt as initContent,kr as initShadowRepo,Vi as initTelemetry,Jt as initToleranceTelemetryWriter,zr as installPrettyZodErrors,Ki as installTestLoggers,Kt as installUserSkill,Se as isAllowedApiOrigin,v as isAllowedWorkspaceHostHeader,st as isConfigDoc,$t as isHocuspocusAuthRejectionReason,N as isHostAdmitted,At as isKnownPackId,_t as isLinkIndexExcludedDoc,Vn as isLoopbackAddress,q as isManagedArtifactDoc,Me as isOriginAdmitted,c as isOrphanMode,_e as isPairedWriteOrigin,Y as isPathWithinDir,Kn as isPeerAdmitted,$i as isProcessAlive,Le as isProjectRoot,fe as isReservedForUserTree,xi as isSelfWrite,wr as isSystemDoc,ci as isToleranceTelemetryEnabled,Qi as isValidLockPid,C as lastKnownHash,Pn as listRescueCheckpoints,Tt as listStarterPacks,Yt as loadCustomAgents,be as loadPrincipal,ha as lockBaseUrl,ra as lockFilePath,Ui as loggerFactory,qi as logsCurrentPath,Zi as logsPreviousPath,Ir as makeLazyEmbeddingsKeyStore,fa as markServerLockDraining,gt as mountMcpAndApi,Pi as normalizeFsPath,z as originGitHubHost,ui as packageVersionMajorMinor,fi as parseAuthRejectionWire,ln as parseGitVersion,et as parseHocuspocusAuthToken,de as parseKeepaliveConnectionId,pt as pathToDocName,Je as planSeed,Ht as prepareSingleFileOpen,qt as processCommand,_r as processUsage,Rr as readAllTargets,an as readBundleDecision,Re as readOwnNativeRules,da as readProcessLock,ca as readProcessLockDetailed,x as readProjectHeadState,Hr as readProjectLocalSemanticConfig,oa as readServerLock,$n as readServerPackageVersion,Xr as readSkillInstallStateSnapshot,Wn as readStateManifest,un as readTargetRecordedAt,bn as readTargetVersion,ze as readUiLock,Nt as reconcile,kn as recordContributor,Bt as recordSkillInstallEvent,oe as registerAllTools,$ as registerWrite,aa as releaseProcessLock,ta as releaseServerLock,G as releaseUiLock,ct as removeLastKnownHash,gr as reportSkillInstall,yr as resetMetrics,t as resolveBundleEnabled,_i as resolveBundledSkillDir,hi as resolveContentDir,me as resolveCursorBinaryDefault,Er as resolveCursorSpawnInvocation,y as resolveEffectiveLinterConfig,Jr as resolveEmbeddingsCredential,Xt as resolveLockDir,Hn as resolveNativeConfigForDoc,W as resolveNativeMarkdownlintConfig,Ft as resolvePack,Pr as resolvePackageVersion,jn as resolveSkillInstallReportSettings,d as resolveUiInfo,Cn as restoreContributors,pi as restoreLifecycleFromConflictsJson,m as rewriteMarkdownLinksForDocumentRename,fn as rewriteWikiLinksForDocumentRename,yn as runAuthReposSubprocess,xr as runAuthStatusSubprocess,pn as runCloneSubprocess,rr as runDeviceFlowSubprocess,dr as runWithMcpLogger,Ue as safeContentPath,Un as safeSubdir,Ut as safetyCheckpoint,Gn as sanitizeClientName,pr as saveInMemoryCheckpoint,Fr as saveVersion,A as seedBasenameIndex,fr as serializeError,Ci as setActiveSpanAttributes,Ke as setupServerObservers,tn as shadowGit,Bi as shutdownTelemetry,Wi as spansCurrentPath,Gi as spansPreviousPath,le as spawnDetached,He as splitMarkdownBlocks,vt as startWatcher,ft as streamingProblemEvent,Rt as swapContributors,Ye as teardownToleranceTelemetryWriter,Sn as toBroadcasterKey,ji as tracedAppendFileSync,Ii as tracedLinkSync,Oi as tracedMkdir,Mi as tracedMkdirSync,Ri as tracedRename,ki as tracedRenameSync,Fi as tracedRmSync,Ni as tracedRmdirSync,Ai as tracedUnlinkSync,Ei as tracedWriteFile,zi as tracedWriteFileSync,ri as trustSystemCertificates,en as untrackTrackedProjectSkillProjection,J as updateLastKnownHash,ia as updateProcessLockPort,ua as updateServerLockPort,ae as updateUiLockPort,Lt as validateAgentId,Ur as validateCloneInputs,Qt as validateSkillZip,pa as waitForServerLockDrain,Pt as withHiddenWindowsConsole,Ti as withSpan,wi as withSpanSync,Sr as writeBundleDecision,P as writeMarkdownlintRule,Qe as writeRootGitignoreForNewRepo,g as writeStateManifest,ir as writeTargetVersion,pe as writeTracker};