@inkeep/open-knowledge 0.47.1 → 0.47.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-qJUo1ApO.mjs → acp-harness-probe-QNrRVJhc.mjs} +2 -2
- package/dist/cli.mjs +7 -7
- package/dist/config-schema.json +10 -1
- package/dist/config.user.schema.json +10 -1
- package/dist/constants-C5EnGQBy.mjs +2 -0
- package/dist/fs-traced-C-HqiL6u.mjs +1 -0
- package/dist/{fs-traced-OS6B1cZZ.mjs → fs-traced-D12ehU8a.mjs} +2 -2
- package/dist/{git-handle-RLYVdszV.mjs → git-handle-CllEzrX4.mjs} +2 -2
- package/dist/git-handle-DJPLRe3o.mjs +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-C55e2NNl.mjs → init-DL_j9FNQ.mjs} +3 -3
- package/dist/init-I4_eavst.mjs +1 -0
- package/dist/{launch-json-removal-D3Q9yvyd.mjs → launch-json-removal-B-K7szy8.mjs} +2 -2
- package/dist/{loader-BsX_JrrA.mjs → loader-Ro5TBLoF.mjs} +2 -2
- package/dist/loader-_DlE802w.mjs +1 -0
- package/dist/md-manager-DqRVEVmJ.mjs +2 -0
- package/dist/{open-browser-4sOlBbCM.mjs → open-browser-DiR8zaBV.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-CwNUTst2.mjs +1 -0
- package/dist/{preview-BAWt2Pnh.mjs → preview-CyVtre2s.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-DnjDjPFp.js → ActivityModeContent-2l8BA531.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Th6j3NhO.js → AgentDiffPane-wqdF9lpR.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BVm5Ldhz.js → AgentThreadClientBinder-56IhVeqo.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-DVfCTGd2.js → ChangedOutsideBadge-eT1ODdAD.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-DmM8F7PJ.js → CodeMirrorPropInput-L7fbBlLy.js} +1 -1
- package/dist/public/assets/{DocumentContext-B0g_vd8N.js → DocumentContext-DD95gIt4.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-DKuXrb9b.js → EditorModeToggle-CR5jA0YM.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-BQttSYlY.js → EnableSyncConfirmDialog-C5fNw26t.js} +1 -1
- package/dist/public/assets/FeedbackForm-macxQS8x.js +1 -0
- package/dist/public/assets/{GraphPanel-DK2w8FEz.js → GraphPanel-BDGxPSvY.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DHfVuiKL.js → ImportSkillDialog-B2ilfqxe.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-B-7Pe22_.js → LintConfigEditor-ByUOzhaw.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-B-Y5eayN.js → ManagedArtifactProperties-CVGjtd3P.js} +2 -2
- package/dist/public/assets/ManagedArtifactProperties-m1GRSrIt.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-DPMIdjmd.js → McpConsentDialogBody-B3ubISnW.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CBHNf1No.js → MermaidDocEditor-CftVeU4U.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CXLxw7Fr.js → ReportBugDialogBody-CWbkwdNL.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DG-dOTBT.js → SchemaConfigEditor-UkvF3UAn.js} +1 -1
- package/dist/public/assets/{SessionsHost-DjbdveAp.js → SessionsHost-Pa6hY3sI.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-CFwua7VK.js → SettingsDialogBody-Be8P3Vqa.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CyWPLWZG.js → ShareBranchSwitchDialog-BmGWQCY6.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-C-fxd4DJ.js → ShareReceiveDialog-BoqZXYhT.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-Y4PyuUCZ.js → ShareReceiveMissDialog-B_DT1dz2.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-Dbu0PwqP.js → SkillEditBanner-hcLaEQ2F.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DuFc7cZs.js → SkillOriginInline-CtSdZ4_j.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-B4k3LXLX.js → SkillToolbarControls-DQYbvJTe.js} +1 -1
- package/dist/public/assets/{SourceEditor-BCMM4zJn.js → SourceEditor-DX9L1Mci.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DkXL03UX.js → TerminalPanel-WTiFd3Z6.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DH34WwKL.js → TerminalWindowApp-CnhrK_tv.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DEdxUQxb.js → TextDocEditor-BGlQEeBq.js} +1 -1
- package/dist/public/assets/{ThreadView-ktubIY9d.js → ThreadView-CExveDEV.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DSvFVt40.js → TimelineDiffPane-DDFvXSlv.js} +1 -1
- package/dist/public/assets/{agent-diff-store-BX4UT3y1.js → agent-diff-store-jazihC28.js} +1 -1
- package/dist/public/assets/{agent-visibility-CYBYXsoR.js → agent-visibility-Ch0XQMkJ.js} +1 -1
- package/dist/public/assets/{auth-state-cache-ZZgXmLCf.js → auth-state-cache-D47fide1.js} +2 -2
- package/dist/public/assets/{client-version-DN8Gnc8R.js → client-version-CHRlMl4l.js} +1 -1
- package/dist/public/assets/{config-context-CdjtvoAz.js → config-context-B2fceTMP.js} +1 -1
- package/dist/public/assets/{config-provider-CKct7q_G.js → config-provider-Cb43FIW2.js} +1 -1
- package/dist/public/assets/{dist-DIn3VYDc2.js → dist-5ovMzVKN2.js} +1 -1
- package/dist/public/assets/{doc-paths-KCjzuC60.js → doc-paths-BFNbv2er.js} +1 -1
- package/dist/public/assets/{documents-events-FrlFXuC-.js → documents-events-BM8xyAJz.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BBMHbQG5.js → file-tree-adapter-C1zJK1Gk.js} +1 -1
- package/dist/public/assets/{file-tree-utils-DeyBapi2.js → file-tree-utils-Dma5c4k_.js} +1 -1
- package/dist/public/assets/{folder-config-api-OU19qNKs.js → folder-config-api-BxuLFuqM.js} +1 -1
- package/dist/public/assets/{globals-D4ycChQP.js → globals-DliH2YSL.js} +1 -1
- package/dist/public/assets/{index-Bnezs-Zg.js → index-DlH6tzhG.js} +108 -108
- package/dist/public/assets/{lint-config-client-D7DpNIwn.js → lint-config-client-DDxBMTZk.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-eFxHHf9q.js → markdownlint-rule-browser-c2Uv_5Ry.js} +1 -1
- package/dist/public/assets/{navigation-targets-BDSeZX3c.js → navigation-targets-D9VW9WdW.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-Wkw7QMir.js → open-managed-artifact-tab-CLwVAGCD.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BN0afFCO.js → pending-receive-nav-store-BmcjNZOu.js} +1 -1
- package/dist/public/assets/{prop-types-MABP6X1c.js → prop-types-BPmLSxhG.js} +1 -1
- package/dist/public/assets/{receive-store-CTNYU3q-.js → receive-store-BlAqmJZT.js} +1 -1
- package/dist/public/assets/{selection-context-BgucOSM-.js → selection-context-DJvv-kK_.js} +1 -1
- package/dist/public/assets/{skill-actions-By3ZQhYp.js → skill-actions-CfQkZqK6.js} +1 -1
- package/dist/public/assets/{skill-scope-DkGQeaIH.js → skill-scope-DwJ84s_r.js} +1 -1
- package/dist/public/assets/{skills-api-BCiYKVSk.js → skills-api-BTy9LAk0.js} +1 -1
- package/dist/public/assets/{src-C_O1F_4l.js → src-hNXjwMT1.js} +1 -1
- package/dist/public/assets/{tag-pill-input-3Bkld5bN.js → tag-pill-input-DVdwNfBT.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BZ8rve8n.js → target-navigation-intent-C6AhTsfc.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-DbpTBIvl.js → terminal-launch-events-B1DGOVIv.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-BMiT9GUh.js → terminal-telemetry-CviFLmIq.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DDN6b6N7.js → typing-burst-detector-B4AQIJp7.js} +1 -1
- package/dist/public/assets/{uninstall-DJBDkbwq.js → uninstall-CfW-qETg.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CInEut0L.js → use-activity-panel-D8pDT3xu.js} +1 -1
- package/dist/public/assets/{use-collab-url-ecWCytiv.js → use-collab-url-CUHlgRv5.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-Bf72FxVk.js → use-live-xterm-theme-CLCjRdjJ.js} +1 -1
- package/dist/public/assets/{use-open-skill-C3UqDa0B.js → use-open-skill-akwbVkG4.js} +1 -1
- package/dist/public/assets/{use-settings-route-CYvmk4XT.js → use-settings-route-BnOIfxuB.js} +1 -1
- package/dist/public/assets/{use-skill-directory-Ce1Wy5Qf.js → use-skill-directory-CSx9txvQ.js} +1 -1
- package/dist/public/assets/{use-skill-origin-DscI7Fo0.js → use-skill-origin-DvSOmIz_.js} +1 -1
- package/dist/public/assets/{use-skills-B19yYlmR.js → use-skills-DcLUuUJ9.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-D556BQSW.js → use-terminal-enabled-CgG0yd-l.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-C_2VFthE.js → use-timeline-entry-diff-DD-1OHsM.js} +1 -1
- package/dist/public/assets/{use-workspace-008C-zhL.js → use-workspace-J5QvjwOx.js} +1 -1
- package/dist/public/index.html +42 -42
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-BLWZjHxK.mjs → repair-launch-json-DlAJs_pz.mjs} +2 -2
- package/dist/{repair-mcp-configs-CTYAl0ua.mjs → repair-mcp-configs-Bg-qmFa_.mjs} +2 -2
- package/dist/{repair-skills-BikzcmQr.mjs → repair-skills-CYkvjSVb.mjs} +2 -2
- package/dist/repair-skills-R8jaRgSC.mjs +1 -0
- package/dist/schemas/v0/config.user.schema.json +10 -1
- package/dist/{server-lock-DgWnoftI.mjs → server-lock-CmYdHyX7.mjs} +2 -2
- package/dist/server-lock-D61z37T2.mjs +1 -0
- package/dist/{sleep-C5OfWWWx.mjs → sleep-jUpHbV7f.mjs} +2 -2
- package/dist/{src-Cgpp8Pf-.mjs → src--MxQA4BK.mjs} +2 -2
- package/dist/{src-CWDcUomk.mjs → src-2gMaOH-l.mjs} +311 -311
- package/dist/{src-CGOjzQCL.mjs → src-B7qPUQHJ.mjs} +1 -1
- package/dist/{src-pJ6LEXKc.mjs → src-CHSJwcpc.mjs} +2 -2
- package/dist/start-BFzPdz8R.mjs +1 -0
- package/dist/{start-TnxpB5de.mjs → start-CszIxyyk.mjs} +3 -3
- package/dist/{write-project-skill-B8LGhuHT.mjs → write-project-skill-jk9SeWrA.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-CUaf8eE_.mjs +0 -2
- package/dist/fs-traced-CbQ-GS7x.mjs +0 -1
- package/dist/git-handle-D0uAjBAd.mjs +0 -1
- package/dist/init-D8a-XbzA.mjs +0 -1
- package/dist/loader-O6z6lVhP.mjs +0 -1
- package/dist/md-manager-CrYbAiKl.mjs +0 -2
- package/dist/preview-Bq9cv2G5.mjs +0 -1
- package/dist/public/assets/FeedbackForm-FbNH_TYS.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Ddk1e_f6.js +0 -1
- package/dist/repair-skills-CCM2p_7S.mjs +0 -1
- package/dist/server-lock-CiN5OJ-t.mjs +0 -1
- package/dist/start-tOC8nkMr.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{Y as t}from"./sleep-
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{Y as t}from"./sleep-jUpHbV7f.mjs";import{Lo as n,X as r,Z as i,bs as a,xs as o}from"./src-CHSJwcpc.mjs";import{Vr as s,at as c,it as l,nt as u,rt as d,si as f,vn as p,xa as m}from"./src-2gMaOH-l.mjs";import{O as h,P as g}from"./fs-traced-D12ehU8a.mjs";import{S as _,u as v,v as y,x as b}from"./server-lock-CmYdHyX7.mjs";import{t as x}from"./yazl-BafwB467.mjs";import{T as S,b as C,d as w,i as ee,x as te}from"./write-project-skill-jk9SeWrA.mjs";import{c as ne}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-QNrRVJhc.mjs";import{D as T,E,S as re,T as D,_ as O,b as ie,o as k,v as A}from"./init-DL_j9FNQ.mjs";import{n as j}from"./constants-C5EnGQBy.mjs";import{t as ae}from"./is-object-ByG7RnjH.mjs";import"./loader-Ro5TBLoF.mjs";import"./preview-CyVtre2s.mjs";import{execSync as oe,spawnSync as M}from"node:child_process";import{basename as N,dirname as P,isAbsolute as se,join as F,relative as ce,resolve as I,sep as le}from"node:path";import{cpSync as ue,createWriteStream as de,existsSync as L,lstatSync as fe,mkdirSync as R,mkdtempSync as pe,readFileSync as z,readdirSync as me,readlinkSync as he,rmSync as ge,statSync as _e,writeFileSync as B}from"node:fs";import{arch as ve,freemem as ye,homedir as be,hostname as xe,platform as Se,release as Ce,tmpdir as we,totalmem as Te,type as Ee,uptime as De}from"node:os";import{realpath as V}from"node:fs/promises";import{createHash as Oe}from"node:crypto";var H=t();const ke=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Ae(e,t,n=p){if(e!==void 0&&!ke.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let je=null;function Me(e){je=e}function Ne(){return je??process.cwd()}function Pe(){return F(be(),`.ok`,`bug-reports`)}function Fe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Pe(),r=`${t}-bugreport`,i=F(n,`${r}.zip`);for(let e=2;L(i);e+=1)i=F(n,`${r}-${e}.zip`);return i}function Ie(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let e=z(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return L(F(e,`.ok`))?Oe(`sha256`).update(I(e)).digest(`hex`).slice(0,12):null}function Le(){let e={timestamp:new Date().toISOString(),platform:Se(),osType:Ee(),osRelease:Ce(),hostname:`[redacted]`,uptime:De(),freeMem:ye(),totalMem:Te(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=oe(`sw_vers -productVersion 2>/dev/null`,s({encoding:`utf8`})).trim()}catch{}try{let t=F(__dirname,`..`,`..`,`package.json`);L(t)&&(e.okVersion=JSON.parse(z(t,`utf8`)).version)}catch{}return e}function Re(e,t){return ze(e,t).files}function ze(e,t){if(!L(t))return{files:[]};let n=me(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>F(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return z(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let t=F(e,`.ok`,`local`);return L(t)?{files:[`server.lock`,`last-spawn-error.log`,r].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function Ve(e){let t=F(e,`.ok`,`local`,`logs`);return L(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=o(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 U(e){for(let t of e.files)try{He({zipfile:e.zipfile,name:`${e.prefix}/${N(t)}`,content:z(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function Ue(t){let{redact:n,outputPath:r,logger:i}=t,o=t.userLogsDir??F(be(),`.ok`,`logs`),s=t.projectDir?Ie(t.projectDir,i):null;R(P(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let c=Le();c.desktop=t.desktop??null;let{files:l}=ze(s,o),{files:u}=t.projectDir?Be(t.projectDir):{files:[]},{files:d}=t.projectDir?Ve(t.projectDir):{files:[]};i?.info({logFileCount:l.length,lockFileCount:u.length,localSinkFileCount:d.length},`files collected`);let f=[],p=[],{ZipFile:m}=await import(`./yazl-vwTkB7U0.mjs`).then(t=>e(t.default,1)),h=new m;U({zipfile:h,files:l,prefix:`logs`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:u,prefix:`lockdir`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:d,prefix:`local-logs`,redact:n,bundleFiles:p,redactions:f,logger:i});for(let e of t.extraFiles??[])try{let t=z(e.sourcePath),n=`extra/${e.zipName??N(e.sourcePath)}`;h.addBuffer(t,n),p.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:h,name:`note.txt`,content:t.note,redact:n,bundleFiles:p,redactions:f});let g=JSON.stringify(c,null,2);h.addBuffer(Buffer.from(g,`utf8`),`sysinfo.json`),p.push(`sysinfo.json`);let _={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:p,redactions:f,sysinfo:c};h.addBuffer(Buffer.from(JSON.stringify(_,null,2),`utf8`),`MANIFEST.json`);let v=f.reduce((e,t)=>e+t.lineCount,0),y=[`# Bug Report Bundle`,``,`Generated: ${_.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${_.disciplineVersion}`,``,`## Contents`,``,...p.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${a.join(`, `)}`,v>0?`${v} line(s) were scrubbed across ${f.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
2
2
|
`);h.addBuffer(Buffer.from(y,`utf8`),`README.md`),h.end();let b=de(r);return h.outputStream.pipe(b),await new Promise((e,t)=>{b.on(`close`,e),b.on(`error`,t)}),i?.info({bundlePath:r,fileCount:p.length,redactionCount:v},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:p,redactions:f,redactedLineCount:v,generatedAt:_.generatedAt}}}var We=e(x(),1),W=e(ne(),1);function G(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ge(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return G(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!Ge(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=K(i,t);return n}function Ke(e,t){let n=z(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
3
3
|
`),i=n.split(`
|
|
4
4
|
`),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=K(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}B(e,r?`${a.join(`
|
|
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{Y as t}from"./sleep-C5OfWWWx.mjs
|
|
|
17
17
|
`).replace(/\n/g,`\r
|
|
18
18
|
`));let u=`${i?``:``}${l}`;return u!==r&&g(e,u,{mode:D(e)}),{kind:`removed`}}function ln(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function un(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function dn(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:d(r),command:r,isDesktop:ln(r)}}function fn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&fn(e)?`ui-orphan`:`stale`}const pn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function mn(e){switch(e){case`running`:return W.default.green(e);case`desktop`:return W.default.blue(e);case`foreign`:return W.default.cyan(e);case`ui-orphan`:return W.default.magenta(e);case`stale`:return W.default.yellow(e)}}function hn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function gn(e){return`${hn(e.server.usage)} | ${hn(e.ui?.usage??null)}`}function _n(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function vn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,_n(e),gn(e),t,String(n),un(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=mn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=W.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
19
19
|
`)}async function yn(e={}){let t=e.discover??u,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??l,a=e.resolveUsage??c,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=dn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&s.push(o)}if(e.json){let e=s.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(vn(e.all?s:s.filter(e=>pn.has(Q(e)))))}function bn(){return new S(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await yn({all:t.all===!0||e===`all`,json:t.json===!0})})}function xn(e,t,n={}){let r=n.isAlive??b,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function Sn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=xn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function Cn(e,t=b){let n=await u(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function wn(e){let t=Sn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Tn(e){return new S(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=Sn({lockDir:f(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await yn({});return}if(n===`all`){let e=await u();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,b)&&!$(r,b)||(wn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await Cn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}wn(t);return}wn(f(I(Ne(),n)))})}function En(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Dn(e,t){let r,i;try{r=await V(I(e)),i=await V(I(P(e)))}catch{return{kind:`not-git`}}if(!On(r,i))return{kind:`symlink-escape`};let a=F(r,`.git`),o;try{o=_e(a)}catch{return{kind:`not-git`}}if(o.isDirectory()){let e;try{e=await V(a)}catch{return{kind:`not-git`}}if(!On(e,r))return{kind:`symlink-escape`}}else if(!o.isFile())return{kind:`not-git`};let s=m(r);if(s.kind!==`repository`)return{kind:`not-git`};let c=s.repository.readRemoteUrl(`origin`);if(c.kind===`unreadable`)return{kind:`not-git`};if(c.kind===`absent`)return c.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let l=c.url,u=Wt(l);if(u===null)return{kind:`non-github`};let d=n(u.hostname);if(d===null)return{kind:`non-github`};let f=d===t.host.toLowerCase(),p=u.owner.toLowerCase()===t.owner.toLowerCase(),h=u.name.toLowerCase()===t.repo.toLowerCase();return!f&&p&&h?{kind:`wrong-host`,actualHost:d}:!f||!p||!h?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://${d}/${u.owner}/${u.name}.git`}}function On(e,t){if(e===t)return!0;let n=ce(t,e);return n.length>0&&!n.startsWith(`..`)&&!se(n)}const kn=[{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=A(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=ee(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 An(e,t,n={},r=kn){let i=[];for(let a of t){let t=w[a];for(let a of r)i.push(a.write(t,e,n))}return i}function jn(e,t,n={}){return{integrations:An(e,t,n)}}export{Fe as C,Ae as D,Me as E,zt as S,Ne as T,Kt as _,Tn as a,Ht as b,Jt as c,tn as d,Zt as f,qt as g,Gt as h,Sn as i,Xt as l,en as m,Dn as n,bn as o,$t as p,En as r,an as s,jn as t,Yt as u,Wt as v,Pe as w,Rt as x,Z as y};
|
|
20
|
-
//# sourceMappingURL=src
|
|
20
|
+
//# sourceMappingURL=src--MxQA4BK.mjs.map
|