@inkeep/open-knowledge 0.59.0-beta.28 → 0.59.0-beta.29
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.
- package/dist/{acp-harness-probe-BioMl_fC.mjs → acp-harness-probe-BJFGLFDN.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-CdBtCoQb.mjs +2 -0
- package/dist/{git-handle-Hi0B37cf.mjs → git-handle-BnzI58ud.mjs} +2 -2
- package/dist/git-handle-M-kQfBzM.mjs +1 -0
- package/dist/index.mjs +76 -76
- package/dist/init-D-sP79Rh.mjs +1 -0
- package/dist/{init-DPUo80Dj.mjs → init-xLzJlygq.mjs} +3 -3
- package/dist/{launch-json-removal-D_4gAmmg.mjs → launch-json-removal-Bsk7l2Lq.mjs} +2 -2
- package/dist/loader-BLj5i1z_.mjs +1 -0
- package/dist/{loader-LDz9zBYC.mjs → loader-CQ-YldFC.mjs} +2 -2
- package/dist/md-manager-C7XAJMWr.mjs +2 -0
- package/dist/{open-browser-8aAyMvgv.mjs → open-browser-CB0sbYH4.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-B34Qj3q9.mjs → preview-B3OgLdgw.mjs} +2 -2
- package/dist/preview-BKpTTzwp.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DJkcYUFG.js → ActivityModeContent-rkVFPeGI.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-QpnE2RxP.js → AgentDiffPane-UM3yi_Jj.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BNxw9YWy.js → AgentThreadClientBinder-DbKx5B2j.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-DlJxY2cd.js → CodeMirrorPropInput-SvCCpq_g.js} +1 -1
- package/dist/public/assets/{DocumentContext-BI0smsxZ.js → DocumentContext-BrlDlUx7.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-DVfUE-Hx.js → EditorModeToggle-Coj-pKbp.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CH3AktRr.js → EnableSyncConfirmDialog-CMQPWKxH.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-HqU6SXrF.js → ExcalidrawDocEditor-Ct_C78n1.js} +1 -1
- package/dist/public/assets/FeedbackForm-cUkhA17t.js +1 -0
- package/dist/public/assets/{GraphPanel-MtHSCEEc.js → GraphPanel-C4IPsveQ.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DqbRbXfG.js → ImportSkillDialog-BUIlH24A.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-DQQlzcbN.js → LintConfigEditor-Q1gGaOab.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-B4xOs3fA.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-CPsIQVz8.js → ManagedArtifactProperties-DUIo-gDU.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-UIF1Y7PM.js → MermaidDocEditor-DBbbNWFO.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BPCVo30u.js → PropertyDisplayRow-DfLhrMek.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-BoQrLPkN.js → ReportBugDialogBody-D5SrIAvZ.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-D5aVltyV.js → SchemaConfigEditor-CkKt8e-E.js} +1 -1
- package/dist/public/assets/{SessionsHost-B0WtFo-7.js → SessionsHost-DxbKcTfw.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Cbsyvnqh.js → SettingsDialogBody-BaPG44Cx.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-DxracRWc.js → ShareBranchSwitchDialog-BvkvEHCc.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-Cfp4wdzT.js → ShareReceiveDialog-C9KNKynH.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DxcAaxnj.js → ShareReceiveMissDialog-CwqxBbfk.js} +1 -1
- package/dist/public/assets/{SkillCostValue-CDg_lpMT.js → SkillCostValue-BvB_BW1x.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-BEG94SMV.js → SkillEditBanner-D0gTinuX.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-xkIcUjyz.js → SkillInstallMenu-Cb7qSrC0.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-WxvVrIDh.js → SkillOriginInline-IRuhZu-j.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-BvIlOBgX.js → SkillToolbarControls-6i3dV6vs.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-DMGLRgXN.js → SlidesToolbarControls-D5EykdNJ.js} +1 -1
- package/dist/public/assets/{SourceEditor-BoCr54OC.js → SourceEditor-p9dgTOkJ.js} +1 -1
- package/dist/public/assets/{TerminalPanel-B136_x01.js → TerminalPanel-cl3V5Lv6.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-C7xQ_h9C.js → TerminalWindowApp-BoxazHdg.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DZYfekpd.js → TextDocEditor-DOoM8Kxy.js} +1 -1
- package/dist/public/assets/{ThreadView-DenCwvfW.js → ThreadView-BxvEDVSr.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-XlGr0GTw.js → TimelineDiffPane-BPuM41-O.js} +1 -1
- package/dist/public/assets/{agent-diff-store-BVPptGby.js → agent-diff-store-D7oOrlOa.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DWZvELXg.js → auth-state-cache-1gTw3GkH.js} +1 -1
- package/dist/public/assets/{client-version-D2k9ZCWX.js → client-version-DPop7QlO.js} +1 -1
- package/dist/public/assets/{comment-chips-D_lOHAKs.js → comment-chips-BSXPyCs1.js} +1 -1
- package/dist/public/assets/{config-provider-CDwrJPp7.js → config-provider-CYqYSyJg.js} +1 -1
- package/dist/public/assets/{dist-Cjt7VASv2.js → dist-YRM6aCj22.js} +190 -190
- package/dist/public/assets/{doc-paths-B8neiW-a.js → doc-paths-DHGjMfMc.js} +1 -1
- package/dist/public/assets/{documents-events-XYcpMExe.js → documents-events-Dh2E-mNH.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-D09K46if.js → file-tree-adapter-8KZtqBfU.js} +1 -1
- package/dist/public/assets/{file-tree-utils-D46TNM8I.js → file-tree-utils-mm4DWltG.js} +1 -1
- package/dist/public/assets/{folder-config-api-BF1s5fn5.js → folder-config-api-ReDuYJ0J.js} +1 -1
- package/dist/public/assets/i18n-BQpXlvfY.js +1 -0
- package/dist/public/assets/{index-DVAzmNmM.js → index-hC142Nnf.js} +7 -7
- package/dist/public/assets/{lint-config-client-CexP4XjM.js → lint-config-client-DDlKZf1J.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-RW_wnt3c.js → markdownlint-rule-browser-Cn61TsP6.js} +1 -1
- package/dist/public/assets/{navigation-targets-B81SRxAl.js → navigation-targets-CFQds_7M.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-ONxSWsRO.js → open-managed-artifact-tab-DI0a5-3C.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-EbqHz-1O.js → pending-receive-nav-store-BQWmsZRi.js} +1 -1
- package/dist/public/assets/{progress-BNa6s6eY.js → progress-DKgTQ0Qz.js} +1 -1
- package/dist/public/assets/{prop-types-Bi69iPbr.js → prop-types-aV6oiD-U.js} +1 -1
- package/dist/public/assets/{receive-store-DvP10j_m.js → receive-store-D1fi7HMJ.js} +1 -1
- package/dist/public/assets/{selection-context-BT0IXs_k.js → selection-context-4KGHvsgP.js} +1 -1
- package/dist/public/assets/{skill-actions-C6XMzsRk.js → skill-actions-BndTKw4P.js} +1 -1
- package/dist/public/assets/{skill-scope-D_Zsy3lJ.js → skill-scope-TpOVvXXj.js} +1 -1
- package/dist/public/assets/{skills-api-BM2BLHCX.js → skills-api-Ci4vZCl_.js} +1 -1
- package/dist/public/assets/{src-DMrqP3nT.js → src-Dyjlw1SL.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BFaMBmJa.js → tag-pill-input-ltY20AtL.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CWvy9cE2.js → target-navigation-intent-Bq0cHa0H.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BbYqTPWX.js → terminal-cli-display-MwCkMfQx.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BPjoquS2.js → terminal-launch-events-cj2KCTDl.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DxMhdnxk.js → terminal-telemetry-ElOB2Hsl.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-B7DPFEEZ.js → typing-burst-detector-kXx1cN6a.js} +1 -1
- package/dist/public/assets/{uninstall-DDXNRWQJ.js → uninstall-CJfdIccl.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CsxwP-4j.js → use-activity-panel-AklD6yAB.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-cAcJ-HL5.js → use-apply-config-color-theme-zpd8fyW1.js} +1 -1
- package/dist/public/assets/{use-collab-url-C79vcmVC.js → use-collab-url-BIoe0OLV.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-D63CLflu.js → use-live-xterm-theme-BgtSx-n3.js} +1 -1
- package/dist/public/assets/{use-open-skill-BXh-h1Gy.js → use-open-skill-CLhiKLe2.js} +1 -1
- package/dist/public/assets/{use-popular-skills-Dzx69gvR.js → use-popular-skills-CSwbHrqM.js} +1 -1
- package/dist/public/assets/{use-settings-route-DT_sDrP6.js → use-settings-route-BuFQqdtV.js} +1 -1
- package/dist/public/assets/{use-skill-origin-djszP4BX.js → use-skill-origin-CbbiS8DZ.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-D8pfw24f.js → use-terminal-enabled-GezhypT9.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CJndzyXq.js → use-timeline-entry-diff-DyOMjIES.js} +1 -1
- package/dist/public/assets/{use-workspace-DanpYgc9.js → use-workspace-C3C8xAY5.js} +1 -1
- package/dist/public/index.html +45 -45
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-DOW2WCJo.mjs → repair-launch-json-D6Vjzoqv.mjs} +2 -2
- package/dist/{repair-mcp-configs-BAzttfrs.mjs → repair-mcp-configs-B1Sn-_ip.mjs} +2 -2
- package/dist/repair-skills-Bn47U59J.mjs +1 -0
- package/dist/{repair-skills-Djy2-44d.mjs → repair-skills-Cs-CbtpF.mjs} +2 -2
- package/dist/{resolve-project-root-B2P-8M30.mjs → resolve-project-root-BD_5TDzP.mjs} +2 -2
- package/dist/server-lock-CV9U-jz6.mjs +1 -0
- package/dist/{server-lock-B131eKn8.mjs → server-lock-DCzdk2Up.mjs} +2 -2
- package/dist/{skill-teardown-Dt9ANTO9.mjs → skill-teardown-TMX-h8on.mjs} +2 -2
- package/dist/{src-C7RaGUoz.mjs → src-B-O_aZ-p.mjs} +2 -2
- package/dist/src-CAvG_8lL.mjs +1 -0
- package/dist/{src-Cw4FdZEC.mjs → src-D28v5dI-.mjs} +1 -1
- package/dist/{src-NmTX6dJc.mjs → src-Dm-FGyIz.mjs} +130 -130
- package/dist/{src-DG3uYi4g.mjs → src-vJKK8Bgd.mjs} +4 -4
- package/dist/{start-CWLycoTz.mjs → start-7do63YHY.mjs} +3 -3
- package/dist/start-B5Kxjkxg.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-D0ddOHQC.mjs +0 -2
- package/dist/git-handle-DucRiayU.mjs +0 -1
- package/dist/init-C-aTi6-U.mjs +0 -1
- package/dist/loader-DBo0fX7c.mjs +0 -1
- package/dist/md-manager-BuU8asuD.mjs +0 -2
- package/dist/preview-DYuZMGB5.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DfjQFt_o.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DkmtIVIZ.js +0 -1
- package/dist/public/assets/i18n-DyGGRo1x.js +0 -1
- package/dist/repair-skills-BDpRz7o1.mjs +0 -1
- package/dist/server-lock-Cs4uE77d.mjs +0 -1
- package/dist/src-jBgBFohw.mjs +0 -1
- package/dist/start-BxDg_l3N.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Is as e,W as t}from"./src-NmTX6dJc.mjs";import{Dr as n,Sn as r,Tr as i,dr as a,gr as o,hr as s,mr as c,ur as l,xr as u,yr as d}from"./src-DG3uYi4g.mjs";import{b as f,c as p,n as m,s as h}from"./resolve-project-root-B2P-8M30.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-Dt9ANTO9.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:()=>u(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>u(e,{checkDesktop:!1}),readBundledVersion:()=>a(),readRecordedVersion:e=>c(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>d(e),readBundleDecision:(e,t)=>l(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(t,n,r){return r.existsSync(w(t,`.agents`,`skills`,n))||e.some(e=>r.existsSync(w(t,e.skillsRoot,n)))}function H(t,n,r,i,a,o){let s=[],c=w(t,`.agents`,`skills`,n);if(V(t,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of e){let e=w(t,r.skillsRoot,n);if(e!==c){if(!i.existsSync(w(t,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-host-absent`});continue}i.existsSync(e)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(w(t,`.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 e){let e=w(t,l.hostDir),u=w(t,l.skillsRoot,n);if(u===c){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!i.existsSync(e)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(i.existsSync(u)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-present`});continue}try{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,i){if(!e||!t)return!1;let a;try{a=e.configPath(n,i)}catch{return!1}let o=e=>w(r(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 p){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=h[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{m(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(e,r,a,o){let s=e=>{r.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await r.readRecordedVersion(e)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of n)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let n of d){let s=i[n.id],c=V(e,s,a),l=await r.readBundleDecision(e,s).catch(()=>null);if(!t(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(e,n.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:n.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:n.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(e,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:n.id,error:e instanceof Error?e.message:String(e)})}p.push(n)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(t=>V(e,i[t.id],a));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===n.length,_=[];for(let{id:t,sourceDir:n}of p){let r=H(e,i[t],n,a,o,l);h.push(...r.entries),_.push({id:t,anyWritten:r.anyWritten,landed:r.anyDestinationSucceeded,centralFailed:r.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:r.entries.some(e=>e.kind===`host`&&e.outcome===`failed`)})}let v=_.some(e=>e.centralFailed),y=_.every(e=>e.landed);if(g&&y&&!v){let t=null;try{await r.writeRecordedVersion(e,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(e){t=e instanceof Error?e.message:String(e),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:t})}for(let{id:e,anyWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:t===null?n?`installed`:`skip-current`:`failed`,version:l,...t===null?{}:{reason:`state-write-failed:${t}`}})}else{g||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:`bundle-unresolved`});for(let{id:e,centralFailed:t,hostFailed:n}of _)!t&&!n||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:`failed`,version:l,reason:n?`all-writes-failed`:`central-write-failed`})}return{outcome:`done`,version:l,entries:h}}async function 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{Is as e,W as t}from"./src-Dm-FGyIz.mjs";import{Dr as n,Sn as r,Tr as i,dr as a,gr as o,hr as s,mr as c,ur as l,xr as u,yr as d}from"./src-vJKK8Bgd.mjs";import{b as f,c as p,n as m,s as h}from"./resolve-project-root-BD_5TDzP.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-TMX-h8on.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:()=>u(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>u(e,{checkDesktop:!1}),readBundledVersion:()=>a(),readRecordedVersion:e=>c(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>d(e),readBundleDecision:(e,t)=>l(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(t,n,r){return r.existsSync(w(t,`.agents`,`skills`,n))||e.some(e=>r.existsSync(w(t,e.skillsRoot,n)))}function H(t,n,r,i,a,o){let s=[],c=w(t,`.agents`,`skills`,n);if(V(t,n,i)){i.existsSync(c)&&s.push({kind:`central`,path:c,outcome:`skipped-present`});for(let r of e){let e=w(t,r.skillsRoot,n);if(e!==c){if(!i.existsSync(w(t,r.hostDir))){s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-host-absent`});continue}i.existsSync(e)&&s.push({kind:`host`,editorId:r.editorId,hostDir:r.hostDir,path:e,outcome:`skipped-present`})}}return{entries:s,anyWritten:!1,anyDestinationSucceeded:!0}}let l=i.existsSync(w(t,`.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 e){let e=w(t,l.hostDir),u=w(t,l.skillsRoot,n);if(u===c){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!i.existsSync(e)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(i.existsSync(u)){s.push({kind:`host`,editorId:l.editorId,hostDir:l.hostDir,path:u,outcome:`skipped-present`});continue}try{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,i){if(!e||!t)return!1;let a;try{a=e.configPath(n,i)}catch{return!1}let o=e=>w(r(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 p){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=h[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{m(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(e,r,a,o){let s=e=>{r.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await r.readRecordedVersion(e)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of n)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let n of d){let s=i[n.id],c=V(e,s,a),l=await r.readBundleDecision(e,s).catch(()=>null);if(!t(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(e,n.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:n.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:n.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(e,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:n.id,error:e instanceof Error?e.message:String(e)})}p.push(n)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(t=>V(e,i[t.id],a));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===n.length,_=[];for(let{id:t,sourceDir:n}of p){let r=H(e,i[t],n,a,o,l);h.push(...r.entries),_.push({id:t,anyWritten:r.anyWritten,landed:r.anyDestinationSucceeded,centralFailed:r.entries.some(e=>e.kind===`central`&&e.outcome===`failed`),hostFailed:r.entries.some(e=>e.kind===`host`&&e.outcome===`failed`)})}let v=_.some(e=>e.centralFailed),y=_.every(e=>e.landed);if(g&&y&&!v){let t=null;try{await r.writeRecordedVersion(e,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(e){t=e instanceof Error?e.message:String(e),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:t})}for(let{id:e,anyWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:t===null?n?`installed`:`skip-current`:`failed`,version:l,...t===null?{}:{reason:`state-write-failed:${t}`}})}else{g||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:`bundle-unresolved`});for(let{id:e,centralFailed:t,hostFailed:n}of _)!t&&!n||s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:e,outcome:`failed`,version:l,reason:n?`all-writes-failed`:`central-write-failed`})}return{outcome:`done`,version:l,entries:h}}async function 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 f(`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-
|
|
4
|
+
//# sourceMappingURL=repair-skills-Cs-CbtpF.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{Ds as r,Es as i,Fs as a,js as o,vs as s}from"./src-
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{Ds as r,Es as i,Fs as a,js as o,vs as s}from"./src-Dm-FGyIz.mjs";import{Fn as c,Hr as l,Sn as u,ei as d,xr as f}from"./src-vJKK8Bgd.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 U(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.claude.json`)}function W(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 G(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.cursor`,`mcp.json`)}function Oe(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).CODEX_HOME??H(t).join(n,`.codex`)}function K(e={}){return H(e.platformName??process.platform).join(Oe(e),`config.toml`)}function q(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 ke(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 J(e={}){return H(e.platformName??process.platform).join(ke(e),`opencode.json`)}function Ae(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.openclaw`,`openclaw.json`)}function je(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.hermes`,`config.yaml`)}function Me(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)=>U({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)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(W({home:t}))},cursor:{id:`cursor`,label:j.cursor,configPath:(e,t)=>G({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(G({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)=>K({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(K({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)=>q({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(q({home:t})),projectSkillPath:e=>_(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:j.opencode,configPath:(e,t)=>J({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>s,buildEntry:(e,t)=>Se(t),scope:`global`,detectPath:(e,t)=>h(J({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)=>Ae({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)=>Me({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)=>je({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=l(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=f(`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`],d({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(c(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=h(o);if(e===o)break;o=e,s+=1}let l=r(a);return l!==null&&Be(l,n)?l===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:l,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}export{_e as S,H as _,A as a,he 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,pe as x,Fe as y};
|
|
56
|
-
//# sourceMappingURL=resolve-project-root-
|
|
56
|
+
//# sourceMappingURL=resolve-project-root-BD_5TDzP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t,s as n}from"./server-lock-DCzdk2Up.mjs";export{e as markServerLockDraining,t as releaseServerLock,n as updateServerLockPort};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./src-
|
|
2
|
-
//# sourceMappingURL=server-lock-
|
|
1
|
+
import"./src-Dm-FGyIz.mjs";import{r as e}from"./logger-Dq-cRhcP.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(){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 y=v(),b=1;function x(e){return new URL(e.url??``,`http://localhost`).searchParams}function S(e){let t=e?.code;return typeof t==`string`?t:void 0}const C=/^[A-Za-z0-9-]{8,64}$/;let w=null;function T(e){return n(e??p(),`.ok`,`machine-id`)}function E(n){if(n===void 0&&w!==null)return w;let r=T(n),i=null;try{let e=l(r,`utf-8`).trim();C.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&&(w=i),i}const 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===E():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!==E()||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:E(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??2,runtimeVersion:r.runtimeVersion??y},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(S(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){S(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){return!Array.isArray(e.capabilities)||e.capabilities.includes(`ui`)}function $(e,t){q({lockName:`server`,lockDir:e,...t})}function ee(e){U({lockName:`server`,lockDir:e})}function te(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,E as _,Z as a,y as b,te as c,V as d,k as f,H as g,q as h,ee as i,O as l,G as m,Y as n,$ as o,W as p,Q as r,X as s,J as t,R as u,S as v,b as x,x as y};
|
|
2
|
+
//# sourceMappingURL=server-lock-DCzdk2Up.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Is as e}from"./src-
|
|
2
|
-
//# sourceMappingURL=skill-teardown-
|
|
1
|
+
import{Is as e}from"./src-Dm-FGyIz.mjs";import{Dr as t,Tr as n}from"./src-vJKK8Bgd.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-TMX-h8on.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{G as t,K as n,ft as r}from"./sleep-DXvB05wr.mjs";import{Cc as i,_o as a,at as o,ot as s,wc as c}from"./src-
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{G as t,K as n,ft as r}from"./sleep-DXvB05wr.mjs";import{Cc as i,_o as a,at as o,ot as s,wc as c}from"./src-Dm-FGyIz.mjs";import{Ci as l,Pn as u,at as d,ei as f,it as p,ot as m,rt as h}from"./src-vJKK8Bgd.mjs";import{D as ee,F as g,I as _,k as v}from"./fs-traced-1KTQL4h-.mjs";import{C as y,S as b,_ as x,f as S,r as C}from"./server-lock-DCzdk2Up.mjs";import{t as w}from"./yazl-DZr4PyKA.mjs";import{b as T,h as te,m as ne}from"./resolve-project-root-BD_5TDzP.mjs";import{c as re}from"./colors-DSyAT9Cz.mjs";import{n as E}from"./acp-harness-probe-BJFGLFDN.mjs";import{E as D,T as ie,_ as ae,b as O,o as oe,w as k,x as se}from"./init-xLzJlygq.mjs";import{n as A}from"./constants-CdBtCoQb.mjs";import{t as j}from"./is-object-Bw0-z8qH.mjs";import"./loader-CQ-YldFC.mjs";import"./skill-teardown-TMX-h8on.mjs";import"./preview-B3OgLdgw.mjs";import{execSync as ce,spawnSync as M}from"node:child_process";import{basename as N,dirname as P,join as F,relative as le,resolve as I,sep as ue}from"node:path";import{cpSync as de,createWriteStream as fe,existsSync as L,lstatSync as pe,mkdirSync as R,mkdtempSync as me,readFileSync as z,readdirSync as he,readlinkSync as ge,rmSync as B,statSync as _e,writeFileSync as V}from"node:fs";import{arch as ve,freemem as ye,homedir as H,hostname as be,platform as xe,release as Se,tmpdir as Ce,totalmem as we,type as Te,uptime as Ee}from"node:os";import"node:fs/promises";import{createHash as De}from"node:crypto";var U=r();const Oe=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function ke(e,t,n=u){if(e!==void 0&&!Oe.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Ae=null;function je(e){Ae=e}function Me(){return Ae??process.cwd()}function Ne(){return F(H(),`.ok`,`bug-reports`)}function Pe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Ne(),r=`${t}-bugreport`,i=F(n,`${r}.zip`);for(let e=2;L(i);e+=1)i=F(n,`${r}-${e}.zip`);return i}function Fe(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let e=z(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return L(F(e,`.ok`))?De(`sha256`).update(I(e)).digest(`hex`).slice(0,12):null}function Ie(){let e={timestamp:new Date().toISOString(),platform:xe(),osType:Te(),osRelease:Se(),hostname:`[redacted]`,uptime:Ee(),freeMem:ye(),totalMem:we(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ce(`sw_vers -productVersion 2>/dev/null`,f({encoding:`utf8`})).trim()}catch{}try{let t=F(__dirname,`..`,`..`,`package.json`);L(t)&&(e.okVersion=JSON.parse(z(t,`utf8`)).version)}catch{}return e}const Le=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Re(e){let t=N(e);return Le.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function ze(e,t){return He(e,t).files}const Be=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Ve(e,t=E){let n=F(e,`${t}.ShipIt`);return L(n)?Be.map(e=>F(n,e)).filter(e=>L(e)):[]}function He(e,t){if(!L(t))return{files:[],excludedByProjectSlug:0};let n=he(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>F(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Re),i=[],a=r.filter(t=>{try{return z(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!Re(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ue(e){let t=F(e,`.ok`,`local`);return L(t)?{files:[`server.lock`,`last-spawn-error.log`,o].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function We(e){let t=F(e,`.ok`,`local`,`logs`);return L(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function Ge(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=c(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function Ke(e){for(let t of e.files)try{Ge({zipfile:e.zipfile,name:`${e.prefix}/${N(t)}`,content:z(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function qe(t){let{redact:n,outputPath:r,logger:a}=t,o=t.userLogsDir??F(H(),`.ok`,`logs`),s=t.projectDir?Fe(t.projectDir,a):null;R(P(r),{recursive:!0}),a?.info({projectSlug:s},`gathering diagnostic data`);let c=Ie();c.desktop=t.desktop??null,c.language=t.language??null;let{files:l,excludedByProjectSlug:u}=He(s,o),{files:d}=t.projectDir?Ue(t.projectDir):{files:[]},{files:f}=t.projectDir?We(t.projectDir):{files:[]},p=t.shipItLogFiles??[];a?.info({logFileCount:l.length,logFilesExcludedByProjectSlug:u,lockFileCount:d.length,localSinkFileCount:f.length,shipItLogFileCount:p.length},`files collected`);let m=[],h=[],{ZipFile:ee}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),g=new ee;Ke({zipfile:g,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:a}),Ke({zipfile:g,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:a}),Ke({zipfile:g,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:a});for(let e of t.extraFiles??[])try{let t=z(e.sourcePath),n=`extra/${e.zipName??N(e.sourcePath)}`;g.addBuffer(t,n),h.push(n)}catch(t){a?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Ge({zipfile:g,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let _=JSON.stringify(c,null,2);g.addBuffer(Buffer.from(_,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let v={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:h,redactions:m,sysinfo:c};g.addBuffer(Buffer.from(JSON.stringify(v,null,2),`utf8`),`MANIFEST.json`);let y=m.reduce((e,t)=>e+t.lineCount,0),b=new Set(p.map(e=>`logs/${N(e)}`)),x=h.filter(e=>b.has(e)),S=s?h.filter(e=>e.startsWith(`logs/`)&&!Re(e)&&!b.has(e)):[],C=[`# Bug Report Bundle`,``,`Generated: ${v.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${v.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...S.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...S.map(e=>`- ${e}`),``]:[],...x.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...x.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${i.join(`, `)}`,y>0?`${y} line(s) were scrubbed across ${m.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
2
2
|
`);g.addBuffer(Buffer.from(C,`utf8`),`README.md`),g.end();let w=fe(r);return g.outputStream.pipe(w),await new Promise((e,t)=>{w.on(`close`,e),w.on(`error`,t)}),a?.info({bundlePath:r,fileCount:h.length,redactionCount:y},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:h,redactions:m,redactedLineCount:y,generatedAt:v.generatedAt}}}var Je=e(w(),1),W=e(re(),1);function Ye(e){return _({absPath:v(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function Xe({home:e=H(),env:r=process.env}={}){let i=Ye(e),{override:o,preferenceList:s}=ee(r),{locale:c,source:l}=a({override:o,storedPreference:i,supportedLocales:n,preferenceList:s,autoDetectableLocales:t});return{preference:i,locale:c,source:l,systemLanguages:s}}function Ze(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Qe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function G(e,t){if(typeof e==`string`)return Ze(e,t.contentDir);if(Array.isArray(e))return e.map(e=>G(e,t));if(!Qe(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=G(i,t);return n}function $e(e,t){let n=z(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
3
3
|
`),i=n.split(`
|
|
4
4
|
`),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=G(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}V(e,r?`${a.join(`
|
|
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{G as t,K as n,ft as r}from"./sle
|
|
|
17
17
|
`).replace(/\n/g,`\r
|
|
18
18
|
`));let u=`${i?``:``}${l}`;return u!==r&&g(e,u,{mode:k(e)}),{kind:`removed`}}function fn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function pn(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function mn(e,t,n,r){if(t.status===`missing`||t.status===`corrupt`)return null;let i=t.lock,a=t.status===`alive`&&C(i)?{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r}:null;return{directory:i.worktreeRoot,server:{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r},ui:a,hostname:i.hostname,lockPath:t.lockPath,binary:n==null?null:p(n),command:n,isDesktop:fn(n)}}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:`stale`}const hn=new Set([`running`,`desktop`,`foreign`]);function gn(e){switch(e){case`running`:return W.default.green(e);case`desktop`:return W.default.blue(e);case`foreign`:return W.default.cyan(e);case`stale`:return W.default.yellow(e)}}function _n(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function vn(e){return`${_n(e.server.usage)} | ${_n(e.ui?.usage??null)}`}function yn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null?`—`:String(e.ui.port)}`}function bn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>[e.directory,yn(e),vn(e),Q(e),String(e.server.pid),pn(e.server.startedAt),e.binary??`—`]),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=gn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=W.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
19
19
|
`)}async function xn(e={}){let t=e.discover??h,n=e.inspect??X,r=e.log??(e=>console.log(e)),i=e.resolveCommand??d,a=e.resolveUsage??m,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=mn(e,t,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid));r!=null&&s.push(r)}if(e.json){let e=s.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(bn(e.all?s:s.filter(e=>hn.has(Q(e)))))}function Sn(){return new T(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await xn({all:t.all===!0||e===`all`,json:t.json===!0})})}function Cn(e,t,n={}){let r=n.isAlive??b,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function wn(e){let t=e.inspect??(t=>t===`ui`?Z(e.lockDir):X(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=Cn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function Tn(e,t=b){let n=await h(),r=null;for(let i of n){let n=X(i,`server`),a=Z(i);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function En(e){let t=wn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Dn(e){return new T(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=wn({lockDir:l(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await xn({});return}if(n===`all`){let e=await h();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=X(n,`server`),r=Z(n);!$(e,b)&&!$(r,b)||(En(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await Tn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}En(t);return}En(l(I(Me(),n)))})}export{Ne as _,$t as a,ke as b,nn as c,Z as d,X as f,Pe as g,Kt as h,cn as i,rn as l,Gt as m,Dn as n,an as o,Yt as p,Sn as r,en as s,wn as t,Qt as u,Me as v,je as y};
|
|
20
|
-
//# sourceMappingURL=src-
|
|
20
|
+
//# sourceMappingURL=src-B-O_aZ-p.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./src-Dm-FGyIz.mjs";import"./resolve-project-root-BD_5TDzP.mjs";import"./src-B-O_aZ-p.mjs";import"./acp-harness-probe-BJFGLFDN.mjs";import"./init-xLzJlygq.mjs";import{n as e}from"./loader-CQ-YldFC.mjs";import"./skill-teardown-TMX-h8on.mjs";import"./preview-B3OgLdgw.mjs";import"./mcp-migrate-event-9DFnNzHa.mjs";export{e as loadConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,Dc as t,Ss as n,Vs as r,W as i,Zs as a,g as o,v as s,vs as c,xs as l,zs as u}from"./src-NmTX6dJc.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,Ea as L,Ei as R,En as z,Er as B,Et as V,F as H,Fi as U,Fn as W,Fr as G,Ft as K,G as q,Gi as J,Gn as Y,Gr as X,Gt as Z,H as Q,Hi as $,Hn as ee,Ht as te,I as ne,Ii as re,In as ie,Ir as ae,It as oe,J as se,Ji as ce,Jn as le,Jr as ue,Jt as de,K as fe,Ki as pe,Kn as me,Kr as he,Kt as ge,L as _e,Li as ve,Ln as ye,Lr 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,Nr as Ae,Nt as je,O as Me,Oi as Ne,On as Pe,Or as Fe,Ot as Ie,P as Le,Pi as Re,Pn as ze,Pr as Be,Pt as Ve,Q as He,Qi as Ue,Qn as We,Qr as Ge,Qt as Ke,R as qe,Ri as Je,Rn as Ye,Rr as Xe,Rt as Ze,S as Qe,Sa as $e,Si as et,Sn as tt,Sr as nt,St as rt,T as it,Ta as at,Ti as ot,Tn as st,Tr as ct,Tt as lt,U as ut,Ui as dt,Un as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vt as _t,W as vt,Wi as yt,Wn as bt,Wr as xt,Wt as St,X as Ct,Xi as wt,Xn as Tt,Xr as Et,Xt as Dt,Y as Ot,Yi as kt,Yn as At,Yr as jt,Yt as Mt,Z as Nt,Zi as Pt,Zn as Ft,Zr as It,Zt as Lt,_ as Rt,_a as zt,_i as Bt,_n as Vt,_r as Ht,_t as Ut,a as Wt,aa as Gt,ai as Kt,an as qt,ar as Jt,at as Yt,b as Xt,ba as Zt,bi as Qt,bn as $t,br as en,bt as tn,c as nn,ca as rn,ci as an,cn as on,cr as sn,ct as cn,d as ln,da as un,di as dn,dn as fn,dr 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,gt as kn,h as An,ha as jn,hi as Mn,hn as Nn,hr as Pn,i as Fn,ia as In,ii as Ln,in as Rn,ir as zn,it as Bn,j as Vn,ji as Hn,jn as Un,jr as Wn,jt as Gn,k as Kn,ki as qn,kn as Jn,kr as Yn,kt as Xn,l as Zn,la as Qn,li as $n,ln as er,lr as tr,lt as nr,m as rr,ma as ir,mi as ar,mn as or,mr as sr,n as cr,na as lr,ni as ur,nn as dr,nr as fr,nt as pr,o as mr,oa as hr,oi as gr,on as _r,or as vr,ot as yr,p as br,pa as xr,pi as Sr,pn as Cr,pr as wr,q as Tr,qi as Er,qn as Dr,qr as Or,qt as kr,r as Ar,ra as jr,ri as Mr,rn as Nr,rr as Pr,rt as Fr,s as Ir,sa as Lr,si as Rr,sn as zr,sr as Br,st as Vr,t as Hr,ta as Ur,ti as Wr,tn as Gr,tr as Kr,tt as qr,u as Jr,ua as Yr,ui as Xr,un as Zr,ur 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,wn as si,wr as ci,wt as li,x as ui,xa as di,xi as fi,xn as pi,xr as mi,xt as hi,y as gi,ya as _i,yi as vi,yn as yi,yr as bi,yt as xi,z as Si,zi as Ci,zn as wi,zt as Ti}from"./src-DG3uYi4g.mjs";import{C as Ei,E as Di,T as Oi,_ as ki,b as Ai,c as ji,d as Mi,g as Ni,i as Pi,l as Fi,m as Ii,n as Li,p as Ri,s as zi,t as Bi,u as Vi,v as Hi,w as Ui,x as Wi,y as Gi}from"./fs-traced-1KTQL4h-.mjs";import{a as Ki,d as qi,f as Ji,i as Yi,l as Xi,n as Zi,r as Qi,t as $i,u as ea}from"./logger-Dq-cRhcP.mjs";import{C as ta,S as na,_ as ra,a as ia,b as aa,c as oa,d as sa,f as ca,g as la,h as ua,i as da,l as fa,m as pa,n as ma,o as ha,p as ga,r as _a,s as va,t as ya,u as ba,x as xa}from"./server-lock-B131eKn8.mjs";export{zt as AGENT_ID_MAX_LEN,ei as AGENT_ID_RE,Oe as AGENT_WRITE_ORIGIN,oi as AcpPermissionStore,di as AcpRegistry,Ne as AcpThreadManager,R as AgentFocusBroadcaster,ot as AgentPresenceBroadcaster,Re as AgentSessionCapacityError,U as AgentSessionManager,Ut as AutoStartDisabledError,k as BUNDLE_IDS,ci as BUNDLE_SCOPE,ct as BUNDLE_SKILL_NAME,fr as BacklinkIndex,J as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Sn as CONFIG_FILENAME,Tt as CONFLICT_MARKER_RE,he as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Rt as ConfigSchema,Pt as DEFAULT_CHECKPOINT_RETENTION,dn as DEFAULT_EMBEDDINGS_DIMENSIONS,xe as DEFAULT_PACK_ID,mt as DocumentDurabilityState,xn as EMBEDDINGS_API_KEY_ENV,si as ExposureConsentError,$e as FEATURED_AGENT_IDS,Ue as FILE_SYSTEM_WRITER,_n as FILE_WATCHER_ORIGIN,Kt as FileEmbeddingsBackend,h as GIT_PREFLIGHT_FAIL_SPAN_NAME,f as GIT_UPSTREAM_WRITER,at as GitDirAccessError,Gr as GitNotAvailableError,dr as GitTooOldError,ii as HOCUSPOCUS_AUTH_REJECTION_REASONS,xi as HocuspocusAuthRejection,tn as HocuspocusAuthTokenSchema,$t as HomeProjectRootError,Ge as INSTALLED_AGENTS_SCHEMES,cn as JSON_SCHEMA_DIALECT_2020_12,u as LINEAGE_EPOCH_KEY,qe as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Ze as LOG_MD_TEMPLATE,F as MANAGED_RENAME_ORIGIN,qn as MAX_ACP_THREADS,re as MAX_AGENT_SESSIONS,Hn as MCP_CONNECTION_ID_HEADER,c as MCP_SERVER_NAME,ve as MIN_EVICTABLE_IDLE_MS,Nr as MIN_GIT_VERSION,Q as MISSING_OK_CONFIG_MESSAGE,L as MalformedGitPointerError,vn as McpLogger,ut as MissingOkConfigError,Ci as OBSERVER_SYNC_ORIGIN,Cr as OK_OKIGNORE_TEMPLATE,B as ONBOARDING_BUNDLE_IDS,l as ORPHAN_MODES,t as PROTOCOL_VERSION,$i as PinoLogger,fa as ProcessLockCollisionError,Zn as ProjectGitInitError,Ie as ROLLBACK_ORIGIN,or as ROOT_GITIGNORE_TEMPLATE,aa as RUNTIME_VERSION,mn as SERVICE_WRITER,ri as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,Ti as STARTER_FOLDERS,w as STARTER_FOLDER_FRONTMATTER_FILENAME,_t as STARTER_PACKS,te as STARTER_PACK_IDS,pt as STARTER_TEMPLATES,it as STATE_MANIFEST_FILENAME,xa as STATE_SCHEMA_VERSION,a as SYSTEM_DOC_NAME,Mt as SeedPrerequisiteError,Dt as SeedRootDirError,ya as ServerLockCollisionError,Hr as SingleFileNotAFileError,cr as SingleFileNotFoundError,Ar as SingleFileNotMarkdownError,I as StateManifestError,Kr as TagIndex,P as USER_GLOBAL_BUNDLE_IDS,Xn as __getShowAllWalkStatsForTesting,b as __resetShowAllWalkStatsForTesting,ba as acquireProcessLock,ma as acquireServerLock,Je as applyAgentMarkdownWrite,le as applyExternalChange,oe as applySeed,j as assertCompatibleStateManifest,Rn as assertGitAvailable,ie as assertNeverDiskEvent,pi as assertNotHomeProjectRoot,M as attachAcpThreadSocket,kn as attachIdleShutdown,$r as bootServer,zn as buildAndOpenSkill,Nn as buildConfigYmlContent,Ot as buildExecResult,st as buildIngressPolicy,_ as buildOkMcpStdioCommand,en as buildSkillZip,St as buildStarterFolderFrontmatterYaml,Ur as buildWipTree,Fe as bundleSkillMdPath,gr as canonicalProjectKey,tt as canonicalizeForCompare,ye as classifyEvents,Bi as classifyFsPath,Rr as clearAllEmbeddingsKeys,ar as clearContributors,Z as coercePackId,o as colorFromSeed,lr as commitUpstreamImport,jr as commitWip,In as commitWipFromTree,qt as compareSemver,Wn as composeEffectiveLinterConfig,Te as composeFrontmatterSchemasConfig,Ft as containsConflictMarkers,Ye as contentHash,Mn as contributorCount,Le as countShadowObjects,H as countStaleAgentWipRefs,ne as countWipRefs,Gn as createApiExtension,V as createAssetServeMiddleware,q as createCollaborationHost,xt as createContentFilter,X as createContentFilterAsync,an as createEmbeddingsSecretStore,Fn as createEphemeralProjectDir,At as createExternalChangeHandler,yn as createFileLogger,Si as createLiveDerivedIndexExtension,Tr as createMcpHttpHandler,m as createOsProbe,De as createPersistenceExtension,T as createServer,Vn as createServerObserverExtension,$ as createStreamingErrorWriter,Zi as createTestLogger,$n as describeStoredEmbeddingsKey,wn as detectClaudeDesktopPresence,_r as detectGit,Me as detectProjectShape,Jt as detectUserSkillHosts,Fr as discoverLockDirs,G as discoverMarkdownlintConfig,gn as emitPreflightFailureSpan,Ct as encodeDocName,Nt as encodeFolderRoute,He as encodeSkillRoute,Jr as ensureProjectGit,Dn as ensureProjectSkillGitignore,dt as errorResponse,wi as evictStaleTrackerEntries,Ee as extractHeadings,Bn as extractOkBinaryPath,Pr as extractWikiLinksFromMarkdown,zr as fallbackPaths,ln as findEnclosingGitRoot,ze as findEnclosingProjectRoot,ae as findNativeMarkdownlintFile,br as flushFileLogger,hi as formatAuthRejectionWire,En as formatContributors,Bt as formatContributorsFrom,Ve as formatPackRationale,Gt as gcCheckpointRefs,qr as getCurrentMcpLogger,z as getIngressContext,fi as getLocalDir,rr as getLogFilePath,Qi as getLogger,An as getLogsDir,ra as getMachineId,Gi as getMeter,bn as getMetrics,Ai as getTracer,xr as handleCollabSocketError,Or as handleSpawnCursor,N as hasForwardingHeaders,_e as hasGcLogLatch,s as iconFromClientName,ir as incrementCollabSocketFilteredError,jn as incrementServerObserverFire,Vt as initContent,hr as initShadowRepo,Wi as initTelemetry,Xt as initToleranceTelemetryWriter,nr as installJsonSchemaDialect,Vr as installPrettyZodErrors,Yi as installTestLoggers,vr as installUserSkill,ke as isAllowedApiOrigin,Un as isAllowedWorkspaceHostHeader,pe as isConfigDoc,rt as isHocuspocusAuthRejectionReason,O as isHomeDir,Pe as isHostAdmitted,ge as isKnownPackId,Er as isLinkIndexExcludedDoc,we as isLoopbackAddress,ce as isManagedArtifactDoc,Jn as isOriginAdmitted,n as isOrphanMode,S as isPairedWriteOrigin,ue as isPathWithinDir,v as isPeerAdmitted,na as isProcessAlive,W as isProjectRoot,kt as isReservedForUserTree,C as isSelfWrite,wt as isSystemDoc,ui as isToleranceTelemetryEnabled,ta as isValidLockPid,gt as lastKnownHash,Lr as listRescueCheckpoints,kr as listStarterPacks,E as loadCustomAgents,Se as loadPrincipal,_a as lockAdvertisesUi,sa as lockBaseUrl,ca as lockFilePath,Ki as loggerFactory,Xi as logsCurrentPath,ea as logsPreviousPath,Xr as makeLazyEmbeddingsKeyStore,da as markServerLockDraining,vt as mountMcpAndApi,Li as normalizeFsPath,Yn as originGitHubHost,ni as packageVersionMajorMinor,A as parseAuthRejectionWire,on as parseGitVersion,li as parseHocuspocusAuthToken,fe as parseKeepaliveConnectionId,ee as pathToDocName,K as planSeed,Wt as prepareSingleFileOpen,Yt as processCommand,yr as processUsage,tr as readAllTargets,Qr as readBundleDecision,be as readOwnNativeRules,ga as readProcessLock,pa as readProcessLockDetailed,x as readProjectHeadState,Ln as readProjectLocalSemanticConfig,ia as readServerLock,pn as readServerPackageVersion,Cn as readSkillInstallStateSnapshot,Kn as readStateManifest,wr as readTargetRecordedAt,sr as readTargetVersion,We as reconcile,ti as recordContributor,bi as recordSkillInstallEvent,se as registerAllTools,ft as registerWrite,ua as releaseProcessLock,ha as releaseServerLock,bt as removeLastKnownHash,sn as reportSkillInstall,Tn as resetMetrics,Br as resolveBuiltinSkillHosts,i as resolveBundleEnabled,mi as resolveBundledSkillDir,et as resolveContentDir,jt as resolveCursorBinaryDefault,Et as resolveCursorSpawnInvocation,Ae as resolveEffectiveLinterConfig,Sr as resolveEmbeddingsCredential,D as resolveLockDir,Be as resolveNativeConfigForDoc,Xe as resolveNativeMarkdownlintConfig,de as resolvePack,Ir as resolvePackageVersion,Ht as resolveSkillInstallReportSettings,d as resolveUiInfo,vi as restoreContributors,gi as restoreLifecycleFromConflictsJson,ur as rewriteMarkdownLinksForDocumentRename,Mr as rewriteWikiLinksForDocumentRename,er as runAuthReposSubprocess,Zr as runAuthStatusSubprocess,Lt as runCloneSubprocess,fn as runDeviceFlowSubprocess,pr as runWithMcpLogger,Wr as safeContentPath,je as safeSubdir,rn as safetyCheckpoint,Ce as sanitizeClientName,Qn as saveInMemoryCheckpoint,Yr as saveVersion,lt as seedBasenameIndex,mr as serializeError,Ei as setActiveSpanAttributes,ht as setupServerObservers,un as shadowGit,Ui as shutdownTelemetry,qi as spansCurrentPath,Ji as spansPreviousPath,It as spawnDetached,p as splitMarkdownBlocks,Y as startWatcher,yt as streamingProblemEvent,Qt as swapContributors,Qe as teardownToleranceTelemetryWriter,_i as toBroadcasterKey,Pi as tracedAppendFileSync,zi as tracedLinkSync,ji as tracedMkdir,Fi as tracedMkdirSync,Vi as tracedRename,Mi as tracedRenameSync,Ri as tracedRmSync,Ii as tracedRmdirSync,Ni as tracedUnlinkSync,ki as tracedWriteFile,Hi as tracedWriteFileSync,ai as trustSystemCertificates,nn as untrackTrackedProjectSkillProjection,me as updateLastKnownHash,la as updateProcessLockPort,va as updateServerLockPort,Zt as validateAgentId,Ke as validateCloneInputs,nt as validateSkillZip,oa as waitForServerLockDrain,hn as withHiddenWindowsConsole,Oi as withSpan,Di as withSpanSync,Pn as writeBundleDecision,y as writeMarkdownlintRule,yi as writeRootGitignoreForNewRepo,g as writeStateManifest,On as writeTargetVersion,Dr as writeTracker};
|
|
1
|
+
import{B as e,Dc as t,Ss as n,Vs as r,W as i,Zs as a,g as o,v as s,vs as c,xs as l,zs as u}from"./src-Dm-FGyIz.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,Ea as L,Ei as R,En as z,Er as B,Et as V,F as H,Fi as U,Fn as W,Fr as G,Ft as K,G as q,Gi as J,Gn as Y,Gr as X,Gt as Z,H as Q,Hi as $,Hn as ee,Ht as te,I as ne,Ii as re,In as ie,Ir as ae,It as oe,J as se,Ji as ce,Jn as le,Jr as ue,Jt as de,K as fe,Ki as pe,Kn as me,Kr as he,Kt as ge,L as _e,Li as ve,Ln as ye,Lr 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,Nr as Ae,Nt as je,O as Me,Oi as Ne,On as Pe,Or as Fe,Ot as Ie,P as Le,Pi as Re,Pn as ze,Pr as Be,Pt as Ve,Q as He,Qi as Ue,Qn as We,Qr as Ge,Qt as Ke,R as qe,Ri as Je,Rn as Ye,Rr as Xe,Rt as Ze,S as Qe,Sa as $e,Si as et,Sn as tt,Sr as nt,St as rt,T as it,Ta as at,Ti as ot,Tn as st,Tr as ct,Tt as lt,U as ut,Ui as dt,Un as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vt as _t,W as vt,Wi as yt,Wn as bt,Wr as xt,Wt as St,X as Ct,Xi as wt,Xn as Tt,Xr as Et,Xt as Dt,Y as Ot,Yi as kt,Yn as At,Yr as jt,Yt as Mt,Z as Nt,Zi as Pt,Zn as Ft,Zr as It,Zt as Lt,_ as Rt,_a as zt,_i as Bt,_n as Vt,_r as Ht,_t as Ut,a as Wt,aa as Gt,ai as Kt,an as qt,ar as Jt,at as Yt,b as Xt,ba as Zt,bi as Qt,bn as $t,br as en,bt as tn,c as nn,ca as rn,ci as an,cn as on,cr as sn,ct as cn,d as ln,da as un,di as dn,dn as fn,dr 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,gt as kn,h as An,ha as jn,hi as Mn,hn as Nn,hr as Pn,i as Fn,ia as In,ii as Ln,in as Rn,ir as zn,it as Bn,j as Vn,ji as Hn,jn as Un,jr as Wn,jt as Gn,k as Kn,ki as qn,kn as Jn,kr as Yn,kt as Xn,l as Zn,la as Qn,li as $n,ln as er,lr as tr,lt as nr,m as rr,ma as ir,mi as ar,mn as or,mr as sr,n as cr,na as lr,ni as ur,nn as dr,nr as fr,nt as pr,o as mr,oa as hr,oi as gr,on as _r,or as vr,ot as yr,p as br,pa as xr,pi as Sr,pn as Cr,pr as wr,q as Tr,qi as Er,qn as Dr,qr as Or,qt as kr,r as Ar,ra as jr,ri as Mr,rn as Nr,rr as Pr,rt as Fr,s as Ir,sa as Lr,si as Rr,sn as zr,sr as Br,st as Vr,t as Hr,ta as Ur,ti as Wr,tn as Gr,tr as Kr,tt as qr,u as Jr,ua as Yr,ui as Xr,un as Zr,ur 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,wn as si,wr as ci,wt as li,x as ui,xa as di,xi as fi,xn as pi,xr as mi,xt as hi,y as gi,ya as _i,yi as vi,yn as yi,yr as bi,yt as xi,z as Si,zi as Ci,zn as wi,zt as Ti}from"./src-vJKK8Bgd.mjs";import{C as Ei,E as Di,T as Oi,_ as ki,b as Ai,c as ji,d as Mi,g as Ni,i as Pi,l as Fi,m as Ii,n as Li,p as Ri,s as zi,t as Bi,u as Vi,v as Hi,w as Ui,x as Wi,y as Gi}from"./fs-traced-1KTQL4h-.mjs";import{a as Ki,d as qi,f as Ji,i as Yi,l as Xi,n as Zi,r as Qi,t as $i,u as ea}from"./logger-Dq-cRhcP.mjs";import{C as ta,S as na,_ as ra,a as ia,b as aa,c as oa,d as sa,f as ca,g as la,h as ua,i as da,l as fa,m as pa,n as ma,o as ha,p as ga,r as _a,s as va,t as ya,u as ba,x as xa}from"./server-lock-DCzdk2Up.mjs";export{zt as AGENT_ID_MAX_LEN,ei as AGENT_ID_RE,Oe as AGENT_WRITE_ORIGIN,oi as AcpPermissionStore,di as AcpRegistry,Ne as AcpThreadManager,R as AgentFocusBroadcaster,ot as AgentPresenceBroadcaster,Re as AgentSessionCapacityError,U as AgentSessionManager,Ut as AutoStartDisabledError,k as BUNDLE_IDS,ci as BUNDLE_SCOPE,ct as BUNDLE_SKILL_NAME,fr as BacklinkIndex,J as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Sn as CONFIG_FILENAME,Tt as CONFLICT_MARKER_RE,he as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Rt as ConfigSchema,Pt as DEFAULT_CHECKPOINT_RETENTION,dn as DEFAULT_EMBEDDINGS_DIMENSIONS,xe as DEFAULT_PACK_ID,mt as DocumentDurabilityState,xn as EMBEDDINGS_API_KEY_ENV,si as ExposureConsentError,$e as FEATURED_AGENT_IDS,Ue as FILE_SYSTEM_WRITER,_n as FILE_WATCHER_ORIGIN,Kt as FileEmbeddingsBackend,h as GIT_PREFLIGHT_FAIL_SPAN_NAME,f as GIT_UPSTREAM_WRITER,at as GitDirAccessError,Gr as GitNotAvailableError,dr as GitTooOldError,ii as HOCUSPOCUS_AUTH_REJECTION_REASONS,xi as HocuspocusAuthRejection,tn as HocuspocusAuthTokenSchema,$t as HomeProjectRootError,Ge as INSTALLED_AGENTS_SCHEMES,cn as JSON_SCHEMA_DIALECT_2020_12,u as LINEAGE_EPOCH_KEY,qe as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Ze as LOG_MD_TEMPLATE,F as MANAGED_RENAME_ORIGIN,qn as MAX_ACP_THREADS,re as MAX_AGENT_SESSIONS,Hn as MCP_CONNECTION_ID_HEADER,c as MCP_SERVER_NAME,ve as MIN_EVICTABLE_IDLE_MS,Nr as MIN_GIT_VERSION,Q as MISSING_OK_CONFIG_MESSAGE,L as MalformedGitPointerError,vn as McpLogger,ut as MissingOkConfigError,Ci as OBSERVER_SYNC_ORIGIN,Cr as OK_OKIGNORE_TEMPLATE,B as ONBOARDING_BUNDLE_IDS,l as ORPHAN_MODES,t as PROTOCOL_VERSION,$i as PinoLogger,fa as ProcessLockCollisionError,Zn as ProjectGitInitError,Ie as ROLLBACK_ORIGIN,or as ROOT_GITIGNORE_TEMPLATE,aa as RUNTIME_VERSION,mn as SERVICE_WRITER,ri as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,Ti as STARTER_FOLDERS,w as STARTER_FOLDER_FRONTMATTER_FILENAME,_t as STARTER_PACKS,te as STARTER_PACK_IDS,pt as STARTER_TEMPLATES,it as STATE_MANIFEST_FILENAME,xa as STATE_SCHEMA_VERSION,a as SYSTEM_DOC_NAME,Mt as SeedPrerequisiteError,Dt as SeedRootDirError,ya as ServerLockCollisionError,Hr as SingleFileNotAFileError,cr as SingleFileNotFoundError,Ar as SingleFileNotMarkdownError,I as StateManifestError,Kr as TagIndex,P as USER_GLOBAL_BUNDLE_IDS,Xn as __getShowAllWalkStatsForTesting,b as __resetShowAllWalkStatsForTesting,ba as acquireProcessLock,ma as acquireServerLock,Je as applyAgentMarkdownWrite,le as applyExternalChange,oe as applySeed,j as assertCompatibleStateManifest,Rn as assertGitAvailable,ie as assertNeverDiskEvent,pi as assertNotHomeProjectRoot,M as attachAcpThreadSocket,kn as attachIdleShutdown,$r as bootServer,zn as buildAndOpenSkill,Nn as buildConfigYmlContent,Ot as buildExecResult,st as buildIngressPolicy,_ as buildOkMcpStdioCommand,en as buildSkillZip,St as buildStarterFolderFrontmatterYaml,Ur as buildWipTree,Fe as bundleSkillMdPath,gr as canonicalProjectKey,tt as canonicalizeForCompare,ye as classifyEvents,Bi as classifyFsPath,Rr as clearAllEmbeddingsKeys,ar as clearContributors,Z as coercePackId,o as colorFromSeed,lr as commitUpstreamImport,jr as commitWip,In as commitWipFromTree,qt as compareSemver,Wn as composeEffectiveLinterConfig,Te as composeFrontmatterSchemasConfig,Ft as containsConflictMarkers,Ye as contentHash,Mn as contributorCount,Le as countShadowObjects,H as countStaleAgentWipRefs,ne as countWipRefs,Gn as createApiExtension,V as createAssetServeMiddleware,q as createCollaborationHost,xt as createContentFilter,X as createContentFilterAsync,an as createEmbeddingsSecretStore,Fn as createEphemeralProjectDir,At as createExternalChangeHandler,yn as createFileLogger,Si as createLiveDerivedIndexExtension,Tr as createMcpHttpHandler,m as createOsProbe,De as createPersistenceExtension,T as createServer,Vn as createServerObserverExtension,$ as createStreamingErrorWriter,Zi as createTestLogger,$n as describeStoredEmbeddingsKey,wn as detectClaudeDesktopPresence,_r as detectGit,Me as detectProjectShape,Jt as detectUserSkillHosts,Fr as discoverLockDirs,G as discoverMarkdownlintConfig,gn as emitPreflightFailureSpan,Ct as encodeDocName,Nt as encodeFolderRoute,He as encodeSkillRoute,Jr as ensureProjectGit,Dn as ensureProjectSkillGitignore,dt as errorResponse,wi as evictStaleTrackerEntries,Ee as extractHeadings,Bn as extractOkBinaryPath,Pr as extractWikiLinksFromMarkdown,zr as fallbackPaths,ln as findEnclosingGitRoot,ze as findEnclosingProjectRoot,ae as findNativeMarkdownlintFile,br as flushFileLogger,hi as formatAuthRejectionWire,En as formatContributors,Bt as formatContributorsFrom,Ve as formatPackRationale,Gt as gcCheckpointRefs,qr as getCurrentMcpLogger,z as getIngressContext,fi as getLocalDir,rr as getLogFilePath,Qi as getLogger,An as getLogsDir,ra as getMachineId,Gi as getMeter,bn as getMetrics,Ai as getTracer,xr as handleCollabSocketError,Or as handleSpawnCursor,N as hasForwardingHeaders,_e as hasGcLogLatch,s as iconFromClientName,ir as incrementCollabSocketFilteredError,jn as incrementServerObserverFire,Vt as initContent,hr as initShadowRepo,Wi as initTelemetry,Xt as initToleranceTelemetryWriter,nr as installJsonSchemaDialect,Vr as installPrettyZodErrors,Yi as installTestLoggers,vr as installUserSkill,ke as isAllowedApiOrigin,Un as isAllowedWorkspaceHostHeader,pe as isConfigDoc,rt as isHocuspocusAuthRejectionReason,O as isHomeDir,Pe as isHostAdmitted,ge as isKnownPackId,Er as isLinkIndexExcludedDoc,we as isLoopbackAddress,ce as isManagedArtifactDoc,Jn as isOriginAdmitted,n as isOrphanMode,S as isPairedWriteOrigin,ue as isPathWithinDir,v as isPeerAdmitted,na as isProcessAlive,W as isProjectRoot,kt as isReservedForUserTree,C as isSelfWrite,wt as isSystemDoc,ui as isToleranceTelemetryEnabled,ta as isValidLockPid,gt as lastKnownHash,Lr as listRescueCheckpoints,kr as listStarterPacks,E as loadCustomAgents,Se as loadPrincipal,_a as lockAdvertisesUi,sa as lockBaseUrl,ca as lockFilePath,Ki as loggerFactory,Xi as logsCurrentPath,ea as logsPreviousPath,Xr as makeLazyEmbeddingsKeyStore,da as markServerLockDraining,vt as mountMcpAndApi,Li as normalizeFsPath,Yn as originGitHubHost,ni as packageVersionMajorMinor,A as parseAuthRejectionWire,on as parseGitVersion,li as parseHocuspocusAuthToken,fe as parseKeepaliveConnectionId,ee as pathToDocName,K as planSeed,Wt as prepareSingleFileOpen,Yt as processCommand,yr as processUsage,tr as readAllTargets,Qr as readBundleDecision,be as readOwnNativeRules,ga as readProcessLock,pa as readProcessLockDetailed,x as readProjectHeadState,Ln as readProjectLocalSemanticConfig,ia as readServerLock,pn as readServerPackageVersion,Cn as readSkillInstallStateSnapshot,Kn as readStateManifest,wr as readTargetRecordedAt,sr as readTargetVersion,We as reconcile,ti as recordContributor,bi as recordSkillInstallEvent,se as registerAllTools,ft as registerWrite,ua as releaseProcessLock,ha as releaseServerLock,bt as removeLastKnownHash,sn as reportSkillInstall,Tn as resetMetrics,Br as resolveBuiltinSkillHosts,i as resolveBundleEnabled,mi as resolveBundledSkillDir,et as resolveContentDir,jt as resolveCursorBinaryDefault,Et as resolveCursorSpawnInvocation,Ae as resolveEffectiveLinterConfig,Sr as resolveEmbeddingsCredential,D as resolveLockDir,Be as resolveNativeConfigForDoc,Xe as resolveNativeMarkdownlintConfig,de as resolvePack,Ir as resolvePackageVersion,Ht as resolveSkillInstallReportSettings,d as resolveUiInfo,vi as restoreContributors,gi as restoreLifecycleFromConflictsJson,ur as rewriteMarkdownLinksForDocumentRename,Mr as rewriteWikiLinksForDocumentRename,er as runAuthReposSubprocess,Zr as runAuthStatusSubprocess,Lt as runCloneSubprocess,fn as runDeviceFlowSubprocess,pr as runWithMcpLogger,Wr as safeContentPath,je as safeSubdir,rn as safetyCheckpoint,Ce as sanitizeClientName,Qn as saveInMemoryCheckpoint,Yr as saveVersion,lt as seedBasenameIndex,mr as serializeError,Ei as setActiveSpanAttributes,ht as setupServerObservers,un as shadowGit,Ui as shutdownTelemetry,qi as spansCurrentPath,Ji as spansPreviousPath,It as spawnDetached,p as splitMarkdownBlocks,Y as startWatcher,yt as streamingProblemEvent,Qt as swapContributors,Qe as teardownToleranceTelemetryWriter,_i as toBroadcasterKey,Pi as tracedAppendFileSync,zi as tracedLinkSync,ji as tracedMkdir,Fi as tracedMkdirSync,Vi as tracedRename,Mi as tracedRenameSync,Ri as tracedRmSync,Ii as tracedRmdirSync,Ni as tracedUnlinkSync,ki as tracedWriteFile,Hi as tracedWriteFileSync,ai as trustSystemCertificates,nn as untrackTrackedProjectSkillProjection,me as updateLastKnownHash,la as updateProcessLockPort,va as updateServerLockPort,Zt as validateAgentId,Ke as validateCloneInputs,nt as validateSkillZip,oa as waitForServerLockDrain,hn as withHiddenWindowsConsole,Oi as withSpan,Di as withSpanSync,Pn as writeBundleDecision,y as writeMarkdownlintRule,yi as writeRootGitignoreForNewRepo,g as writeStateManifest,On as writeTargetVersion,Dr as writeTracker};
|