@inkeep/open-knowledge 0.35.4 → 0.35.5
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/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +57 -57
- package/dist/constants-CzMfRMnb.mjs +2 -0
- package/dist/{gh-detect-sjzh2ZLB.mjs → gh-detect-D21DaYXA.mjs} +2 -2
- package/dist/{git-handle-CpHtlro0.mjs → git-handle-C-78iRUR.mjs} +2 -2
- package/dist/git-handle-Cm2rQ_SB.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-CrGjQFHu.mjs → init-CXWLzzz8.mjs} +4 -4
- package/dist/init-ow4EPsHw.mjs +1 -0
- package/dist/{launch-json-removal-Cyj-enab.mjs → launch-json-removal-BG3lXGmD.mjs} +2 -2
- package/dist/{lib-CsZlOZVg.mjs → lib-CW6dpYSh.mjs} +8 -8
- package/dist/{loader-CV4pnn1l.mjs → loader-Ba02haEW.mjs} +2 -2
- package/dist/loader-FEsQJAvq.mjs +1 -0
- package/dist/{open-browser-D-PuwGFp.mjs → open-browser-CO5MRLMI.mjs} +2 -2
- package/dist/{preview-B0TJVRj3.mjs → preview-BmqEZpW4.mjs} +2 -2
- package/dist/preview-D6OgDGh2.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-Bb_9SBwL.js → ActivityModeContent-BekkKvt5.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-B58_IeWO.js → AgentDiffPane-DX5yygoO.js} +1 -1
- package/dist/public/assets/{DocumentContext-DTN1oVEu.js → DocumentContext-DpeyjVxx.js} +2 -2
- package/dist/public/assets/{GraphPanel-BVQvaUEA.js → GraphPanel-klcC474u.js} +5 -5
- package/dist/public/assets/{ManagedArtifactProperties-DIo2u2MY.js → ManagedArtifactProperties-BM943qIb.js} +1 -1
- package/dist/public/assets/{PropertyPanel-DzBaIRl7.js → PropertyPanel-CghCdyF1.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-C04-Rlvj.js → SettingsDialogBody-DCuLzGe5.js} +1 -1
- package/dist/public/assets/{SourceEditor-CLD-sb0k.js → SourceEditor-CQzUCXVj.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-ZlzsNQ6w.js → TimelineDiffPane-BSMJUakG.js} +1 -1
- package/dist/public/assets/{auth-state-cache-Zvboee_f.js → auth-state-cache-CIX5FmID.js} +1 -1
- package/dist/public/assets/{index-BQaQovXc.js → index-BzMVLovC.js} +91 -91
- package/dist/public/assets/prop-types-Cf8g0EEm.js +1 -0
- package/dist/public/assets/{selection-context-j5QW8iZP.js → selection-context-ixLwMixV.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-C8g1J2Wa.js → typing-burst-detector-v9igCcyQ.js} +1 -1
- package/dist/public/assets/{use-activity-panel-B2dGbqlu.js → use-activity-panel-DM1azsHE.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-er0OzL5P.js → use-timeline-entry-diff-jL54o2-s.js} +1 -1
- package/dist/public/index.html +7 -7
- package/dist/{repair-launch-json-C9ukmIe5.mjs → repair-launch-json-BgE9FpBW.mjs} +2 -2
- package/dist/{repair-mcp-configs-DORS4pfW.mjs → repair-mcp-configs-BbLGJLUg.mjs} +2 -2
- package/dist/repair-skills-B_LT6KmX.mjs +1 -0
- package/dist/{repair-skills-BCyNfi-J.mjs → repair-skills-D7OqUhR5.mjs} +2 -2
- package/dist/server-lock-B4ji1_12.mjs +1 -0
- package/dist/{server-lock-CqieF_wm.mjs → server-lock-B_XsVesk.mjs} +2 -2
- package/dist/{src-CHgigP4i.mjs → src-CgIX2vtn.mjs} +39 -39
- package/dist/src-DyQpI2xy.mjs +21 -0
- package/dist/{src-iBJ8-UwF.mjs → src-PsxMXz66.mjs} +1 -1
- package/dist/src-i2Sa6WJ8.mjs +3310 -0
- package/dist/start-BJyMxLYI.mjs +1 -0
- package/dist/{start-DqMc80dE.mjs → start-CHiIFCgP.mjs} +2 -2
- package/dist/{write-project-skill-cDXEyRpr.mjs → write-project-skill-BZ1Qx_Fc.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-y_nlVhdF.mjs +0 -2
- package/dist/git-handle-DFEbLV_G.mjs +0 -1
- package/dist/init-BKo0uIaM.mjs +0 -1
- package/dist/loader-DXjRn8eH.mjs +0 -1
- package/dist/preview-CRf-Xs87.mjs +0 -1
- package/dist/public/assets/prop-types-B3K32NJg.js +0 -1
- package/dist/repair-skills-CtCQWVgx.mjs +0 -1
- package/dist/server-lock-DaLWkSjq.mjs +0 -1
- package/dist/src-BnjVL3Qp.mjs +0 -3310
- package/dist/src-DsHNvf5d.mjs +0 -21
- package/dist/start-WiQnpefT.mjs +0 -1
package/dist/src-DsHNvf5d.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{Go as t,M as n}from"./src-CHgigP4i.mjs";import{Mr as r,Tr as i,et as a,fa as o,la as s,nn as c,nt as l,rt as u,tt as d}from"./src-BnjVL3Qp.mjs";import{b as f,u as ee,v as p,y as m}from"./server-lock-CqieF_wm.mjs";import{t as h}from"./yazl-BucAN8Ez.mjs";import{t as g}from"./esm-EvSEzE_V.mjs";import"./gh-detect-sjzh2ZLB.mjs";import{E as _,S as v,T as y,_ as b,b as x,o as S,v as te,w as C}from"./init-CrGjQFHu.mjs";import{n as w}from"./constants-y_nlVhdF.mjs";import{t as T}from"./is-object-DYBErO9v.mjs";import{_ as ne,d as re,i as E,v as ie}from"./write-project-skill-cDXEyRpr.mjs";import"./loader-CV4pnn1l.mjs";import{c as ae}from"./colors-B_qgKwrk.mjs";import"./preview-B0TJVRj3.mjs";import{execSync as D,spawnSync as O}from"node:child_process";import{basename as k,dirname as A,isAbsolute as j,join as M,relative as N,resolve as P,sep as oe}from"node:path";import{cpSync as se,createWriteStream as ce,existsSync as F,lstatSync as le,mkdirSync as I,mkdtempSync as ue,readFileSync as L,readdirSync as de,readlinkSync as fe,rmSync as pe,statSync as me,writeFileSync as R}from"node:fs";import{arch as he,freemem as ge,homedir as _e,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import{readFile as Te,realpath as z}from"node:fs/promises";import{createHash as B}from"node:crypto";const Ee=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],De=Ee.map(e=>e.name);function V(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
2
|
-
`).map(e=>{let r=e;for(let{name:e,regex:i,replacement:a}of Ee)i.lastIndex=0,i.test(r)&&(t.add(e),n++,i.lastIndex=0,r=r.replace(i,a));return r}).join(`
|
|
3
|
-
`),patterns:[...t],lineCount:n}}function Oe(){return M(_e(),`.ok`,`bug-reports`)}function ke(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`);return M(Oe(),`${t}-bugreport.zip`)}function Ae(e,t){let n=M(e,`.ok`,`config.yml`);if(F(n))try{let e=L(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e instanceof Error?e.message:String(e)},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return F(M(e,`.ok`))?B(`sha256`).update(P(e)).digest(`hex`).slice(0,12):null}function je(){let e={timestamp:new Date().toISOString(),platform:ye(),osType:Ce(),osRelease:be(),hostname:`[redacted]`,uptime:we(),freeMem:ge(),totalMem:Se(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=D(`sw_vers -productVersion 2>/dev/null`,r({encoding:`utf8`})).trim()}catch{}try{let t=M(__dirname,`..`,`..`,`package.json`);F(t)&&(e.okVersion=JSON.parse(L(t,`utf8`)).version)}catch{}return e}function Me(e,t){if(!F(t))return{files:[]};let n=de(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>M(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return L(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Ne(e){let t=M(e,`.ok`,`local`);return F(t)?{files:[`server.lock`,`last-spawn-error.log`].map(e=>M(t,e)).filter(e=>F(e))}:{files:[]}}function Pe(e){let t=M(e,`.ok`,`local`,`logs`);return F(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>M(t,e)).filter(e=>F(e))}:{files:[]}}function Fe(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=V(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function H(e){for(let t of e.files)try{Fe({zipfile:e.zipfile,name:`${e.prefix}/${k(t)}`,content:L(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n instanceof Error?n.message:String(n)},`bug-report: skipped unreadable file`)}}async function Ie(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??M(_e(),`.ok`,`logs`),o=t.projectDir?Ae(t.projectDir,i):null;I(A(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=je();s.desktop=t.desktop??null;let{files:c}=Me(o,a),{files:l}=t.projectDir?Ne(t.projectDir):{files:[]},{files:u}=t.projectDir?Pe(t.projectDir):{files:[]};i?.info({logFileCount:c.length,lockFileCount:l.length,localSinkFileCount:u.length},`files collected`);let d=[],f=[],{ZipFile:ee}=await import(`./yazl-DvlathRc.mjs`).then(t=>e(t.default,1)),p=new ee;H({zipfile:p,files:c,prefix:`logs`,redact:n,bundleFiles:f,redactions:d,logger:i}),H({zipfile:p,files:l,prefix:`lockdir`,redact:n,bundleFiles:f,redactions:d,logger:i}),H({zipfile:p,files:u,prefix:`local-logs`,redact:n,bundleFiles:f,redactions:d,logger:i});for(let e of t.extraFiles??[])try{let t=L(e.sourcePath),n=`extra/${e.zipName??k(e.sourcePath)}`;p.addBuffer(t,n),f.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Fe({zipfile:p,name:`note.txt`,content:t.note,redact:n,bundleFiles:f,redactions:d});let m=JSON.stringify(s,null,2);p.addBuffer(Buffer.from(m,`utf8`),`sysinfo.json`),f.push(`sysinfo.json`);let h={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:f,redactions:d,sysinfo:s};p.addBuffer(Buffer.from(JSON.stringify(h,null,2),`utf8`),`MANIFEST.json`);let g=d.reduce((e,t)=>e+t.lineCount,0),_=[`# Bug Report Bundle`,``,`Generated: ${h.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${h.disciplineVersion}`,``,`## Contents`,``,...f.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${De.join(`, `)}`,g>0?`${g} line(s) were scrubbed across ${d.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
4
|
-
`);p.addBuffer(Buffer.from(_,`utf8`),`README.md`),p.end();let v=ce(r);return p.outputStream.pipe(v),await new Promise((e,t)=>{v.on(`close`,e),v.on(`error`,t)}),i?.info({bundlePath:r,fileCount:f.length,redactionCount:g},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:f,redactions:d,redactedLineCount:g,generatedAt:h.generatedAt}}}var U=t(),Le=e(h(),1);const Re=new Set([`doc.name`,`currentDoc`]);function ze(e){return`doc:${B(`sha256`).update(e).digest(`hex`).slice(0,8)}`}function Be(e,t,n){let r=e.docNameMap[n];if(r===void 0){e.docNameMap[n]=t;return}if(r===t)return;let i=e.docNameCollisions[n];i?i.includes(t)||i.push(t):e.docNameCollisions[n]=[t]}function Ve(e,t){let n=t.originalToHashed.get(e);if(n!==void 0)return n;let r=ze(e);return t.originalToHashed.set(e,r),Be(t,e,r),r}function W(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function G(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return W(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!G(e))return e;let n=typeof e.key==`string`&&Re.has(e.key)&&G(e.value)&&typeof e.value.stringValue==`string`?e.value.stringValue:null,r={};for(let[i,a]of Object.entries(e))if(n!==null&&i===`value`&&G(a)){let e=Ve(n,t);r[i]={...a,stringValue:e}}else Re.has(i)&&typeof a==`string`?r[i]=Ve(a,t):r[i]=K(a,t);return r}function He(e,t){if(t.originalToHashed.size===0)return e;let n=Array.from(t.originalToHashed.entries()).sort(([e],[t])=>t.length-e.length),r=e;for(let[e,t]of n)e.length!==0&&r.includes(e)&&(r=r.split(e).join(t));return r}function Ue(e,t){let n=L(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
5
|
-
`),i=n.split(`
|
|
6
|
-
`),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=K(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}R(e,r?`${a.join(`
|
|
7
|
-
`)}\n`:a.join(`
|
|
8
|
-
`))}function We(e,t){let n=L(e,`utf-8`);if(n.trim().length!==0)try{let r=K(JSON.parse(n),t),i=n.endsWith(`
|
|
9
|
-
`)?`
|
|
10
|
-
`:``;R(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=He(W(n,t.contentDir),t);r!==n&&R(e,r)}}function Ge(e,t){let n=L(e,`utf-8`),r=W(n,t.contentDir);r!==n&&R(e,r)}function Ke(e){try{return de(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>M(e,t.name))}catch{return[]}}const qe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function Je(e){let t={contentDir:e.contentDir,docNameMap:{},originalToHashed:new Map,docNameCollisions:{}};for(let n of[`telemetry`,`logs`,`process`])for(let r of Ke(M(e.stagingDir,n)))r.endsWith(`.jsonl`)?Ue(r,t):r.endsWith(`.json`)?We(r,t):Ge(r,t);for(let n of Ke(M(e.stagingDir,`state`))){let e=k(n);qe.has(e)?We(n,t):Ge(n,t)}return{docNameMap:t.docNameMap,docNameCollisions:t.docNameCollisions}}const Ye=[`.ok`,`local`,`telemetry`],Xe=[`.ok`,`local`,`logs`],Ze=`spans-current.jsonl`,Qe=`spans-prev.jsonl`,$e=`server-current.jsonl`,et=`server-prev.jsonl`;function tt(e){return M(e,...Ye,Ze)}function nt(e){return M(e,...Ye,Qe)}function rt(e){return M(e,...Xe,$e)}function it(e){return M(e,...Xe,et)}const at=1e3;async function ot(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(at)});return t.ok?await t.text():null}catch{return null}}async function st(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(at)});return t.ok?await t.text():null}catch{return null}}function ct(e){let t=M(e,`.git`,`ok`);if(!F(t))return null;let n=O(`git`,[`-C`,t,`log`,`--oneline`,`-50`],r({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function lt(e){let t=M(e,`.git`,`ok`);if(!F(t))return null;let n=O(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],r({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function ut(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function dt(){return{nodeVersion:process.version,platform:ye(),arch:he()}}function ft(){return process.env.OTEL_SDK_DISABLED===`false`}function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pt(e){if(!F(e))return{};let t;try{t=(0,U.parse)(L(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(!q(t))return{};let n=t.telemetry;if(!q(n))return{};let r=n.localSink;return q(r)?r:{}}function mt(e){return typeof e==`boolean`?e:void 0}function ht(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function J(e){if(q(e))return ht(e.maxBytes)}function gt(e){let t=pt(s(`project`,e)),n=pt(s(`project-local`,e));return{enabled:mt(n.enabled)??mt(t.enabled)??!0,spansMaxBytes:J(n.spans)??J(t.spans)??52428800,logsMaxBytes:J(n.logs)??J(t.logs)??26214400}}function _t(e){return B(`sha256`).update(e).digest(`hex`)}function vt(e){let t=L(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function yt(e){let t=L(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function Y(e,t){return F(e)?(I(A(t),{recursive:!0}),se(e,t),!0):!1}function bt(e){let t=[],n=e=>{let r=de(e,{withFileTypes:!0});for(let i of r){let r=M(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const xt=new Set([`.jsonl`]);function St(e){let t=e.lastIndexOf(`.`);return t===-1?!1:xt.has(e.slice(t))}const Ct=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function wt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Ct.has(e.slice(t))}function Tt(e){let t=[];for(let n of bt(e)){let r=Et(e,n);if(!wt(r))continue;let{redacted:i,patterns:a,lineCount:o}=V(L(n,`utf-8`));a.length!==0&&(R(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Et(e,t){return N(e,t).split(oe).join(`/`)}async function Dt(e){let t=P(e.contentDir),r=P(e.projectDir??e.contentDir),i=e.deps??{},a=i.fetchAgentPresence??ot,o=i.fetchAgentEffects??st,s=i.readShadowHead??ct,c=i.readCheckpointRefs??lt,l=i.now??(()=>new Date),u=i.okVersion??(()=>w),d=i.readDesktopEnv??ut,f=i.readRuntime??dt,ee=i.isOtlpPushEnabled??ft,p=ue(M(xe(),`ok-bundle-`));try{I(M(p,`telemetry`),{recursive:!0}),I(M(p,`logs`),{recursive:!0}),I(M(p,`state`),{recursive:!0}),Y(tt(r),M(p,`telemetry`,Ze)),Y(nt(r),M(p,`telemetry`,Qe)),Y(rt(r),M(p,`logs`,$e)),Y(it(r),M(p,`logs`,et));let m=M(r,`.ok`,`local`),h=M(m,`server.lock`),g=`not-running`,_=`no server.lock`,v=null;if(F(h)){Y(h,M(p,`state`,`server.lock`));try{let e=L(h,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?v=t.port:_=`lock present but no port`}catch{_=`lock present but unparseable`}}if(v!==null){let e=await a(v);e===null?_=`agent-presence endpoint at :${v} unreachable`:(R(M(p,`state`,`agent-presence.json`),e),g=`running`,_=``);let t=await o(v);t!==null&&R(M(p,`state`,`agent-effects.json`),t)}let y=s(t);y!==null&&R(M(p,`state`,`shadow-head.txt`),y);let b=c(t);b!==null&&R(M(p,`state`,`checkpoint-refs.txt`),b),Y(M(m,`last-spawn-error.log`),M(p,`state`,`last-spawn-error.log`)),Y(M(m,n),M(p,`state`,n));let x=f(),S=d(),te={ok:{version:u(),nodeVersion:x.nodeVersion,platform:x.platform,arch:x.arch},host:{desktop:S}};R(M(p,`state`,`runtime.json`),`${JSON.stringify(te,null,2)}\n`);let C=g===`running`?`running
|
|
11
|
-
`:`not-running (${_})\n`;if(R(M(p,`state`,`server-status.txt`),C),e.processDir&&F(e.processDir)){let t=M(p,`process`);I(t,{recursive:!0}),se(e.processDir,t,{recursive:!0})}let w=null;e.redact===!0&&(w=Je({stagingDir:p,contentDir:t})),e.note&&R(M(p,`note.txt`),e.note);let T=null;e.scrubSecrets===!0&&(T=Tt(p));for(let t of e.extraFiles??[])Y(t.sourcePath,M(p,`extra`,t.zipName??k(t.sourcePath)))||i.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ne=gt(r),re=bt(p),E=[],ie=0,ae=0;for(let e of re){let t=Et(p,e),n=me(e).size,r=St(t)?vt(e):0;E.push({path:t,bytes:n,lines:r}),ie+=n,t.startsWith(`telemetry/`)&&St(t)&&(ae+=yt(e))}let D=w===null?{applied:!1,docNameMapSidecar:null}:Object.keys(w.docNameCollisions).length>0?{applied:!0,docNameMapSidecar:null,docNameCollisions:w.docNameCollisions}:{applied:!0,docNameMapSidecar:null};T!==null&&(D.secretScrub=T);let O={schemaVersion:1,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:x.nodeVersion,platform:x.platform,arch:x.arch},host:{desktop:S},contentDir:{pathSha256:_t(t),absolutePath:w===null?t:`<CONTENT_DIR>`},telemetry:{localSink:ne,otlpPushEnabled:ee()},redaction:D,serverStatus:g,files:E};R(M(p,`manifest.json`),`${JSON.stringify(O,null,2)}\n`);let A=re.some(e=>{try{return L(e,`utf-8`).includes(t)}catch{return!1}}),j={totalBytes:ie,fileCount:E.length,docNameCount:ae,contentDirVisible:A,redacted:w!==null},N=!1;return{stagingDir:p,manifest:O,summary:j,redactionMapPayload:w===null?null:{docNameMap:w.docNameMap,docNameCollisions:w.docNameCollisions},cleanup:()=>{N||(N=!0,pe(p,{recursive:!0,force:!0}))}}}catch(e){throw pe(p,{recursive:!0,force:!0}),e}}async function Ot(e){let{collected:t,outputPath:n}=e,r=A(n);if(!F(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);if(t.redactionMapPayload!==null){let e=`${k(n,`.zip`)}.docnames.json`,r={...t.manifest,redaction:{...t.manifest.redaction,applied:!0,docNameMapSidecar:e}};R(M(t.stagingDir,`manifest.json`),`${JSON.stringify(r,null,2)}\n`)}let i=new Le.ZipFile,a=bt(t.stagingDir);for(let e of a){let n=Et(t.stagingDir,e);i.addFile(e,n)}i.end(),t.redactionMapPayload!==null&&R(M(r,`${k(n,`.zip`)}.docnames.json`),`${JSON.stringify({docNameMap:t.redactionMapPayload.docNameMap,docNameCollisions:t.redactionMapPayload.docNameCollisions},null,2)}\n`,{mode:384});let o=ce(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 kt(e,t){let n=M(e,`.ok`,`config.yml`);if(F(n))try{let t=(0,U.parse)(L(n,`utf-8`)),r=T(t)?t.content:void 0,i=T(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return P(e,i)}catch(e){t?.warn({configPath:n,err:e instanceof Error?e.message:String(e)},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return P(e)}async function At(e,t,n){let r=await Dt({contentDir:kt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,deps:{readDesktopEnv:n,logger:e.logger}});try{I(A(e.outputPath),{recursive:!0}),await Ot({collected:r,outputPath:e.outputPath});let n=r.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:Ae(t,e.logger),files:r.manifest.files.map(e=>e.path),redactions:n?.redactions??[],redactedLineCount:n?.redactedLineCount??0,generatedAt:r.manifest.createdAt}}}finally{r.cleanup()}}async function jt(e){let{projectDir:t}=e,n=e.readDesktopEnv??ut;if(e.level===`full`&&t!==void 0)return At(e,t,n);let{zipPath:r,summary:i}=await Ie({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n()});return{zipPath:r,summary:{level:e.level,systemWide:t===void 0,projectSlug:i.projectSlug,files:i.files,redactions:i.redactions,redactedLineCount:i.redactedLineCount,generatedAt:i.generatedAt}}}function X(e,t,n={}){let r=ee(e,t);if(!F(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(L(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!f(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??m)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??p())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??ve();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function Mt(e){return e.replace(/:\d+$/,``)}function Nt(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Mt(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Mt(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Mt(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 Pt(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!==`github.com`&&t.hostname!==`www.github.com`)return null;let n=t.pathname.split(`/`).filter(e=>e.length>0);if(n.length<5||n[2]!==`blob`)return null;let r,i,a,o;try{r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]),a=decodeURIComponent(n[3]),o=n.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!r||!i||!a||o.length===0||o.some(e=>e.length===0)?null:{owner:r,repo:i,branch:a,path:o.join(`/`)}}function Ft(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!==`github.com`&&t.hostname!==`www.github.com`)return null;let n=t.pathname.split(`/`);if(n.length<5||n[0]!==``||n[3]!==`tree`)return null;let r=n.slice(5);r.length===1&&r[0]===``&&r.pop();let i,a,o,s;try{i=decodeURIComponent(n[1]),a=decodeURIComponent(n[2]),o=decodeURIComponent(n[4]),s=r.map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.some(e=>e.length===0)?null:{owner:i,repo:a,branch:o,path:s.join(`/`)}}function It(e){let t=Pt(e);if(t)return{kind:`doc`,...t};let n=Ft(e);return n?{kind:`folder`,...n}:null}var Z=e(ae(),1);const Lt=`# >>> open-knowledge cli >>>`,Rt=`# <<< open-knowledge cli <<<`,zt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Bt(e){return M(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const Vt={existsSync:e=>F(e),readFileSync:(e,t)=>L(e,t),lstatSync:e=>le(e),readlinkSync:e=>fe(e)};function Ht(e,t=Vt){let n=Bt(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function Ut(e){let t=e.replace(zt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function Wt(e,t,n=Vt){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function Gt(e){return ne(e)||ie(e)||v(e)}const Kt=10*1024*1024;function qt(e,t,n,r){let i=S(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!Gt(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);return e.format===`file`?(pe(a,{force:!0}),{kind:`removed`}):e.format===`toml`?Xt(a,o):e.format===`yaml`?Yt(a,e.topLevelKey,o):Jt(a,e.topLevelKey,e.serverMapSubKey,o)}function Jt(e,t,n,r){let i;try{i=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>Kt)return{kind:`declined`,reason:`oversize`};let{text:a,changed:s}=_(i,b(t,n,r));return s?(o(e,a,{mode:C(e)}),{kind:`removed`}):{kind:`not-present`}}function Yt(e,t,n){let r;try{r=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>Kt)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,s=(0,U.parseDocument)(a);if(s.errors.length>0)return{kind:`declined`,reason:`unparseable`};let c=[t,n];if(!s.hasIn(c))return{kind:`not-present`};s.deleteIn(c);let l=s.toString(),u=y(a);a.trim()===``||a.endsWith(`
|
|
12
|
-
`)?l.endsWith(`
|
|
13
|
-
`)||(l=`${l}\n`):l=l.replace(/\n+$/,``),u&&(l=l.replace(/\r\n/g,`
|
|
14
|
-
`).replace(/\n/g,`\r
|
|
15
|
-
`));let d=`${i?``:``}${l}`;return d!==r&&o(e,d,{mode:C(e)}),{kind:`removed`}}function Xt(e,t){let n=x();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,s=y(a),c=a.trim()===``||a.endsWith(`
|
|
16
|
-
`),l;try{l=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!l.existed)return{kind:`not-present`};let u=l.text;c?u.endsWith(`
|
|
17
|
-
`)||(u=`${u}\n`):u=u.replace(/\n+$/,``),s&&(u=u.replace(/\r\n/g,`
|
|
18
|
-
`).replace(/\n/g,`\r
|
|
19
|
-
`));let d=`${i?``:``}${u}`;return d!==r&&o(e,d,{mode:C(e)}),{kind:`removed`}}const Zt=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Qt(e,t,n=c){if(e!==void 0&&!Zt.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let $t=null;function en(e){$t=e}function tn(){return $t??process.cwd()}function nn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function rn(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function an(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:d(r),command:r,isDesktop:nn(r)}}function on(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&on(e)?`ui-orphan`:`stale`}const sn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function cn(e){switch(e){case`running`:return Z.default.green(e);case`desktop`:return Z.default.blue(e);case`foreign`:return Z.default.cyan(e);case`ui-orphan`:return Z.default.magenta(e);case`stale`:return Z.default.yellow(e)}}function ln(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function un(e){return`${ln(e.server.usage)} | ${ln(e.ui?.usage??null)}`}function dn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function fn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,dn(e),un(e),t,String(n),rn(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=cn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=Z.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
20
|
-
`)}async function pn(e={}){let t=e.discover??a,n=e.inspect??X,r=e.log??(e=>console.log(e)),i=e.resolveCommand??l,o=e.resolveUsage??u,s=await t(),c=[];for(let e of s){let t=n(e,`server`),r=n(e,`ui`),a=an(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:o(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:o(r.lock.pid));a!=null&&c.push(a)}if(e.json){let e=c.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(fn(e.all?c:c.filter(e=>sn.has(Q(e)))))}function mn(){return new g(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await pn({all:t.all===!0||e===`all`,json:t.json===!0})})}function hn(e,t,n={}){let r=n.isAlive??m,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function gn(e){let t=e.inspect??(t=>X(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=hn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function _n(e,t=m){let n=await a(),r=null;for(let i of n){let n=X(i,`server`),a=X(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function vn(e){let t=gn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function yn(e){return new g(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=gn({lockDir:i(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await pn({});return}if(n===`all`){let e=await a();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=X(n,`server`),r=X(n,`ui`);!$(e,m)&&!$(r,m)||(vn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await _n(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}vn(t);return}vn(i(P(tn(),n)))})}function bn(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function xn(e,t){let n,r;try{n=await z(P(e)),r=await z(P(A(e)))}catch{return{kind:`not-git`}}if(!Cn(n,r))return{kind:`symlink-escape`};let i=M(n,`.git`),a;try{a=me(i)}catch{return{kind:`not-git`}}let o;if(a.isDirectory()){let e;try{e=await z(i)}catch{return{kind:`not-git`}}if(!Cn(e,n))return{kind:`symlink-escape`};o=e}else if(a.isFile()){let e;try{e=await Te(i,`utf-8`)}catch{return{kind:`not-git`}}let t=/^gitdir:\s*(.+)$/m.exec(e.trim());if(!t)return{kind:`not-git`};let r=t[1].trim(),a=j(r)?r:P(n,r);try{o=await z(a)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let s=M(await Sn(o),`config`),c;try{c=await Te(s,`utf-8`)}catch{return{kind:`not-git`}}let l=Tn(c);if(l===null)return{kind:`no-origin`};let u=Nt(l);if(u===null||u.hostname!==`github.com`)return{kind:`non-github`};let d=u.owner.toLowerCase()===t.owner.toLowerCase(),f=u.name.toLowerCase()===t.repo.toLowerCase();return!d||!f?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://github.com/${u.owner}/${u.name}.git`}}async function Sn(e){let t;try{t=(await Te(M(e,`commondir`),`utf-8`)).trim()}catch{return e}if(t.length===0)return e;let n=j(t)?t:P(e,t);try{return await z(n)}catch{return n}}function Cn(e,t){if(e===t)return!0;let n=N(t,e);return n.length>0&&!n.startsWith(`..`)&&!j(n)}function wn(e){let t=e.indexOf(`#`),n=e.indexOf(`;`),r=-1;return t>=0&&n>=0?r=Math.min(t,n):t>=0?r=t:n>=0&&(r=n),(r===-1?e:e.slice(0,r)).trim()}function Tn(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=wn(n);if(e.length===0)continue;if(e.startsWith(`[`)){t=/^\[\s*remote\s+["']origin["']\s*\]$/.test(e);continue}if(!t)continue;let r=/^url\s*=\s*(.+)$/.exec(e);if(r)return En(r[1])}return null}function En(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const Dn=[{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=te(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=E(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 On(e,t,n={},r=Dn){let i=[];for(let a of t){let t=re[a];for(let a of r)i.push(a.write(t,e,n))}return i}function kn(e,t,n={}){return{integrations:On(e,t,n)}}export{jt as C,V as D,ke as E,X as S,Ot as T,Ut as _,yn as a,Ft as b,en as c,Lt as d,zt as f,Ht as g,Bt as h,gn as i,Qt as l,Wt as m,xn as n,mn as o,Rt as p,bn as r,tn as s,kn as t,qt as u,Pt as v,Dt as w,Nt as x,It as y};
|
|
21
|
-
//# sourceMappingURL=src-DsHNvf5d.mjs.map
|
package/dist/start-WiQnpefT.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,f as t,r as n}from"./start-DqMc80dE.mjs";export{n as bootStartServer,t as resolveHost,e as startCommand};
|