@inkeep/open-knowledge 0.59.0-beta.4 → 0.59.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/acp-harness-probe-CwlSA2YA.mjs +3 -0
  2. package/dist/cli.mjs +63 -63
  3. package/dist/constants-ClvhUhKC.mjs +2 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/init-BBypWa1X.mjs +1 -0
  6. package/dist/init-DtEg1CVj.mjs +638 -0
  7. package/dist/{launch-json-removal-BhmMM8X0.mjs → launch-json-removal-DMIuk2Xm.mjs} +2 -2
  8. package/dist/loader-5d79Yfz_.mjs +1 -0
  9. package/dist/{loader-CZBp0dfY.mjs → loader-FTxT5qp1.mjs} +2 -2
  10. package/dist/{open-browser-Bi-bfP_S.mjs → open-browser-S9VrM_aN.mjs} +2 -2
  11. package/dist/preview-CMoCG15V.mjs +1 -0
  12. package/dist/{preview-DHKdOAk5.mjs → preview-DbzR0PS5.mjs} +2 -2
  13. package/dist/public/assets/{ActivityModeContent-D6uA_m7H.js → ActivityModeContent-16L4CN2t.js} +1 -1
  14. package/dist/public/assets/{AgentDiffPane-D4PWUKcp.js → AgentDiffPane-DWuD5gDF.js} +1 -1
  15. package/dist/public/assets/{CodeMirrorPropInput-BkFI4cSq.js → CodeMirrorPropInput-DuZeupvc.js} +1 -1
  16. package/dist/public/assets/{DocumentContext-HSIpKTjH.js → DocumentContext-EVe8T_4V.js} +1 -1
  17. package/dist/public/assets/{EditorModeToggle-DmglY6xV.js → EditorModeToggle-C89Lmfvi.js} +1 -1
  18. package/dist/public/assets/{EnableSyncConfirmDialog-VRpK89T0.js → EnableSyncConfirmDialog-DuuoUeCA.js} +1 -1
  19. package/dist/public/assets/{ExcalidrawDocEditor-C8bpwBA4.js → ExcalidrawDocEditor-DKpnK_Te.js} +1 -1
  20. package/dist/public/assets/FeedbackForm-GJ-gi37F.js +1 -0
  21. package/dist/public/assets/{ImportSkillDialog-59ssHpH-.js → ImportSkillDialog-BW8hYUMC.js} +1 -1
  22. package/dist/public/assets/{LintConfigEditor-Bij2fHgM.js → LintConfigEditor-DI9ZL8t7.js} +1 -1
  23. package/dist/public/assets/ManagedArtifactProperties-HsfjkNmc.js +1 -0
  24. package/dist/public/assets/{ManagedArtifactProperties-DkJQ1vVn.js → ManagedArtifactProperties-SInV_eE5.js} +1 -1
  25. package/dist/public/assets/{MermaidDocEditor-C8bhqP4t.js → MermaidDocEditor-Taa4xIn5.js} +1 -1
  26. package/dist/public/assets/{PropertyDisplayRow-DW6AeN1K.js → PropertyDisplayRow-DY3LkrAq.js} +1 -1
  27. package/dist/public/assets/{SchemaConfigEditor-DNaQmo_3.js → SchemaConfigEditor-08j6Goue.js} +1 -1
  28. package/dist/public/assets/{SessionsHost-D_oypiot.js → SessionsHost-D2TiYy-t.js} +2 -2
  29. package/dist/public/assets/{SettingsDialogBody-D8qSj91O.js → SettingsDialogBody-DDFx4vDq.js} +1 -1
  30. package/dist/public/assets/{ShareReceiveMissDialog-C8yHT5CC.js → ShareReceiveMissDialog-9uyWPE2r.js} +1 -1
  31. package/dist/public/assets/{SkillInstallMenu-DXZKa7ir.js → SkillInstallMenu-7rF7_Qqj.js} +1 -1
  32. package/dist/public/assets/{SkillToolbarControls-BsyoVC5Q.js → SkillToolbarControls-Ib5ly02n.js} +1 -1
  33. package/dist/public/assets/{SourceEditor-BVVe4FH-.js → SourceEditor-Dmdy2M_V.js} +1 -1
  34. package/dist/public/assets/{TerminalWindowApp-Cjr_tele.js → TerminalWindowApp-BgdbGRUg.js} +1 -1
  35. package/dist/public/assets/{TextDocEditor-m87BSysa.js → TextDocEditor-O6cHtSVn.js} +1 -1
  36. package/dist/public/assets/{ThreadView-a9UBrGPP.js → ThreadView-nJXOmPeX.js} +1 -1
  37. package/dist/public/assets/{TimelineDiffPane-DyW8LDRD.js → TimelineDiffPane-B3xMtotK.js} +1 -1
  38. package/dist/public/assets/{agent-diff-store-D4tFKX4K.js → agent-diff-store-_LXkwhjL.js} +1 -1
  39. package/dist/public/assets/{auth-state-cache-Cfy-VA-P.js → auth-state-cache-CYlHHIOy.js} +1 -1
  40. package/dist/public/assets/{client-version-C5E9Q07s.js → client-version-Q-5pX-lW.js} +1 -1
  41. package/dist/public/assets/{comment-chips-Ba1WfR06.js → comment-chips-Cyvt-GuB.js} +1 -1
  42. package/dist/public/assets/{config-provider-Bs9S-Mvn.js → config-provider-Bab4_nwt.js} +1 -1
  43. package/dist/public/assets/{follow-file-BKlnqkgL.js → follow-file-CXSEufj8.js} +1 -1
  44. package/dist/public/assets/{index-hVkgGI1V.js → index-CvOmEWwY.js} +7 -7
  45. package/dist/public/assets/{pending-receive-nav-store-CZyI0Y3v.js → pending-receive-nav-store-YRIcYpak.js} +1 -1
  46. package/dist/public/assets/{selection-context-CcGgvqKu.js → selection-context-B9p1R6mm.js} +1 -1
  47. package/dist/public/assets/{skill-actions-Dm7_Q9qA.js → skill-actions-Dmiv-OaH.js} +1 -1
  48. package/dist/public/assets/{src-BxKUvqJT.js → src-954nlWtx.js} +1 -1
  49. package/dist/public/assets/{telemetry-impl-B-PaTlR_.js → telemetry-impl-BEwAvzD6.js} +1 -1
  50. package/dist/public/assets/{telemetry-startup-toj6ifVD.js → telemetry-startup-Buxh4qDW.js} +1 -1
  51. package/dist/public/assets/{typing-burst-detector-B9Z2sXqG.js → typing-burst-detector-CtytQZKZ.js} +1 -1
  52. package/dist/public/assets/{use-activity-panel-CVOuigTa.js → use-activity-panel-Ch01VK0x.js} +1 -1
  53. package/dist/public/assets/{use-open-skill-D7aPRwcl.js → use-open-skill-BtJdSHXl.js} +1 -1
  54. package/dist/public/assets/{use-popular-skills-0Mbrn7FI.js → use-popular-skills-Pfi6527q.js} +1 -1
  55. package/dist/public/assets/{use-terminal-enabled-50K5tfJr.js → use-terminal-enabled-CGezX1Y6.js} +1 -1
  56. package/dist/public/assets/{use-timeline-entry-diff-yvOI8kJw.js → use-timeline-entry-diff-D_77fB53.js} +1 -1
  57. package/dist/public/index.html +20 -20
  58. package/dist/{repair-launch-json-BGi7iGAu.mjs → repair-launch-json-B6gMDsrz.mjs} +2 -2
  59. package/dist/repair-mcp-configs-BdOq8Vf6.mjs +2 -0
  60. package/dist/repair-skills-D39s_ZLC.mjs +1 -0
  61. package/dist/repair-skills-y87OAXdt.mjs +4 -0
  62. package/dist/{write-project-skill-DVTW-eBV.mjs → resolve-project-root-COu6TC2y.mjs} +7 -7
  63. package/dist/{skill-teardown-Cu6kl-qW.mjs → skill-teardown-W9f5SFoc.mjs} +2 -2
  64. package/dist/src-61Qo6YtO.mjs +1 -0
  65. package/dist/src-BDmrU0nU.mjs +20 -0
  66. package/dist/{src-Bo1GhWhP.mjs → src-CUP74RDx.mjs} +1 -1
  67. package/dist/{src-BvF1D3wV.mjs → src-DJejT6Wt.mjs} +340 -340
  68. package/dist/start-CXB1wcA0.mjs +1 -0
  69. package/dist/{start-DV97kZ7y.mjs → start-DtE0-Zi2.mjs} +5 -5
  70. package/dist/{ui-FUxqG_rr.mjs → ui-Ci1Xxx_K.mjs} +3 -3
  71. package/package.json +4 -4
  72. package/dist/acp-harness-probe-DVaE2c7_.mjs +0 -3
  73. package/dist/constants-LTNYGM_i.mjs +0 -2
  74. package/dist/init-BNc1Q9X1.mjs +0 -1
  75. package/dist/init-CAL8YljK.mjs +0 -638
  76. package/dist/loader-D-zR1qZN.mjs +0 -1
  77. package/dist/preview-C2LuL4mc.mjs +0 -1
  78. package/dist/public/assets/FeedbackForm-C9DN3mVr.js +0 -1
  79. package/dist/public/assets/ManagedArtifactProperties-P2EDJZ3f.js +0 -1
  80. package/dist/repair-mcp-configs-MrX_ffu8.mjs +0 -2
  81. package/dist/repair-skills-Bqfr1HD1.mjs +0 -4
  82. package/dist/repair-skills-D2IsYlEp.mjs +0 -1
  83. package/dist/src-2v6V_dXE.mjs +0 -1
  84. package/dist/src-BHt2-iCE.mjs +0 -20
  85. package/dist/start-Df7JNRUs.mjs +0 -1
