@inkeep/open-knowledge 0.82.0-beta.3 → 0.82.0-beta.4
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/cli.mjs +70 -70
- package/dist/constants-W9G4vRvJ.mjs +1 -0
- package/dist/dist-C1WwDYOU.mjs +1 -0
- package/dist/{dist-TAcrANM7.mjs → dist-DdoZ294B.mjs} +496 -496
- package/dist/index.d.mts +8 -0
- package/dist/index.mjs +12 -12
- package/dist/init-DaBUbh8G.mjs +1 -0
- package/dist/{init-DQVtFZSr.mjs → init-vgeY_wHD.mjs} +63 -63
- package/dist/{launch-json-removal-C5wtVwU_.mjs → launch-json-removal-D4FuJ2Te.mjs} +1 -1
- package/dist/{loader-XJNah9bm.mjs → loader-DYbtvtxH.mjs} +1 -1
- package/dist/loader-YyyVC5zh.mjs +1 -0
- package/dist/{open-browser-CJaJbExe.mjs → open-browser-Dg3gcrHM.mjs} +1 -1
- package/dist/{preview-DFRLvckr.mjs → preview-1EGVW00C.mjs} +1 -1
- package/dist/preview-BQhr7b8a.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BqpVsK8l.js → ActivityModeContent-qim4zFx-.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CAW5QCX8.js → AddPropertiesButton-DKXiB5hC.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Bg5A5RO2.js → AgentDiffPane-BD8yOgrS.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-lnPRDMaW.js → CodeMirrorPropInput-D7ODqRwE.js} +1 -1
- package/dist/public/assets/{DocumentContext-CiI7-kAU.js → DocumentContext-BHjfklWj.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-BJidPutF.js → EditorModeToggle-XKuoOdJs.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-BL56x7EQ.js → ExcalidrawDocEditor-I2eQXX7E.js} +1 -1
- package/dist/public/assets/FeedbackForm-BQ8aBBom.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-UbeDdBTn.js → ImportSkillDialog-CU7KSDgH.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BY8qPMlW.js → LintConfigEditor-81_fDdG_.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-B4Mp4oZQ.js → ManagedArtifactProperties-DTfJaeLZ.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-yEjDaTS8.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DJeha_H0.js → MermaidDocEditor-Dw5SypSn.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-D9_d1KsK.js → PropertyDisplayRow-Bn0kgK3p.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DAagpi8v.js → SchemaConfigEditor-BLXTxBGL.js} +1 -1
- package/dist/public/assets/{SessionsHost-mg9fx7DH.js → SessionsHost-DquHUp9T.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DwNVEA39.js → SettingsDialogBody-DKEUH63t.js} +1 -1
- package/dist/public/assets/ShareBranchSwitchDialog-BUS2my96.js +1 -0
- package/dist/public/assets/{ShareReceiveMissDialog-DShK8007.js → ShareReceiveMissDialog-_8dejDWk.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-8-VCWJg_.js → SkillInstallMenu-Cju9gFSt.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Ca_jnifx.js → SkillToolbarControls-SRsQowBm.js} +1 -1
- package/dist/public/assets/{SourceEditor-CyVTEVVa.js → SourceEditor-DUhZs5yo.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-CRsuOziY.js → SyncStatusBadge-B9wP5KjD.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Dv3QBZej.js → TerminalWindowApp-CAjzSiBI.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CLZRQrgg.js → TextDocEditor-C7dpFdVd.js} +1 -1
- package/dist/public/assets/{ThreadView-DGLAO83T.js → ThreadView-CsZKSzs5.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-ErzMzIn_.js → TimelineDiffPane-DcChEu2J.js} +1 -1
- package/dist/public/assets/{auth-state-cache-Bz3EsxBR.js → auth-state-cache-Dz-Yvu70.js} +1 -1
- package/dist/public/assets/{comment-chips-u8dnjbXP.js → comment-chips-jwrddJ4n.js} +1 -1
- package/dist/public/assets/{config-provider-krmD4VSt.js → config-provider-B4cgjuAt.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-Dgsedc5E.js → doc-undo-manager-ZAJ7EhHf.js} +1 -1
- package/dist/public/assets/{index-7RGg47Tt.js → index-BdhkBLck.js} +7 -7
- package/dist/public/assets/{messages-DCLxtq5E.js → messages-15pqM65e.js} +1 -1
- package/dist/public/assets/{messages-s1kQ0F_h.js → messages-9WOa9KUm.js} +1 -1
- package/dist/public/assets/{messages-AFVdD964.js → messages-B_Wv5APO.js} +1 -1
- package/dist/public/assets/{messages-BcWRA-nI.js → messages-C7pSlTmA.js} +1 -1
- package/dist/public/assets/{messages-CbN1r9yA.js → messages-CAYad86H.js} +1 -1
- package/dist/public/assets/{messages-OBzrmAFm.js → messages-CQ1vIgoS.js} +1 -1
- package/dist/public/assets/{messages-C0Gd4qNa.js → messages-CciFZ7sP.js} +1 -1
- package/dist/public/assets/messages-CibA1WyZ.js +1 -0
- package/dist/public/assets/{messages-DM9zlCjV.js → messages-Dd9VKFx-.js} +1 -1
- package/dist/public/assets/{messages-BCP_tUaH.js → messages-DsNN544W.js} +1 -1
- package/dist/public/assets/{messages-hoIRV_jf.js → messages-KKn5PQmE.js} +1 -1
- package/dist/public/assets/{messages-C2ZTIk86.js → messages-WxVoyVTt.js} +1 -1
- package/dist/public/assets/{messages-l5K8pww3.js → messages-spfa9ZpO.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DPCjeW6k.js → pending-receive-nav-store-4xt56kJR.js} +1 -1
- package/dist/public/assets/{progress-Ft463XK1.js → progress-D6YLD7xV.js} +1 -1
- package/dist/public/assets/{selection-context-Bk3yAvWZ.js → selection-context-CDv7YpZ_.js} +1 -1
- package/dist/public/assets/{src-XXqnTiU6.js → src-xGMvMbEd.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BuHBn_6z.js → typing-burst-detector-Bwb8vXQS.js} +1 -1
- package/dist/public/assets/{uninstall-D_93vcTI.js → uninstall-BcI5d3jC.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DwWmPc8H.js → use-activity-panel-Bm-_7omz.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-COH3Pg2u.js → use-apply-config-language-Bzn7Rbw_.js} +2 -2
- package/dist/public/assets/{use-open-skill-H_tjyNt-.js → use-open-skill-BpW3ZhuK.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BXYM2yvn.js → use-terminal-enabled-Br80VTvl.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-8pKiL5Sa.js → use-timeline-entry-diff-l604pHZz.js} +1 -1
- package/dist/public/index.html +19 -19
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-C8t0beB6.mjs → registry-probes-BXgdIidc.mjs} +8 -8
- package/dist/{removal-file-path-vGqtuN6p.mjs → removal-file-path-Ce-oxAGQ.mjs} +1 -1
- package/dist/{repair-launch-json-C2M3QJCU.mjs → repair-launch-json-CtsInz2s.mjs} +1 -1
- package/dist/{repair-mcp-configs-DV7hcTRV.mjs → repair-mcp-configs-BESnoIPY.mjs} +1 -1
- package/dist/src-BPwbNxCr.mjs +1 -0
- package/dist/src-KNAqsxPK.mjs +11 -0
- package/dist/start-B8iic9V_.mjs +5 -0
- package/dist/start-BXE7aaH4.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-BZCC7yS1.mjs +0 -1
- package/dist/dist-DttP19KX.mjs +0 -1
- package/dist/init-D6Fi9suH.mjs +0 -1
- package/dist/loader-DeHi6YRp.mjs +0 -1
- package/dist/preview-y_qYI633.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DQYT8_7L.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-s6BAlOXR.js +0 -1
- package/dist/public/assets/ShareBranchSwitchDialog-DpxzT0qX.js +0 -1
- package/dist/public/assets/messages-fT_Mlcyb.js +0 -1
- package/dist/src-B4ZXvtQf.mjs +0 -1
- package/dist/src-D1k-b-_e.mjs +0 -11
- package/dist/start-C-MwllNx.mjs +0 -1
- package/dist/start-t8aEZijL.mjs +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -2435,6 +2435,12 @@ type WorktreeCreateResult = {
|
|
|
2435
2435
|
readonly reason: 'helper-not-found';
|
|
2436
2436
|
readonly helper: string;
|
|
2437
2437
|
readonly message?: string;
|
|
2438
|
+
} | {
|
|
2439
|
+
readonly ok: false;
|
|
2440
|
+
readonly reason: 'unsafe-symlinks';
|
|
2441
|
+
readonly refusedSymlinkPaths: readonly string[];
|
|
2442
|
+
readonly message?: never;
|
|
2443
|
+
readonly helper?: never;
|
|
2438
2444
|
} | {
|
|
2439
2445
|
readonly ok: false;
|
|
2440
2446
|
readonly reason: 'fetch-failed';
|
|
@@ -10993,6 +10999,8 @@ type OkLocalOpCloneEvent = {
|
|
|
10993
10999
|
} | {
|
|
10994
11000
|
type: 'error';
|
|
10995
11001
|
message: string;
|
|
11002
|
+
code?: 'unsafe-symlinks';
|
|
11003
|
+
refusedSymlinkPaths?: string[];
|
|
10996
11004
|
};
|
|
10997
11005
|
interface OkLocalOpStream<E> {
|
|
10998
11006
|
readonly events: AsyncIterable<E>;
|
package/dist/index.mjs
CHANGED
|
@@ -1102,30 +1102,30 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
|
|
|
1102
1102
|
`);try{return[...e.rescanInPlaceSkillDirs()].sort().join(`
|
|
1103
1103
|
`)}catch{return[...a].sort().join(`
|
|
1104
1104
|
`)}},async rebuildIgnorePatterns(){let t=e=>(ee=e().finally(()=>{ee=null}),ee),o=async()=>{if(c.reset(),e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){I8.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}let t=d,o=f,s=p,l=m,u=h,g=_,S=v,C=Date.now();return mOe(`config.ignore.rebuild`,{attributes:{}},async e=>{try{let t=y();b.clear(),i===void 0&&await XOe(n,x,b);let a=Date.now()-C;if(e.setAttributes({"ok.ignore.pattern_count":t.patternCount,"ok.ignore.nested_file_count":t.nestedFileCount,"ok.ignore.bytes":t.bytes}),I8.info({patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:a},`content-filter rebuild succeeded`),r)try{r()}catch(e){I8.warn({err:e instanceof Error?e:Error(String(e))},`content-filter onAfterRebuild callback threw — derived views may be stale`)}return{ok:!0,patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:a}}catch(e){d=t,f=o,p=s,m=l,h=u,_=g,v=S,b.clear();try{T()}catch(e){I8.warn({err:e instanceof Error?e:Error(String(e))},`content-filter rollback dirCount re-walk failed — sibling-asset counts may be stale until next rebuild`)}let n=e instanceof Error?e.message:String(e);return I8.warn({err:e instanceof Error?e:Error(n)},`content-filter rebuild failed — rolled back to previous state`),{ok:!1,error:{message:n}}}})};return ee===null?t(o):(te===null&&(te=ee.catch(()=>null).then(()=>(te=null,t(o)))),te)}}}async function XOe(e,t,n){let r=[{dir:e,relPath:``}],i=0;for(;r.length>0;){let{dir:e,relPath:a}=r.pop();i+=1,i>=50&&(i=0,await new Promise(e=>setImmediate(e)));let o;try{o=w(e,{withFileTypes:!0})}catch(t){I8.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);continue}for(let i of o){let o=a?`${a}/${i.name}`:i.name;if(i.isDirectory()){if(V8(i.name)||t(o)||t(`${o}/`))continue;r.push({dir:A(e,i.name),relPath:o})}else i.isFile()&&M8(i.name)&&!t(o)&&n.set(a,(n.get(a)??0)+1)}}}function n5(e,t,n,r){let i;try{i=w(e,{withFileTypes:!0})}catch(t){I8.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);return}for(let a of i){let i=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){if(V8(a.name)||n(i)||n(`${i}/`))continue;n5(A(e,a.name),i,n,r)}else a.isFile()&&M8(a.name)&&!n(i)&&r.set(t,(r.get(t)??0)+1)}}function r5(e){return e.split(`
|
|
1105
|
-
`).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`))}function i5(e,t){let n=e.startsWith(`!`),r=n?e.slice(1):e,i=r.startsWith(`/`)?r.slice(1):r,a=i.endsWith(`/`)?i.slice(0,-1):i,o=r.startsWith(`/`)||a.includes(`/`)?`${t}/${i}`:`${t}/**/${i}`;return n?`!${o}`:o}function a5(e,t,n,r,i){let a;try{a=w(e,{withFileTypes:!0})}catch(t){return I8.warn({dir:e,err:t},`Failed to read directory ${e}`),0}let o=0;for(let s of a){if(!s.isDirectory()||V8(s.name))continue;let a=A(e,s.name),c=F8(j(t,a));if(!c.startsWith(`..`)&&!(n.ignores(c)||n.ignores(`${c}/`))){for(let e of e5){let t=A(a,e);if(g(t))try{let a=S(t,`utf-8`);i.value+=a.length;let s=r5(a).map(e=>i5(e,c));n.add(s),e===`.okignore`&&r.add(s),o++}catch(n){I8.warn({path:t,err:n},`Failed to read nested ${e} at ${t}`)}}o+=a5(a,t,n,r,i)}}return o}RegExp(`<(${FJ.map(e=>e.tagName).join(`|`)})\\b([^>]*)\\/>`,`y`);const ZOe=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,QOe=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,o5=String.raw`([^\]\n]*)`,s5=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,c5=e=>RegExp(`(!?)${ZOe}`,e),l5=(e,t)=>RegExp(`(!?)\\[${e}\\]${QOe}`,t);c5(`y`),c5(`g`),l5(o5,`y`),l5(s5,`y`),l5(o5,`g`),l5(s5,`g`);const $Oe=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp($Oe,`y`),TZ(`file-watcher`),TZ(`conflict-authority`),TZ(`parse-pool`),Math.max(1,Math.min(4,ge()-1)),O8(()=>{}),TZ(`bridge-watchdog`),O8(()=>{}),TZ(`server-observers`),TZ(`server-observers`),TZ(`agent-sessions`),new class{writes=new WeakMap;record(e,t,n){let r=this.writes.get(e)??new Map;for(let[e,t]of r)
|
|
1105
|
+
`).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`))}function i5(e,t){let n=e.startsWith(`!`),r=n?e.slice(1):e,i=r.startsWith(`/`)?r.slice(1):r,a=i.endsWith(`/`)?i.slice(0,-1):i,o=r.startsWith(`/`)||a.includes(`/`)?`${t}/${i}`:`${t}/**/${i}`;return n?`!${o}`:o}function a5(e,t,n,r,i){let a;try{a=w(e,{withFileTypes:!0})}catch(t){return I8.warn({dir:e,err:t},`Failed to read directory ${e}`),0}let o=0;for(let s of a){if(!s.isDirectory()||V8(s.name))continue;let a=A(e,s.name),c=F8(j(t,a));if(!c.startsWith(`..`)&&!(n.ignores(c)||n.ignores(`${c}/`))){for(let e of e5){let t=A(a,e);if(g(t))try{let a=S(t,`utf-8`);i.value+=a.length;let s=r5(a).map(e=>i5(e,c));n.add(s),e===`.okignore`&&r.add(s),o++}catch(n){I8.warn({path:t,err:n},`Failed to read nested ${e} at ${t}`)}}o+=a5(a,t,n,r,i)}}return o}RegExp(`<(${FJ.map(e=>e.tagName).join(`|`)})\\b([^>]*)\\/>`,`y`);const ZOe=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,QOe=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,o5=String.raw`([^\]\n]*)`,s5=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,c5=e=>RegExp(`(!?)${ZOe}`,e),l5=(e,t)=>RegExp(`(!?)\\[${e}\\]${QOe}`,t);c5(`y`),c5(`g`),l5(o5,`y`),l5(s5,`y`),l5(o5,`g`),l5(s5,`g`);const $Oe=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp($Oe,`y`),new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}};const eke=/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/gu;function u5(e){return e.replace(eke,``).normalize(`NFC`).toUpperCase().toLowerCase().normalize(`NFC`)}function d5(e){let t=u5(e);for(let e=0;e<4;e++){let e=u5(t);if(e===t)break;t=e}return t.replace(/[. ]+$/u,(e,t)=>t===0?e:``)}const tke=new Set([`.ok`,`.open-knowledge`,`.openknowledge`,...Object.values(tt).map(({userHomeDirName:e})=>e)].map(d5));new Set([...ao,...no,...Ere].map(d5));function nke(e){let t=new Set;for(let n of e){let e=n.replace(/^\.+/u,``);if(!/^[a-z0-9-]+$/u.test(e))throw Error(`cannot derive 8.3 short names for config dir "${n}"`);e.length<=2?t.add(`${e}[0-9a-f]{4}`):(t.add(e.slice(0,6)),t.add(`${e.slice(0,2)}[0-9a-f]{4}`))}return RegExp(`^(?:${[...t].join(`|`)})~\\d+$`,`u`)}nke(tke),TZ(`file-watcher`),TZ(`conflict-authority`),TZ(`parse-pool`),Math.max(1,Math.min(4,ge()-1)),O8(()=>{}),TZ(`bridge-watchdog`),O8(()=>{}),TZ(`server-observers`),TZ(`server-observers`),TZ(`agent-sessions`),new class{writes=new WeakMap;record(e,t,n){let r=this.writes.get(e)??new Map;for(let[e,t]of r)rke(t,n)||r.delete(e);r.set(t,n),this.writes.set(e,r)}hasRecentPeer(e,t,n){let r=this.writes.get(e);if(r===void 0)return!1;for(let[e,i]of r){let a=n-i;if(Math.abs(a)>=2e3){r.delete(e);continue}if(e!==t)return!0}return!1}};function rke(e,t){return e!==void 0&&Math.abs(t-e)<2e3}const f5={discovery:`open-knowledge-discovery`,project:`open-knowledge`,"write-skill":`open-knowledge-write-skill`};new Set(Object.values(f5));const ike=Object.keys(f5),ake={discovery:`user`,project:`project`,"write-skill":`user`},p5=ike.filter(e=>ake[e]===`user`);new Set(p5.map(e=>f5[e]));const m5=`OpenKnowledge.app/Contents/Resources/cli/dist/assets/skills`;function h5(e){return new URL(e).pathname.endsWith(`.ts`)}function oke(e,t,n){let r=n.platform??process.platform,i=n.checkDesktop??!1,a=n.home??ve(),o=[],s=process.env.NODE_ENV===`test`;return i&&r===`darwin`&&(s||o.push(A(`/Applications`,m5,e)),(!s||n.home!==void 0)&&o.push(A(a,`Applications`,m5,e))),h5(t)?(o.push(pe(new URL(`../assets/skills/${e}`,t))),o):(o.push(pe(new URL(`../dist/assets/skills/${e}`,t))),o.push(pe(new URL(`../assets/skills/${e}`,t))),o.push(pe(new URL(`./assets/skills/${e}`,t))),o)}function ske(e,t,n){let r=h5(t)?`Running from source, only the source assets are read, so the bundle name is unknown or its directory under packages/server/assets/skills is missing.`:"This usually means the package build did not copy packages/server/assets into dist/assets. Run `pnpm run build` in the package that ships the skills before publishing.";return`Bundled skill asset directory not found for bundle '${e}'. Tried: ${n.join(`, `)}. ${r}`}function g5(e,t={}){let n=oke(e,import.meta.url,t);for(let e of n)if(g(e))return e;throw Error(ske(e,import.meta.url,n))}function cke(){try{let e=O(pe(import.meta.url)),t=M(e,`..`,`package.json`),n=JSON.parse(S(t,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}cke();function lke(e,t,n){let[r,i,a,...o]=process.argv.slice(1);(r===void 0||i===void 0||a===void 0)&&(process.stderr.write(`ok-browser relay: missing the folder, files or command argument
|
|
1106
1106
|
`),process.exit(2));let s=new Set(n),c={roots:[{uri:t.pathToFileURL(i).href,name:`chat files`}]},l=e.spawn(a,o,{cwd:r,stdio:[`pipe`,`pipe`,`inherit`],windowsHide:!0}),u=l.stdin,d=l.stdout;(u===null||d===null)&&(process.stderr.write(`ok-browser relay: the browser server has no pipes
|
|
1107
1107
|
`),process.exit(1));let f=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:null,p=e=>{u.write(`${JSON.stringify(e)}\n`)},m=e=>{process.stdout.write(`${JSON.stringify(e)}\n`)},h=(e,t)=>{process.stderr.write(`ok-browser relay: dropped a ${e} line that ${t}\n`)},g=(e,t,n)=>{if(e.trim()===``)return null;let r;try{r=JSON.parse(e)}catch{return h(t,`is not JSON`),null}let i=f(r);if(i!==null)return i;if(Array.isArray(r))for(let e of r){let t=f(e);t?.method!==void 0&&t.id!==void 0&&n({jsonrpc:`2.0`,id:t.id,error:{code:-32600,message:`Batched messages are not supported`}})}return h(t,`is not a single JSON-RPC message`),null},_=e=>{let t=g(e,`client`,m);if(t===null||t.method===`notifications/roots/list_changed`)return null;let n=f(t.params),r=n?.name;return t.method===`tools/call`&&(typeof r!=`string`||!s.has(r))?(t.id!==void 0&&m({jsonrpc:`2.0`,id:t.id,error:{code:-32602,message:`Tool ${String(r)} is not available`}}),null):(t.method===`initialize`&&n!==null&&(n.capabilities={...f(n.capabilities),roots:{listChanged:!1}}),JSON.stringify(t))},v=e=>{let t=g(e,`server`,p);if(t===null)return null;if(t.method===`roots/list`)return t.id!==void 0&&p({jsonrpc:`2.0`,id:t.id,result:c}),null;let n=f(t.result),r=n?.tools;if(n===null||!Array.isArray(r))return e;let i=r.filter(e=>{let t=f(e)?.name;return typeof t==`string`&&s.has(t)});for(let e of i){let t=f(f(e)?.annotations);t!==null&&(t.readOnlyHint=!1)}return n.tools=i,JSON.stringify(t)},y=(e,t,n,r)=>{let i=``,a=e=>{let r=n(e);r!==null&&t.write(`${r}\n`)};e.setEncoding(`utf8`),e.on(`data`,e=>{i+=String(e);let t=i.indexOf(`
|
|
1108
1108
|
`);for(;t!==-1;)a(i.slice(0,t)),i=i.slice(t+1),t=i.indexOf(`
|
|
1109
|
-
`)}),e.on(`end`,()=>{i!==``&&a(i),r&&t.end()})};u.on(`error`,()=>{}),y(process.stdin,u,_,!0),y(d,process.stdout,v,!1);for(let e of[`SIGINT`,`SIGTERM`,`SIGHUP`])process.on(e,()=>l.kill());l.on(`error`,e=>{process.stderr.write(`${e.message}\n`),process.exit(1)}),l.on(`close`,e=>{process.exitCode=e??1,process.stdin.destroy()})}`${oke.toString()}${JSON.stringify([`browser_click`,`browser_close`,`browser_console_messages`,`browser_drag`,`browser_drop`,`browser_emulate_media`,`browser_evaluate`,`browser_file_upload`,`browser_fill_form`,`browser_find`,`browser_handle_dialog`,`browser_hover`,`browser_navigate`,`browser_navigate_back`,`browser_network_request`,`browser_network_requests`,`browser_press_key`,`browser_resize`,`browser_select_option`,`browser_snapshot`,`browser_tabs`,`browser_take_screenshot`,`browser_type`,`browser_wait_for`])}`;const h5=B({name:F(),version:F().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/)});V([z(h5),H(F(),h5).transform(e=>Object.values(e))]).pipe(Ji([h5])),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Ne(x),TZ(`agent-registry-apply`),TZ(`local-op-security`),new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),uR.cursor,uR.codex,uR[`claude-desktop`],O8(()=>{}),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})}),TZ(`external-change-attribution`),TZ(`mermaid-validator`),TZ(`rename-log`),TZ(`history`),TZ(`backlinks`);function g5(e){return _t.filter(t=>g(A(e,t.hostDir)))}function _5(e,t){return[...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({editor:e,root:t})),{editor:`agents`,root:t}]}_5(ut,ds),[..._5(dt,ds)].sort((e,t)=>{let n=q4.indexOf(e.editor),r=q4.indexOf(t.editor);return(n===-1?q4.length:n)-(r===-1?q4.length:r)||e.editor.localeCompare(t.editor)}),TZ(`installed-skills-marker`),TZ(`skill-import`),TZ(`tag-index`),TZ(`derived-document-index`),new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}};const v5={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...v5,propertyKey:F().min(1).optional(),propertyPath:z(V([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const y5=di();Wi(`action`,[B({action:W(`edit`),id:y5,body:F(),summary:F().optional()}),B({action:W(`resolve`),id:y5,summary:F().optional()}),B({action:W(`reopen`),id:y5,summary:F().optional()}),B({action:W(`replace`),id:y5,...v5,summary:F().optional()}),B({action:W(`queue`),id:y5,summary:F().optional()}),B({action:W(`unqueue`),id:y5,summary:F().optional()}),B({action:W(`dispatch-prepare`),id:y5,summary:F().optional()}),B({action:W(`dispatch-complete`),id:y5,summary:F().optional()}),B({action:W(`dispatch-prepare-batch`),ids:z(y5).min(1).max(200),summary:F().optional()}),B({action:W(`dispatch-complete-batch`),ids:z(y5).min(1).max(200),summary:F().optional()})]),TZ(`embeddings`),TZ(`embeddings`);function ske(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}ske(nu),TZ(`embeddings`),TZ(`embeddings`);const cke=/^[A-Za-z0-9-]{8,64}$/;let b5=null;function lke(e){return A(e??ve(),`.ok`,`machine-id`)}function uke(e){if(e===void 0&&b5!==null)return b5;let t=lke(e),n=null;try{let e=S(t,`utf-8`).trim();cke.test(e)&&(n=e)}catch{}if(n===null){n=je();try{v(O(t),{recursive:!0}),ie(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){TZ(`machine-id`).warn({path:t,err:e},`Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(b5=n),n}TZ(`process-lock`);function dke(e,t){return M(e,`${t}.lock`)}function fke(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 pke(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=fke(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}TZ(`asset-references`),TZ(`file-ops`),TZ(`upload-streaming`);const x5=`Absolute OK project/worktree path. Routed stdio: required until set unless one client root exists. Project-bound HTTP: optional, confined to its root.`,S5=`Canonical ids: ${zge().map(e=>e.name).join(`, `)}. Call palette({components:[ids]}) before authoring for syntax/props, markdown-native forms, Mermaid and themed html preview for interactive charts/demos. Other JSX stays raw MDX when no canonical fits.`;F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const mke=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),hke=z(H(F(),R()));H(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(EJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves UNLESS `brokenLinkSuppression` is also present, in which case a project policy withheld findings. A withholding that arrives in a shape this build cannot validate is dropped rather than relayed, so `brokenLinkSuppression` stays absent even though findings were withheld. The `audit` tool is the surface that discloses that case, through its `warnings`. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),OJ.optional().describe('Present ONLY when a project policy omitted detected broken links from `brokenLinks` — so an empty `brokenLinks` beside it does NOT mean every link resolves. `{ reason, count }`; `reason` today is `"reserved-log-policy"` (a reserved `log.md` records history whose links are expected not to resolve) and is an open token, so treat one you do not recognize as a withholding policy all the same. `count` is how many findings were withheld; the hrefs are deliberately not returned, because none of them is yours to repair.'),mke.optional(),z(wJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const gke=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function C5(e){return{text:gke,...e}}function _ke(e){return`Machine-readable codes aligned 1:1 with \`warnings\` (\`warnings[i]\` is the display text for \`warningCodes[i]\`) — switch on these, never on the English. Absent when ${e} sent warning text it did not pair with codes, or paired one with a code this build does not recognise; \`warnings\` still carries the full text either way, so treat a missing field as unknown rather than as an all-clear.`}_ke(`the server`);function vke(e){return`Always emitted, \`[]\` when there were none. \`warningCodes\` accompanies this list 1:1 whenever ${e} paired every warning it sent with a code this build recognises; otherwise \`warningCodes\` is absent and this list still carries the full text. \`content[0].text\` lists every warning either way. A \`warnings\` payload in a shape this build cannot read at all becomes one entry saying so, with \`warningCodes\` absent — \`[]\` never means "unreadable".`}vke(`the server`);const yke=/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/gu;function w5(e){return e.replace(yke,``).normalize(`NFC`).toUpperCase().toLowerCase().normalize(`NFC`)}function T5(e){let t=w5(e);for(let e=0;e<4;e++){let e=w5(t);if(e===t)break;t=e}return t.replace(/[. ]+$/u,(e,t)=>t===0?e:``)}const bke=new Set([`.ok`,`.open-knowledge`,`.openknowledge`,...Object.values(tt).map(({userHomeDirName:e})=>e)].map(T5));new Set([...ao,...no,...Ere].map(T5));function xke(e){let t=new Set;for(let n of e){let e=n.replace(/^\.+/u,``);if(!/^[a-z0-9-]+$/u.test(e))throw Error(`cannot derive 8.3 short names for config dir "${n}"`);e.length<=2?t.add(`${e}[0-9a-f]{4}`):(t.add(e.slice(0,6)),t.add(`${e.slice(0,2)}[0-9a-f]{4}`))}return RegExp(`^(?:${[...t].join(`|`)})~\\d+$`,`u`)}xke(bke),TZ(`git-checkout`),TZ(`git-worktree-status`),TZ(`git-context`),TZ(`managed-artifact-persistence`),TZ(`timeline`),TZ(`suggest-links`),TZ(`clone-flow`),Ne(o),u5.project,Object.fromEntries(Object.entries(fs).map(([e,t])=>[t,e])),[`These are patterns to adapt to your domain, not a layout to copy verbatim.`,"To build a variant: create your own folders (via `write` or your editor) and reuse only the ideas that fit.","To adopt this pack as-is: re-run without `--dry-run`."].join(`
|
|
1109
|
+
`)}),e.on(`end`,()=>{i!==``&&a(i),r&&t.end()})};u.on(`error`,()=>{}),y(process.stdin,u,_,!0),y(d,process.stdout,v,!1);for(let e of[`SIGINT`,`SIGTERM`,`SIGHUP`])process.on(e,()=>l.kill());l.on(`error`,e=>{process.stderr.write(`${e.message}\n`),process.exit(1)}),l.on(`close`,e=>{process.exitCode=e??1,process.stdin.destroy()})}`${lke.toString()}${JSON.stringify([`browser_click`,`browser_close`,`browser_console_messages`,`browser_drag`,`browser_drop`,`browser_emulate_media`,`browser_evaluate`,`browser_file_upload`,`browser_fill_form`,`browser_find`,`browser_handle_dialog`,`browser_hover`,`browser_navigate`,`browser_navigate_back`,`browser_network_request`,`browser_network_requests`,`browser_press_key`,`browser_resize`,`browser_select_option`,`browser_snapshot`,`browser_tabs`,`browser_take_screenshot`,`browser_type`,`browser_wait_for`])}`;const _5=B({name:F(),version:F().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/)});V([z(_5),H(F(),_5).transform(e=>Object.values(e))]).pipe(Ji([_5])),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Ne(x),TZ(`agent-registry-apply`),TZ(`local-op-security`),new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),uR.cursor,uR.codex,uR[`claude-desktop`],O8(()=>{}),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})}),TZ(`external-change-attribution`),TZ(`mermaid-validator`),TZ(`rename-log`),TZ(`history`),TZ(`backlinks`);function v5(e){return _t.filter(t=>g(A(e,t.hostDir)))}function y5(e,t){return[...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({editor:e,root:t})),{editor:`agents`,root:t}]}y5(ut,ds),[...y5(dt,ds)].sort((e,t)=>{let n=q4.indexOf(e.editor),r=q4.indexOf(t.editor);return(n===-1?q4.length:n)-(r===-1?q4.length:r)||e.editor.localeCompare(t.editor)}),TZ(`installed-skills-marker`),TZ(`skill-import`),TZ(`tag-index`),TZ(`derived-document-index`);const b5={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...b5,propertyKey:F().min(1).optional(),propertyPath:z(V([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const x5=di();Wi(`action`,[B({action:W(`edit`),id:x5,body:F(),summary:F().optional()}),B({action:W(`resolve`),id:x5,summary:F().optional()}),B({action:W(`reopen`),id:x5,summary:F().optional()}),B({action:W(`replace`),id:x5,...b5,summary:F().optional()}),B({action:W(`queue`),id:x5,summary:F().optional()}),B({action:W(`unqueue`),id:x5,summary:F().optional()}),B({action:W(`dispatch-prepare`),id:x5,summary:F().optional()}),B({action:W(`dispatch-complete`),id:x5,summary:F().optional()}),B({action:W(`dispatch-prepare-batch`),ids:z(x5).min(1).max(200),summary:F().optional()}),B({action:W(`dispatch-complete-batch`),ids:z(x5).min(1).max(200),summary:F().optional()})]),TZ(`embeddings`),TZ(`embeddings`);function uke(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}uke(nu),TZ(`embeddings`),TZ(`embeddings`);const dke=/^[A-Za-z0-9-]{8,64}$/;let S5=null;function fke(e){return A(e??ve(),`.ok`,`machine-id`)}function pke(e){if(e===void 0&&S5!==null)return S5;let t=fke(e),n=null;try{let e=S(t,`utf-8`).trim();dke.test(e)&&(n=e)}catch{}if(n===null){n=je();try{v(O(t),{recursive:!0}),ie(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){TZ(`machine-id`).warn({path:t,err:e},`Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(S5=n),n}TZ(`process-lock`);function mke(e,t){return M(e,`${t}.lock`)}function hke(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 gke(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=hke(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}TZ(`asset-references`),TZ(`file-ops`),TZ(`upload-streaming`);const C5=`Absolute OK project/worktree path. Routed stdio: required until set unless one client root exists. Project-bound HTTP: optional, confined to its root.`,w5=`Canonical ids: ${zge().map(e=>e.name).join(`, `)}. Call palette({components:[ids]}) before authoring for syntax/props, markdown-native forms, Mermaid and themed html preview for interactive charts/demos. Other JSX stays raw MDX when no canonical fits.`;F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const _ke=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),vke=z(H(F(),R()));H(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(EJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves UNLESS `brokenLinkSuppression` is also present, in which case a project policy withheld findings. A withholding that arrives in a shape this build cannot validate is dropped rather than relayed, so `brokenLinkSuppression` stays absent even though findings were withheld. The `audit` tool is the surface that discloses that case, through its `warnings`. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),OJ.optional().describe('Present ONLY when a project policy omitted detected broken links from `brokenLinks` — so an empty `brokenLinks` beside it does NOT mean every link resolves. `{ reason, count }`; `reason` today is `"reserved-log-policy"` (a reserved `log.md` records history whose links are expected not to resolve) and is an open token, so treat one you do not recognize as a withholding policy all the same. `count` is how many findings were withheld; the hrefs are deliberately not returned, because none of them is yours to repair.'),_ke.optional(),z(wJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const yke=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function T5(e){return{text:yke,...e}}function bke(e){return`Machine-readable codes aligned 1:1 with \`warnings\` (\`warnings[i]\` is the display text for \`warningCodes[i]\`) — switch on these, never on the English. Absent when ${e} sent warning text it did not pair with codes, or paired one with a code this build does not recognise; \`warnings\` still carries the full text either way, so treat a missing field as unknown rather than as an all-clear.`}bke(`the server`);function xke(e){return`Always emitted, \`[]\` when there were none. \`warningCodes\` accompanies this list 1:1 whenever ${e} paired every warning it sent with a code this build recognises; otherwise \`warningCodes\` is absent and this list still carries the full text. \`content[0].text\` lists every warning either way. A \`warnings\` payload in a shape this build cannot read at all becomes one entry saying so, with \`warningCodes\` absent — \`[]\` never means "unreadable".`}xke(`the server`),TZ(`git-checkout`),TZ(`git-worktree-status`),TZ(`git-context`),TZ(`managed-artifact-persistence`),TZ(`timeline`),TZ(`suggest-links`),TZ(`clone-flow`),Ne(o),f5.project,Object.fromEntries(Object.entries(fs).map(([e,t])=>[t,e])),[`These are patterns to adapt to your domain, not a layout to copy verbatim.`,"To build a variant: create your own folders (via `write` or your editor) and reuse only the ideas that fit.","To adopt this pack as-is: re-run without `--dry-run`."].join(`
|
|
1110
1110
|
`),TZ(`skills-leaderboard`),TZ(`handoff-dispatch`),B({target:U(Object.keys({"claude-cowork":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},"claude-code":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},codex:{type:`app-bundle`,appName:`Codex`,urlScheme:`codex:`,probeScheme:`codex`,quitFirst:!0},cursor:{type:`cli-binary`,binaryName:`cursor`,urlScheme:`cursor:`}})),url:F().min(1).max(4096),workspacePath:F().optional()}),B({}).loose(),TZ(`github-permissions`),TZ(`github-reference`),TZ(`github-reference`),TZ(`link-preview.guarded-fetch`),TZ(`link-preview.cache`),TZ(`saved-themes`),B({enabled:L(),active:L(),git:B({state:U([`not-applicable`,`ready`,`missing`,`conflict`,`unavailable`]),ownership:U([`open-knowledge`,`existing`]).optional()}),applied:L().optional(),reason:U([`git-conflict`,`git-unavailable`,`config-write`]).optional()}),B({enabled:L()}).strict(),TZ(`managed-rename`),Object.assign(mEe,{m4v:`video/mp4`,mkv:`video/x-matroska`,flac:`audio/flac`,toml:`application/toml`,lock:`text/plain`,"7z":`application/x-7z-compressed`,tar:`application/x-tar`,rar:`application/vnd.rar`,xls:`application/vnd.ms-excel`,ppt:`application/vnd.ms-powerpoint`,odt:`application/vnd.oasis.opendocument.text`,ods:`application/vnd.oasis.opendocument.spreadsheet`,odp:`application/vnd.oasis.opendocument.presentation`,pages:`application/vnd.apple.pages`,numbers:`application/vnd.apple.numbers`,key:`application/vnd.apple.keynote`,mobi:`application/x-mobipocket-ebook`}),TZ(`search`),TZ(`skill-install`),TZ(`api`),B({principalId:F().optional(),tabSessionId:F().optional(),expectedServerInstanceId:F().optional(),expectedBranch:F().optional(),expectedDocLineageEpoch:F().optional(),clientProtocolVersion:I().optional(),clientRuntimeVersion:F().optional(),clientKind:F().optional()}).loose(),new Ve,O8(()=>{}),[...Dge],["Read-only validation of markdownlint, frontmatter, OKF and broken internal links. Requires the Hocuspocus server. No args scans all in-scope .md/.mdx; `path` narrows to file/folder. `links` is the navigation/graph tool.","ran names selected `markdownlint`, `frontmatter`, `okf`, `links`. A family absent from `ran` was not checked. A selected family remains in ran if degraded; warnings explain why and it may still have contributed findings. okf covers document and project-tree OKF checks here.",`Broken links are reported under the source doc. Default-on validation.suppressLogLinkAdvisories omits links inside lowercase log.md/log.mdx at any depth; LOG.md is ordinary. brokenLinkSuppression reports reason reserved-log-policy and count without paths/hrefs. Logs are append-only history: never rewrite old entries to clear links. links({kind:'dead'}) reads raw state.`,`Diagnostics carry source, code, message, 0-based LSP range (link columns approximate) and severity. Broken links default to warning; validation.links can raise/hide them. Only problematic files are listed; fileCount/errorCount/warningCount reflect full scan. Output is capped at 10 files × 10 diagnostics each and project-wide at 10 warnings; omittedWarningCount reports dropped warnings. Narrow path reduces competing files; per-file caps still apply. Follow runtime hints for document lint and raw dead links; project-tree OKF findings remain capped.`,`Nothing is modified. Auto-fix document lint with lint({document,fix:true}); fix broken links with edit/write.`].join(`
|
|
1111
1111
|
`),[`Save a project-wide checkpoint of every document. Requires the Hocuspocus server. Optional summary ≤80 chars defaults to "Checkpoint version"; avoid secrets or PII because it persists in git history. Returns version (40-char SHA). Find it with history and restore one doc with restore_version({document,version}).`].join(`
|
|
1112
1112
|
`),[`Read effective config merged defaults → user → project; no running OK server needed. Optional key is a dotted path (content, appearance.theme); omit for the full config. All fields are readable. Re-read after disk changes or before relying on an old value.`,"Removed server.*, mcp.*, github.*, preview.baseUrl and preview.scriptSrc return exists:false; appearance.preview.autoOpen remains live. This is a pure read. Use `install` skillFolders for folder topology."].join(`
|
|
1113
|
-
`),F().optional().describe(`Dotted config key (e.g. "appearance.theme"). Omit to return the full merged config.`),F().optional().describe(
|
|
1114
|
-
`),["Edit exactly one `document`, `folder`, `template`, or `skill`: body find/replace OR metadata, never both in one call. Requires the Hocuspocus server.","`document: {path, find, replace, occurrence?}` edits body only; frontmatter-intersecting finds are rejected. occurrence selects a match (1 = first). `{path, frontmatter}` merge-patches metadata; null deletes a key.","`folder: {path, frontmatter}` patches metadata (no body). `template: {path: '<folder>/<name>', ...}` takes body find/replace/occurrence or frontmatter.","`skill: {name, ...}` takes body find/replace/occurrence OR description (its only metadata leaf). Recorded, unedited copies refresh from the source on watcher/startup sync; links reflect edits immediately. Hand-edited copies are preserved.",`Optional summary: one-line outcome ≤80 chars for any edit, persisted to git history; avoid secrets or PII.`,`Read structuredContent.document.warnings: content-divergence/disk-edit-reconciled means re-read with exec; mermaid-parse-error means the edit landed but fix the fence and re-edit.`,
|
|
1113
|
+
`),F().optional().describe(`Dotted config key (e.g. "appearance.theme"). Omit to return the full merged config.`),F().optional().describe(C5),T5({value:R().describe(`Resolved config value at the requested path (or full config).`),exists:L().optional().describe('Whether the requested path resolved to a value. `false` distinguishes "path absent" from "path explicitly set to null". Always emitted — `true` on a full-config read.'),key:F().optional().describe(`Echo of the requested dotted key (absent when reading the full config).`)});const Ske=[`lock`],Cke=V([ss,Pi()]),wke=V([F(),I(),L(),z(R()),H(F(),R()),Pi()]);H(F(),wke).superRefine((e,t)=>{for(let[n,r]of Object.entries(e))Cke.safeParse(r).success||t.addIssue({code:`custom`,path:[n],message:`invalid frontmatter value — allowed: a scalar (string | number | boolean), a scalar array, a nested object, or an array of objects; a top-level key may be null to delete it, but nested null is not allowed`})}).describe(`Metadata as a key→value map. Values may be a scalar (string | number | boolean), a scalar array, a nested object, or an array of objects. Merge-patch: include a top-level key to set it, set a top-level key to null to delete it; keys you omit are unchanged. A nested object REPLACES the existing subtree at that key (send the full subtree you want). Example: { title: "Q3 Planning", tags: ["planning"], metadata: { version: "1.0", author: "Inkeep" } }.`),U([`append`,`prepend`,`replace`]).describe(`Where content lands. replace = overwrite the whole body (default for a new doc; required for an existing doc). append / prepend = add to the end / start.`),U(lR).describe("File format for a NEW doc: `.md` (default) or `.mdx` (Markdown + JSX components). Honored only on create — an existing doc keeps its on-disk extension. Takes precedence over an extension typed into `path`."),U(us).describe(`Level: "project" (default — a Project skill: lives in this KB wherever its folder is, shared with teammates via git) or "global" (a Global skill: lives under your user home, available in every project on this machine — not shared, not version-tracked). Pass the literal value "global" for a Global skill.`),new Set(qJ),[`Delete exactly one document, folder, template, skill or asset. Requires the Hocuspocus server. Irreversible; deleting a doc leaves inbound redlinks. Call links({kind:'backlinks',document}) BEFORE deleting.`,`document: path or paths array; folder: recursive folder path; template: {path:'<folder>/<name>'}; asset: {path:'<folder>/<file.ext>'}. skill: {name} deletes the whole bundle, or {name,files:['references/x.md']} deletes selected files. Template/skill deletion is attributed and cleans empty .ok/ directories.`].join(`
|
|
1114
|
+
`),["Edit exactly one `document`, `folder`, `template`, or `skill`: body find/replace OR metadata, never both in one call. Requires the Hocuspocus server.","`document: {path, find, replace, occurrence?}` edits body only; frontmatter-intersecting finds are rejected. occurrence selects a match (1 = first). `{path, frontmatter}` merge-patches metadata; null deletes a key.","`folder: {path, frontmatter}` patches metadata (no body). `template: {path: '<folder>/<name>', ...}` takes body find/replace/occurrence or frontmatter.","`skill: {name, ...}` takes body find/replace/occurrence OR description (its only metadata leaf). Recorded, unedited copies refresh from the source on watcher/startup sync; links reflect edits immediately. Hand-edited copies are preserved.",`Optional summary: one-line outcome ≤80 chars for any edit, persisted to git history; avoid secrets or PII.`,`Read structuredContent.document.warnings: content-divergence/disk-edit-reconciled means re-read with exec; mermaid-parse-error means the edit landed but fix the fence and re-edit.`,w5].join(`
|
|
1115
1115
|
`);const Tke=[`node_modules`,`.git`,`dist`,`build`,`.next`,`.turbo`,`.nuxt`,`coverage`,`.cache`,`.parcel-cache`,`.vercel`,`.ok`,`.claude`];[...new Set([`-name`,`-iname`,`-path`,`-ipath`,`-regex`,`-iregex`,`-lname`,`-ilname`])],new Set(Tke),TZ(`mcp:exec`),["STOP: with `.ok/`, use exec for in-scope .md/.mdx; native Read/Grep/Glob omit wiki context. Native tools are for source code, non-markdown or projects without .ok/. See the open-knowledge skill for the full rule and escape hatch.",`Read-only bash-like command; returns stdout and enrichedPaths with frontmatter, backlinks/forward links, unresolved comments, shadow-repo activity and git history with human/agent attribution. Unresolved comments are open human review requests: consider before editing and report them.`,`Allowlist: cat, ls, grep, find, head, tail, wc, sort, uniq, cut. One command or pipe per call. No &&, ;, subshells, writes or redirection (including <). Use multiple paths or separate calls.`,`cwd: command paths resolve inside explicit absolute cwd, or the client's sole advertised root. With zero/multiple roots pass cwd; traversal above it is rejected.`,`Stdout provenance: ls <dir>/ labels the directory; single-file cat/head/tail labels its path. Multi-file cat has no header; enrichedPaths still lists files. Piped head/tail preserve upstream provenance.`,`Examples: exec({command:'cat notes/a.md'}); exec({command:'grep -rn oauth notes/ | head -5'}); exec({command:'ls',cwd:'/abs/project'}).`].join(`
|
|
1116
1116
|
`),[`Get the full browser URL for this project or a document/folder/skill, or an absolute markdown file outside the project. Opening is demand: auto-starts OK under the normal OK_MCP_AUTOSTART gate and waits briefly for UI; cold calls can take seconds. Other tools return route-only previewUrl paths; use this tool for an openable URL, never guess ports or hunt via ok ps/status.`,`Choose one: document (extension-less), folder (trailing-slash route), skill:{name,scope?} (project default), or file (absolute .md/.mdx in a loose-file/worktree session). file ignores cwd; other targets use current project. Omit targets for UI root.`,`When YOUR host opens URLs, navigate its embedded browser to url; Claude Code Desktop uses preview_start({url}) then navigate({url}). Only a stdio host without a browser tool should open the URL in the system browser. A CLI without a browser can use ok open <doc> for OK Desktop. This tool forces browser access even when Desktop is installed.`,`INSIDE OK's terminal/agent panel, use returned okOpenCommand instead; never paste url in the answer. If no UI is reachable, returns url:null, baseUrl:null, running:false, autoOpen plus state-specific recovery text (autostart disabled, no spawn authority or UI timeout). Follow it.`].join(`
|
|
1117
|
-
`),F().optional().describe(`Extension-less doc path to resolve a preview URL for (e.g. "specs/foo/SPEC"). Omit to get the UI root URL.`),F().min(1).optional().describe('Folder path to resolve a folder-route preview URL for (e.g. "specs/foo"); returns the `…/#/<folder>/` route. Mutually exclusive with `document`.'),B({name:F().min(1).regex(O_e,`Skill name must be lowercase letters, digits, and hyphens only.`).describe(`Skill name (the bundle-dir identity, wherever the skill lives).`),scope:U(us).optional().describe("Skill scope; defaults to `project`.")}).optional().describe("Skill to resolve an editor preview URL for; returns the `…/#/__skill__/<scope>/<name>` route. Mutually exclusive with `document`/`folder`/`file`."),F().optional().describe("Absolute path to a single markdown file to open, including one OUTSIDE any Open Knowledge project. Resolves to the running single-file (or worktree) session whose content directory contains it and returns that session’s `url`. Mutually exclusive with `document` / `folder` / `skill`. When `file` is set, `cwd` is ignored."),F().optional().describe(
|
|
1117
|
+
`),F().optional().describe(`Extension-less doc path to resolve a preview URL for (e.g. "specs/foo/SPEC"). Omit to get the UI root URL.`),F().min(1).optional().describe('Folder path to resolve a folder-route preview URL for (e.g. "specs/foo"); returns the `…/#/<folder>/` route. Mutually exclusive with `document`.'),B({name:F().min(1).regex(O_e,`Skill name must be lowercase letters, digits, and hyphens only.`).describe(`Skill name (the bundle-dir identity, wherever the skill lives).`),scope:U(us).optional().describe("Skill scope; defaults to `project`.")}).optional().describe("Skill to resolve an editor preview URL for; returns the `…/#/__skill__/<scope>/<name>` route. Mutually exclusive with `document`/`folder`/`file`."),F().optional().describe("Absolute path to a single markdown file to open, including one OUTSIDE any Open Knowledge project. Resolves to the running single-file (or worktree) session whose content directory contains it and returns that session’s `url`. Mutually exclusive with `document` / `folder` / `skill`. When `file` is set, `cwd` is ignored."),F().optional().describe(C5),T5({url:F().nullable().describe("Browser-reachable URL — the UI base joined with the doc route when `document` is given, else the UI root. `null` when no UI is running."),baseUrl:F().nullable().describe("Browser-reachable origin of the running UI (e.g. `http://localhost:5173`). `null` when no UI is running."),running:L().describe(`Whether a UI is running for the project.`),autoOpen:L().describe("User-scoped preview-auto-open preference (`appearance.preview.autoOpen`). When `true`, the agent should route the preview using capability-based routing (in-app browser if available, system browser as fallback). When `false`, the user is managing their own preview view (OK Desktop window, a browser tab they opened, etc.) — the agent must NOT open or refresh any preview UI, and should surface this URL only on direct user ask. Resolved fresh on every call; defaults to `true`."),okOpenCommand:F().nullable().optional().describe("Machine-readable form of the hosted-agent steer: when the calling agent runs inside an OpenKnowledge surface (the desktop app’s built-in terminal, or its in-app agent panel) AND a doc/folder/skill target was given, the exact `ok open …` command to run to bring it up for the user. Run it INSTEAD of navigating `url`, and do not paste `url` into your reply — the user is already in the app it points at. `null`/absent in every other context (navigate `url` per your host instead).")}),B({version:F().describe("40-char commit SHA for this entry — pass to `restore_version({ document, version })`."),timestamp:F().describe(`ISO timestamp of the entry.`),author:F().describe(`Author display name.`),authorEmail:F().describe(`Author email.`),kind:U([`checkpoint`,`wip`,`upstream`]).describe(`Entry kind: checkpoint / wip / upstream.`),message:F().describe(`Commit subject (the checkpoint summary, when one was set).`),contributors:vke.describe(`Per-contributor records parsed from the commit (writer id, name, docs, summaries).`),checkpoint:R().nullable().describe(`Checkpoint metadata when this entry is a checkpoint, else null.`)}),[`Read version history: pass exactly one document, folder or skill. Requires the Hocuspocus server. Returns shadow-repo entries newest first; version is a 40-char SHA for restore_version({document,version}) or restore_version({skill,version}).`,`document accepts optional .md/.mdx. folder lists attributed template/frontmatter activity; empty string is project root. skill is a project-scope name; global skills are unversioned. Optional branch (current default), limit (50 default, 200 max), offset (0), kind (checkpoint/upstream/wip), author and excludeAuthor (name/email).`].join(`
|
|
1118
1118
|
`),[...qJ,...eY],[`Import an external agentskills.io/skills.sh skill as managed content. Requires the Hocuspocus server. source accepts a full skills.sh page URL (including website catalogs), owner/repo[/subpath], git URL, or local/file:// path. skill picks one from a multi-skill source. scope: project (default, versioned/shared) or global (user-wide, unversioned).`,`Writes the .agents/skills/<name>/ hub with provenance in .ok/skills-lock.json. Scripts are NEVER executed. add selects editor locations; import always places the skill somewhere. Use install later to change placement/form/source. Name collisions use <name>-imported, never overwrite; identical content-hash re-import is a no-op.`].join(`
|
|
1119
1119
|
`),new Set(eY),["Manage where a SKILL is available: `{name, add?, remove?, convert?, mode?, source?, scope?}` or `{skillFolders: {...}}` alone. Requires the Hocuspocus server. One real source folder plus managed copies/symlinks; the source still loads with no extra locations. Use delete to remove the skill everywhere.",`name is the bundle identity: lowercase letters/digits/hyphens, ≤64 chars. Locations: claude/cursor/codex/copilot/opencode/pi, agents (.agents/skills), or custom root containing '/' such as .team/skills. Custom roots are project-relative, home-relative at global scope. scope: project (default, shared via git) or global (user-wide).`,`add/remove change membership; omitting both installs to configured editors. remove cannot remove the source; folder aliases unfollow minus this skill and keep others. Differing copies are preserved; editor removal may succeed and leave them in place.`,`mode: link = live symlink for source updates; copy = separate folder, refreshed on watcher/startup sync while unedited. Hand-edited copies fork; differing copies are preserved and cannot be converted. Requires add or convert; affects named locations only, no skill-wide default. Omit mode on add to inherit form. convert requires mode and changes form without membership; name all locations for uniformity.`,`source moves the real folder; its old location becomes a symlink. Run alone, not with add/remove. Source SKILL.md with conflict markers, invalid/missing frontmatter, XML in name/description or reserved open-knowledge* names is refused before projection.`,`skillFolders runs alone without name. link: {action:'link', scope, root, target}; target required, merge then symlink root; equal entries deduplicate, differing skills abort, interrupted merges can rerun. unlink: {action:'unlink', scope, root, exclude?}; makes a real directory of per-skill symlinks, excluding named skills and retaining others. add-root: {action:'add-root', scope, root}; declares a custom root for install/link.`].join(`
|
|
1120
1120
|
`),[`Read the wiki-link graph. Requires the Hocuspocus server. kind is one value or an array; results merge, failures go in errors. Use audit for validation.`,"`backlinks`/`forward`/`suggest` require document. suggest finds unlinked prose mentions; excerpt is normalized context, NOT edit-ready text. Re-read with exec, locate the real text using offset, then edit into a wiki-link.","`dead` lists raw unresolved internal targets; sourceDocuments optionally filters with OR semantics. Includes skill docs and lowercase log.md/log.mdx: inspect deliberately, never use as a repair queue or rewrite existing log entries to clear findings.","`orphans` finds disconnected pages; mode incoming/outgoing/both. `hubs` lists most-linked pages; limit defaults 20."].join(`
|
|
1121
1121
|
`),["Lint markdown and optionally auto-fix. Requires the Hocuspocus server. `document` selects one extension-less doc and overrides path. Otherwise scan all in-scope .md/.mdx; path narrows to file/folder. `fix: true` requires document and applies fixable rules through the live collaborative doc with attribution. Use edit/write for remaining findings; shell ok lint --fix is the unattributed headless/CI path.","ran lists selected `markdownlint`, `frontmatter` and document-level `okf` families. A family absent from `ran` was not checked. Project-tree OKF checks and link validation run only through audit.",`Findings carry source, code, message, 0-based LSP range and severity; only problematic files are listed. Counts reflect the full scan. Project output is capped at 10 files × 10 diagnostics each and project-wide at 10 warnings; omittedWarningCount reports dropped warnings. Narrow path reduces competing files; per-file caps still apply. Follow truncation recovery text.`,`Configure lint in Settings → Plugins and native .markdownlint.* rules.`].join(`
|
|
1122
1122
|
`),[`For .md/.mdx inspection before or after a move in a project with .ok/, use exec; native Read/Grep/Glob omit wiki context.`,"Move/rename a document, folder or asset with `{from, to}`, a template with `{template: {from, to}}`, or a skill with `{skill: {from, to, scope?, toScope?}}`. Choose one form. Requires the Hocuspocus server. Document/folder/asset kind is auto-detected.",`Paths: docs accept optional .md/.mdx; folders are relative with no leading/trailing slash; assets include the extension. Templates use '<folder>/<name>'; inherited templates cannot move (move their local copy or owning folder). Template moves rewrite no inbound links.`,`Links to the moved document keep pointing to it. The old path stops existing; do not leave a redirect or stub.`,`Managed moves preserve wiki-link targets and rewrite supported inline Markdown links; renamed assets are reported.`,`Skills: scope defaults project; global means your home. Within one scope, rename keeps SKILL.md name in sync. A differing toScope moves between project/global: history does not transfer; supported editor locations are re-projected. Other locations are dropped; on SUCCESS only, use droppedLocations and the response to reinstall at the destination.`,`Cross-scope failures can leave partial state. Before retrying or reinstalling, read moveState and recovery text regardless of status. Never remove either copy without comparing source/destination when the outcome is missing or inconsistent.`,`Optional summary: one-line outcome ≤80 chars. If omitted, defaults to "Renamed X → Y". Avoid secrets or PII; persisted to git history. Invalid/excluded paths, missing sources and existing destinations are refused; collisions report colliding[].`].join(`
|
|
1123
1123
|
`),[`Read the authoring palette: markdown-native components/examples/guidance, themed html preview embedPatterns (charts, stat cards, SVG, interactive controls), and CSS tokens. No running OK server needed. Optional components:[ids] adds full JSX props in componentDetails plus notFound; ids are case-sensitive, max 32. cwd selects project.`,`Prefer native forms: > [!NOTE], <details>, mermaid fences, $math$. For interactive HTML/JS/CSS use html preview starters and var(--chart-1)/var(--foreground) tokens for light/dark themes. Inside SVG use style="fill: var(--chart-1)", not a fill presentation attribute.`,`Delimiters are live even in ordinary prose: ==highlight==, $inline math$/$$block math$$, %%comment%% and <!-- comment --> (HIDES text), ~~strikethrough~~. Keep literal pairs in an inline code span or backslash-escape either delimiter. For ~~ escape BOTH tildes on both sides; one-sided escaping is rewritten on save.`,`Preview iframes have open network access for external HTTPS resources/fetch/fonts/maps. They are sandboxed null-origin frames and cannot access the knowledge base, cookies or auth.`].join(`
|
|
1124
|
-
`),z(F().min(1)).max(32).optional().describe("Canonical ids to expand to full JSX-form detail (max 32, case-sensitive). Returns `componentDetails` + `notFound`."),F().optional().describe(
|
|
1124
|
+
`),z(F().min(1)).max(32).optional().describe("Canonical ids to expand to full JSX-form detail (max 32, case-sensitive). Returns `componentDetails` + `notFound`."),F().optional().describe(C5),T5({version:W(1).describe(`Schema version stamp — bump for breaking shape changes.`),components:z(B({id:F(),displayName:F(),description:F(),authoring:U([`markdown`,`jsx`]).describe("`markdown` — write the markdown-native form OK auto-promotes; `jsx` — write the JSX tag directly (no markdown-native form exists)."),example:F().describe(`Copy-ready source for the authoring form.`),guidance:F().describe(`One line on when / how to use this construct.`)})).describe(`Canonical authoring constructs, keyed by the form an agent should write.`),embedPatterns:z(B({id:F(),title:F(),description:F(),snippet:F().describe("A complete, theme-wired ```html preview fenced block.")})).describe("Copy-ready themed `html preview` starters."),tokens:z(B({name:F().describe("CSS custom-property name, e.g. `--chart-1`."),light:F(),dark:F()})).describe("Theme tokens injected into every preview iframe — reference with `var(--name)`."),componentDetails:z(H(F(),R())).optional().describe("Full JSX-form prop schema for the requested `components` ids (when provided)."),notFound:z(F()).optional().describe("Requested `components` ids that did not match any canonical.")}),[`Restore exactly one document or skill to version (40-char SHA from history). Requires the Hocuspocus server. document accepts optional .md/.mdx; restore is append-only through CRDT and visible to connected editors. skill is a PROJECT-scope name (global is unversioned); its folder is rewritten. Recorded, unedited copies refresh on watcher/startup sync; links reflect edits immediately. Hand-edited copies are preserved.`,`Optional summary ≤80 chars; avoid secrets or PII, persisted to git history. content-divergence in structuredContent.warnings means restore landed but bytes differ: re-read with exec to see the converged result.`].join(`
|
|
1125
1125
|
`),TZ(`mcp:search`),[`Ranked search across ALL non-ignored files and folders. Requires the Hocuspocus server. All file name/path values are indexed; only markdown bodies are indexed. Run in parallel with exec grep for exhaustive literal content search, especially code/config/data.`,`Pass query; intent full_text (default) includes bodies, omnibar searches title/path/folders. scopes: page/folder/file/content; defaults follow intent. limit: 20 default, 100 max. Ranking combines title boost, BM25 and recency; hits include signals, and pages include snippets (other files are name-only).`,`When workspace semantic search is enabled, full_text adds embeddings by default; query and matching content go to the configured provider. Set semantic:false for lexical-only/no embedding egress. Response semantic reports coverage.`,`ready:false means an incomplete cold index, not an authoritative empty result. Wait 2–3 seconds before retrying; after 2–3 retries use exec grep. If the server is down, follow recovery text; exec grep is the server-free search fallback.`].join(`
|
|
1126
|
-
`),F().describe(`Search query — title, path, or body terms.`),U([`omnibar`,`full_text`]).optional().describe(`'omnibar' for title/path/folder only (fast); 'full_text' includes body content. Default 'full_text'.`),z(U([`page`,`folder`,`content`,`file`])).optional().describe(`Override the default scope set. Members: 'page', 'folder', 'file', 'content'. Defaults derive from intent.`),I().int().min(1).max(100).optional().describe(`Max rows; default 20, max 100.`),L().optional().describe(`Set false to force pure-lexical ranking for this call even when semantic search is enabled. Omit to use semantic when available.`),F().optional().describe(
|
|
1127
|
-
`),
|
|
1128
|
-
`),["Create/replace exactly one `document`, `folder`, `template`, `skill`, or `asset`; use `documents` for an ordered batch. Requires the Hocuspocus server.","Nested paths such as `guides/overview` can be documents; put all requested blocks in one `document.content`. Use `folder` only for separate pages.","`document: {path, content|template, frontmatter?, position?}`: content and template are exclusive. Existing docs require position: replace/append/prepend; new docs default replace. frontmatter with literal content forces replace, even with append/prepend. Recent edits by another writer can refuse replace; follow the recovery response; append/prepend/edit bypass this refusal. Peers are per MCP connection; own writes and writers sharing a connection do not refuse each other; connected editors can. No agentId is needed.","`folder: {path, frontmatter?}` creates NEW folders; edit existing ones. `template: {path: '<folder>/<name>', content, frontmatter: {title, description?, tags?}}` creates reusable doc templates.","`skill: {name, description, body, scope?}` writes agent guidance; lowercase letters/digits/hyphens name is identity, description is when to use it. New skills use the default skill home; existing ones keep their real folder. Use install for editors.","`asset: {path, content|source}` uploads binary image/file: base64 content or local source path. `documents` takes document specs and reports each result.",`Optional summary: one-line outcome ≤80 chars, persisted to git history; avoid secrets or PII. Batches need per-entry summary; top-level is ignored.`,`Read response warnings: content-divergence/disk-edit-reconciled means re-read; mermaid-parse-error means the write landed but fix the fence.`,
|
|
1126
|
+
`),F().describe(`Search query — title, path, or body terms.`),U([`omnibar`,`full_text`]).optional().describe(`'omnibar' for title/path/folder only (fast); 'full_text' includes body content. Default 'full_text'.`),z(U([`page`,`folder`,`content`,`file`])).optional().describe(`Override the default scope set. Members: 'page', 'folder', 'file', 'content'. Defaults derive from intent.`),I().int().min(1).max(100).optional().describe(`Max rows; default 20, max 100.`),L().optional().describe(`Set false to force pure-lexical ranking for this call even when semantic search is enabled. Omit to use semantic when available.`),F().optional().describe(C5);const Eke=B({kind:U([`page`,`folder`,`file`]),path:F(),docName:F(),title:F().nullable(),score:I(),signals:B({lexical:I(),fullText:I(),recency:I(),vector:I().optional()}),snippet:F().optional(),previewUrl:F().nullable(),previewUrlSource:U(Ske).optional()});T5({cwd:F(),query:F(),intent:F(),resultCount:I().int(),results:z(Eke),elapsedMs:I().nullable(),semantic:aY.optional(),ready:W(!1).optional()}),[`Build a shareable GitHub-substrate URL for a teammate to receive a doc/folder subtree in OpenKnowledge, pinned to current branch. Requires the Hocuspocus server. Read-only, no commits/pushes/fetch. Publishing is a user act: agents do NOT publish; a missing remote returns Share-wizard guidance.`,"`path` is content-relative, docs accept .md/.mdx, empty string means root folder. `kind` doc/folder is optional for auto-probe (.mdx → .md → directory); REQUIRED when `path` is empty (use folder). Optional `cwd` selects project. Requires a named branch, GitHub/GH Enterprise origin, and branch already pushed."].join(`
|
|
1127
|
+
`),T5({ok:L().describe(`Success discriminator.`),shareUrl:F().optional().describe(`Marketing share URL (success only).`),sharedUrl:F().optional().describe(`Unencoded GitHub blob/tree URL (success only).`),branch:F().optional().describe(`Branch the share URL pins to (success only).`),resolvedKind:U([`doc`,`folder`]).optional().describe(`Kind the target resolved to (success only).`),freshness:vB.optional().describe(`Whether the shared target matches origin (success only): current, stale (unpushed edits), absent (not on origin, a push fixes it), or empty (a folder holding nothing git can track, which no push fixes). Omitted when the probe could not run.`),error:U([..._B.options,`target-not-found`,`kind-mismatch`,`unknown`]).optional().describe(`Failure code (error path only).`),message:F().optional().describe(`Agent-actionable error message (error path only).`),previewUrl:F().nullable().optional().describe("Route-only preview URL (no host:port): `/#/<doc>` for a doc, `/#/<folder>/` for a folder, `/#/` for the content root. `null` when no UI is running."),previewUrlSource:F().optional().describe(`Internal: preview-URL provenance.`)});const E5="Which level the skill lives at. `project` = lives in this KB (wherever its folder is; shared via git); `global` = user-level under your home dir (available in every project on this machine, not shared).",Dke=B({id:F().describe("Location id — editor host id, `agents`, or a custom root path. Pass to `install`."),path:F().describe('Base-relative bundle dir (e.g. ".claude/skills/x"). INFORMATIONAL — for showing a user where a location lives. Skills are addressed by `name` + `scope`: pass `id` to `install`, and read bundle files with `skills({ name, file })`, never by handing this path to `exec` or a native file tool.'),role:U([`source`,`copy`,`symlink`]).describe(`source = the REAL folder (the skill itself); copy = independent folder, refreshed from the source on watcher/startup sync while unedited (hand edits fork it); symlink = live link to the source.`),audience:z(F()).optional().describe(`Folders that RESOLVE INTO this location (folder-level symlinks) — their agents read what lands here.`),drift:L().optional().describe(`Something outside OK rewrote this path since OK last wrote it.`)});B({name:F().describe("Skill name (its identity; pass to `edit`/`move`/`delete`/`install`)."),scope:U([`project`,`global`]).describe(E5),description:F().optional().describe(`The skill's one-line description (when present).`),installed:L().describe('Always true for a managed skill — its source folder IS the skill, so it is never "not installed". Read `locations[]` for where it actually lives.'),hosts:z(F()).describe(`Flat location ids (locations[].id), SOURCE first — legacy projection.`),locations:z(Dke).describe("Everywhere the skill lives. Exactly one `source` (the skill's real folder); every other entry is a managed copy or symlink of it."),mode:U([`copy`,`link`]).describe("The form a NEW location would take, derived from the ones the skill already uses. Not a stored preference and not a claim about existing locations — read `locations[].role` for those."),conflicts:z(F()).optional().describe(`Host ids where a DIFFERENT skill with this name occupies the slot.`)});const Oke=B({path:F().describe(`Skill-relative path (e.g. "references/tiers.md").`),kind:U([`reference`,`script`]).describe("`script` for anything under scripts/; `reference` for every other bundle file.")});B({name:F().describe(`Skill name (its identity).`),scope:U([`project`,`global`]).describe(E5),description:F().describe(`The skill's one-line description (empty if none).`),body:F().describe(`The SKILL.md body (markdown, frontmatter stripped).`),files:z(Oke).describe("Bundle files beside SKILL.md (path + kind, no inline text). Read one via `file`.")}),B({path:F().describe(`Skill-relative path read.`),kind:U([`reference`,`script`]).describe("`reference` or `script`."),text:F().describe(`Full text of the bundle file.`)}),B({name:F().describe("Skill name to pass as `skill` to `import`."),source:F().describe("Import-ready repository coordinates or website hostname. Pass this exact value to `import`."),description:F().describe(`Marketplace description for deciding whether the skill matches the task.`),installs:I().int().nonnegative().nullable().describe(`skills.sh install count, if known.`),publisher:F().nullable().describe(`Publisher, website, or GitHub owner, if known.`)}),[`Read-only skill discovery. Requires the Hocuspocus server. query searches the skills.sh marketplace and returns import-ready name/source/description/publisher/install-count rows. Import a chosen row with import({source,skill:name}); external rows are not managed or active editor content until imported/projected.`,`Omit name to list Project and Global managed skills with scope/description/hosts. name reads description/body plus a bundle files list (path/kind, no inline text); name+file reads one reference/script/bundle file. Optional scope; name-only prefers Project. Address skills by name/scope, never raw .ok/ paths or native cat.`,`Built-in open-knowledge* runtime skills are already in your skill list; do not fetch them here. Use write/edit/delete/move/install for changes.`].join(`
|
|
1128
|
+
`),["Create/replace exactly one `document`, `folder`, `template`, `skill`, or `asset`; use `documents` for an ordered batch. Requires the Hocuspocus server.","Nested paths such as `guides/overview` can be documents; put all requested blocks in one `document.content`. Use `folder` only for separate pages.","`document: {path, content|template, frontmatter?, position?}`: content and template are exclusive. Existing docs require position: replace/append/prepend; new docs default replace. frontmatter with literal content forces replace, even with append/prepend. Recent edits by another writer can refuse replace; follow the recovery response; append/prepend/edit bypass this refusal. Peers are per MCP connection; own writes and writers sharing a connection do not refuse each other; connected editors can. No agentId is needed.","`folder: {path, frontmatter?}` creates NEW folders; edit existing ones. `template: {path: '<folder>/<name>', content, frontmatter: {title, description?, tags?}}` creates reusable doc templates.","`skill: {name, description, body, scope?}` writes agent guidance; lowercase letters/digits/hyphens name is identity, description is when to use it. New skills use the default skill home; existing ones keep their real folder. Use install for editors.","`asset: {path, content|source}` uploads binary image/file: base64 content or local source path. `documents` takes document specs and reports each result.",`Optional summary: one-line outcome ≤80 chars, persisted to git history; avoid secrets or PII. Batches need per-entry summary; top-level is ignored.`,`Read response warnings: content-divergence/disk-edit-reconciled means re-read; mermaid-parse-error means the write landed but fix the fence.`,w5].join(`
|
|
1129
1129
|
`),TZ(`config-persistence`),TZ(`generated-index-git-attributes`),TZ(`head-watcher`),TZ(`shadow-gc`),TZ(`shadow-maintenance`),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_DEAD_CHAIN_THRESHOLD;if(!e)return 5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:5})(),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_CONSOLIDATION_SPACING_MS;if(!e)return 6e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:6e5})(),TZ(`mermaid-persistence`),TZ(`persistence`),TZ(`persistence-staleness`),TZ(`recovered-file-target`),TZ(`removed-docs-journal`),TZ(`server-observers`),TZ(`github-account`),TZ(`sync-engine`),Ne(o),new Set(z_e);const D5=[`no-push-permission`,`auth-error`,`git-index-locked`,`git-operation-in-progress`,`no-commits-yet`,`unsafe-incoming-symlinks`];new Set(D5),[...D5],(()=>{let e=Object.freeze({origin:`park-snapshot`,paired:!0});return Object.freeze({source:`local`,skipStoreHooks:!1,context:e})})(),(()=>{let e=Object.freeze({origin:`generated-index`,paired:!0});return Object.freeze({source:`local`,skipStoreHooks:!1,context:e})})();let O5=null;O8(()=>{O5?.disable(),O5=null}),TZ(`skill-migrate`);function k5(e){return[{host:`agents`,root:ds},...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({host:e,root:t}))].sort((e,t)=>{let n=q4.indexOf(e.host),r=q4.indexOf(t.host);return(n===-1?q4.length:n)-(r===-1?q4.length:r)||e.host.localeCompare(t.host)})}k5(ut),k5(dt),Number(process.env.OK_DESTROY_STEP_TIMEOUT_MS);const kke=mu;KX(),Ne(o),TZ(`project-git`);var A5=i((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})),j5=i((e=>{let{InvalidArgumentError:t}=A5();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}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})),M5=i((e=>{let{humanReadableArgName:t}=j5();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(`
|
|
1130
1130
|
`)}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,`
|
|
1131
1131
|
`+` `.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(`
|
|
@@ -1487,7 +1487,7 @@ export default function okBridge(pi: {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
});
|
|
1489
1489
|
}
|
|
1490
|
-
`}function Kke(e,t){let n=j(k8(t),k8(e));return n.length>0&&!n.startsWith(`..`)&&!k(n)}const qke=e=>{try{let t=s(`git`,[`rev-parse`,`--show-toplevel`],N8({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function Jke(e,t={}){let n=t.homeDir??ve(),r=t.gitTopLevel??qke,i=M(e),a;try{a=E(i)}catch{a=i}let o=a,s=0;for(;s<30&&o!==n&&o!==`/`&&o!==``;){if(P8(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=O(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&Kke(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}var I5=class extends Error{name=`ProjectPathSafetyError`;code=`PROJECT_PATH_SAFETY`};function L5(e,t){let n;try{n=_(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw new I5(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);R5(e,t)}function Yke(e,t){R5(e,t)}function R5(e,t){z5(e,t)}function z5(e,t){let n=t,r;try{r=E(n)}catch{r=M(n)}let i=O(e);for(;i.length>1&&i!==ue;){let t;try{t=E(i)}catch(e){if(e.code===`ENOENT`){i=O(i);continue}throw e}let n=j(r,t);if(n===``||!n.startsWith(`..`)&&!k(n))return;throw new I5(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${r}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function B5(e,t){let n=O(t),r=g(t)?`overwritten`:`written`;if(r===`written`&&g(n))throw Error(`Refusing to replace ${n}: it exists but holds no SKILL.md, so it is not a bundle OpenKnowledge wrote. Move it aside and try again.`);return ee(n,{recursive:!0,force:!0}),v(O(n),{recursive:!0}),m(e,n,{recursive:!0}),r}function V5(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function H5(e,t,n){try{if(ne(n).size>10485760)return!1}catch{return!1}let r;try{r=S(n,`utf-8`)}catch{return!1}let i=[],a=KTe(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!V5(a))return!1;let o=a[e.topLevelKey];if(!V5(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;if(!V5(s))return!1;let c=s[e.serverName(t)];return V5(c)&&c.enabled===!1?!1:hX(c)||zve(c)}function Xke(e){let t=Za[e]?.satisfiers.find(e=>e.piece===`mcp`&&e.scope===`project`),n=t?.pathId===void 0?null:ja(t.pathId);return n===null||n.kind!==`editor-project-config`||n.editor===e?null:EX[n.editor]??null}function Zke(e,t,n={}){if(!xt.includes(e.id))return!0;let r=Xke(e.id),i=r?.projectConfigPath?.(t);if(r!==null&&i!==void 0&&H5(r,t,i))return!0;try{return H5(e,t,e.configPath(t,n.home))}catch{return!1}}function Qke(e){let t=new Set(ft.filter(e=>e.scope===`project`).map(e=>e.editorId));return e.filter(e=>t.has(e))}function $ke(e,t){if(Qke(t).length===0)return null;let n=A(e,ds,ht,`SKILL.md`);try{let t=
|
|
1490
|
+
`}function Kke(e,t){let n=j(k8(t),k8(e));return n.length>0&&!n.startsWith(`..`)&&!k(n)}const qke=e=>{try{let t=s(`git`,[`rev-parse`,`--show-toplevel`],N8({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function Jke(e,t={}){let n=t.homeDir??ve(),r=t.gitTopLevel??qke,i=M(e),a;try{a=E(i)}catch{a=i}let o=a,s=0;for(;s<30&&o!==n&&o!==`/`&&o!==``;){if(P8(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=O(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&Kke(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}var I5=class extends Error{name=`ProjectPathSafetyError`;code=`PROJECT_PATH_SAFETY`};function L5(e,t){let n;try{n=_(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw new I5(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);R5(e,t)}function Yke(e,t){R5(e,t)}function R5(e,t){z5(e,t)}function z5(e,t){let n=t,r;try{r=E(n)}catch{r=M(n)}let i=O(e);for(;i.length>1&&i!==ue;){let t;try{t=E(i)}catch(e){if(e.code===`ENOENT`){i=O(i);continue}throw e}let n=j(r,t);if(n===``||!n.startsWith(`..`)&&!k(n))return;throw new I5(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${r}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function B5(e,t){let n=O(t),r=g(t)?`overwritten`:`written`;if(r===`written`&&g(n))throw Error(`Refusing to replace ${n}: it exists but holds no SKILL.md, so it is not a bundle OpenKnowledge wrote. Move it aside and try again.`);return ee(n,{recursive:!0,force:!0}),v(O(n),{recursive:!0}),m(e,n,{recursive:!0}),r}function V5(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function H5(e,t,n){try{if(ne(n).size>10485760)return!1}catch{return!1}let r;try{r=S(n,`utf-8`)}catch{return!1}let i=[],a=KTe(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!V5(a))return!1;let o=a[e.topLevelKey];if(!V5(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;if(!V5(s))return!1;let c=s[e.serverName(t)];return V5(c)&&c.enabled===!1?!1:hX(c)||zve(c)}function Xke(e){let t=Za[e]?.satisfiers.find(e=>e.piece===`mcp`&&e.scope===`project`),n=t?.pathId===void 0?null:ja(t.pathId);return n===null||n.kind!==`editor-project-config`||n.editor===e?null:EX[n.editor]??null}function Zke(e,t,n={}){if(!xt.includes(e.id))return!0;let r=Xke(e.id),i=r?.projectConfigPath?.(t);if(r!==null&&i!==void 0&&H5(r,t,i))return!0;try{return H5(e,t,e.configPath(t,n.home))}catch{return!1}}function Qke(e){let t=new Set(ft.filter(e=>e.scope===`project`).map(e=>e.editorId));return e.filter(e=>t.has(e))}function $ke(e,t){if(Qke(t).length===0)return null;let n=A(e,ds,ht,`SKILL.md`);try{let t=g5(`project`,{checkDesktop:!0});return L5(O(n),e),{editorId:`agents`,label:`.agents hub`,action:B5(t,n),path:n}}catch(e){return{editorId:`agents`,label:`.agents hub`,action:`failed`,path:n,error:e instanceof Error?e.message:String(e)}}}function U5(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!Zke(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=g5(`project`,{checkDesktop:!0});L5(O(r),t);let i=B5(n,r);return{editorId:e.id,label:e.label,action:i,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function eAe(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=O(n);return g(n)?(Yke(r,t),ee(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function tAe(){let e=GY();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function nAe(e){let t=e,n=new Set;for(;;){let r;try{r=_(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=T(t)}catch(t){return WY(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=k(i)?i:A(O(t),i)}}let W5;function rAe(){return W5===void 0&&(W5=tAe()),W5}function G5(e,t=rAe){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){WY(`resolveSymlinkWritePath threw`,e)}return nAe(e)}const K5=`**/.ok/*`,q5=`!**/.ok/skills/`;function J5(e){let t=[`.ok/`,`.okignore`];for(let n of YY){let r=EX[n];r.projectConfigPath&&t.push(dAe(r.projectConfigPath(e),e))}return t.push(`.claude/launch.json`),Array.from(new Set(t))}function Y5(e){let t=A(e,...gR);if(!g(t))return[];try{let e=bR(S(t,`utf-8`));if(!e)return[];let n=[];for(let[t,r]of Object.entries(e.skills))if(t!==`open-knowledge`)for(let e of r.hosts){let r=ut[e];r&&n.push(`${r}/${t}/`)}return Array.from(new Set(n))}catch{return[]}}function iAe(e,t){let n=X5(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:Z5(n)};let r=Q5(e);if(r.kind!==`ok`)return r.result;let i=g(r.path)?S(r.path,`utf-8`):``,a=new Set(Y5(e)),o=[],s=a.size===0?i:i.split(`
|
|
1491
1491
|
`).filter(e=>{let t=e.trim();return!a.has(t)||(o.push(t),!1)}).join(`
|
|
1492
1492
|
`),c=t7(s),l=[],u=[];for(let e of t)e7(c,e)?u.push(e):l.push(e);if(l.length===0&&o.length===0)return{kind:`updated`,appended:l,alreadyPresent:u,removed:[]};let d=l.length===0||s.length===0||s.endsWith(`
|
|
1493
1493
|
`)?``:`
|
|
@@ -1530,13 +1530,13 @@ GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){funct
|
|
|
1530
1530
|
`),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(`
|
|
1531
1531
|
`)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
|
|
1532
1532
|
`).replace(/\n/g,`\r
|
|
1533
|
-
`));let u=`${i?``:``}${l}`;return u!==r&&vY(e,u,{mode:a7(e)}),{kind:`removed`}}function kje(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}function Aje(e){let{priorCommand:t,priorArgs:n}=h9(e.priorEntry);return{event:`mcp-config-migrate`,scope:e.scope,surface:e.surface,editorId:e.editorId,configPath:e.configPath,priorCommand:t,priorArgs:n}}function h9(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function g9(e,t,n={}){let r=dke(e,t),i;try{i=S(r,`utf-8`)}catch(e){return e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`?{status:`missing`,lockPath:r}:{status:`read-error`,lockPath:r,error:e instanceof Error?e.message:String(e)}}let a;try{a=JSON.parse(i)}catch{return{status:`corrupt`,lockPath:r}}let o=a&&typeof a==`object`?a:{},s=`machineId`in o&&typeof o.machineId==`string`?o.machineId!==(n.machineId??uke()):`hostname`in o&&typeof o.hostname==`string`&&o.hostname!==(n.host??ye());if(!a||typeof a!=`object`||!gOe(a.pid))return{status:`corrupt`,lockPath:r,...s?{foreignHost:!0}:{}};let c=a.pid,l=`machineId`in o&&typeof o.machineId==`string`||`hostname`in o&&typeof o.hostname==`string`;return s?{status:`foreign-host`,lockPath:r,lock:a}:(n.isAlive??A8)(c)?l?{status:`alive`,lockPath:r,lock:a}:{status:`unverified-owner`,lockPath:r,pid:c}:{status:`dead-pid`,lockPath:r,lock:a}}async function jje(e,t=void 0){let n=g9(e,`server`);if(n.status!==`alive`&&n.status!==`foreign-host`)return null;let r=pke(n.lock);if(r===null)return null;try{let n=await fetch(`${r}/api/server-info`,{signal:AbortSignal.timeout(1500),redirect:`manual`});if(!n.ok)return t?.warn({lockDir:e,baseUrl:r,outcome:`http-error`,status:n.status},`stop client-probe failed`),null;let i=(await n.json())?.collabClients;return typeof i==`number`&&Number.isFinite(i)?i:(t?.warn({lockDir:e,baseUrl:r,outcome:`no-client-count`,received:typeof i},`stop client-probe failed`),null)}catch(n){return t?.warn({lockDir:e,baseUrl:r,outcome:`unreachable`,err:n},`stop client-probe failed`),null}}function Mje(e,t={}){return{targets:Pje(e,t.isAlive??A8)?[{name:`server`,pid:e.lock.pid,port:e.lock.port}]:[]}}async function Nje(e){let t=e.inspect??(()=>g9(e.lockDir,`server`)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=e.probeClients??jje,o=e.logger??void 0,s=Mje(t(),{isAlive:e.isAlive});if(s.targets.length===0)return r(`No running open-knowledge processes.`),o?.info({lockDir:e.lockDir,targets:0},`stop found nothing to signal`),{stopped:[],failed:[],hadTargets:!1};if(e.force!==!0){let t=await a(e.lockDir,o);if(t!==null&&t>0)return i(`Not stopping: ${t} collaboration client${t===1?``:`s`} (editor window${t===1?``:`s`} or agents) still connected to the server at ${e.lockDir}. Close them, or re-run with --force to terminate anyway.`),o?.warn({lockDir:e.lockDir,clients:t,pids:s.targets.map(e=>e.pid)},`stop declined: live collaboration clients`),{stopped:[],failed:[],hadTargets:!0,declined:{clients:t}}}let c=[],l=[];for(let e of s.targets)try{n(e.pid,`SIGTERM`),c.push(e)}catch(t){l.push({target:e,error:t instanceof Error?t.message:String(t)})}return c.length>0&&r(`Stopped: ${c.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),o?.info({lockDir:e.lockDir,signalled:c.map(e=>({name:e.name,pid:e.pid,port:e.port})),failed:l.map(({target:e,error:t})=>({pid:e.pid,error:t})),forced:e.force===!0},`stop signalled processes`),l.length>0&&i(`Failed to stop: ${l.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:c,failed:l,hadTargets:!0}}function Pje(e,t){return e.status===`alive`||e.status===`foreign-host`&&t(e.lock.pid)}function _9(e){if(!g(e))return{value:null,path:e,source:null,doc:null};let t;try{t=S(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,rs.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return HY(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function Fje(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=xu({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function Ije(e){let t=e??process.cwd(),n=[],r=[],i=[],a=[],o=SY(`user`,t),s=mY({absPath:o});r.push(...s.diagnostics),!s.valid&&s.sidelinedTo!==void 0&&i.push({from:o,to:s.sidelinedTo}),s.valid&&s.source!==void 0&&n.push(o);let c=(e,t=!1)=>{let i=_9(e);if(i.diagnostic!==void 0&&r.push(i.diagnostic),i.value===null)return{};let o=Uu({value:i.value,file:i.path,source:i.source,doc:i.doc});r.push(...o),n.push(e);let s=o.length>0?Gu(i.value):i.value;return t&&a.push(...rR({value:s,file:i.path,source:i.source,doc:i.doc})),s},l=M(t,`.ok`,`config.yml`),u=c(l,!0),d=c(SY(`project-local`,t)),f=iR(s.value,u,d),p=kke.safeParse(f);if(!p.success){let e=_9(l),t={code:`SCHEMA_INVALID`,issues:Fje(p.error.issues,e)};throw Error(Ru(t))}return{config:p.data,sources:n,diagnostics:r,sidelined:i,ignoredCommittedKeys:a}}function v9(e){return e.replace(/:\d+$/,``)}function y9(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:v9(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:v9(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:v9(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}function b9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=kc(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`).filter(e=>e.length>0);if(r.length<5||r[2]!==`blob`)return null;let i,a,o,s;try{i=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]),o=decodeURIComponent(r[3]),s=r.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.length===0||s.some(e=>e.length===0)?null:{host:n,owner:i,repo:a,branch:o,path:s.join(`/`)}}function x9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=kc(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`);if(r.length<5||r[0]!==``||r[3]!==`tree`)return null;let i=r.slice(5);i.length===1&&i[0]===``&&i.pop();let a,o,s,c;try{a=decodeURIComponent(r[1]),o=decodeURIComponent(r[2]),s=decodeURIComponent(r[4]),c=i.map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function Lje(e){let t=b9(e);if(t)return{kind:`doc`,...t};let n=x9(e);return n?{kind:`folder`,...n}:null}async function Rje(e,t){let n,r;try{n=await De(M(e)),r=await De(M(O(e)))}catch{return{kind:`not-git`}}if(!S9(n,r))return{kind:`symlink-escape`};let i=A(n,`.git`),a;try{a=ne(i)}catch{return{kind:`not-git`}}if(a.isDirectory()){let e;try{e=await De(i)}catch{return{kind:`not-git`}}if(!S9(e,n))return{kind:`symlink-escape`}}else if(!a.isFile())return{kind:`not-git`};let o=Gye(n);if(o.kind!==`repository`)return{kind:`not-git`};let s=o.repository.readRemoteUrl(`origin`);if(s.kind===`unreadable`)return{kind:`not-git`};if(s.kind===`absent`)return s.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let c=s.url,l=y9(c);if(l===null)return{kind:`non-github`};let u=kc(l.hostname);if(u===null)return{kind:`non-github`};let d=u===t.host.toLowerCase(),f=l.owner.toLowerCase()===t.owner.toLowerCase(),p=l.name.toLowerCase()===t.repo.toLowerCase();return!d&&f&&p?{kind:`wrong-host`,actualHost:u}:!d||!f||!p?{kind:`wrong-repo`,actualOwner:l.owner,actualRepo:l.name}:{kind:`ok`,gitRemoteUrl:`https://${u}/${l.owner}/${l.name}.git`}}function S9(e,t){if(e===t)return!0;let n=j(t,e);return n.length>0&&!n.startsWith(`..`)&&!k(n)}const zje=`# >>> open-knowledge cli >>>`,Bje=`# <<< open-knowledge cli <<<`,Vje=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Hje(e){return mR(at(),e)}function C9(e,t,n=[]){let r=g(A(e,u5[t]))?`satisfied`:`absent`;return{...r===`satisfied`?{state:r,strictness:[`reclaim-permissive`]}:{state:r},...n.length===0?{}:{sharedWith:n}}}function Uje(e,t){let n=YY.flatMap(t=>{let n=e[t];return n===null?[]:[{editor:t,root:n}]}),r=ft.filter(e=>e.scope===t).map(e=>({editor:e.editorId,root:ds}));return[...n,...r]}function w9(e,t,n,r){let i=pEe(e,Uje(t,r)),a=i.find(e=>e.host===n);if(a===void 0||a.state===`absent`)return[];let o=a.real;return i.filter(e=>e.host!==n&&e.state!==`absent`&&e.real===o).map(e=>e.host)}function Wje(e,t){let n=(t??ve()).replace(/[\\/]+$/,``);if(!n.includes(`\\`))return e.startsWith(`${n}/`)?`~/${e.slice(n.length+1)}`:e;let r=e=>e.replace(/\\/g,`/`),i=r(n),a=r(e);return a.startsWith(`${i}/`)?`~/${a.slice(i.length+1)}`:e}function Gje(e,t){let n=EX[e];return h7(n,``,t)&&!m7(n,``,t)}function T9(e,t,n,r,i){let a=EX[e],o;if(i===void 0)try{o=a.configPath(n,r)}catch{return{state:`structural-na`}}else o=i;let s=i===void 0?Wje(o,r):void 0,c=y7(a,n,r,i);switch(c.kind){case`absent`:case`no-entry`:return i===void 0&&Gje(e,r)?{state:`structural-na`}:{state:`absent`,path:s};case`decline`:return{state:`unprobed`};case`present`:{let{entry:r}=c,i=[];oX(r)&&i.push(`reclaim-permissive`),lX(r)&&i.push(`pre-approval-exact`),b7(e)(r)&&i.push(`injection-functional`);let o=Hve(a,n);return i.length>0&&(o!==null&&Uve(r,o)||t.includes(`pre-approval-exact`)&&i.includes(`reclaim-permissive`)&&!i.includes(`pre-approval-exact`))?{state:`drifted`,strictness:i,path:s}:i.length>0?{state:`satisfied`,strictness:i,path:s}:Lve(a)?{state:`foreign-replaceable`,path:s}:{state:`foreign`,path:s}}}}function Kje(e){let{cwd:t,home:n}=e;return e=>{if(e.pathId===null)return null;let r=ja(e.pathId);if(r===null)return null;if(r.kind===`central-skill-store`)return n===void 0?null:C9(A(n,ds),`discovery`,w9(n,dt,e.agent,`global`));let i=r.editor;switch(r.kind){case`editor-user-skill-root`:{let e=dt[i];return e===null||n===void 0?null:g5(n).some(e=>e.editorId===i)?C9(A(n,e),`discovery`,w9(n,dt,i,`global`)):{state:`structural-na`}}case`editor-project-skill-root`:{let e=ut[i];return e===null?null:C9(A(t,e),`project`,w9(t,ut,i,`project`))}case`editor-user-config`:return T9(i,e.strictness,t,n);case`editor-project-config`:{let r=EX[i].projectConfigPath?.(t);return r===void 0?null:T9(i,e.strictness,t,n,r)}}}}[...d5.map(e=>u5[e])];function qje(e){if(!k(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=M(e);if(t===ue||O(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function E9(e){let t=qje(e),n=[];for(let e of d5){let r=u5[e];n.push({path:A(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of _t)n.push({path:A(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function Jje(e,t){let n=[];for(let r of E9(e))if(r.bundleId===t)try{ee(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}`)}const Yje=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=g7(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=U5(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function Xje(e,t,n={},r=Yje){let i=[];for(let a of t){let t=EX[a];for(let a of r)i.push(a.write(t,e,n))}let a=$ke(e,t);return a&&i.push({integration:`project-skill`,editorId:a.editorId,action:a.action,...a.path?{path:a.path}:{},...a.error?{error:a.error}:{}}),i}function Zje(e,t,n={}){return{integrations:Xje(e,t,n)}}function D9(e,t){let n=dt[e];return n===null?null:A(t,...n.split(`/`),u5.discovery,`SKILL.md`)}function Qje(e,t){let n=D9(e,t);if(n===null)return{editorId:e,label:e,action:`skipped-unsupported`,path:``};if(!g5(t).some(t=>t.editorId===e))return{editorId:e,label:e,action:`skipped-unsupported`,path:n};try{let r=m5(`discovery`,{checkDesktop:!0});return z5(O(n),t),{editorId:e,label:e,action:B5(r,n),path:n}}catch(t){return{editorId:e,label:e,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function $je(e){return g(A(e,...`.agents/skills`.split(`/`),u5.discovery))?!0:ct.some(t=>{let n=D9(t,e);return n!==null&&g(O(n))})}function eMe(e,t){let n=D9(e,t);if(n===null)return{editorId:e,label:e,action:`skipped-unsupported`,path:``};let r=O(n);try{return g(n)?(z5(r,t),ee(r,{recursive:!0,force:!0}),{editorId:e,label:e,action:`removed`,path:n}):{editorId:e,label:e,action:`not-present`,path:n}}catch(t){return{editorId:e,label:e,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function tMe(e){return mY({absPath:SY(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function O9({home:e=ve(),env:t=process.env}={}){let n=tMe(e),{override:r,preferenceList:i}=tve(t),{locale:a,source:o}=MB({override:r,storedPreference:n,supportedLocales:ul,preferenceList:i,autoDetectableLocales:fl});return{preference:n,locale:a,source:o,systemLanguages:i}}function k9(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function nMe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A9(e,t){if(typeof e==`string`)return k9(e,t.contentDir);if(Array.isArray(e))return e.map(e=>A9(e,t));if(!nMe(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=A9(i,t);return n}function j9(e,t){let n=S(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
1533
|
+
`));let u=`${i?``:``}${l}`;return u!==r&&vY(e,u,{mode:a7(e)}),{kind:`removed`}}function kje(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}function Aje(e){let{priorCommand:t,priorArgs:n}=h9(e.priorEntry);return{event:`mcp-config-migrate`,scope:e.scope,surface:e.surface,editorId:e.editorId,configPath:e.configPath,priorCommand:t,priorArgs:n}}function h9(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function g9(e,t,n={}){let r=mke(e,t),i;try{i=S(r,`utf-8`)}catch(e){return e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`?{status:`missing`,lockPath:r}:{status:`read-error`,lockPath:r,error:e instanceof Error?e.message:String(e)}}let a;try{a=JSON.parse(i)}catch{return{status:`corrupt`,lockPath:r}}let o=a&&typeof a==`object`?a:{},s=`machineId`in o&&typeof o.machineId==`string`?o.machineId!==(n.machineId??pke()):`hostname`in o&&typeof o.hostname==`string`&&o.hostname!==(n.host??ye());if(!a||typeof a!=`object`||!gOe(a.pid))return{status:`corrupt`,lockPath:r,...s?{foreignHost:!0}:{}};let c=a.pid,l=`machineId`in o&&typeof o.machineId==`string`||`hostname`in o&&typeof o.hostname==`string`;return s?{status:`foreign-host`,lockPath:r,lock:a}:(n.isAlive??A8)(c)?l?{status:`alive`,lockPath:r,lock:a}:{status:`unverified-owner`,lockPath:r,pid:c}:{status:`dead-pid`,lockPath:r,lock:a}}async function jje(e,t=void 0){let n=g9(e,`server`);if(n.status!==`alive`&&n.status!==`foreign-host`)return null;let r=gke(n.lock);if(r===null)return null;try{let n=await fetch(`${r}/api/server-info`,{signal:AbortSignal.timeout(1500),redirect:`manual`});if(!n.ok)return t?.warn({lockDir:e,baseUrl:r,outcome:`http-error`,status:n.status},`stop client-probe failed`),null;let i=(await n.json())?.collabClients;return typeof i==`number`&&Number.isFinite(i)?i:(t?.warn({lockDir:e,baseUrl:r,outcome:`no-client-count`,received:typeof i},`stop client-probe failed`),null)}catch(n){return t?.warn({lockDir:e,baseUrl:r,outcome:`unreachable`,err:n},`stop client-probe failed`),null}}function Mje(e,t={}){return{targets:Pje(e,t.isAlive??A8)?[{name:`server`,pid:e.lock.pid,port:e.lock.port}]:[]}}async function Nje(e){let t=e.inspect??(()=>g9(e.lockDir,`server`)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=e.probeClients??jje,o=e.logger??void 0,s=Mje(t(),{isAlive:e.isAlive});if(s.targets.length===0)return r(`No running open-knowledge processes.`),o?.info({lockDir:e.lockDir,targets:0},`stop found nothing to signal`),{stopped:[],failed:[],hadTargets:!1};if(e.force!==!0){let t=await a(e.lockDir,o);if(t!==null&&t>0)return i(`Not stopping: ${t} collaboration client${t===1?``:`s`} (editor window${t===1?``:`s`} or agents) still connected to the server at ${e.lockDir}. Close them, or re-run with --force to terminate anyway.`),o?.warn({lockDir:e.lockDir,clients:t,pids:s.targets.map(e=>e.pid)},`stop declined: live collaboration clients`),{stopped:[],failed:[],hadTargets:!0,declined:{clients:t}}}let c=[],l=[];for(let e of s.targets)try{n(e.pid,`SIGTERM`),c.push(e)}catch(t){l.push({target:e,error:t instanceof Error?t.message:String(t)})}return c.length>0&&r(`Stopped: ${c.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),o?.info({lockDir:e.lockDir,signalled:c.map(e=>({name:e.name,pid:e.pid,port:e.port})),failed:l.map(({target:e,error:t})=>({pid:e.pid,error:t})),forced:e.force===!0},`stop signalled processes`),l.length>0&&i(`Failed to stop: ${l.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:c,failed:l,hadTargets:!0}}function Pje(e,t){return e.status===`alive`||e.status===`foreign-host`&&t(e.lock.pid)}function _9(e){if(!g(e))return{value:null,path:e,source:null,doc:null};let t;try{t=S(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,rs.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return HY(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function Fje(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=xu({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function Ije(e){let t=e??process.cwd(),n=[],r=[],i=[],a=[],o=SY(`user`,t),s=mY({absPath:o});r.push(...s.diagnostics),!s.valid&&s.sidelinedTo!==void 0&&i.push({from:o,to:s.sidelinedTo}),s.valid&&s.source!==void 0&&n.push(o);let c=(e,t=!1)=>{let i=_9(e);if(i.diagnostic!==void 0&&r.push(i.diagnostic),i.value===null)return{};let o=Uu({value:i.value,file:i.path,source:i.source,doc:i.doc});r.push(...o),n.push(e);let s=o.length>0?Gu(i.value):i.value;return t&&a.push(...rR({value:s,file:i.path,source:i.source,doc:i.doc})),s},l=M(t,`.ok`,`config.yml`),u=c(l,!0),d=c(SY(`project-local`,t)),f=iR(s.value,u,d),p=kke.safeParse(f);if(!p.success){let e=_9(l),t={code:`SCHEMA_INVALID`,issues:Fje(p.error.issues,e)};throw Error(Ru(t))}return{config:p.data,sources:n,diagnostics:r,sidelined:i,ignoredCommittedKeys:a}}function v9(e){return e.replace(/:\d+$/,``)}function y9(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:v9(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:v9(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:v9(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}function b9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=kc(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`).filter(e=>e.length>0);if(r.length<5||r[2]!==`blob`)return null;let i,a,o,s;try{i=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]),o=decodeURIComponent(r[3]),s=r.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.length===0||s.some(e=>e.length===0)?null:{host:n,owner:i,repo:a,branch:o,path:s.join(`/`)}}function x9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=kc(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`);if(r.length<5||r[0]!==``||r[3]!==`tree`)return null;let i=r.slice(5);i.length===1&&i[0]===``&&i.pop();let a,o,s,c;try{a=decodeURIComponent(r[1]),o=decodeURIComponent(r[2]),s=decodeURIComponent(r[4]),c=i.map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function Lje(e){let t=b9(e);if(t)return{kind:`doc`,...t};let n=x9(e);return n?{kind:`folder`,...n}:null}async function Rje(e,t){let n,r;try{n=await De(M(e)),r=await De(M(O(e)))}catch{return{kind:`not-git`}}if(!S9(n,r))return{kind:`symlink-escape`};let i=A(n,`.git`),a;try{a=ne(i)}catch{return{kind:`not-git`}}if(a.isDirectory()){let e;try{e=await De(i)}catch{return{kind:`not-git`}}if(!S9(e,n))return{kind:`symlink-escape`}}else if(!a.isFile())return{kind:`not-git`};let o=Gye(n);if(o.kind!==`repository`)return{kind:`not-git`};let s=o.repository.readRemoteUrl(`origin`);if(s.kind===`unreadable`)return{kind:`not-git`};if(s.kind===`absent`)return s.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let c=s.url,l=y9(c);if(l===null)return{kind:`non-github`};let u=kc(l.hostname);if(u===null)return{kind:`non-github`};let d=u===t.host.toLowerCase(),f=l.owner.toLowerCase()===t.owner.toLowerCase(),p=l.name.toLowerCase()===t.repo.toLowerCase();return!d&&f&&p?{kind:`wrong-host`,actualHost:u}:!d||!f||!p?{kind:`wrong-repo`,actualOwner:l.owner,actualRepo:l.name}:{kind:`ok`,gitRemoteUrl:`https://${u}/${l.owner}/${l.name}.git`}}function S9(e,t){if(e===t)return!0;let n=j(t,e);return n.length>0&&!n.startsWith(`..`)&&!k(n)}const zje=`# >>> open-knowledge cli >>>`,Bje=`# <<< open-knowledge cli <<<`,Vje=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Hje(e){return mR(at(),e)}function C9(e,t,n=[]){let r=g(A(e,f5[t]))?`satisfied`:`absent`;return{...r===`satisfied`?{state:r,strictness:[`reclaim-permissive`]}:{state:r},...n.length===0?{}:{sharedWith:n}}}function Uje(e,t){let n=YY.flatMap(t=>{let n=e[t];return n===null?[]:[{editor:t,root:n}]}),r=ft.filter(e=>e.scope===t).map(e=>({editor:e.editorId,root:ds}));return[...n,...r]}function w9(e,t,n,r){let i=pEe(e,Uje(t,r)),a=i.find(e=>e.host===n);if(a===void 0||a.state===`absent`)return[];let o=a.real;return i.filter(e=>e.host!==n&&e.state!==`absent`&&e.real===o).map(e=>e.host)}function Wje(e,t){let n=(t??ve()).replace(/[\\/]+$/,``);if(!n.includes(`\\`))return e.startsWith(`${n}/`)?`~/${e.slice(n.length+1)}`:e;let r=e=>e.replace(/\\/g,`/`),i=r(n),a=r(e);return a.startsWith(`${i}/`)?`~/${a.slice(i.length+1)}`:e}function Gje(e,t){let n=EX[e];return h7(n,``,t)&&!m7(n,``,t)}function T9(e,t,n,r,i){let a=EX[e],o;if(i===void 0)try{o=a.configPath(n,r)}catch{return{state:`structural-na`}}else o=i;let s=i===void 0?Wje(o,r):void 0,c=y7(a,n,r,i);switch(c.kind){case`absent`:case`no-entry`:return i===void 0&&Gje(e,r)?{state:`structural-na`}:{state:`absent`,path:s};case`decline`:return{state:`unprobed`};case`present`:{let{entry:r}=c,i=[];oX(r)&&i.push(`reclaim-permissive`),lX(r)&&i.push(`pre-approval-exact`),b7(e)(r)&&i.push(`injection-functional`);let o=Hve(a,n);return i.length>0&&(o!==null&&Uve(r,o)||t.includes(`pre-approval-exact`)&&i.includes(`reclaim-permissive`)&&!i.includes(`pre-approval-exact`))?{state:`drifted`,strictness:i,path:s}:i.length>0?{state:`satisfied`,strictness:i,path:s}:Lve(a)?{state:`foreign-replaceable`,path:s}:{state:`foreign`,path:s}}}}function Kje(e){let{cwd:t,home:n}=e;return e=>{if(e.pathId===null)return null;let r=ja(e.pathId);if(r===null)return null;if(r.kind===`central-skill-store`)return n===void 0?null:C9(A(n,ds),`discovery`,w9(n,dt,e.agent,`global`));let i=r.editor;switch(r.kind){case`editor-user-skill-root`:{let e=dt[i];return e===null||n===void 0?null:v5(n).some(e=>e.editorId===i)?C9(A(n,e),`discovery`,w9(n,dt,i,`global`)):{state:`structural-na`}}case`editor-project-skill-root`:{let e=ut[i];return e===null?null:C9(A(t,e),`project`,w9(t,ut,i,`project`))}case`editor-user-config`:return T9(i,e.strictness,t,n);case`editor-project-config`:{let r=EX[i].projectConfigPath?.(t);return r===void 0?null:T9(i,e.strictness,t,n,r)}}}}[...p5.map(e=>f5[e])];function qje(e){if(!k(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=M(e);if(t===ue||O(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function E9(e){let t=qje(e),n=[];for(let e of p5){let r=f5[e];n.push({path:A(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of _t)n.push({path:A(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function Jje(e,t){let n=[];for(let r of E9(e))if(r.bundleId===t)try{ee(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}`)}const Yje=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=g7(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=U5(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function Xje(e,t,n={},r=Yje){let i=[];for(let a of t){let t=EX[a];for(let a of r)i.push(a.write(t,e,n))}let a=$ke(e,t);return a&&i.push({integration:`project-skill`,editorId:a.editorId,action:a.action,...a.path?{path:a.path}:{},...a.error?{error:a.error}:{}}),i}function Zje(e,t,n={}){return{integrations:Xje(e,t,n)}}function D9(e,t){let n=dt[e];return n===null?null:A(t,...n.split(`/`),f5.discovery,`SKILL.md`)}function Qje(e,t){let n=D9(e,t);if(n===null)return{editorId:e,label:e,action:`skipped-unsupported`,path:``};if(!v5(t).some(t=>t.editorId===e))return{editorId:e,label:e,action:`skipped-unsupported`,path:n};try{let r=g5(`discovery`,{checkDesktop:!0});return z5(O(n),t),{editorId:e,label:e,action:B5(r,n),path:n}}catch(t){return{editorId:e,label:e,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function $je(e){return g(A(e,...`.agents/skills`.split(`/`),f5.discovery))?!0:ct.some(t=>{let n=D9(t,e);return n!==null&&g(O(n))})}function eMe(e,t){let n=D9(e,t);if(n===null)return{editorId:e,label:e,action:`skipped-unsupported`,path:``};let r=O(n);try{return g(n)?(z5(r,t),ee(r,{recursive:!0,force:!0}),{editorId:e,label:e,action:`removed`,path:n}):{editorId:e,label:e,action:`not-present`,path:n}}catch(t){return{editorId:e,label:e,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function tMe(e){return mY({absPath:SY(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function O9({home:e=ve(),env:t=process.env}={}){let n=tMe(e),{override:r,preferenceList:i}=tve(t),{locale:a,source:o}=MB({override:r,storedPreference:n,supportedLocales:ul,preferenceList:i,autoDetectableLocales:fl});return{preference:n,locale:a,source:o,systemLanguages:i}}function k9(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function nMe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A9(e,t){if(typeof e==`string`)return k9(e,t.contentDir);if(Array.isArray(e))return e.map(e=>A9(e,t));if(!nMe(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=A9(i,t);return n}function j9(e,t){let n=S(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
1534
1534
|
`),i=n.split(`
|
|
1535
1535
|
`),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=A9(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}let o=r?`${a.join(`
|
|
1536
1536
|
`)}\n`:a.join(`
|
|
1537
1537
|
`);ie(e,o)}function M9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=A9(JSON.parse(n),t),i=n.endsWith(`
|
|
1538
1538
|
`)?`
|
|
1539
1539
|
`:``;ie(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=k9(n,t.contentDir);r!==n&&ie(e,r)}}function N9(e,t){let n=S(e,`utf-8`),r=k9(n,t.contentDir);r!==n&&ie(e,r)}function P9(e){try{return w(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>A(e,t.name))}catch{return[]}}const rMe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function F9(e){return/\.log\.\d+$/.test(e)}function iMe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||F9(e)}const aMe=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function oMe(e){let t={contentDir:e.contentDir};for(let n of aMe)for(let r of P9(A(e.stagingDir,n)))iMe(r)?j9(r,t):r.endsWith(`.json`)?M9(r,t):N9(r,t);for(let n of P9(A(e.stagingDir,`state`))){let e=oe(n);n.endsWith(`.jsonl`)?j9(n,t):rMe.has(e)?M9(n,t):N9(n,t)}}const I9=[`.ok`,`local`,`telemetry`],L9=[`.ok`,`local`,`logs`],R9=[`.ok`,`local`,`loss-capture`],z9=`spans-current.jsonl`,B9=`spans-prev.jsonl`,V9=`server-current.jsonl`,H9=`server-prev.jsonl`,U9=`loss-current.jsonl`,W9=`loss-prev.jsonl`;function sMe(e){return A(e,...I9,z9)}function cMe(e){return A(e,...I9,B9)}function lMe(e){return A(e,...L9,V9)}function uMe(e){return A(e,...L9,H9)}function dMe(e){return A(e,...R9,U9)}function fMe(e){return A(e,...R9,W9)}const G9=1e3;async function pMe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function mMe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function hMe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}function gMe(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(`
|
|
1540
|
-
`)}\n`:null}catch{return null}}function _Me(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vMe(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){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 yMe(){return{nodeVersion:process.version,platform:be(),arch:he()}}function bMe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,rs.parse)(S(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(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function xMe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return xMe(e.maxBytes)}function SMe(e){let t=J9(SY(`project`,e)),n=J9(SY(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function CMe(e){return Ae(`sha256`).update(e).digest(`hex`)}function wMe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const TMe=[`"doc.name"`,`"docName"`];function EMe(e){let t=S(e,`utf-8`),n=0;for(let e of TMe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(O(t),{recursive:!0}),e.endsWith(`.ips`)?ie(t,C7(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=A(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const DMe=new Set([`.jsonl`]);function OMe(e){let t=e.lastIndexOf(`.`);return t!==-1&&DMe.has(e.slice(t))}const kMe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function AMe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&kMe.has(e.slice(t))}function jMe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!AMe(r))continue;let{redacted:i,patterns:a,lineCount:o}=RB(S(n,`utf-8`));a.length!==0&&(ie(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return j(e,t).split(ue).join(`/`)}async function MMe(e){let t=M(e.contentDir),n=M(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??pMe,a=r.fetchAgentEffects??mMe,o=r.fetchWatcherRecent??hMe,s=r.readShadowHead??_Me,c=r.readCheckpointRefs??vMe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.82.0-beta.
|
|
1540
|
+
`)}\n`:null}catch{return null}}function _Me(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vMe(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){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 yMe(){return{nodeVersion:process.version,platform:be(),arch:he()}}function bMe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,rs.parse)(S(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(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function xMe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return xMe(e.maxBytes)}function SMe(e){let t=J9(SY(`project`,e)),n=J9(SY(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function CMe(e){return Ae(`sha256`).update(e).digest(`hex`)}function wMe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const TMe=[`"doc.name"`,`"docName"`];function EMe(e){let t=S(e,`utf-8`),n=0;for(let e of TMe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(O(t),{recursive:!0}),e.endsWith(`.ips`)?ie(t,C7(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=A(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const DMe=new Set([`.jsonl`]);function OMe(e){let t=e.lastIndexOf(`.`);return t!==-1&&DMe.has(e.slice(t))}const kMe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function AMe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&kMe.has(e.slice(t))}function jMe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!AMe(r))continue;let{redacted:i,patterns:a,lineCount:o}=RB(S(n,`utf-8`));a.length!==0&&(ie(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return j(e,t).split(ue).join(`/`)}async function MMe(e){let t=M(e.contentDir),n=M(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??pMe,a=r.fetchAgentEffects??mMe,o=r.fetchWatcherRecent??hMe,s=r.readShadowHead??_Me,c=r.readCheckpointRefs??vMe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.82.0-beta.4`),d=r.readDesktopEnv??K9,f=r.readLanguage??O9,p=r.readRuntime??yMe,h=r.isOtlpPushEnabled??bMe,_=y(A(Se(),`ok-bundle-`));try{v(A(_,`telemetry`),{recursive:!0}),v(A(_,`logs`),{recursive:!0}),v(A(_,`state`),{recursive:!0}),Z9(sMe(n),A(_,`telemetry`,z9)),Z9(cMe(n),A(_,`telemetry`,B9)),Z9(lMe(n),A(_,`logs`,V9)),Z9(uMe(n),A(_,`logs`,H9));for(let t of e.userLogFiles??[])Z9(t,A(_,`logs`,oe(t)));for(let t of e.userStateFiles??[])Z9(t,A(_,WL,oe(t)));let y=0;for(let t of e.diagnosticReports?.files??[])Z9(t,A(_,`diagnostic-reports`,oe(t)))&&(y+=1);let b=A(n,`.ok`,`local`),x=A(b,`server.lock`),C=`not-running`,w=`no server.lock`,T=null;if(g(x)){Z9(x,A(_,`state`,`server.lock`));try{let e=S(x,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?T=t.port:w=`lock present but no port`}catch{w=`lock present but unparseable`}}if(T!==null){let e=await i(T);e===null?w=`agent-presence endpoint at :${T} unreachable`:(ie(A(_,`state`,`agent-presence.json`),e),C=`running`,w=``);let t=await a(T);t!==null&&ie(A(_,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=gMe(n);e!==null&&ie(A(_,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&ie(A(_,`state`,`shadow-head.txt`),E);let D=c(t);D!==null&&ie(A(_,`state`,`checkpoint-refs.txt`),D),Z9(dMe(n),A(_,`state`,U9)),Z9(fMe(n),A(_,`state`,W9)),Z9(A(b,`last-spawn-error.log`),A(_,`state`,`last-spawn-error.log`)),Z9(A(b,qu),A(_,`state`,qu)),Z9(A(b,Ju),A(_,`state`,Ju)),Z9(A(b,Ku),A(_,`state`,Ku));let te=p(),re=d(),ae=f(),O={ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ae}};ie(A(_,`state`,`runtime.json`),`${JSON.stringify(O,null,2)}\n`);let se=C===`running`?`running
|
|
1541
1541
|
`:`not-running (${w})\n`;ie(A(_,`state`,`server-status.txt`),se);let k=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:S7(e.diagnosticReports,y);if(ie(A(_,`state`,`diagnostic-reports-status.txt`),`${k}\n`),e.processDir&&g(e.processDir)){let t=A(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let ce=e.redact===!0;ce&&oMe({stagingDir:_,contentDir:t}),e.note&&ie(A(_,`note.txt`),e.note);let le=null;e.scrubSecrets===!0&&(le=jMe(_));for(let t of e.extraFiles??[]){let e=t.zipName??oe(t.sourcePath);if(!Z9(t.sourcePath,A(_,`extra`,e))){r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);continue}let n=T7(t,`extra/${e}`);n!==null&&(le??={redactions:[],redactedLineCount:0},le.redactions.push(n),le.redactedLineCount+=n.lineCount)}let j=SMe(n),M=Q9(_),ue=[],de=0,fe=0;for(let e of M){let t=$9(_,e),n=ne(e).size,r=OMe(t)?wMe(e):0;ue.push({path:t,bytes:n,lines:r}),de+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(fe+=EMe(e))}let pe={applied:ce};le!==null&&(pe.secretScrub=le);let N={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ae},contentDir:{pathSha256:CMe(t),absolutePath:ce?`<CONTENT_DIR>`:t},telemetry:{localSink:j,otlpPushEnabled:h()},redaction:pe,serverStatus:C,files:ue};ie(A(_,`manifest.json`),`${JSON.stringify(N,null,2)}\n`);let me=M.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),he={stagedDiagnosticReports:y,totalBytes:de,fileCount:ue.length,docNameCount:fe,contentDirVisible:me,redacted:ce},ge=!1;return{stagingDir:_,manifest:N,summary:he,cleanup:()=>{ge||(ge=!0,ee(_,{recursive:!0,force:!0}))}}}catch(e){throw ee(_,{recursive:!0,force:!0}),e}}async function NMe(e){let{collected:t,outputPath:n}=e,r=O(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new DTe.ZipFile,a=Q9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(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 PMe(e,t){let n=A(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,rs.parse)(S(n,`utf-8`)),r=HY(t)?t.content:void 0,i=HY(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return M(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 M(e)}async function FMe(e,t,n,r,i){let a=E7(t,e.logger),o=await MMe({contentDir:PMe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...GAe(a,e.userLogsDir??A(hY(),`logs`)),...O7(e.cachesDir??A(ve(),`Library`,`Caches`))],userStateFiles:k7(e.bugReportsDir??w7()),diagnosticReports:i,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(O(e.outputPath),{recursive:!0}),await NMe({collected:o,outputPath:e.outputPath});let t=o.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:a,files:o.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:o.manifest.createdAt}}}finally{o.cleanup()}}async function IMe(e){let{projectDir:t}=e,n=e.readDesktopEnv??K9,r=e.readLanguage??O9,i=()=>BAe(e.diagnosticReportsDir??A(ve(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return FMe(e,t,n,r,i());let{zipPath:a,summary:o}=await XAe({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:O7(e.cachesDir??A(ve(),`Library`,`Caches`)),bugReportLedgerFiles:k7(e.bugReportsDir??w7()),diagnosticReports:e.level===`full`?i():void 0,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:a,summary:{level:e.level,systemWide:t===void 0,projectSlug:o.projectSlug,files:o.files,redactions:o.redactions,redactedLineCount:o.redactedLineCount,generatedAt:o.generatedAt}}}export{YY as ALL_EDITOR_IDS,XY as EDITOR_LABELS,EX as EDITOR_TARGETS,Pve as HOSTS_WITH_USER_SKILL_DIR,EAe as LAUNCH_CONFIG_NAME,zje as PATH_SHIM_BEGIN,Vje as PATH_SHIM_BLOCK_RE,Bje as PATH_SHIM_END,I5 as ProjectPathSafetyError,iAe as addOkPathsToGitExclude,L5 as assertProjectPathSafe,cX as buildManagedServerEntry,kje as buildMcpConfigDeclineEvent,Aje as buildMcpConfigMigrateEvent,y7 as classifyExistingMcpEntry,IMe as collectReportBundle,Kje as createCliProbeResolver,OY as createTokenStore,HAe as defaultBugReportZipPath,We as detectGh,qe as detectGhAccounts,AAe as detectInstalledEditors,_X as droppedManagedKeys,tye as editorConfigPathDisplay,eye as editorEntryLocator,vje as ensurePiBridge,Z5 as formatTrackedRemediation,sAe as getExcludedOkPaths,Y5 as getInstalledSkillProjectionPaths,Nve as getNativeTomlMcpEditor,J5 as getOkArtifactPaths,oX as isEntryUpToDate,lX as isOwnManagedEntry,Ije as loadConfig,ave as makeLazyProbeTokenStore,w7 as okBugReportsDir,b9 as parseGitHubBlobUrl,Lje as parseGitHubShareUrl,x9 as parseGitHubTreeUrl,y9 as parseGitUrl,Hje as pathInstallMarkerPath,Uke as previewContent,jAe as probeOwnManagedEditorMcpEntry,gje as probePiBridgeState,X5 as probeTrackedOkPaths,_7 as readExistingMcpEntry,oAe as readSharingMode,RB as redactContent,aAe as removeOkPathsFromGitExclude,Tje as removeOwnMcpEntry,eAe as removeProjectSkill,Jje as removeUserGlobalSkillBundle,eMe as removeUserSkill,Jke as resolveProjectRoot,Nje as runStop,h9 as truncatePriorEntry,E9 as userGlobalSkillBundleTargets,$je as userSkillPresentAnywhere,Rje as validateLocalFolderForShare,g7 as writeEditorMcpConfig,Zje as writeProjectAiIntegrations,U5 as writeProjectSkill,kAe as writeUserMcpConfigs,Qje as writeUserSkill};
|
|
1542
1542
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-DdoZ294B.mjs";import{_ as e}from"./init-vgeY_wHD.mjs";export{e as runInit};
|