@inkeep/open-knowledge 0.68.5 → 0.68.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-CdThI_5J.mjs → acp-harness-probe-Dd0_vY88.mjs} +2 -2
- package/dist/cli.mjs +41 -41
- package/dist/constants-DfYjLVQT.mjs +2 -0
- package/dist/{git-handle-DnoBon5O.mjs → git-handle-C9RU-MxT.mjs} +2 -2
- package/dist/git-handle-CzN6a5i1.mjs +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +172 -171
- package/dist/{init-awwoGR7Q.mjs → init-CM8I2X5C.mjs} +3 -3
- package/dist/init-igFI1B-e.mjs +1 -0
- package/dist/{launch-json-removal-DBb9lR1z.mjs → launch-json-removal-CCYps2DF.mjs} +2 -2
- package/dist/loader-B5BhlXcb.mjs +1 -0
- package/dist/{loader-Ca0nq0TT.mjs → loader-DhglZWNe.mjs} +2 -2
- package/dist/md-manager-B0rABilg.mjs +2 -0
- package/dist/{open-browser-iFLZcDi8.mjs → open-browser-DxgGjEoj.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-DIdTxxi9.mjs +1 -0
- package/dist/{preview-CDhwt0Oj.mjs → preview-DuaQ0yaD.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-CTYc4r-M.js → ActivityModeContent-Co1JyqXQ.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-BHzYZdaA.js → AddPropertiesButton-b5lnEVKK.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-CgDh65X-.js → AgentDiffPane-DSyEDn_Y.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BfzzW91s.js → AgentThreadClientBinder-g9d9BU09.js} +1 -1
- package/dist/public/assets/{BugReportHistory-BFeDHqqW.js → BugReportHistory-BYU251NU.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-BTq3iS9V.js → BugReportHistoryDialog-wi8j2imF.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-2n_88FNl.js +3 -0
- package/dist/public/assets/{ConsentDialogBody-e0bDGpfC.js → ConsentDialogBody-D2QQqLvP.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-C_NVhw3Y.js → DiffViewBoundary-BIjXbCNm.js} +1 -1
- package/dist/public/assets/DocumentContext-C1MDqUGQ.js +38 -0
- package/dist/public/assets/{EditorModeToggle-c5TOBudF.js → EditorModeToggle-PGfji8Z4.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DiSbCa-4.js → EnableSyncConfirmDialog-D73cTIc2.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-DoDpRzmC.js → ExcalidrawDocEditor-DLYL4uLQ.js} +1 -1
- package/dist/public/assets/FeedbackForm-DgVONYW4.js +1 -0
- package/dist/public/assets/{GraphPanel-BUWA0D9J.js → GraphPanel-DODcHiM6.js} +2 -2
- package/dist/public/assets/{ImportSkillDialog-CdC9Dc5x.js → ImportSkillDialog-SFJoXCHy.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-Bj_WTICg.js → LintConfigEditor-cz4oBJkn.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-D4in1i0d.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-wYlXlIDm.js → ManagedArtifactProperties-DVYEs_-t.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-ufgVBY_B.js → MermaidDocEditor-BnbvkIUa.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BqncBWH_.js → PropertyDisplayRow-DoKlSeCY.js} +1 -1
- package/dist/public/assets/ReportBugDialogBody-Cn9kuPrd.js +3 -0
- package/dist/public/assets/{ReportBugMenuTrigger-BTdzj2n4.js → ReportBugMenuTrigger-BWaaWbbQ.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-JS9t3cVS.js → SchemaConfigEditor-BqXzeHB3.js} +1 -1
- package/dist/public/assets/{SessionsHost-DuRJyyf0.js → SessionsHost-C1OZt5vc.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-S8BOIyhs.js → SettingsDialogBody-DQtkh-bL.js} +4 -4
- package/dist/public/assets/{ShareBranchSwitchDialog-4R7TrS-D.js → ShareBranchSwitchDialog--N1Bd5qo.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-Cmq2hZPb.js → ShareReceiveDialog-By6mslOj.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DHkouI0P.js → ShareReceiveMissDialog-DrHrN8Zh.js} +1 -1
- package/dist/public/assets/{SkillCostValue-DHSmxhI-.js → SkillCostValue-CkONMU96.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-B27-_Aay.js → SkillEditBanner-BkN4Vlyo.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-BAZRmLVh.js → SkillForkDialog-Bkhm9FwF.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-D_8pSxzw.js → SkillInstallMenu-DPBO7ZLl.js} +2 -2
- package/dist/public/assets/{SkillOriginInline-BSlC26uH.js → SkillOriginInline-DqGgPWeD.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-D7sBmfgp.js → SkillToolbarControls-kSIovUXj.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-BxNx9-Fx.js → SlidesToolbarControls-CloREzdd.js} +1 -1
- package/dist/public/assets/{SourceEditor-Ck_ph2zm.js → SourceEditor-DxcW7Ji4.js} +1 -1
- package/dist/public/assets/{TerminalPanel-uwQJYmWz.js → TerminalPanel-zXPIa6n_.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CMLGSKlU.js → TerminalWindowApp-Cpr1PRtm.js} +1 -1
- package/dist/public/assets/{TextDocEditor-BMniHrmA.js → TextDocEditor-CNvGi20m.js} +1 -1
- package/dist/public/assets/{ThreadView-9Zn6djZ0.js → ThreadView-BdfdaWKJ.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CNF7LQC7.js → TimelineDiffPane-BIR2lWwH.js} +1 -1
- package/dist/public/assets/{agent-diff-store-PmNFw1bf.js → agent-diff-store-_WIhmrnK.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DvM3i1AO.js → auth-state-cache-BCDkELSW.js} +4 -4
- package/dist/public/assets/{bug-report-send-manager-TlhphH7d.js → bug-report-send-manager-BhNwFXTM.js} +1 -1
- package/dist/public/assets/client-version-DPdchc8q.js +1 -0
- package/dist/public/assets/{comment-chips-Dc7VfDxa.js → comment-chips-SxWcQbb_.js} +1 -1
- package/dist/public/assets/config-provider-CFXUtiwu.js +5 -0
- package/dist/public/assets/{dist-CMzT53pm.js → dist-CDr44_5B.js} +3 -3
- package/dist/public/assets/{doc-hash-CbN6l-bN.js → doc-hash-CbPdvdAA.js} +1 -1
- package/dist/public/assets/{documents-events-BQph4Rf_.js → documents-events-CRdjzLAr.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BpMqjQeh.js → file-tree-adapter-Bg4PgS4F.js} +1 -1
- package/dist/public/assets/{file-tree-utils-D3vfryrA.js → file-tree-utils-Dt-qVN4W.js} +1 -1
- package/dist/public/assets/{folder-config-api-BGqXA_Yc.js → folder-config-api-Do2u-Rpg.js} +1 -1
- package/dist/public/assets/{globals-CL98nbsz.css → globals-ByagJMEb.css} +1 -1
- package/dist/public/assets/i18n-CApFNCKM.js +1 -0
- package/dist/public/assets/{index-BvzVFp9A.js → index-DWEZyyUh.js} +14 -14
- package/dist/public/assets/{launcher-selection-Q4ZIQ0VB.js → launcher-selection-BtAC_6OE.js} +1 -1
- package/dist/public/assets/{lint-config-client-nUUp3gxC.js → lint-config-client-C7Do4K-V.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-Dw2Ln--S.js → markdownlint-rule-browser-BuLeocmZ.js} +1 -1
- package/dist/public/assets/messages-6fcD2J3f.js +1 -0
- package/dist/public/assets/messages-BcgMON4t.js +1 -0
- package/dist/public/assets/messages-BfSRfllp.js +1 -0
- package/dist/public/assets/messages-BzB2vjb8.js +1 -0
- package/dist/public/assets/messages-CFC4xaZ5.js +1 -0
- package/dist/public/assets/messages-CHyeSnWa.js +1 -0
- package/dist/public/assets/messages-DZE-VzhB.js +1 -0
- package/dist/public/assets/messages-DZfszRg3.js +1 -0
- package/dist/public/assets/messages-DnatZmOM.js +1 -0
- package/dist/public/assets/messages-DrjcM4fb.js +1 -0
- package/dist/public/assets/messages-DvrupXSr.js +1 -0
- package/dist/public/assets/messages-DwrUkQ2i.js +1 -0
- package/dist/public/assets/page-list-cache-VMIjzKn4.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-CZWELP1p.js → pending-receive-nav-store-DWGtNmXZ.js} +1 -1
- package/dist/public/assets/{progress-Bcz6XuxC.js → progress-mhZcxRBo.js} +3 -3
- package/dist/public/assets/{project-paths-5B1myPxo.js → project-paths-BhoLIJti.js} +1 -1
- package/dist/public/assets/{prop-types-BkTKnQXu.js → prop-types-CUmrzSW1.js} +1 -1
- package/dist/public/assets/{receive-store-BQjSh3hv.js → receive-store-D2_q1wUu.js} +1 -1
- package/dist/public/assets/{selection-context-hxGStP38.js → selection-context-EAVqhQEK.js} +1 -1
- package/dist/public/assets/{skill-scope-QdZW9jQB.js → skill-scope-NCYHirwV.js} +1 -1
- package/dist/public/assets/{skills-api-_0gvQ7uH.js → skills-api-Dz_rVA1C.js} +1 -1
- package/dist/public/assets/{src-AID8LMTH.js → src-DuGGvfdD.js} +1 -1
- package/dist/public/assets/{startup-marks-BrgDU-FF.js → startup-marks-BPR5ipj8.js} +1 -1
- package/dist/public/assets/{tag-pill-input-ORi2pYBF.js → tag-pill-input-CYAsZCew.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BE1C7c1m.js → target-navigation-intent-CYAnPRok.js} +1 -1
- package/dist/public/assets/{telemetry-impl-VsKSwoCW.js → telemetry-impl-Cx5oP3TZ.js} +1 -1
- package/dist/public/assets/{telemetry-startup-CqPO3R20.js → telemetry-startup-kezMCRHJ.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BBkrKOa9.js → terminal-cli-display-jaULlk-O.js} +1 -1
- package/dist/public/assets/{terminal-command-events-De5Ifk_s.js → terminal-command-events-D5gbDNfs.js} +1 -1
- package/dist/public/assets/typing-burst-detector-Dc6Z0dV2.js +8 -0
- package/dist/public/assets/{uninstall-3URh0Jfo.js → uninstall-DAcZS1HG.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DueILXKJ.js → use-activity-panel-C8rnLWCk.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-B7J-6HE8.js → use-apply-config-color-theme-C3t6RLOI.js} +1 -1
- package/dist/public/assets/{use-collab-url-2h75iiK6.js → use-collab-url-CUI36lWb.js} +1 -1
- package/dist/public/assets/{use-conflicts-aEERGkga.js → use-conflicts-CBdH6psn.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-tJoPOgqZ.js → use-live-xterm-theme-mYE4hguI.js} +1 -1
- package/dist/public/assets/{use-open-skill-CIPHnSEU.js → use-open-skill-1xuIk7AK.js} +1 -1
- package/dist/public/assets/{use-settings-route-DwMidANO.js → use-settings-route-C_HC7gny.js} +1 -1
- package/dist/public/assets/{use-skill-origin-BCC3l5H8.js → use-skill-origin-BKe9dbHW.js} +1 -1
- package/dist/public/assets/{use-skills-rVlSdbIJ.js → use-skills-BhaOexz2.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BfHLzUUx.js → use-terminal-enabled-M2ci--Ho.js} +1 -1
- package/dist/public/assets/use-timeline-entry-diff-CIsFdF1_.js +6 -0
- package/dist/public/assets/{use-workspace-BzePm1UL.js → use-workspace-BHq7gCE9.js} +1 -1
- package/dist/public/index.html +52 -52
- package/dist/public/uninstall.html +6 -6
- package/dist/{repair-launch-json-ZKrEoixC.mjs → repair-launch-json-B4lEM4O3.mjs} +2 -2
- package/dist/{repair-mcp-configs-6TjePRwI.mjs → repair-mcp-configs-CeseMRbG.mjs} +2 -2
- package/dist/{repair-skills-BEtsD-_R.mjs → repair-skills-C8i0m9eF.mjs} +2 -2
- package/dist/repair-skills-WzWxastJ.mjs +1 -0
- package/dist/{resolve-project-root-GuD0zdTB.mjs → resolve-project-root-DbR2ne4Y.mjs} +2 -2
- package/dist/{server-lock-BIDrb6q3.mjs → server-lock-CGm9uKLf.mjs} +2 -2
- package/dist/server-lock-CHQfzAi7.mjs +1 -0
- package/dist/{skill-teardown-Bk4eOAS-.mjs → skill-teardown-ByJL1y5S.mjs} +2 -2
- package/dist/{src-CDcerRX2.mjs → src-CIngi0dD.mjs} +3 -3
- package/dist/src-CZM4Agb9.mjs +1 -0
- package/dist/src-DcauhAhM.mjs +21 -0
- package/dist/{src-DXMPKJnx.mjs → src-DoNjy6J-.mjs} +425 -425
- package/dist/{src-G8KmzYRf.mjs → src-Dp7hirDl.mjs} +1 -1
- package/dist/start-BB7nE39u.mjs +1 -0
- package/dist/{start-idTf0Cy-.mjs → start-C74J2bIU.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-Dwg2z20_.mjs +0 -2
- package/dist/git-handle-CgzfmB2x.mjs +0 -1
- package/dist/init-qLxpt9pm.mjs +0 -1
- package/dist/loader-BltYx1K9.mjs +0 -1
- package/dist/md-manager-BcWiy3AP.mjs +0 -2
- package/dist/preview-C6v9I-o4.mjs +0 -1
- package/dist/public/assets/CodeMirrorPropInput-CI296ELX.js +0 -3
- package/dist/public/assets/DocumentContext-Dc72CCLX.js +0 -38
- package/dist/public/assets/FeedbackForm-BUzq3_LW.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CuGR3_vr.js +0 -1
- package/dist/public/assets/ReportBugDialogBody-CmxYVKGf.js +0 -3
- package/dist/public/assets/client-version-DgAHPE5j.js +0 -1
- package/dist/public/assets/config-provider-CgKzlU66.js +0 -5
- package/dist/public/assets/i18n-BDM0SfuE.js +0 -1
- package/dist/public/assets/messages-BCDzGZ-z.js +0 -1
- package/dist/public/assets/messages-BIKExws8.js +0 -1
- package/dist/public/assets/messages-BRuH4eGg.js +0 -1
- package/dist/public/assets/messages-BbmzhhGy.js +0 -1
- package/dist/public/assets/messages-Bm1_dKft.js +0 -1
- package/dist/public/assets/messages-CgeWrYpD.js +0 -1
- package/dist/public/assets/messages-CpNH27MF.js +0 -1
- package/dist/public/assets/messages-CrOuHdVj.js +0 -1
- package/dist/public/assets/messages-D-KzxOns.js +0 -1
- package/dist/public/assets/messages-Do2oL-dp.js +0 -1
- package/dist/public/assets/messages-JDwxbJeu.js +0 -1
- package/dist/public/assets/messages-Yj8SVZjn.js +0 -1
- package/dist/public/assets/page-list-cache-D2uEX_G6.js +0 -1
- package/dist/public/assets/typing-burst-detector-BY6dOLpb.js +0 -8
- package/dist/public/assets/use-timeline-entry-diff-Qs4mKP9p.js +0 -6
- package/dist/repair-skills-DMUMX0Fe.mjs +0 -1
- package/dist/server-lock-C1GmzCcn.mjs +0 -1
- package/dist/src-DEeDpkHD.mjs +0 -1
- package/dist/src-hS3R1miu.mjs +0 -20
- package/dist/start-Df0HIk3X.mjs +0 -1
- /package/dist/public/assets/{globals-QZHWoM5P.js → globals-DIT-uAXH.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{Ct as e}from"./sleep-CFk6IVkN.mjs";import{Bi as t}from"./src-
|
|
1
|
+
import{Ct as e}from"./sleep-CFk6IVkN.mjs";import{Bi as t}from"./src-DoNjy6J-.mjs";import{I as n,N as r,P as i}from"./fs-traced-C8gNIaHq.mjs";import{b as a,g as o,m as s,p as c,s as l}from"./resolve-project-root-DbR2ne4Y.mjs";import{S as ee,T as u,d as te,o as d,v as f,x as ne}from"./init-CM8I2X5C.mjs";import{t as p}from"./is-object-Bw0-z8qH.mjs";import{execFileSync as m,spawn as h}from"node:child_process";import{basename as re,dirname as g,join as _,resolve as ie,win32 as v}from"node:path";import{existsSync as y,mkdirSync as b,readFileSync as x,readdirSync as ae,statSync as oe,writeFileSync as se}from"node:fs";import{homedir as S}from"node:os";var C=e();const w=`open-knowledge`;function T(e){try{e()}catch{}}var E=class{backend=`keyring`;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(w,e).getPassword()}catch(t){return T(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return T(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return T(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(w,e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(w,e).deletePassword()}catch{}}},D=class{backend=`file`;authFile;constructor(e){this.authFile=e??_(S(),`.ok`,`auth.yml`)}read(){if(!y(this.authFile))return{};try{return(0,C.parse)(x(this.authFile,`utf-8`))??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=g(this.authFile);y(t)||b(t,{recursive:!0,mode:448}),se(this.authFile,(0,C.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},ce=class{backend=`keyring`;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ~/.ok/auth.yml to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function O(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(w,`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
2
2
|
`),T(()=>t?.onBackendSelected?.({backend:`keyring`})),new ce(new E(t?.onKeychainRead),new D(e))}catch(n){let r=n instanceof Error?`${n.name}: ${n.message}`:String(n);return process.stderr.write(`[auth] token storage: file (~/.ok/auth.yml) — OS keychain unavailable: ${r}\n`),T(()=>t?.onBackendSelected?.({backend:`file`,reason:r})),new D(e)}}function k(e){let t=null;return function(){if(t)return t;let n=2e3;return t=(async()=>{let t=null,r=new Promise(r=>{t=setTimeout(()=>{process.stderr.write(`[auth] token storage: keyring init exceeded ${n}ms; falling back to file (~/.ok/auth.yml)\n`),r(new D(e))},n)});try{return await Promise.race([O(e),r])}catch{return new D(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function le(e){let t=k(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token,login:n.login}}}}function ue(e){let t=k(e);return{backend:`file`,async get(e){return(await t()).get(e)},async set(e,n,r,i){return(await t()).set(e,n,r,i)},async clear(e){return(await t()).clear(e)}}}async function de(e,t){let n=[],r=new D(t);await r.get(e)!=null&&(await r.clear(e),n.push(`file`));let i;try{let{Entry:t}=await import(`@napi-rs/keyring`);new t(w,`__probe__`);let r,a=await new E(e=>{e.kind===`read-error`&&(r=e.error??`read-error`)}).get(e);if(r!==void 0)i=r;else if(a!=null)try{new t(w,e).deletePassword(),n.push(`keychain`)}catch(e){i=e instanceof Error?e.name:`delete-error`}}catch{}return{touched:n,keychainError:i}}const fe=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`],A={encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3,windowsHide:!0};function j(e,t={}){let{login:n}=t,r=t._exec??m,i=M(t._fileExists??y),a=e?[`--hostname`,e]:[];if(n){let e=N(r,i,[`auth`,`token`,...a,`--user`,n]);if(e)return{available:!0,token:e,resolvedLogin:n,fallback:!1}}let o=N(r,i,[`auth`,`token`,...a]);return o?n?{available:!0,token:o,fallback:!0}:{available:!0,token:o}:{available:!1}}function M(e){return[`gh`,...fe.filter(e)]}function N(e,t,n){for(let r of t)try{let t=e(r,n,A).toString().trim();if(t.length>0)return t}catch{}}function P(e,t={}){let n=t._exec??m,r=M(t._fileExists??y),i=[`auth`,`status`,...e?[`--hostname`,e]:[]],a=N(n,r,[...i,`--json`,`hosts`]);if(a!==void 0){let t=I(a,e);if(t)return t}let o=N(n,r,i);if(o!==void 0){let e=V(o);if(e.length>0)return e}}function F(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function I(e,t){let n;try{n=JSON.parse(e)}catch{return}let r=F(F(n)?.hosts);if(!r||t!==void 0&&r[t]===void 0)return;let i=t===void 0?Object.values(r):[r[t]],a=[];for(let e of i){if(!Array.isArray(e))return;for(let t of e){let e=F(t);if(!e)continue;let n=e.login;typeof n!=`string`||n.length===0||a.push({login:n,active:e.active===!0})}}return a}const L=/Logged in to \S+ account (\S+) \(/,R=/(?:Failed to log in to|Timeout trying to log in to) \S+/,z=/^\s*-\s*Active account:\s*true\s*$/,B=/\u001b\[[0-9;]*m/g;function V(e){let t=[],n;for(let r of e.split(`
|
|
3
3
|
`)){let e=r.replace(B,``),i=L.exec(e)?.[1];if(i){n={login:i,active:!1},t.push(n);continue}if(R.test(e)){n=void 0;continue}n&&z.test(e)&&(n.active=!0)}return t}function pe(e){let t={...e};return delete t.ELECTRON_RUN_AS_NODE,t}function H(e){let t=e?.code;return t===`ENOENT`||t===`EACCES`||t===`EPERM`?{ok:!1,reason:`not-installed`}:{ok:!1,reason:`spawn-error`}}function U(e){return t({detached:!0,stdio:`ignore`,shell:!1,env:pe(e)})}function W(e,t,n={}){let r=(n.spawn??h)(e,[...t],U(n.env??process.env));return r.unref(),r}function me(e,t,n={}){let r=n.spawn??h,i=n.timeoutMs??2e3;return new Promise(a=>{let o=!1,s=e=>{o||(o=!0,a(e))},c=setTimeout(()=>s({ok:!1,reason:`timeout`}),i);try{let i=r(e,[...t],U(n.env??process.env));i.once(`error`,e=>{clearTimeout(c),s(H(e))}),i.once(`spawn`,()=>{clearTimeout(c),s({ok:!0})});try{i.unref()}catch{}}catch(e){clearTimeout(c),s(H(e))}})}const G=`com.inkeep.open-knowledge`,K=`OpenKnowledge.app`,q=`/Applications/${K}`;function he(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return oe(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function ge(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(J(e,q))return q;let t=_(e.homeDir??S(),`Applications`,K);return J(e,t)?t:null}function J(e,t){return Y(e,_(t,`Contents`,`MacOS`,`OpenKnowledge`))}function Y(e,t){try{let n=e.statSync(t);return n&&typeof n.isFile==`function`?n.isFile():!1}catch{return!1}}const _e=[`@inkeepopen-knowledge-desktop`,`OpenKnowledge`];function ve(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&/\\OpenKnowledge\.exe$/i.test(e.execPath))return e.execPath;let t=e.env.LOCALAPPDATA;if(t)for(let n of _e){let r=v.join(t,`Programs`,n,`OpenKnowledge.exe`);if(Y(e,r))return r}return null}function ye(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&e.execPath.endsWith(`/openknowledge`))return e.execPath;let t=`/opt/OpenKnowledge/openknowledge`;return Y(e,t)?t:null}function be(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`&&e.platform!==`win32`&&e.platform!==`linux`)return{available:!1,reason:`unsupported-platform`};let t;try{t=e.platform===`darwin`?ge(e):e.platform===`win32`?ve(e):ye(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:!(e.isTTY===!0||e.platform===`win32`&&e.isTTY===void 0&&!e.env.CI)||e.env.SSH_CONNECTION||e.env.SSH_TTY||e.platform===`linux`&&!e.env.DISPLAY&&!e.env.WAYLAND_DISPLAY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function xe(e,t){let n=e.log??(e=>console.error(e)),r=e.platform??process.platform;if(n("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)"),r===`darwin`){W(`open`,[`-b`,G],{spawn:e.spawn});return}let i=t?.bundlePath;if(!i){n(`Desktop launch skipped: no resolved desktop executable (caller bug).`);return}W(i,[],{spawn:e.spawn})}function Se(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found (checked the standard install locations for this OS). Install it from https://openknowledge.ai/download, or omit --mode for browser mode.`;case`darwin-only`:case`unsupported-platform`:return`Desktop app is not available on this platform. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect the desktop install (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available but launch dispatch did not fire (caller bug).`}}function X(e,t){let n=ie(e),r=t===void 0?a():a({home:t,env:{}});return{cwd:n,bridgePath:l.pi.projectConfigPath?.(n)??``,trustPath:_(r,`trust.json`)}}function Z(e,t,n){let r=d(l.pi,e,n,t);if(r.kind===`absent`)return{state:`absent`,text:null};if(r.kind!==`present`)return{state:`unreadable`,text:null};let i=r.entry,a=Array.isArray(i.args)&&typeof i.args[0]==`string`?i.args[0]:null;return s(i)?{state:`own-current`,text:a}:ee(i)?{state:`own-stale`,text:a}:{state:`foreign`,text:a}}function Q(e,t){let n;try{n=x(e,`utf-8`)}catch(e){let t=e.code;return t===`ENOENT`||t===`ENOTDIR`?{state:`untrusted`,entries:{},trailingNewline:!1}:{state:`unreadable`,entries:null,trailingNewline:!1}}if(n.trim()===``)return{state:`untrusted`,entries:{},trailingNewline:!1};let r;try{r=JSON.parse(n)}catch{return{state:`unreadable`,entries:null,trailingNewline:!1}}return p(r)?{state:r[t]===!0?`trusted`:`untrusted`,entries:r,trailingNewline:n.endsWith(`
|
|
4
4
|
`)}:{state:`unreadable`,entries:null,trailingNewline:!1}}function Ce(e,t){let n=X(e,t),r=Z(n.cwd,n.bridgePath,t).state,i=Q(n.trustPath,n.cwd).state;return{...n,bridge:r,trust:i,bridgeLoadable:(r===`own-current`||r===`own-stale`)&&i===`trusted`,otherExtensions:$(n.bridgePath).names}}function $(e){let t=g(e),n=re(e);try{return{names:ae(t).filter(e=>e!==n&&e.endsWith(`.ts`)).sort(),verified:!0}}catch(e){let t=e.code;return{names:[],verified:t===`ENOENT`||t===`ENOTDIR`}}}async function we(e,t={mode:`published`},n){let r=X(e,n),i=Z(r.cwd,r.bridgePath,n);if(i.state===`foreign`)return{...r,ok:!1,bridge:`refused-foreign`,trust:`skipped`};if(i.state===`unreadable`)return{...r,ok:!1,bridge:`refused-unreadable`,trust:`skipped`};let a;if(i.state===`absent`)a=`written`;else{let e;try{e=ne(t)}catch{e=void 0}a=e!==void 0&&i.text===e?`unchanged`:`refreshed`}if(a!==`unchanged`){let e=f(l.pi,r.cwd,t,n,r.bridgePath);if(e.action!==`written`&&e.action!==`overwritten`)return{...r,ok:!1,bridge:`failed`,trust:`skipped`,error:e.error??`bridge write ${e.action}`}}let o=await Te(r.trustPath,r.cwd);return{...r,ok:o.action===`already-trusted`||o.action===`added`,bridge:a,trust:o.action,...o.error===void 0?{}:{error:o.error}}}async function Te(e,t){try{b(g(e),{recursive:!0})}catch(e){return{action:`failed`,error:e instanceof Error?e.message:String(e)}}let i={action:`added`};try{await r(`${e}.lock`,async()=>{let r=Q(e,t);if(r.state===`trusted`){i.action=`already-trusted`;return}if(r.entries===null){i.action=`refused-unreadable`;return}let a={...r.entries,[t]:!0},o=JSON.stringify(a,null,2)+(r.trailingNewline?`
|
|
5
5
|
`:``),s=u(e);n(e,o,s===void 0?void 0:{mode:s}),i.action=`added`})}catch(e){return{action:`failed`,error:e instanceof Error?e.message:String(e)}}return i.action===`refused-unreadable`?{action:`refused-unreadable`,error:`trust store is not a readable JSON object`}:{action:i.action}}function Ee(e,t){let r=X(e,t),a=$(r.bridgePath);if(!a.verified)return{action:`kept-unverified`,error:`could not read the Pi extensions folder`};if(a.names.length>0)return{action:`kept-shared`};if(!y(r.trustPath))return{action:`not-present`};let o={action:`removed`};try{i(`${r.trustPath}.lock`,()=>{let e=Q(r.trustPath,r.cwd);if(e.entries===null){o.action=e.state===`unreadable`?`refused-unreadable`:`not-present`;return}if(!(r.cwd in e.entries)){o.action=`not-present`;return}let t={...e.entries};delete t[r.cwd];let i=JSON.stringify(t,null,2)+(e.trailingNewline?`
|
|
6
6
|
`:``),a=u(r.trustPath);n(r.trustPath,i,a===void 0?void 0:{mode:a}),o.action=`removed`})}catch(e){return{action:`failed`,error:e instanceof Error?e.message:String(e)}}return o.action===`refused-unreadable`?{action:`refused-unreadable`,error:`trust store is not a readable JSON object`}:{action:o.action}}function De(e){return e===`opencode`?o:c}function Oe(e,t,n){let r=l[e],i=De(e),a=[],o=r.projectConfigPath?.(t);o!==void 0&&a.push({scope:`project`,configPath:o});try{a.push({scope:`user`,configPath:r.configPath(t,n)})}catch{}for(let o of a){let a=te(r,t,n,o.configPath);if(a!==null&&i(a))return{editorId:e,scope:o.scope,configPath:o.configPath}}return null}export{ue as _,G as a,xe as c,me as d,j as f,le as g,O as h,Ee as i,Se as l,de as m,we as n,he as o,P as p,Ce as r,be as s,Oe as t,W as u};
|
|
7
|
-
//# sourceMappingURL=acp-harness-probe-
|
|
7
|
+
//# sourceMappingURL=acp-harness-probe-Dd0_vY88.mjs.map
|