@@ -1,2 +1,2 @@
1
- import{Ms as e}from"./src-BxdlvOrw.mjs";import{Er as t,Or as n}from"./src-BvF1D3wV.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...n.map(e=>t[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of n){let n=t[r];o.push({path:a(i,`.agents`,`skills`,n),bundleId:r,scope:`central`});for(let t of e)o.push({path:a(i,t.skillsRoot,n),bundleId:r,scope:`host`,hostDir:t.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
- //# sourceMappingURL=skill-teardown-Cu6kl-qW.mjs.map
1
+ import{Ms as e}from"./src-BxdlvOrw.mjs";import{Er as t,Or as n}from"./src-DJejT6Wt.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...n.map(e=>t[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of n){let n=t[r];o.push({path:a(i,`.agents`,`skills`,n),bundleId:r,scope:`central`});for(let t of e)o.push({path:a(i,t.skillsRoot,n),bundleId:r,scope:`host`,hostDir:t.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
+ //# sourceMappingURL=skill-teardown-W9f5SFoc.mjs.map
@@ -0,0 +1 @@
1
+ import"./src-BxdlvOrw.mjs";import"./resolve-project-root-COu6TC2y.mjs";import"./src-BDmrU0nU.mjs";import"./acp-harness-probe-CwlSA2YA.mjs";import"./init-DtEg1CVj.mjs";import{n as e}from"./loader-FTxT5qp1.mjs";import"./skill-teardown-W9f5SFoc.mjs";import"./preview-DbzR0PS5.mjs";import"./mcp-migrate-event-B1gJf6bG.mjs";export{e as loadConfig};
@@ -0,0 +1,20 @@
1
+ import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sleep-B416PNUo.mjs";import{bc as i,ho as a,it as o,rt as s,yc as c}from"./src-BxdlvOrw.mjs";import{Fn as l,at as u,it as d,ot as f,rt as p,ti as m,wi as h}from"./src-DJejT6Wt.mjs";import{D as g,F as _,I as v,k as y}from"./fs-traced-CJ0NSnI0.mjs";import{C as b,S as x,_ as S,d as C}from"./server-lock-BmwIVWMl.mjs";import{t as w}from"./yazl-DZr4PyKA.mjs";import{b as T,g as E,h as D}from"./resolve-project-root-COu6TC2y.mjs";import{c as ee}from"./colors-BsmVIwfM.mjs";import{n as te}from"./acp-harness-probe-CwlSA2YA.mjs";import{E as O,T as k,_ as ne,b as re,o as A,w as j,x as ie}from"./init-DtEg1CVj.mjs";import{n as M}from"./constants-ClvhUhKC.mjs";import{t as N}from"./is-object-ByG7RnjH.mjs";import"./loader-FTxT5qp1.mjs";import"./skill-teardown-W9f5SFoc.mjs";import"./preview-DbzR0PS5.mjs";import{execSync as ae,spawnSync as oe}from"node:child_process";import{basename as P,dirname as F,join as I,relative as se,resolve as L,sep as ce}from"node:path";import{cpSync as le,createWriteStream as ue,existsSync as R,lstatSync as de,mkdirSync as z,mkdtempSync as fe,readFileSync as B,readdirSync as pe,readlinkSync as me,rmSync as he,statSync as ge,writeFileSync as V}from"node:fs";import{arch as _e,freemem as ve,homedir as H,hostname as ye,platform as be,release as xe,tmpdir as Se,totalmem as Ce,type as we,uptime as Te}from"node:os";import"node:fs/promises";import{createHash as Ee}from"node:crypto";var De=n();const Oe=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function ke(e,t,n=l){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 I(H(),`.ok`,`bug-reports`)}function Pe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Ne(),r=`${t}-bugreport`,i=I(n,`${r}.zip`);for(let e=2;R(i);e+=1)i=I(n,`${r}-${e}.zip`);return i}function Fe(e,t){let n=I(e,`.ok`,`config.yml`);if(R(n))try{let e=B(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 R(I(e,`.ok`))?Ee(`sha256`).update(L(e)).digest(`hex`).slice(0,12):null}function Ie(){let e={timestamp:new Date().toISOString(),platform:be(),osType:we(),osRelease:xe(),hostname:`[redacted]`,uptime:Te(),freeMem:ve(),totalMem:Ce(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ae(`sw_vers -productVersion 2>/dev/null`,m({encoding:`utf8`})).trim()}catch{}try{let t=I(__dirname,`..`,`..`,`package.json`);R(t)&&(e.okVersion=JSON.parse(B(t,`utf8`)).version)}catch{}return e}const Le=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function U(e){let t=P(e);return Le.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Re(e,t){return Ve(e,t).files}const ze=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Be(e,t=te){let n=I(e,`${t}.ShipIt`);return R(n)?ze.map(e=>I(n,e)).filter(e=>R(e)):[]}function Ve(e,t){if(!R(t))return{files:[],excludedByProjectSlug:0};let n=pe(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>I(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(U),i=[],a=r.filter(t=>{try{return B(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=>!U(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function He(e){let t=I(e,`.ok`,`local`);return R(t)?{files:[`server.lock`,`last-spawn-error.log`,s].map(e=>I(t,e)).filter(e=>R(e))}:{files:[]}}function Ue(e){let t=I(e,`.ok`,`local`,`logs`);return R(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>I(t,e)).filter(e=>R(e))}:{files:[]}}function We(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=i(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function W(e){for(let t of e.files)try{We({zipfile:e.zipfile,name:`${e.prefix}/${P(t)}`,content:B(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 Ge(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??I(H(),`.ok`,`logs`),o=t.projectDir?Fe(t.projectDir,i):null;z(F(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Ie();s.desktop=t.desktop??null,s.language=t.language??null;let{files:l,excludedByProjectSlug:u}=Ve(o,a),{files:d}=t.projectDir?He(t.projectDir):{files:[]},{files:f}=t.projectDir?Ue(t.projectDir):{files:[]},p=t.shipItLogFiles??[];i?.info({logFileCount:l.length,logFilesExcludedByProjectSlug:u,lockFileCount:d.length,localSinkFileCount:f.length,shipItLogFileCount:p.length},`files collected`);let m=[],h=[],{ZipFile:g}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),_=new g;W({zipfile:_,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:i}),W({zipfile:_,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:i}),W({zipfile:_,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=B(e.sourcePath),n=`extra/${e.zipName??P(e.sourcePath)}`;_.addBuffer(t,n),h.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&We({zipfile:_,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let v=JSON.stringify(s,null,2);_.addBuffer(Buffer.from(v,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let y={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:h,redactions:m,sysinfo:s};_.addBuffer(Buffer.from(JSON.stringify(y,null,2),`utf8`),`MANIFEST.json`);let b=m.reduce((e,t)=>e+t.lineCount,0),x=new Set(p.map(e=>`logs/${P(e)}`)),S=h.filter(e=>x.has(e)),C=o?h.filter(e=>e.startsWith(`logs/`)&&!U(e)&&!x.has(e)):[],w=[`# Bug Report Bundle`,``,`Generated: ${y.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${y.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...C.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:`,...C.map(e=>`- ${e}`),``]:[],...S.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:`,...S.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${c.join(`, `)}`,b>0?`${b} 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
+ `);_.addBuffer(Buffer.from(w,`utf8`),`README.md`),_.end();let T=ue(r);return _.outputStream.pipe(T),await new Promise((e,t)=>{T.on(`close`,e),T.on(`error`,t)}),i?.info({bundlePath:r,fileCount:h.length,redactionCount:b},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:h,redactions:m,redactedLineCount:b,generatedAt:y.generatedAt}}}var Ke=e(w(),1),G=e(ee(),1);function qe(e){return v({absPath:y(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function Je({home:e=H(),env:n=process.env}={}){let i=qe(e),{override:o,preferenceList:s}=g(n),{locale:c,source:l}=a({override:o,storedPreference:i,supportedLocales:r,preferenceList:s,autoDetectableLocales:t});return{preference:i,locale:c,source:l,systemLanguages:s}}function K(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ye(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e,t){if(typeof e==`string`)return K(e,t.contentDir);if(Array.isArray(e))return e.map(e=>q(e,t));if(!Ye(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=q(i,t);return n}function Xe(e,t){let n=B(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
3
+ `),i=n.split(`
4
+ `),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=q(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}V(e,r?`${a.join(`
5
+ `)}\n`:a.join(`
6
+ `))}function Ze(e,t){let n=B(e,`utf-8`);if(n.trim().length!==0)try{let r=q(JSON.parse(n),t),i=n.endsWith(`
7
+ `)?`
8
+ `:``;V(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=K(n,t.contentDir);r!==n&&V(e,r)}}function Qe(e,t){let n=B(e,`utf-8`),r=K(n,t.contentDir);r!==n&&V(e,r)}function $e(e){try{return pe(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>I(e,t.name))}catch{return[]}}const et=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function tt(e){return/\.log\.\d+$/.test(e)}function nt(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||tt(e)}function rt(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of $e(I(e.stagingDir,n)))nt(r)?Xe(r,t):r.endsWith(`.json`)?Ze(r,t):Qe(r,t);for(let n of $e(I(e.stagingDir,`state`))){let e=P(n);n.endsWith(`.jsonl`)?Xe(n,t):et.has(e)?Ze(n,t):Qe(n,t)}}const it=[`.ok`,`local`,`telemetry`],at=[`.ok`,`local`,`logs`],ot=[`.ok`,`local`,`loss-capture`],st=`spans-current.jsonl`,ct=`spans-prev.jsonl`,lt=`server-current.jsonl`,ut=`server-prev.jsonl`,dt=`loss-current.jsonl`,ft=`loss-prev.jsonl`;function pt(e){return I(e,...it,st)}function mt(e){return I(e,...it,ct)}function ht(e){return I(e,...at,lt)}function gt(e){return I(e,...at,ut)}function _t(e){return I(e,...ot,dt)}function vt(e){return I(e,...ot,ft)}const yt=1e3;async function bt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(yt)});return t.ok?await t.text():null}catch{return null}}async function xt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(yt)});return t.ok?await t.text():null}catch{return null}}async function St(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(yt)});return t.ok?await t.text():null}catch{return null}}function Ct(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
9
+ `)}\n`:null}catch{return null}}function wt(e){let t=I(e,`.git`,`ok`);if(!R(t))return null;let n=oe(`git`,[`-C`,t,`log`,`--oneline`,`-50`],m({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Tt(e){let t=I(e,`.git`,`ok`);if(!R(t))return null;let n=oe(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],m({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Et(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Dt(){return{nodeVersion:process.version,platform:be(),arch:_e()}}function Ot(){return process.env.OTEL_SDK_DISABLED===`false`}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kt(e){if(!R(e))return{};let t;try{t=(0,De.parse)(B(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!J(t))return{};let n=t.telemetry;if(!J(n))return{};let r=n.localSink;return J(r)?r:{}}function At(e){return typeof e==`boolean`?e:void 0}function jt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y(e){if(J(e))return jt(e.maxBytes)}function Mt(e){let t=kt(y(`project`,e)),n=kt(y(`project-local`,e));return{enabled:At(n.enabled)??At(t.enabled)??!0,spansMaxBytes:Y(n.spans)??Y(t.spans)??52428800,logsMaxBytes:Y(n.logs)??Y(t.logs)??26214400}}function Nt(e){return Ee(`sha256`).update(e).digest(`hex`)}function Pt(e){let t=B(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Ft(e){let t=B(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X(e,t){if(!R(e))return!1;try{return z(F(t),{recursive:!0}),le(e,t),!0}catch{return!1}}function It(e){let t=[],n=e=>{let r=pe(e,{withFileTypes:!0});for(let i of r){let r=I(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Lt=new Set([`.jsonl`]);function Rt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Lt.has(e.slice(t))}const zt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Bt(e){if(tt(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:zt.has(e.slice(t))}function Vt(e){let t=[];for(let n of It(e)){let r=Ht(e,n);if(!Bt(r))continue;let{redacted:a,patterns:o,lineCount:s}=i(B(n,`utf-8`));o.length!==0&&(V(n,a),t.push({file:r,lineCount:s,patterns:o}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Ht(e,t){return se(e,t).split(ce).join(`/`)}async function Ut(e){let t=L(e.contentDir),n=L(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??bt,a=r.fetchAgentEffects??xt,c=r.fetchWatcherRecent??St,l=r.readShadowHead??wt,u=r.readCheckpointRefs??Tt,d=r.now??(()=>new Date),f=r.okVersion??(()=>M),p=r.readDesktopEnv??Et,m=r.readLanguage??Je,h=r.readRuntime??Dt,g=r.isOtlpPushEnabled??Ot,_=fe(I(Se(),`ok-bundle-`));try{z(I(_,`telemetry`),{recursive:!0}),z(I(_,`logs`),{recursive:!0}),z(I(_,`state`),{recursive:!0}),X(pt(n),I(_,`telemetry`,st)),X(mt(n),I(_,`telemetry`,ct)),X(ht(n),I(_,`logs`,lt)),X(gt(n),I(_,`logs`,ut));for(let t of e.userLogFiles??[])X(t,I(_,`logs`,P(t)));let v=I(n,`.ok`,`local`),y=I(v,`server.lock`),b=`not-running`,x=`no server.lock`,S=null;if(R(y)){X(y,I(_,`state`,`server.lock`));try{let e=B(y,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?S=t.port:x=`lock present but no port`}catch{x=`lock present but unparseable`}}if(S!==null){let e=await i(S);e===null?x=`agent-presence endpoint at :${S} unreachable`:(V(I(_,`state`,`agent-presence.json`),e),b=`running`,x=``);let t=await a(S);t!==null&&V(I(_,`state`,`agent-effects.json`),t);let n=await c(S);if(n!==null){let e=Ct(n);e!==null&&V(I(_,`state`,`watcher-recent.jsonl`),e)}}let C=l(t);C!==null&&V(I(_,`state`,`shadow-head.txt`),C);let w=u(t);w!==null&&V(I(_,`state`,`checkpoint-refs.txt`),w),X(_t(n),I(_,`state`,dt)),X(vt(n),I(_,`state`,ft)),X(I(v,`last-spawn-error.log`),I(_,`state`,`last-spawn-error.log`)),X(I(v,o),I(_,`state`,o)),X(I(v,s),I(_,`state`,s));let T=h(),E=p(),D=m(),ee={ok:{version:f(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D}};V(I(_,`state`,`runtime.json`),`${JSON.stringify(ee,null,2)}\n`);let te=b===`running`?`running
10
+ `:`not-running (${x})\n`;if(V(I(_,`state`,`server-status.txt`),te),e.processDir&&R(e.processDir)){let t=I(_,`process`);z(t,{recursive:!0}),le(e.processDir,t,{recursive:!0})}let O=e.redact===!0;O&&rt({stagingDir:_,contentDir:t}),e.note&&V(I(_,`note.txt`),e.note);let k=null;e.scrubSecrets===!0&&(k=Vt(_));for(let t of e.extraFiles??[])X(t.sourcePath,I(_,`extra`,t.zipName??P(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ne=Mt(n),re=It(_),A=[],j=0,ie=0;for(let e of re){let t=Ht(_,e),n=ge(e).size,r=Rt(t)?Pt(e):0;A.push({path:t,bytes:n,lines:r}),j+=n,t.startsWith(`telemetry/`)&&Rt(t)&&(ie+=Ft(e))}let M={applied:O};k!==null&&(M.secretScrub=k);let N={schemaVersion:2,createdAt:d().toISOString(),ok:{version:f(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D},contentDir:{pathSha256:Nt(t),absolutePath:O?`<CONTENT_DIR>`:t},telemetry:{localSink:ne,otlpPushEnabled:g()},redaction:M,serverStatus:b,files:A};V(I(_,`manifest.json`),`${JSON.stringify(N,null,2)}\n`);let ae=re.some(e=>{try{return B(e,`utf-8`).includes(t)}catch{return!1}}),oe={totalBytes:j,fileCount:A.length,docNameCount:ie,contentDirVisible:ae,redacted:O},F=!1;return{stagingDir:_,manifest:N,summary:oe,cleanup:()=>{F||(F=!0,he(_,{recursive:!0,force:!0}))}}}catch(e){throw he(_,{recursive:!0,force:!0}),e}}async function Wt(e){let{collected:t,outputPath:n}=e,r=F(n);if(!R(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Ke.ZipFile,a=It(t.stagingDir);for(let e of a){let n=Ht(t.stagingDir,e);i.addFile(e,n)}i.end();let o=ue(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function Gt(e,t){let n=I(e,`.ok`,`config.yml`);if(R(n))try{let t=(0,De.parse)(B(n,`utf-8`)),r=N(t)?t.content:void 0,i=N(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return L(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return L(e)}async function Kt(e,t,n,r){let i=Fe(t,e.logger),a=await Ut({contentDir:Gt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...Re(i,e.userLogsDir??I(H(),`.ok`,`logs`)),...Be(e.cachesDir??I(H(),`Library`,`Caches`))],deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{z(F(e.outputPath),{recursive:!0}),await Wt({collected:a,outputPath:e.outputPath});let t=a.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:i,files:a.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:a.manifest.createdAt}}}finally{a.cleanup()}}async function qt(e){let{projectDir:t}=e,n=e.readDesktopEnv??Et,r=e.readLanguage??Je;if(e.level===`full`&&t!==void 0)return Kt(e,t,n,r);let{zipPath:i,summary:a}=await Ge({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:Be(e.cachesDir??I(H(),`Library`,`Caches`)),logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:i,summary:{level:e.level,systemWide:t===void 0,projectSlug:a.projectSlug,files:a.files,redactions:a.redactions,redactedLineCount:a.redactedLineCount,generatedAt:a.generatedAt}}}function Z(e,t,n={}){let r=C(e,t);if(!R(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(B(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!b(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??x)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??S())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??ye();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function Jt(e){return e.replace(/:\d+$/,``)}function Yt(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Jt(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Jt(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Jt(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}const Xt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Zt(e){return I(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const Qt={existsSync:e=>R(e),readFileSync:(e,t)=>B(e,t),lstatSync:e=>de(e),readlinkSync:e=>me(e)};function $t(e,t=Qt){let n=Zt(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function en(e){let t=e.replace(Xt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function tn(e,t,n=Qt){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function nn(e){return D(e)||E(e)||ie(e)}const rn=10*1024*1024;function an(e,t,n,r){let i=A(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!nn(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);return e.format===`file`?(he(a,{force:!0}),{kind:`removed`}):e.format===`toml`?cn(a,o):e.format===`yaml`?sn(a,e.topLevelKey,o):on(a,e.topLevelKey,e.serverMapSubKey,o)}function on(e,t,n,r){let i;try{i=B(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=O(i,ne(t,n,r));return o?(_(e,a,{mode:j(e)}),{kind:`removed`}):{kind:`not-present`}}function sn(e,t,n){let r;try{r=B(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,De.parseDocument)(a);if(o.errors.length>0)return{kind:`declined`,reason:`unparseable`};let s=[t,n];if(!o.hasIn(s))return{kind:`not-present`};o.deleteIn(s);let c=o.toString(),l=k(a);a.trim()===``||a.endsWith(`
11
+ `)?c.endsWith(`
12
+ `)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
13
+ `).replace(/\n/g,`\r
14
+ `));let u=`${i?``:``}${c}`;return u!==r&&_(e,u,{mode:j(e)}),{kind:`removed`}}function cn(e,t){let n=re();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=B(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=k(a),s=a.trim()===``||a.endsWith(`
15
+ `),c;try{c=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!c.existed)return{kind:`not-present`};let l=c.text;s?l.endsWith(`
16
+ `)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
17
+ `).replace(/\n/g,`\r
18
+ `));let u=`${i?``:``}${l}`;return u!==r&&_(e,u,{mode:j(e)}),{kind:`removed`}}function ln(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function un(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function dn(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:d(r),command:r,isDesktop:ln(r)}}function fn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&fn(e)?`ui-orphan`:`stale`}const pn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function mn(e){switch(e){case`running`:return G.default.green(e);case`desktop`:return G.default.blue(e);case`foreign`:return G.default.cyan(e);case`ui-orphan`:return G.default.magenta(e);case`stale`:return G.default.yellow(e)}}function hn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function gn(e){return`${hn(e.server.usage)} | ${hn(e.ui?.usage??null)}`}function _n(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function vn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,_n(e),gn(e),t,String(n),un(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=mn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=G.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
19
+ `)}async function yn(e={}){let t=e.discover??p,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??u,a=e.resolveUsage??f,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=dn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&s.push(o)}if(e.json){let e=s.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(vn(e.all?s:s.filter(e=>pn.has(Q(e)))))}function bn(){return new T(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await yn({all:t.all===!0||e===`all`,json:t.json===!0})})}function xn(e,t,n={}){let r=n.isAlive??x,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function Sn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=xn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function Cn(e,t=x){let n=await p(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function wn(e){let t=Sn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Tn(e){return new T(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=Sn({lockDir:h(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await yn({});return}if(n===`all`){let e=await p();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,x)&&!$(r,x)||(wn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await Cn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}wn(t);return}wn(h(L(Me(),n)))})}export{Me as _,Xt as a,$t as c,Z as d,qt as f,Ne as g,Pe as h,an as i,en as l,Wt as m,Tn as n,tn as o,Ut as p,bn as r,Zt as s,Sn as t,Yt as u,je as v,ke as y};
20
+ //# sourceMappingURL=src-BDmrU0nU.mjs.map
@@ -1 +1 @@
1
- import{B as e,Cc as t,Fs as n,Ls as r,W as i,_s as a,g as o,ms as s,qs as c,v as l,vs as u}from"./src-BxdlvOrw.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,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Ht as ne,I as re,Ii as ie,In as ae,Ir as oe,It as se,J as ce,Ji as le,Jn as ue,Jr as de,Jt as fe,K as pe,Ki as me,Kn as he,Kr as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lr as xe,Lt as Se,M as Ce,Mi as we,Mn as Te,Mr as Ee,Mt as De,N as Oe,Ni as ke,Nn as Ae,Nr as je,Nt as Me,O as Ne,Oi as Pe,On as Fe,Or as Ie,Ot as Le,P as Re,Pi as ze,Pn as Be,Pr as Ve,Pt as He,Q as Ue,Qi as We,Qn as Ge,Qr as Ke,Qt as qe,R as Je,Ri as Ye,Rn as Xe,Rr as Ze,Rt as Qe,S as $e,Sa as et,Si as tt,Sn as nt,Sr as rt,St as it,T as at,Ta 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,Wt as xt,X as St,Xi as Ct,Xn as wt,Xr as Tt,Xt as Et,Y as Dt,Yi as Ot,Yn as kt,Yr as At,Yt as jt,Z as Mt,Zi as Nt,Zn as Pt,Zr as Ft,Zt as It,_ as Lt,_a as Rt,_i as zt,_n as Bt,_r as Vt,_t as Ht,a as Ut,aa as Wt,ai as Gt,an as Kt,ar as qt,at as Jt,b as Yt,ba as Xt,bi as Zt,bn as Qt,br as $t,bt as en,c as tn,ca as nn,ci as rn,cn as an,cr as on,ct as sn,d as cn,da as ln,di as un,dn,dr as fn,ea as pn,ei as mn,en as hn,er as gn,et as _n,f as vn,fa as yn,fi as bn,fn as xn,fr as Sn,g as Cn,ga as wn,gi as Tn,gn as En,gr as Dn,gt as On,h as kn,ha as An,hi as jn,hn as Mn,hr as Nn,i as Pn,ia as Fn,ii as In,in as Ln,ir as Rn,it as zn,j as Bn,ji as Vn,jn as Hn,jr as Un,jt as Wn,k as Gn,ki as Kn,kn as qn,kr as Jn,kt as Yn,l as Xn,la as Zn,li as Qn,ln as $n,lr as er,lt as tr,m as nr,ma as rr,mi as ir,mn as ar,mr as or,n as sr,na as cr,ni as lr,nn as ur,nr as dr,nt as fr,o as pr,oa as mr,oi as hr,on as gr,or as _r,ot as vr,p as yr,pa as br,pi as xr,pn as Sr,pr as Cr,q as wr,qi as Tr,qn as Er,qr as Dr,qt as Or,r as kr,ra as Ar,ri as jr,rn as Mr,rr as Nr,rt as Pr,s as Fr,sa as Ir,si as Lr,sn as Rr,sr as zr,st as Br,t as Vr,ta as Hr,ti as Ur,tn as Wr,tr as Gr,tt as Kr,u as qr,ua as Jr,ui as Yr,un as Xr,ur as Zr,v as Qr,va as $r,vi as ei,vn as ti,vr as ni,vt as ri,w as ii,wa as ai,wi 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,zr as Ti,zt as Ei}from"./src-BvF1D3wV.mjs";import{C as Di,E as Oi,T as ki,_ as Ai,b as ji,c as Mi,d as Ni,g as Pi,i as Fi,l as Ii,m as Li,n as Ri,p as zi,s as Bi,t as Vi,u as Hi,v as Ui,w as Wi,x as Gi,y as Ki}from"./fs-traced-CJ0NSnI0.mjs";import{a as qi,d as Ji,f as Yi,i as Xi,l as Zi,n as Qi,r as $i,t as ea,u as ta}from"./logger-DFxEUjvj.mjs";import{C as na,S as ra,_ as ia,a as aa,b as oa,c as sa,d 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-BmwIVWMl.mjs";export{$r as AGENT_ID_MAX_LEN,_i as AGENT_ID_RE,ze as AGENT_WRITE_ORIGIN,ot as AcpPermissionStore,et as AcpRegistry,Kn as AcpThreadManager,N as AgentFocusBroadcaster,z as AgentPresenceBroadcaster,W as AgentSessionCapacityError,ie as AgentSessionManager,Ht as AutoStartDisabledError,ci as BUNDLE_IDS,ct as BUNDLE_SCOPE,V as BUNDLE_SKILL_NAME,Nr as BacklinkIndex,me as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Bt as CONFIG_FILENAME,Pt as CONFLICT_MARKER_RE,Dr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Lt as ConfigSchema,We as DEFAULT_CHECKPOINT_RETENTION,bn as DEFAULT_EMBEDDINGS_DIMENSIONS,ne as DEFAULT_PACK_ID,mt as DocumentDurabilityState,xr as EMBEDDINGS_API_KEY_ENV,st as ExposureConsentError,E as FEATURED_AGENT_IDS,f as FILE_SYSTEM_WRITER,Gr as FILE_WATCHER_ORIGIN,hr as FileEmbeddingsBackend,Ln as GIT_PREFLIGHT_FAIL_SPAN_NAME,pn as GIT_UPSTREAM_WRITER,R as GitDirAccessError,gr as GitNotAvailableError,Rr as GitTooOldError,ri as HOCUSPOCUS_AUTH_REJECTION_REASONS,xi as HocuspocusAuthRejection,en as HocuspocusAuthTokenSchema,m as INSTALLED_AGENTS_SCHEMES,sn as JSON_SCHEMA_DIALECT_2020_12,n as LINEAGE_EPOCH_KEY,Je as LIVE_DERIVED_INDEX_DEBOUNCE_MS,pt as LOG_MD_TEMPLATE,I as MANAGED_RENAME_ORIGIN,_ as MAX_ACP_THREADS,ye as MAX_AGENT_SESSIONS,we as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Ye as MIN_EVICTABLE_IDLE_MS,an as MIN_GIT_VERSION,$ as MISSING_OK_CONFIG_MESSAGE,M as MalformedGitPointerError,_n as McpLogger,ut as MissingOkConfigError,S as OBSERVER_SYNC_ORIGIN,ti as OK_OKIGNORE_TEMPLATE,F as ONBOARDING_BUNDLE_IDS,a as ORPHAN_MODES,t as PROTOCOL_VERSION,ea as PinoLogger,sa as ProcessLockCollisionError,Xn as ProjectGitInitError,Le as ROLLBACK_ORIGIN,yi as ROOT_GITIGNORE_TEMPLATE,oa as RUNTIME_VERSION,Hr as SERVICE_WRITER,bi as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,xt as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,_e as STARTER_PACKS,Or as STARTER_PACK_IDS,fe as STARTER_TEMPLATES,at as STATE_MANIFEST_FILENAME,xa as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,hn as SeedPrerequisiteError,Wr as SeedRootDirError,ya as ServerLockCollisionError,Vr as SingleFileNotAFileError,sr as SingleFileNotFoundError,kr as SingleFileNotMarkdownError,L as StateManifestError,dr as TagIndex,Ie as USER_GLOBAL_BUNDLE_IDS,He as UiLockCollisionError,Yn as __getShowAllWalkStatsForTesting,b as __resetShowAllWalkStatsForTesting,fa as acquireProcessLock,ma as acquireServerLock,q as acquireUiLock,Ci as applyAgentMarkdownWrite,kt as applyExternalChange,_t as applySeed,j as assertCompatibleStateManifest,$n as assertGitAvailable,be as assertNeverDiskEvent,Pe as attachAcpThreadSocket,On as attachIdleShutdown,Qr as bootServer,qt as buildAndOpenSkill,Qt as buildConfigYmlContent,Dt as buildExecResult,B as buildIngressPolicy,Vn as buildOkMcpStdioCommand,mi as buildSkillZip,jt as buildStarterFolderFrontmatterYaml,cr as buildWipTree,Jn as bundleSkillMdPath,Lr as canonicalProjectKey,Xe as classifyEvents,Vi as classifyFsPath,rn as clearAllEmbeddingsKeys,jn as clearContributors,Et as coercePackId,o as colorFromSeed,Ar as commitUpstreamImport,Fn as commitWip,Wt as commitWipFromTree,Xr as compareSemver,Ee as composeEffectiveLinterConfig,je as composeFrontmatterSchemasConfig,Ge as containsConflictMarkers,wi as contentHash,Tn as contributorCount,Re as countShadowObjects,U as countStaleAgentWipRefs,re as countWipRefs,Wn as createApiExtension,H as createAssetServeMiddleware,J as createCollaborationHost,Z as createContentFilter,ge as createContentFilterAsync,Qn as createEmbeddingsSecretStore,Pn as createEphemeralProjectDir,wt as createExternalChangeHandler,vn as createFileLogger,Si as createLiveDerivedIndexExtension,wr as createMcpHttpHandler,mn as createOsProbe,Oe as createPersistenceExtension,T as createServer,Bn as createServerObserverExtension,dt as createStreamingErrorWriter,Qi as createTestLogger,Yr as describeStoredEmbeddingsKey,Cn as detectClaudeDesktopPresence,dn as detectGit,Ne as detectProjectShape,_r as detectUserSkillHosts,Pr as discoverLockDirs,oe as discoverMarkdownlintConfig,Kt as emitPreflightFailureSpan,St as encodeDocName,Mt as encodeFolderRoute,Ue as encodeSkillRoute,qr as ensureProjectGit,pi as ensureProjectSkillGitignore,yt as errorResponse,C as evictStaleTrackerEntries,De as extractHeadings,zn as extractOkBinaryPath,Rn as extractWikiLinksFromMarkdown,xn as fallbackPaths,cn as findEnclosingGitRoot,G as findEnclosingProjectRoot,xe as findNativeMarkdownlintFile,yr as flushFileLogger,hi as formatAuthRejectionWire,zt as formatContributors,ei as formatContributorsFrom,Ei as formatPackRationale,mr as gcCheckpointRefs,Kr as getCurrentMcpLogger,P as getIngressContext,tt as getLocalDir,nr as getLogFilePath,$i as getLogger,kn as getLogsDir,ia as getMachineId,Ki as getMeter,br as getMetrics,ji as getTracer,rr as handleCollabSocketError,de as handleSpawnCursor,Fe as hasForwardingHeaders,ve as hasGcLogLatch,l as iconFromClientName,An as incrementCollabSocketFilteredError,wn as incrementServerObserverFire,nt as initContent,Ir as initShadowRepo,Gi as initTelemetry,Yt as initToleranceTelemetryWriter,tr as installJsonSchemaDialect,Br as installPrettyZodErrors,Xi as installTestLoggers,zr as installUserSkill,Be as isAllowedApiOrigin,Te as isAllowedWorkspaceHostHeader,Tr as isConfigDoc,it as isHocuspocusAuthRejectionReason,qn as isHostAdmitted,It as isKnownPackId,le as isLinkIndexExcludedDoc,Ae as isLoopbackAddress,Ot as isManagedArtifactDoc,v as isOriginAdmitted,u as isOrphanMode,ht as isPairedWriteOrigin,At as isPathWithinDir,Hn as isPeerAdmitted,ra as isProcessAlive,ae as isProjectRoot,Ct as isReservedForUserTree,gt as isSelfWrite,Nt as isSystemDoc,ui as isToleranceTelemetryEnabled,na as isValidLockPid,te as lastKnownHash,nn as listRescueCheckpoints,qe as listStarterPacks,ai as loadCustomAgents,Ce as loadPrincipal,ba as lockBaseUrl,ca as lockFilePath,qi as loggerFactory,Zi as logsCurrentPath,ta as logsPreviousPath,un as makeLazyEmbeddingsKeyStore,_a as markServerLockDraining,vt as mountMcpAndApi,Ri as normalizeFsPath,y as originGitHubHost,O as packageVersionMajorMinor,A as parseAuthRejectionWire,Sr as parseGitVersion,li as parseHocuspocusAuthToken,pe as parseKeepaliveConnectionId,ft as pathToDocName,w as planSeed,Ut as prepareSingleFileOpen,Jt as processCommand,vr as processUsage,Zr as readAllTargets,fn as readBundleDecision,Ze as readOwnNativeRules,ga as readProcessLock,pa as readProcessLockDetailed,x as readProjectHeadState,Gt as readProjectLocalSemanticConfig,da as readServerLock,Sn as readServerPackageVersion,Cr as readSkillInstallStateSnapshot,Gn as readStateManifest,or as readTargetRecordedAt,Nn as readTargetVersion,se as readUiLock,p as reconcile,vi as recordContributor,$t as recordSkillInstallEvent,ce as registerAllTools,bt as registerWrite,ua as releaseProcessLock,aa as releaseServerLock,Se as releaseUiLock,X as removeLastKnownHash,er as reportSkillInstall,Rt as resetMetrics,on as resolveBuiltinSkillHosts,i as resolveBundleEnabled,rt as resolveBundledSkillDir,D as resolveContentDir,Tt as resolveCursorBinaryDefault,Ft as resolveCursorSpawnInvocation,Ve as resolveEffectiveLinterConfig,ir as resolveEmbeddingsCredential,oi as resolveLockDir,K as resolveNativeConfigForDoc,Ti as resolveNativeMarkdownlintConfig,h as resolvePack,Fr as resolvePackageVersion,ni as resolveSkillInstallReportSettings,d as resolveUiInfo,Zt as restoreContributors,gi as restoreLifecycleFromConflictsJson,jr as rewriteMarkdownLinksForDocumentRename,In as rewriteWikiLinksForDocumentRename,ar as runAuthReposSubprocess,Mn as runAuthStatusSubprocess,ur as runCloneSubprocess,En as runDeviceFlowSubprocess,fr as runWithMcpLogger,lr as safeContentPath,Me as safeSubdir,Zn as safetyCheckpoint,ke as sanitizeClientName,Jr as saveInMemoryCheckpoint,ln as saveVersion,lt as seedBasenameIndex,pr as serializeError,Di as setActiveSpanAttributes,ee as setupServerObservers,yn as shadowGit,Wi as shutdownTelemetry,Ji as spansCurrentPath,Yi as spansPreviousPath,Ke as spawnDetached,gn as splitMarkdownBlocks,he as startWatcher,Y as streamingProblemEvent,fi as swapContributors,$e as teardownToleranceTelemetryWriter,Xt as toBroadcasterKey,Fi as tracedAppendFileSync,Bi as tracedLinkSync,Mi as tracedMkdir,Ii as tracedMkdirSync,Hi as tracedRename,Ni as tracedRenameSync,zi as tracedRmSync,Li as tracedRmdirSync,Pi as tracedUnlinkSync,Ai as tracedWriteFile,Ui as tracedWriteFileSync,ii as trustSystemCertificates,tn as untrackTrackedProjectSkillProjection,Er as updateLastKnownHash,la as updateProcessLockPort,ha as updateServerLockPort,Qe as updateUiLockPort,di as validateAgentId,Mr as validateCloneInputs,k as validateSkillZip,va as waitForServerLockDrain,Ur as withHiddenWindowsConsole,ki as withSpan,Oi as withSpanSync,Dn as writeBundleDecision,Un as writeMarkdownlintRule,si as writeRootGitignoreForNewRepo,g as writeStateManifest,Vt as writeTargetVersion,ue as writeTracker};
1
+ import{B as e,Cc as t,Fs as n,Ls as r,W as i,_s as a,g as o,ms as s,qs as c,v as l,vs as u}from"./src-BxdlvOrw.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,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Ht as ne,I as re,Ii as ie,In as ae,Ir as oe,It as se,J as ce,Ji as le,Jn as ue,Jr as de,Jt as fe,K as pe,Ki as me,Kn as he,Kr as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lr as xe,Lt as Se,M as Ce,Mi as we,Mn as Te,Mr as Ee,Mt as De,N as Oe,Ni as ke,Nn as Ae,Nr as je,Nt as Me,O as Ne,Oi as Pe,On as Fe,Or as Ie,Ot as Le,P as Re,Pi as ze,Pn as Be,Pr as Ve,Pt as He,Q as Ue,Qi as We,Qn as Ge,Qr as Ke,Qt as qe,R as Je,Ri as Ye,Rn as Xe,Rr as Ze,Rt as Qe,S as $e,Sa as et,Si as tt,Sn as nt,Sr as rt,St as it,T as at,Ta 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,Wt as xt,X as St,Xi as Ct,Xn as wt,Xr as Tt,Xt as Et,Y as Dt,Yi as Ot,Yn as kt,Yr as At,Yt as jt,Z as Mt,Zi as Nt,Zn as Pt,Zr as Ft,Zt as It,_ as Lt,_a as Rt,_i as zt,_n as Bt,_r as Vt,_t as Ht,a as Ut,aa as Wt,ai as Gt,an as Kt,ar as qt,at as Jt,b as Yt,ba as Xt,bi as Zt,bn as Qt,br as $t,bt as en,c as tn,ca as nn,ci as rn,cn as an,cr as on,ct as sn,d as cn,da as ln,di as un,dn,dr as fn,ea as pn,ei as mn,en as hn,er as gn,et as _n,f as vn,fa as yn,fi as bn,fn as xn,fr as Sn,g as Cn,ga as wn,gi as Tn,gn as En,gr as Dn,gt as On,h as kn,ha as An,hi as jn,hn as Mn,hr as Nn,i as Pn,ia as Fn,ii as In,in as Ln,ir as Rn,it as zn,j as Bn,ji as Vn,jn as Hn,jr as Un,jt as Wn,k as Gn,ki as Kn,kn as qn,kr as Jn,kt as Yn,l as Xn,la as Zn,li as Qn,ln as $n,lr as er,lt as tr,m as nr,ma as rr,mi as ir,mn as ar,mr as or,n as sr,na as cr,ni as lr,nn as ur,nr as dr,nt as fr,o as pr,oa as mr,oi as hr,on as gr,or as _r,ot as vr,p as yr,pa as br,pi as xr,pn as Sr,pr as Cr,q as wr,qi as Tr,qn as Er,qr as Dr,qt as Or,r as kr,ra as Ar,ri as jr,rn as Mr,rr as Nr,rt as Pr,s as Fr,sa as Ir,si as Lr,sn as Rr,sr as zr,st as Br,t as Vr,ta as Hr,ti as Ur,tn as Wr,tr as Gr,tt as Kr,u as qr,ua as Jr,ui as Yr,un as Xr,ur as Zr,v as Qr,va as $r,vi as ei,vn as ti,vr as ni,vt as ri,w as ii,wa as ai,wi 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,zr as Ti,zt as Ei}from"./src-DJejT6Wt.mjs";import{C as Di,E as Oi,T as ki,_ as Ai,b as ji,c as Mi,d as Ni,g as Pi,i as Fi,l as Ii,m as Li,n as Ri,p as zi,s as Bi,t as Vi,u as Hi,v as Ui,w as Wi,x as Gi,y as Ki}from"./fs-traced-CJ0NSnI0.mjs";import{a as qi,d as Ji,f as Yi,i as Xi,l as Zi,n as Qi,r as $i,t as ea,u as ta}from"./logger-DFxEUjvj.mjs";import{C as na,S as ra,_ as ia,a as aa,b as oa,c as sa,d 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-BmwIVWMl.mjs";export{$r as AGENT_ID_MAX_LEN,_i as AGENT_ID_RE,ze as AGENT_WRITE_ORIGIN,ot as AcpPermissionStore,et as AcpRegistry,Kn as AcpThreadManager,N as AgentFocusBroadcaster,z as AgentPresenceBroadcaster,W as AgentSessionCapacityError,ie as AgentSessionManager,Ht as AutoStartDisabledError,ci as BUNDLE_IDS,ct as BUNDLE_SCOPE,V as BUNDLE_SKILL_NAME,Nr as BacklinkIndex,me as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Bt as CONFIG_FILENAME,Pt as CONFLICT_MARKER_RE,Dr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Lt as ConfigSchema,We as DEFAULT_CHECKPOINT_RETENTION,bn as DEFAULT_EMBEDDINGS_DIMENSIONS,ne as DEFAULT_PACK_ID,mt as DocumentDurabilityState,xr as EMBEDDINGS_API_KEY_ENV,st as ExposureConsentError,E as FEATURED_AGENT_IDS,f as FILE_SYSTEM_WRITER,Gr as FILE_WATCHER_ORIGIN,hr as FileEmbeddingsBackend,Ln as GIT_PREFLIGHT_FAIL_SPAN_NAME,pn as GIT_UPSTREAM_WRITER,R as GitDirAccessError,gr as GitNotAvailableError,Rr as GitTooOldError,ri as HOCUSPOCUS_AUTH_REJECTION_REASONS,xi as HocuspocusAuthRejection,en as HocuspocusAuthTokenSchema,m as INSTALLED_AGENTS_SCHEMES,sn as JSON_SCHEMA_DIALECT_2020_12,n as LINEAGE_EPOCH_KEY,Je as LIVE_DERIVED_INDEX_DEBOUNCE_MS,pt as LOG_MD_TEMPLATE,I as MANAGED_RENAME_ORIGIN,_ as MAX_ACP_THREADS,ye as MAX_AGENT_SESSIONS,we as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Ye as MIN_EVICTABLE_IDLE_MS,an as MIN_GIT_VERSION,$ as MISSING_OK_CONFIG_MESSAGE,M as MalformedGitPointerError,_n as McpLogger,ut as MissingOkConfigError,S as OBSERVER_SYNC_ORIGIN,ti as OK_OKIGNORE_TEMPLATE,F as ONBOARDING_BUNDLE_IDS,a as ORPHAN_MODES,t as PROTOCOL_VERSION,ea as PinoLogger,sa as ProcessLockCollisionError,Xn as ProjectGitInitError,Le as ROLLBACK_ORIGIN,yi as ROOT_GITIGNORE_TEMPLATE,oa as RUNTIME_VERSION,Hr as SERVICE_WRITER,bi as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,xt as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,_e as STARTER_PACKS,Or as STARTER_PACK_IDS,fe as STARTER_TEMPLATES,at as STATE_MANIFEST_FILENAME,xa as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,hn as SeedPrerequisiteError,Wr as SeedRootDirError,ya as ServerLockCollisionError,Vr as SingleFileNotAFileError,sr as SingleFileNotFoundError,kr as SingleFileNotMarkdownError,L as StateManifestError,dr as TagIndex,Ie as USER_GLOBAL_BUNDLE_IDS,He as UiLockCollisionError,Yn as __getShowAllWalkStatsForTesting,b as __resetShowAllWalkStatsForTesting,fa as acquireProcessLock,ma as acquireServerLock,q as acquireUiLock,Ci as applyAgentMarkdownWrite,kt as applyExternalChange,_t as applySeed,j as assertCompatibleStateManifest,$n as assertGitAvailable,be as assertNeverDiskEvent,Pe as attachAcpThreadSocket,On as attachIdleShutdown,Qr as bootServer,qt as buildAndOpenSkill,Qt as buildConfigYmlContent,Dt as buildExecResult,B as buildIngressPolicy,Vn as buildOkMcpStdioCommand,mi as buildSkillZip,jt as buildStarterFolderFrontmatterYaml,cr as buildWipTree,Jn as bundleSkillMdPath,Lr as canonicalProjectKey,Xe as classifyEvents,Vi as classifyFsPath,rn as clearAllEmbeddingsKeys,jn as clearContributors,Et as coercePackId,o as colorFromSeed,Ar as commitUpstreamImport,Fn as commitWip,Wt as commitWipFromTree,Xr as compareSemver,Ee as composeEffectiveLinterConfig,je as composeFrontmatterSchemasConfig,Ge as containsConflictMarkers,wi as contentHash,Tn as contributorCount,Re as countShadowObjects,U as countStaleAgentWipRefs,re as countWipRefs,Wn as createApiExtension,H as createAssetServeMiddleware,J as createCollaborationHost,Z as createContentFilter,ge as createContentFilterAsync,Qn as createEmbeddingsSecretStore,Pn as createEphemeralProjectDir,wt as createExternalChangeHandler,vn as createFileLogger,Si as createLiveDerivedIndexExtension,wr as createMcpHttpHandler,mn as createOsProbe,Oe as createPersistenceExtension,T as createServer,Bn as createServerObserverExtension,dt as createStreamingErrorWriter,Qi as createTestLogger,Yr as describeStoredEmbeddingsKey,Cn as detectClaudeDesktopPresence,dn as detectGit,Ne as detectProjectShape,_r as detectUserSkillHosts,Pr as discoverLockDirs,oe as discoverMarkdownlintConfig,Kt as emitPreflightFailureSpan,St as encodeDocName,Mt as encodeFolderRoute,Ue as encodeSkillRoute,qr as ensureProjectGit,pi as ensureProjectSkillGitignore,yt as errorResponse,C as evictStaleTrackerEntries,De as extractHeadings,zn as extractOkBinaryPath,Rn as extractWikiLinksFromMarkdown,xn as fallbackPaths,cn as findEnclosingGitRoot,G as findEnclosingProjectRoot,xe as findNativeMarkdownlintFile,yr as flushFileLogger,hi as formatAuthRejectionWire,zt as formatContributors,ei as formatContributorsFrom,Ei as formatPackRationale,mr as gcCheckpointRefs,Kr as getCurrentMcpLogger,P as getIngressContext,tt as getLocalDir,nr as getLogFilePath,$i as getLogger,kn as getLogsDir,ia as getMachineId,Ki as getMeter,br as getMetrics,ji as getTracer,rr as handleCollabSocketError,de as handleSpawnCursor,Fe as hasForwardingHeaders,ve as hasGcLogLatch,l as iconFromClientName,An as incrementCollabSocketFilteredError,wn as incrementServerObserverFire,nt as initContent,Ir as initShadowRepo,Gi as initTelemetry,Yt as initToleranceTelemetryWriter,tr as installJsonSchemaDialect,Br as installPrettyZodErrors,Xi as installTestLoggers,zr as installUserSkill,Be as isAllowedApiOrigin,Te as isAllowedWorkspaceHostHeader,Tr as isConfigDoc,it as isHocuspocusAuthRejectionReason,qn as isHostAdmitted,It as isKnownPackId,le as isLinkIndexExcludedDoc,Ae as isLoopbackAddress,Ot as isManagedArtifactDoc,v as isOriginAdmitted,u as isOrphanMode,ht as isPairedWriteOrigin,At as isPathWithinDir,Hn as isPeerAdmitted,ra as isProcessAlive,ae as isProjectRoot,Ct as isReservedForUserTree,gt as isSelfWrite,Nt as isSystemDoc,ui as isToleranceTelemetryEnabled,na as isValidLockPid,te as lastKnownHash,nn as listRescueCheckpoints,qe as listStarterPacks,ai as loadCustomAgents,Ce as loadPrincipal,ba as lockBaseUrl,ca as lockFilePath,qi as loggerFactory,Zi as logsCurrentPath,ta as logsPreviousPath,un as makeLazyEmbeddingsKeyStore,_a as markServerLockDraining,vt as mountMcpAndApi,Ri as normalizeFsPath,y as originGitHubHost,O as packageVersionMajorMinor,A as parseAuthRejectionWire,Sr as parseGitVersion,li as parseHocuspocusAuthToken,pe as parseKeepaliveConnectionId,ft as pathToDocName,w as planSeed,Ut as prepareSingleFileOpen,Jt as processCommand,vr as processUsage,Zr as readAllTargets,fn as readBundleDecision,Ze as readOwnNativeRules,ga as readProcessLock,pa as readProcessLockDetailed,x as readProjectHeadState,Gt as readProjectLocalSemanticConfig,da as readServerLock,Sn as readServerPackageVersion,Cr as readSkillInstallStateSnapshot,Gn as readStateManifest,or as readTargetRecordedAt,Nn as readTargetVersion,se as readUiLock,p as reconcile,vi as recordContributor,$t as recordSkillInstallEvent,ce as registerAllTools,bt as registerWrite,ua as releaseProcessLock,aa as releaseServerLock,Se as releaseUiLock,X as removeLastKnownHash,er as reportSkillInstall,Rt as resetMetrics,on as resolveBuiltinSkillHosts,i as resolveBundleEnabled,rt as resolveBundledSkillDir,D as resolveContentDir,Tt as resolveCursorBinaryDefault,Ft as resolveCursorSpawnInvocation,Ve as resolveEffectiveLinterConfig,ir as resolveEmbeddingsCredential,oi as resolveLockDir,K as resolveNativeConfigForDoc,Ti as resolveNativeMarkdownlintConfig,h as resolvePack,Fr as resolvePackageVersion,ni as resolveSkillInstallReportSettings,d as resolveUiInfo,Zt as restoreContributors,gi as restoreLifecycleFromConflictsJson,jr as rewriteMarkdownLinksForDocumentRename,In as rewriteWikiLinksForDocumentRename,ar as runAuthReposSubprocess,Mn as runAuthStatusSubprocess,ur as runCloneSubprocess,En as runDeviceFlowSubprocess,fr as runWithMcpLogger,lr as safeContentPath,Me as safeSubdir,Zn as safetyCheckpoint,ke as sanitizeClientName,Jr as saveInMemoryCheckpoint,ln as saveVersion,lt as seedBasenameIndex,pr as serializeError,Di as setActiveSpanAttributes,ee as setupServerObservers,yn as shadowGit,Wi as shutdownTelemetry,Ji as spansCurrentPath,Yi as spansPreviousPath,Ke as spawnDetached,gn as splitMarkdownBlocks,he as startWatcher,Y as streamingProblemEvent,fi as swapContributors,$e as teardownToleranceTelemetryWriter,Xt as toBroadcasterKey,Fi as tracedAppendFileSync,Bi as tracedLinkSync,Mi as tracedMkdir,Ii as tracedMkdirSync,Hi as tracedRename,Ni as tracedRenameSync,zi as tracedRmSync,Li as tracedRmdirSync,Pi as tracedUnlinkSync,Ai as tracedWriteFile,Ui as tracedWriteFileSync,ii as trustSystemCertificates,tn as untrackTrackedProjectSkillProjection,Er as updateLastKnownHash,la as updateProcessLockPort,ha as updateServerLockPort,Qe as updateUiLockPort,di as validateAgentId,Mr as validateCloneInputs,k as validateSkillZip,va as waitForServerLockDrain,Ur as withHiddenWindowsConsole,ki as withSpan,Oi as withSpanSync,Dn as writeBundleDecision,Un as writeMarkdownlintRule,si as writeRootGitignoreForNewRepo,g as writeStateManifest,Vt as writeTargetVersion,ue as writeTracker};