@inkeep/open-knowledge 0.8.0-beta.20 → 0.8.0-beta.22
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 +2 -1
- package/dist/cli.mjs +4 -4
- package/dist/config-schema.json +21 -1
- package/dist/config.project-local.schema.json +5 -1
- package/dist/config.user.schema.json +21 -1
- package/dist/constants-DoYWKOfq.mjs +2 -0
- package/dist/{dist-4x_d-0GF.mjs → dist-BRdwpvRU.mjs} +1 -1
- package/dist/{dist-BWAKwlW9.mjs → dist-Ca54A9UG.mjs} +13 -13
- package/dist/{gh-detect-CSW5IRNM.mjs → gh-detect-CauEoJLn.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{init-thuZWJ1y.mjs → init-CVUAGlni.mjs} +4 -4
- package/dist/init-DIl5O63L.mjs +1 -0
- package/dist/loader-7flVKLEn.mjs +1 -0
- package/dist/{loader-BOSnqU2v.mjs → loader-DEjyJycG.mjs} +2 -2
- package/dist/{preview-BbpC7NzU.mjs → preview-8GeUlQ4U.mjs} +2 -2
- package/dist/preview-xC9SBSxk.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-D8YR6SMv.js → ActivityModeContent-74fud2PX.js} +1 -1
- package/dist/public/assets/{DocumentContext-ChHEoqaV.js → DocumentContext-D0hMZvqt.js} +18 -18
- package/dist/public/assets/{GraphPanel-Dzx3Zg0v.js → GraphPanel-CAKYBrh_.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-CcDcbViP.js → SettingsDialogBody-CA5IZw_a.js} +2 -2
- package/dist/public/assets/{SourceEditor-dd-Qcqkz.js → SourceEditor-Y1rYp83q.js} +1 -1
- package/dist/public/assets/{config-validation-events-D8fQSuEW.js → config-validation-events-CpTwSaaY.js} +1 -1
- package/dist/public/assets/{index-DhsD687E.css → index-CUIPiS16.css} +1 -1
- package/dist/public/assets/{index-BcU2S6Nn.js → index-DxA-954E.js} +7 -7
- package/dist/public/assets/{prop-types-Cyh4p-YX.js → prop-types-vr6qWjMf.js} +2 -2
- package/dist/public/assets/{target-navigation-intent-gvCIKhvh.js → target-navigation-intent-BTTe7RwN.js} +1 -1
- package/dist/public/assets/{toggle-group-6WLbf3-e.js → toggle-group-BKjtvTFY.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DgfXa9sF.js → typing-burst-detector-RJxLgd3M.js} +1 -1
- package/dist/public/index.html +8 -8
- package/dist/{repair-launch-json-xn4cdXuq.mjs → repair-launch-json-D4EDx1qE.mjs} +2 -2
- package/dist/{repair-mcp-configs-B40aAdEh.mjs → repair-mcp-configs-C4W8hER9.mjs} +2 -2
- package/dist/repair-skills-BlQp9JSE.mjs +1 -0
- package/dist/{repair-skills-ClqjW2ic.mjs → repair-skills-Cjs7REOr.mjs} +2 -2
- package/dist/schemas/v0/config.project-local.schema.json +5 -1
- package/dist/schemas/v0/config.user.schema.json +21 -1
- package/dist/{src-C3n7feZn.mjs → src-BQr1GKJv.mjs} +2 -2
- package/dist/start-BGi1RpFb.mjs +1 -0
- package/dist/{start-Bs05_Fdd.mjs → start-CldQJe7l.mjs} +2 -2
- package/dist/{write-project-skill-C3aYUp9w.mjs → write-project-skill-yR3pYdTj.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-DgOkqYR5.mjs +0 -2
- package/dist/init-BasVjE6u.mjs +0 -1
- package/dist/loader-DhfiO_1K.mjs +0 -1
- package/dist/preview-B3dGmHaF.mjs +0 -1
- package/dist/repair-skills-BGSggwrg.mjs +0 -1
- package/dist/start-Crf5DM7q.mjs +0 -1
|
@@ -3,7 +3,7 @@ name: open-knowledge-discovery
|
|
|
3
3
|
description: "Read when the user asks what Open Knowledge is, wants to install it on a repository, wants to share an Open Knowledge project with collaborators, or asks how `ok init` / `ok install-skill` / OK Desktop set up a project. Do NOT load to perform Open Knowledge reads/writes — the runtime guidance for editing markdown inside an initialized OK project ships as a separate project-local skill at `.claude/skills/open-knowledge/` whenever `ok init` runs. If the user appears to be editing markdown inside a `.ok/` project and this is the only OK skill loaded, advise them to re-run `ok init` to install the project-local skill."
|
|
4
4
|
compatibility: "Any agent host — no MCP server required. Pure discovery + install guidance."
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.8.0-beta.
|
|
6
|
+
version: "0.8.0-beta.22"
|
|
7
7
|
author: "Inkeep"
|
|
8
8
|
repository: "https://github.com/inkeep/open-knowledge"
|
|
9
9
|
---
|
|
@@ -3,7 +3,7 @@ name: open-knowledge
|
|
|
3
3
|
description: "MUST invoke before reading or editing any `.md` / `.mdx` file, and before any `mcp__open-knowledge__*` tool call (`exec`, `search`, `write_document`, `edit_document`, and the rest). This skill is installed into the repository by `ok init`, so its presence alone means this is an Open Knowledge project — its runtime contract governs every markdown file here, with no need to probe for a `.ok/` directory. Authoritative agent-runtime contract; supersedes the overlapping MCP server `instructions` echo."
|
|
4
4
|
compatibility: "Claude Code, Claude Desktop, Claude Cowork, Claude.ai web. Requires Open Knowledge MCP server + code execution."
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.8.0-beta.
|
|
6
|
+
version: "0.8.0-beta.22"
|
|
7
7
|
author: "Inkeep"
|
|
8
8
|
repository: "https://github.com/inkeep/open-knowledge"
|
|
9
9
|
---
|
|
@@ -73,6 +73,7 @@ The user watches your edits land in a live browser preview. Open it once at sess
|
|
|
73
73
|
- **You have a `preview_*` tool** (e.g. `preview_start`) → call `preview_start("open-knowledge-ui")` and nothing else. The pane supplies its own origin; you never need a URL. Do NOT also call `get_preview_url`. Do NOT read, diagnose, or edit `.claude/launch.json` — that file is host-managed, and the OK lock-collision proxy handles the UI-already-running case automatically. If `preview_start` fails, report it to the user; do not try to "fix" `launch.json`.
|
|
74
74
|
- **No `preview_*` tool, but you have an in-app / built-in browser tool** — including Codex's built-in browser, and any host tool whose contract is "navigate to a URL" (`browser`, `view_url`, `open_url`, `web.browse`, host-specific names, etc.) → call `get_preview_url` once to get the full browser URL (`{ url, baseUrl, running }`), then navigate your **in-app browser** to `url`. Pass a `docName` to `get_preview_url` to jump straight to a doc, or omit it for the UI root.
|
|
75
75
|
- **Truly no browser-capable tool — if you have ANY tool that navigates to a URL, use the in-app branch above** (a pure stdio host with no URL-navigation tool at all) → call `get_preview_url`, then `open <url>` in the system browser as a last resort, and say so plainly to the user ("opening the preview in your system browser — this host has no in-app browser"). The system browser is the fallback, never the default.
|
|
76
|
+
- **Honor `autoOpen`** (on `get_preview_url`, or on `warning` for write tools). If `false`, do not open or refresh any preview UI; surface the URL only if asked.
|
|
76
77
|
|
|
77
78
|
**Opening or reading a file IS a preview navigation.** On any "open `<file>`" / "read `<file>`" request, navigate the browser to that doc's `previewUrl` route from the tool response — not a separate fetch, not a fresh system-browser launch.
|
|
78
79
|
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{o as e}from"./chunk-FK9Q3tQk.mjs";import{t}from"./esm-CEs3LWY3.mjs";import{$ as n,$r as r,Ai as i,Bi as a,D as o,Ei as s,Et as c,Fi as l,G as u,H as d,Hi as f,Ii as p,Jt as m,Kn as h,Li as g,Mi as _,Ni as v,O as ee,Oi as te,Pi as y,Pn as b,Qn as ne,Qr as re,Ri as x,Si as ie,Ui as ae,V as oe,Vi as se,Wi as ce,Zr as le,ai as ue,an as de,cn as fe,ei as pe,gr as me,h as he,it as ge,ni as _e,si as ve,st as ye,ti as be,tr as xe,yn as Se,zi as S}from"./dist-
|
|
2
|
+
import{o as e}from"./chunk-FK9Q3tQk.mjs";import{t}from"./esm-CEs3LWY3.mjs";import{$ as n,$r as r,Ai as i,Bi as a,D as o,Ei as s,Et as c,Fi as l,G as u,H as d,Hi as f,Ii as p,Jt as m,Kn as h,Li as g,Mi as _,Ni as v,O as ee,Oi as te,Pi as y,Pn as b,Qn as ne,Qr as re,Ri as x,Si as ie,Ui as ae,V as oe,Vi as se,Wi as ce,Zr as le,ai as ue,an as de,cn as fe,ei as pe,gr as me,h as he,it as ge,ni as _e,si as ve,st as ye,ti as be,tr as xe,yn as Se,zi as S}from"./dist-Ca54A9UG.mjs";import{a as Ce,n as we,r as Te,t as Ee}from"./gh-detect-CauEoJLn.mjs";import{n as De,r as Oe,t as C}from"./dist-bundle-BK4P1EQn.mjs";import{A as ke,C as Ae,D as je,E as Me,O as Ne,S as Pe,T as Fe,b as Ie,k as Le,o as Re,p as ze,w as Be,x as Ve}from"./init-CVUAGlni.mjs";import{c as He,f as Ue,l as We,n as Ge,s as w}from"./server-lock-BniQ3qki-C_0QTo_r.mjs";import{i as Ke}from"./git-handle-CjyGVy33-B_7lAMm9.mjs";import{n as qe}from"./constants-DoYWKOfq.mjs";import{i as Je}from"./src-BQr1GKJv.mjs";import{n as Ye,t as Xe}from"./loader-DEjyJycG.mjs";import{c as Ze,f as Qe,h as $e,m as et,p as tt,u as nt}from"./start-CldQJe7l.mjs";import{c as rt,i as it,n as T,o as E,r as D,s as at,t as O}from"./colors-DEbd2OH6.mjs";import{n as ot}from"./repair-skills-Cjs7REOr.mjs";import{execSync as st,spawn as k,spawnSync as A}from"node:child_process";import ct,{basename as lt,dirname as ut,isAbsolute as dt,join as j,relative as ft,resolve as M}from"node:path";import{closeSync as pt,createWriteStream as mt,existsSync as N,lstatSync as ht,mkdirSync as gt,mkdtempSync as _t,openSync as vt,readFileSync as P,readdirSync as yt,realpathSync as bt,rmSync as xt,statSync as St,unlinkSync as Ct,writeFileSync as wt}from"node:fs";import Tt from"node:process";import{freemem as Et,homedir as Dt,hostname as Ot,platform as kt,release as At,tmpdir as jt,totalmem as Mt,type as Nt,uptime as Pt}from"node:os";import{fileURLToPath as Ft}from"node:url";import{AsyncLocalStorage as It,AsyncResource as Lt}from"node:async_hooks";import{stripVTControlCharacters as Rt,styleText as F}from"node:util";import*as zt from"node:readline";import{createHash as Bt,randomUUID as Vt}from"node:crypto";import{realpath as Ht}from"node:fs/promises";import{setTimeout as Ut}from"node:timers/promises";import{createInterface as Wt}from"node:readline/promises";async function Gt(e,t,n){let r=Kt(await qt(e)).host??``;if(!r)return 1;let i=await n.get(r);if(i==null)return 1;let a=e=>e.replace(/[\r\n]/g,``);return t.write(`username=${a(i.login)}\npassword=${a(i.token)}\n`),0}function Kt(e){let t={};for(let n of e.split(`
|
|
3
3
|
`)){let e=n.trim();if(e===``)continue;let r=e.indexOf(`=`);r!==-1&&(t[e.slice(0,r)]=e.slice(r+1))}return t}function qt(e){return new Promise((t,n)=>{let r=[];e.on(`data`,e=>r.push(e)),e.on(`end`,()=>t(Buffer.concat(r).toString(`utf-8`))),e.on(`error`,n)})}function Jt(e){let n=new t(`git-credential`);return n.description(`Git credential helper (git credential-helper protocol)`),n.command(`get`).description(`Lookup credentials from TokenStore (called by git)`).action(async()=>{let t=await e(),n=await Gt(process.stdin,process.stdout,t);process.exit(n)}),n}function Yt(e){let t=e.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(t.baseUrl)?`https://github.com`:t.baseUrl.replace(`/api/v3`,``)}async function Xt(e,t,n){let r={baseUrl:Yt(e),headers:{accept:`application/json`},...n},i=await e(t,r);if(`error`in i.data){let n=new De(`${i.data.error_description} (${i.data.error}, ${i.data.error_uri})`,400,{request:e.endpoint.merge(t,r)});throw n.response=i,n}return i}async function Zt(e){let t=e.request||C,n={client_id:e.clientId};return`scopes`in e&&Array.isArray(e.scopes)&&(n.scope=e.scopes.join(` `)),Xt(t,`POST /login/device/code`,n)}async function Qt(e){let t=await Xt(e.request||C,`POST /login/oauth/access_token`,{client_id:e.clientId,device_code:e.code,grant_type:`urn:ietf:params:oauth:grant-type:device_code`}),n={clientType:e.clientType,clientId:e.clientId,token:t.data.access_token,scopes:t.data.scope.split(/\s+/).filter(Boolean)};if(`clientSecret`in e&&(n.clientSecret=e.clientSecret),e.clientType===`github-app`){if(`refresh_token`in t.data){let e=new Date(t.headers.date).getTime();n.refreshToken=t.data.refresh_token,n.expiresAt=$t(e,t.data.expires_in),n.refreshTokenExpiresAt=$t(e,t.data.refresh_token_expires_in)}delete n.scopes}return{...t,authentication:n}}function $t(e,t){return new Date(e+t*1e3).toISOString()}async function en(e,t){let n=tn(e,t.auth);if(n)return n;let{data:r}=await Zt({clientType:e.clientType,clientId:e.clientId,request:t.request||e.request,scopes:t.auth.scopes||e.scopes});await e.onVerification(r);let i=await rn(t.request||e.request,e.clientId,e.clientType,r);return e.authentication=i,i}function tn(e,t){if(t.refresh===!0||!e.authentication)return!1;if(e.clientType===`github-app`)return e.authentication;let n=e.authentication;return(`scopes`in t&&t.scopes||e.scopes).join(` `)===n.scopes.join(` `)?n:!1}async function nn(e){await new Promise(t=>setTimeout(t,e*1e3))}async function rn(e,t,n,r){try{let i={clientId:t,request:e,code:r.device_code},{authentication:a}=n===`oauth-app`?await Qt({...i,clientType:`oauth-app`}):await Qt({...i,clientType:`github-app`});return{type:`token`,tokenType:`oauth`,...a}}catch(i){if(!i.response)throw i;let a=i.response.data.error;if(a===`authorization_pending`)return await nn(r.interval),rn(e,t,n,r);if(a===`slow_down`)return await nn(r.interval+7),rn(e,t,n,r);throw i}}async function an(e,t){return en(e,{auth:t})}async function on(e,t,n,r){let i=t.endpoint.merge(n,r);if(/\/login\/(oauth\/access_token|device\/code)$/.test(i.url))return t(i);let{token:a}=await en(e,{request:t,auth:{type:`oauth`}});return i.headers.authorization=`token ${a}`,t(i)}var sn=`0.0.0-development`;function cn(e){let t=e.request||C.defaults({headers:{"user-agent":`octokit-auth-oauth-device.js/${sn} ${Oe()}`}}),{request:n=t,...r}=e,i=e.clientType===`github-app`?{...r,clientType:`github-app`,request:n}:{...r,clientType:`oauth-app`,request:n,scopes:e.scopes||[]};if(!e.clientId)throw Error(`[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)`);if(!e.onVerification)throw Error(`[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)`);return Object.assign(an.bind(null,i),{hook:on.bind(null,i)})}async function ln(e){let{clientId:t,scopes:n=[`repo`,`read:user`,`user:email`],onVerification:r,host:i}=e,a=i&&i!==`github.com`?`https://${i}/api/v3`:`https://api.github.com`,o=cn({clientType:`oauth-app`,clientId:t,scopes:n,onVerification:async e=>{await r({verificationUri:e.verification_uri,userCode:e.user_code,expiresIn:e.expires_in,interval:e.interval})},request:a===`https://api.github.com`?void 0:(await import(`./dist-bundle-CjV1Pdeo.mjs`)).request.defaults({baseUrl:a})}),s;try{s=await o({type:`oauth`})}catch(e){if(e instanceof Error){let t=e.message.toLowerCase();throw t.includes(`access_denied`)?Error(`Device-flow authorization was denied.`):t.includes(`expired_token`)||t.includes(`timeout`)||t.includes(`timed out`)?Error(`Device-flow code expired before authorization — please try again.`):Error(`GitHub sign-in failed: ${e.message}`)}throw e}return{token:s.token,tokenType:s.tokenType,scopes:s.scopes??[]}}const un={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};var dn;(function(e){})(dn||={});function fn(e){return f(_,e)}function pn(){return process.env.OPEN_KNOWLEDGE_GITHUB_CLIENT_ID??`Ov23liqlSd0V1MwR6rhI`}const mn=new Set([`gitlab.com`,`bitbucket.org`,`codeberg.org`,`gitea.com`,`sr.ht`,`sourcehut.org`]);function I(e){let t=e.toLowerCase().replace(/:\d+$/,``);mn.has(t)&&(process.stderr.write(`Error: ${e} is not a GitHub host. Only GitHub and GitHub Enterprise Server are supported.\n`),process.exit(1))}function hn(e,t){e&&process.stdout.write(`${JSON.stringify(t)}\n`)}async function gn(e,t,n=ln){let r=pn(),{host:i,json:a}=e;I(i),a||process.stderr.write(`Logging in to ${i}\n`);let o=await n({clientId:r,host:i===`github.com`?void 0:i,onVerification:e=>{e.userCode,e.verificationUri,a?hn(!0,{type:`verification`,user_code:e.userCode,verification_uri:e.verificationUri,expires_in:e.expiresIn}):process.stderr.write(`Open: ${e.verificationUri}\nEnter code: ${e.userCode}\n`)}}),s=`unknown`,c,l;try{let e=i===`github.com`?`https://api.github.com`:`https://${i}/api/v3`,t=await fetch(`${e}/user`,{headers:{Authorization:`Bearer ${o.token}`,"User-Agent":`open-knowledge-cli`,Accept:`application/vnd.github+json`}});if(t.ok){let e=await t.json();s=e.login??s,c=e.name??void 0,l=e.email??void 0}}catch{}await t.set(i,s,o.token,{gitProtocol:`https`,name:c,email:l}),a?hn(!0,{type:`complete`,host:i,login:s}):process.stderr.write(`✓ Logged in as ${s} on ${i}\n`)}function _n(e){return new t(`login`).description(`Authenticate with GitHub via Device Flow`).option(`--host <host>`,`GitHub or GitHub Enterprise hostname`,`github.com`).option(`--json`,`Output JSONL progress events`,!1).action(async t=>{await gn(t,await e())})}const vn=e=>e.name===`enter`||e.name===`return`;var yn=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},bn=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},xn=class extends Error{name=`ExitPromptError`},Sn=class extends Error{name=`HookError`},Cn=class extends Error{name=`ValidationError`};const wn=new It;function Tn(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function En(e,t){let n=Tn(e);return wn.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function L(){let e=wn.getStore();if(!e)throw new Sn(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Dn(){return L().rl}function On(e){return Lt.bind((...t)=>{let n=L(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function kn(e){let t=L(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function An(){L().handleChange()}const jn={queue(e){let t=L(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Dn());if(r!=null&&typeof r!=`function`)throw new Cn(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=L();On(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=L();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function Mn(e){return typeof e==`function`}function R(e){return kn(t=>{let n=Lt.bind(function(e){t.get()!==e&&(t.set(e),An())});if(t.initialized)return[t.get(),n];let r=Mn(e)?e():e;return t.set(r),[r,n]})}function Nn(e,t){kn(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&jn.queue(e),n.set(t)})}const Pn={prefix:{idle:F(`blue`,`?`),done:F(`green`,ke.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>F(`yellow`,e))},style:{answer:e=>F(`cyan`,e),message:e=>F(`bold`,e),error:e=>F(`red`,`> ${e}`),defaultAnswer:e=>F(`dim`,`(${e})`),help:e=>F(`dim`,e),highlight:e=>F(`cyan`,e),key:e=>F(`cyan`,F(`bold`,`<${e}>`))}};function Fn(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function In(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=Fn(n)&&Fn(r)?In(n,r):r}return t}function Ln(...e){return In(Pn,...e.filter(e=>e!=null))}function Rn({status:e=`idle`,theme:t}){let[n,r]=R(!1),[i,a]=R(0),{prefix:o,spinner:s}=Ln(t);return Nn(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function zn(e){return R({current:e})[0]}function Bn(e){let t=zn(e);t.current=e,Nn(e=>{let n=!1,r=On((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var Vn=e(Le(),1);function Hn(e,t){return e.split(`
|
|
4
4
|
`).flatMap(e=>Ne(e,t,{trim:!1,hard:!0}).split(`
|
|
5
5
|
`).map(e=>e.trimEnd())).join(`
|
|
@@ -20,10 +20,10 @@ import{o as e}from"./chunk-FK9Q3tQk.mjs";import{t}from"./esm-CEs3LWY3.mjs";impor
|
|
|
20
20
|
`),patterns:[...t],lineCount:n}}function ci(e){let t=j(e,`.ok`,`config.yml`);if(N(t))try{let e=P(t,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch{}return N(j(e,`.ok`))?Bt(`sha256`).update(M(e)).digest(`hex`).slice(0,12):null}function li(){let e={timestamp:new Date().toISOString(),platform:kt(),osType:Nt(),osRelease:At(),hostname:`[redacted]`,uptime:Pt(),freeMem:Et(),totalMem:Mt(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=st(`sw_vers -productVersion 2>/dev/null`,{encoding:`utf8`}).trim()}catch{}try{let t=j(__dirname,`..`,`..`,`package.json`);N(t)&&(e.okVersion=JSON.parse(P(t,`utf8`)).version)}catch{}return e}function ui(e){if(!N(ii))return{files:[],dir:ii};let t=yt(ii).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>j(ii,e));if(e&&t.length>0){let n=t.filter(t=>{try{return P(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});n.length>0&&(t=n)}return{files:t,dir:ii}}function di(e){let t=j(e,`.ok`,`local`);return N(t)?{files:[`server.lock`,`last-spawn-error.log`].map(e=>j(t,e)).filter(e=>N(e)),dir:t}:{files:[],dir:null}}async function fi(t){let n=bc();gt(ai,{recursive:!0});let r=j(ai,`${new Date().toISOString().replace(/[:.]/g,`-`)}-bugreport.zip`);n?.info({projectSlug:t.projectSlug},`gathering diagnostic data`);let i=li(),{files:a}=ui(t.projectSlug),{files:o}=di(t.cwd);n?.info({logFileCount:a.length,lockFileCount:o.length},`files collected`);let s=[],c=[],{ZipFile:l}=await import(`./yazl-Cw7cic8l.mjs`).then(t=>e(t.default,1)),u=new l;for(let e of a)try{let{redacted:t,patterns:n,lineCount:r}=si(P(e,`utf8`)),i=`logs/${lt(e)}`;u.addBuffer(Buffer.from(t,`utf8`),i),c.push(i),n.length>0&&s.push({file:i,lineCount:r,patterns:n})}catch{}for(let e of o)try{let{redacted:t,patterns:n,lineCount:r}=si(P(e,`utf8`)),i=`lockdir/${lt(e)}`;u.addBuffer(Buffer.from(t,`utf8`),i),c.push(i),n.length>0&&s.push({file:i,lineCount:r,patterns:n})}catch{}let d=JSON.stringify(i,null,2);u.addBuffer(Buffer.from(d,`utf8`),`sysinfo.json`),c.push(`sysinfo.json`);let f={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:t.projectSlug,files:c,redactions:s,sysinfo:i};u.addBuffer(Buffer.from(JSON.stringify(f,null,2),`utf8`),`MANIFEST.json`);let p=s.reduce((e,t)=>e+t.lineCount,0),m=[`# Bug Report Bundle`,``,`Generated: ${f.generatedAt}`,`Project: ${t.projectSlug??`(unscoped)`}`,`Discipline version: ${f.disciplineVersion}`,``,`## Contents`,``,...c.map(e=>`- ${e}`),``,`## Privacy`,``,`This bundle was auto-redacted before packaging.`,`Patterns checked: ${oi.map(e=>e.name).join(`, `)}`,p>0?`${p} line(s) were scrubbed across ${s.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.`].join(`
|
|
21
21
|
`);u.addBuffer(Buffer.from(m,`utf8`),`README.md`),u.end();let h=mt(r);if(u.outputStream.pipe(h),await new Promise((e,t)=>{h.on(`close`,e),h.on(`error`,t)}),n?.info({bundlePath:r,fileCount:c.length,redactionCount:p},`bundle written`),process.stdout.write(`${r}\n`),p>0&&process.stderr.write(`ok bug-report: ${p} line(s) auto-redacted across ${s.length} file(s)\n`),!t.noReveal&&kt()===`darwin`)try{k(`/usr/bin/open`,[`-R`,r],{detached:!0,stdio:`ignore`}).unref()}catch{}return r}function pi(){return new t(`bug-report`).description(`Generate a diagnostic bundle for bug reporting`).option(`--reveal`,`Reveal the bundle in Finder (default: true)`,!0).option(`--no-reveal`,`Do not reveal the bundle in Finder`).action(async e=>{let t=process.cwd(),n=ci(t);try{await fi({projectSlug:n,cwd:t,noReveal:!e.reveal})}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`ok bug-report: failed — ${t}\n`),process.exitCode=1}})}function V(e,t,n={}){let r=We(e,t);if(!N(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(P(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!He(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??w)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};let o=n.host??Ot();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function mi(e,t){let n=[];for(let[r,i]of[[`server`,e],[`ui`,t]])(i.status===`dead-pid`||i.status===`corrupt`)&&n.push({name:r,lockPath:i.lockPath,reason:i.status});return{prune:n}}function hi(e){let t=e.inspect??(t=>V(e.lockDir,t)),n=e.unlink??(e=>Ct(e)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=mi(t(`server`),t(`ui`));if(a.prune.length===0)return r(`No stale locks.`),{pruned:[],failed:[]};let o=[],s=[];for(let e of a.prune)try{n(e.lockPath),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}if(o.length>0){let e=o.map(e=>`${e.name} (${e.reason})`).join(`, `);r(`Pruned ${o.length} stale lock${o.length===1?``:`s`}: ${e}`)}return s.length>0&&i(`Failed to prune: ${s.map(({target:e,error:t})=>`${e.name} (${e.lockPath}): ${t}`).join(`; `)}`),{pruned:o,failed:s}}function gi(e){return new t(`clean`).description(`Prune stale / corrupt open-knowledge lock files (never touches live locks)`).action(()=>{e(),hi({lockDir:xe(process.cwd())}).failed.length>0&&(process.exitCode=1)})}async function _i(e,t,n={},r=Ee){if(!n.skipGhDetect&&r().available)return{tier:`A`,credentialArgs:[`-c`,`credential.helper=!gh auth git-credential`]};let i=await t.get(e);return i==null?{tier:`none`,credentialArgs:[]}:{tier:i.gitProtocol===`ssh`?`C`:`B`,credentialArgs:[`-c`,`credential.helper=!open-knowledge auth git-credential`]}}async function vi(e,t,n=fetch){let r=new AbortController,i=setTimeout(()=>r.abort(),5e3);try{return(await n(`https://api.github.com/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{signal:r.signal,headers:{"User-Agent":`open-knowledge-cli`,Accept:`application/vnd.github+json`}})).status===200}catch{return!1}finally{clearTimeout(i)}}const yi=[[`count`,0,10],[`compress`,10,20],[`receiv`,20,60],[`resolv`,60,100]];function bi(e){let t=/^([\w ]+):\s+(\d+)%/.exec(e.trim());if(!t)return null;let n=t[1].toLowerCase(),r=Number(t[2]);for(let[e,i,a]of yi)if(n.includes(e))return{stage:t[1],pct:Math.round(i+r/100*(a-i))};return null}function H(e,t){e&&process.stdout.write(`${JSON.stringify(t)}\n`)}function xi(e){return typeof e!=`string`||e.length===0?[`--progress`]:[`--progress`,`-b`,e]}const Si=te;async function Ci(e){try{return await e.clone(xi(e.branch)),{fellBack:!1}}catch(t){if(e.branch!==null&&Si(t))return e.onFallback(e.branch),await e.clone(xi(null)),{fellBack:!0};throw t}}function wi(e,t,n){return e===`https`&&t===`github.com`&&n}async function Ti(e,t,n,r=process.cwd()){let i=Je(e);if(!i)throw Error(`Invalid git URL: ${e}`);let a=t.dir?M(r,t.dir):M(r,i.name);if(N(a)&&yt(a).length>0)throw Error(`Target directory is not empty: ${a}`);let o=Ce(),s=i.protocol===`https`&&i.hostname===`github.com`?await vi(i.owner,i.name):!1,c=wi(i.protocol,i.hostname,s)?{tier:`none`,credentialArgs:[]}:await _i(i.hostname,o,{}),l=Ke({baseDir:r,config:c.credentialArgs.length>=2?[c.credentialArgs[1]]:[],unsafe:{allowUnsafeCredentialHelper:!0}}).env({GIT_TERMINAL_PROMPT:`0`}),u=-1;l.outputHandler((e,n,r)=>{r.on(`data`,e=>{let n=e.toString(`utf-8`);for(let e of n.split(`
|
|
22
22
|
`)){let n=bi(e);n&&n.pct!==u&&(u=n.pct,H(t.json,{type:`progress`,pct:n.pct,stage:n.stage}),t.json||process.stderr.write(`\r Cloning ${n.pct}%`))}})}),await Ci({branch:typeof t.branch==`string`&&t.branch.length>0?t.branch:null,clone:t=>l.clone(e,a,t),onFallback:e=>{H(t.json,{type:`branch-fallback`,branch:e}),t.json||process.stderr.write(`\n Branch '${e}' not found upstream — cloning default branch instead.\n`)}}),t.json||process.stderr.write(`
|
|
23
|
-
`);try{let{runInit:e}=await import(`./init-
|
|
23
|
+
`);try{let{runInit:e}=await import(`./init-DIl5O63L.mjs`),n=await e({cwd:a,mcp:!1});if(n.contentUpdated.length>0){let e=`auto-init: updated ${n.contentUpdated.join(`, `)}`;t.json?H(!0,{type:`warning`,message:e}):process.stderr.write(` ${e}\n`)}}catch(e){let n=e instanceof Error?e.message:String(e);t.json?H(!0,{type:`warning`,message:`auto-init: ${n}`}):process.stderr.write(` auto-init: ${n}\n`)}try{Ei(a)}catch(e){let n=e instanceof Error?e.message:String(e);t.json?H(!0,{type:`warning`,message:`git-exclude: ${n}`}):process.stderr.write(` git-exclude: ${n}\n`)}return a}function Ei(e){let t=j(e,`.git`,`info`,`exclude`);if(!N(t))return`no-exclude`;let n=P(t,`utf-8`),r=new Set([`.ok`,`.ok/`,`/.ok`,`/.ok/`]);return n.split(`
|
|
24
24
|
`).map(e=>e.trim()).some(e=>r.has(e))?`already-present`:(wt(t,`${n}${n.length===0||n.endsWith(`
|
|
25
25
|
`)?``:`
|
|
26
|
-
`}.ok/\n`,`utf-8`),`appended`)}function Di(e){return new t(`clone`).description(`Clone a git repository and open it`).argument(`<url>`,`Repository URL or owner/repo shorthand`).argument(`[dir]`,`Target directory (default: ./<repo-name>)`).option(`--json`,`Output JSONL progress events`,!1).option(`-b, --branch <branch>`,`Branch to check out (falls back to default if missing)`).action(async(t,n,r)=>{let i=e();try{let a=await Ti(t,{json:r.json,dir:n,branch:r.branch??null},i);if(r.json)H(!0,{type:`complete`,dir:a});else{process.stderr.write(`✓ Cloned to ${a}\n`),process.chdir(a);let{startCommand:t}=await import(`./start-
|
|
26
|
+
`}.ok/\n`,`utf-8`),`appended`)}function Di(e){return new t(`clone`).description(`Clone a git repository and open it`).argument(`<url>`,`Repository URL or owner/repo shorthand`).argument(`[dir]`,`Target directory (default: ./<repo-name>)`).option(`--json`,`Output JSONL progress events`,!1).option(`-b, --branch <branch>`,`Branch to check out (falls back to default if missing)`).action(async(t,n,r)=>{let i=e();try{let a=await Ti(t,{json:r.json,dir:n,branch:r.branch??null},i);if(r.json)H(!0,{type:`complete`,dir:a});else{process.stderr.write(`✓ Cloned to ${a}\n`),process.chdir(a);let{startCommand:t}=await import(`./start-BGi1RpFb.mjs`);await t(e).parseAsync([],{from:`user`})}}catch(e){let t=e instanceof Error?e.message:String(e);r.json?H(!0,{type:`error`,message:t}):process.stderr.write(`✗ ${t}\n`),process.exitCode=1}})}var Oi=ce();const ki=[[`sync`],[`persistence`,`debounceMs`],[`persistence`,`maxDebounceMs`],[`server`,`port`],[`content`,`include`],[`content`,`exclude`]];function Ai(e={}){let t=e.log??(e=>console.error(e)),n=e.error??(e=>console.error(e)),r=e.loadConfigFn??Ye;try{let{sources:n}=r(e.cwd);return t(`✓ Configuration valid (sources: ${n.length===0?`defaults only`:n.join(`, `)})`),{ok:!0}}catch(e){return n(e instanceof Error?e.message:String(e)),{ok:!1}}}function ji(e){let t=(0,Oi.parseDocument)(P(e,`utf-8`));if(t.errors.length>0)throw Error(`Could not parse ${e}: ${t.errors.map(e=>e.message).join(`; `)}`);let n=[];for(let e of ki)t.hasIn(e)&&n.push(e.join(`.`));return n}function Mi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ni(e){let t={};for(let n of e){let e=t;for(let t=0;t<n.length-1;t++){let r=n[t],i=e[r],a=Mi(i)?i:{};e[r]=a,e=a}e[n[n.length-1]]=null}return t}async function Pi(e={}){let t=e.log??(e=>console.log(e)),n=e.error??(e=>console.error(e)),r=e.scope??`both`,i=e.dryRun??!1,a=e.cwd??process.cwd(),o=e.writeConfigPatchFn??ve,c=[];(r===`project`||r===`both`)&&c.push({scope:`project`,absPath:ue(`project`,a,e.homedirOverride)}),(r===`user`||r===`both`)&&c.push({scope:`user`,absPath:ue(`user`,a,e.homedirOverride)});let l=[],u=!0;for(let{scope:t,absPath:n}of c){if(!N(n)){l.push({path:n,scope:t,found:[],removed:[]});continue}let r;try{r=ji(n)}catch(e){let r=e instanceof Error?e.message:String(e);l.push({path:n,scope:t,found:[],removed:[],error:r}),u=!1;continue}if(r.length===0||i){l.push({path:n,scope:t,found:r,removed:[]});continue}let c=await o({cwd:a,scope:t,patch:Ni(ki.filter(e=>r.includes(e.join(`.`)))),homedirOverride:e.homedirOverride});if(!c.ok){l.push({path:n,scope:t,found:r,removed:[],error:s(c.error)}),u=!1;continue}l.push({path:n,scope:t,found:r,removed:r})}for(let e of l)e.error&&n(`✗ ${e.path}: ${e.error}`);let d=l.some(e=>e.error!==void 0),f=l.reduce((e,t)=>e+t.found.length,0);if(f===0&&!d)t(`No deprecated fields found.`);else if(f>0)for(let e of l)e.error||(e.found.length===0?t(` ${e.path}: no deprecated fields`):t(i?`[dry-run] ${e.path}: would remove ${e.found.length} field(s): ${e.found.join(`, `)}`:`✓ ${e.path}: removed ${e.removed.length} field(s): ${e.removed.join(`, `)}`));return{outcomes:l,ok:u}}function Fi(){let e=new t(`config`).description(`Inspect and maintain Open Knowledge configuration files`);return e.command(`validate`).description(`Validate the merged config (defaults → user → project)`).action(()=>{Ai({}).ok||(process.exitCode=1)}),e.command(`migrate`).description(`Remove deprecated config fields (sync.*, persistence.{debounceMs,maxDebounceMs}, server.port, content.{include,exclude}) idempotently`).option(`--scope <scope>`,`Which scope to migrate: project | user | both`,`both`).option(`--dry-run`,`Preview without writing`,!1).action(async e=>{let t=e.scope;if(t!==`project`&&t!==`user`&&t!==`both`){console.error(`Invalid --scope: ${t}. Expected: project | user | both`),process.exitCode=2;return}(await Pi({scope:t,dryRun:e.dryRun})).ok||(process.exitCode=1)}),e}var U=e(rt(),1);const W=2e3,Ii=2e3,Li=[/cli\.mjs/,/(^|[\s/])(open-knowledge|ok)\s+(start|mcp|ui)(\s|$)/,/Open Knowledge(?:\.app| Helper)/,/(^|[\s/])bun([\s/]).*?(run dev|packages\/app|vite|hocuspocus)/,/(^|[\s/])node([\s/]).*?(packages\/(cli|app)|vite|hocuspocus)/,/(^|\s)--ok-lock-dir-b64=/,/(^|\s)--ok-project-path=/];function Ri(e){return Li.some(t=>t.test(e))}function zi(e){let t=e.trim().split(/\s+/).find(e=>e.startsWith(`--ok-lock-dir-b64=`));if(t==null)return null;let n=t.slice(18);if(!n)return null;try{let e=Buffer.from(n,`base64url`).toString(`utf8`);return dt(e)?e:null}catch{return null}}function Bi(e){let t=e.indexOf(`--ok-project-path=`);if(t===-1)return null;let n=t+18,r=e.slice(n),i=r.search(/\s--/),a=(i===-1?r:r.slice(0,i)).trim();return a&&dt(a)?a:null}function Vi(e){let t=[];for(let n of e.split(`
|
|
27
27
|
`)){let e=n.trim();if(!e)continue;let r=e.indexOf(` `);if(r===-1)continue;let i=e.slice(0,r),a=e.slice(r+1),o=Number.parseInt(i,10);!Number.isNaN(o)&&Ri(a)&&t.push({pid:o,command:a})}return t}function Hi(e){let t=[],n=e.split(`
|
|
28
28
|
`);for(let e=1;e<n.length;e++){let r=n[e]?.trim();if(!r)continue;let i=r.indexOf(` `);if(i===-1)continue;let a=r.slice(0,i),o=r.slice(i+1).trim(),s=Number.parseInt(a,10);!Number.isNaN(s)&&Ri(o)&&t.push({pid:s,command:o})}return t}async function Ui(){let e=A(`pgrep`,[`-a`,`-f`,`cli\\.mjs|open-knowledge|Open Knowledge(\\.app| Helper)|--ok-lock-dir-b64=|--ok-project-path=|(^|[ /])ok[ ]+(start|mcp|ui)([ ]|$)|packages/(cli|app)|hocuspocus|vite`],{encoding:`utf-8`,timeout:W});if(!(e.error!=null&&e.error.code===`ENOENT`)){let t=e.stdout??``,n=Vi(t);if(n.length>0||t.trim()===``)return n}let t=A(`ps`,[`-axo`,`pid,command`],{encoding:`utf-8`,timeout:W});return t.error!=null||!t.stdout?[]:Hi(t.stdout)}function Wi(e){let t=e.trim().split(/\s+/).filter(Boolean);for(let e of t){if(e.startsWith(`@`))continue;let t=lt(e);if(t===`open-knowledge`||t===`ok`||e.endsWith(`/packages/cli/src/cli.ts`)||e.endsWith(`/packages/cli/dist/cli.mjs`)||t===`cli.mjs`||t===`cli.ts`)return e}return null}function Gi(e){let t=A(`ps`,[`-p`,String(e),`-o`,`command=`],{encoding:`utf-8`,timeout:W});return t.error!=null||!t.stdout?null:t.stdout.trim()||null}function Ki(e){let t=A(`ps`,[`-p`,String(e),`-o`,`%cpu=,%mem=`],{encoding:`utf-8`,timeout:W});if(t.error!=null||!t.stdout)return null;let[n,r]=t.stdout.trim().split(/\s+/),i=Number.parseFloat(n??``),a=Number.parseFloat(r??``);return Number.isNaN(i)||Number.isNaN(a)?null:{cpuPercent:i,memPercent:a}}async function qi(e){let t=A(`lsof`,[`-p`,String(e),`-a`,`-d`,`cwd`,`-Fn`],{encoding:`utf-8`,timeout:W});if(t.error!=null)return null;let n=t.stdout??``;for(let e of n.split(`
|
|
29
29
|
`))if(e.startsWith(`n`)&&e.length>1)return e.slice(1);return null}function Ji(e){let t=[],n=e.split(`
|
|
@@ -60,7 +60,7 @@ setTimeout(() => process.exit(2), ${t+1e4});
|
|
|
60
60
|
`,r),o=-1;if(i!==-1&&a!==-1?o=Math.min(i,a):i===-1?a!==-1&&(o=a):o=i===e.length-1?-1:i,o===-1){n=e.slice(r);break}else{let n=e.slice(r,o);t.push(n),r=o+1,e[r-1]===`\r`&&e[r]===`
|
|
61
61
|
`&&r++}}return[t,n]}var Jo=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(i){r=Ko({onEvent:e=>{i.enqueue(e)},onError(t){e===`terminate`?i.error(t):typeof e==`function`&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}};const Yo={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};var Y=class extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}},Xo=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=Ma(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??Yo}async _authThenStart(){if(!this._authProvider)throw new J(`No auth provider`);let e;try{e=await Co(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(e){throw this.onerror?.(e),e}if(e!==`AUTHORIZED`)throw new J;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let t=await this._authProvider.tokens();t&&(e.Authorization=`Bearer ${t.access_token}`)}this._sessionId&&(e[`mcp-session-id`]=this._sessionId),this._protocolVersion&&(e[`mcp-protocol-version`]=this._protocolVersion);let t=ja(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){let{resumptionToken:t}=e;try{let n=await this._commonHeaders();n.set(`Accept`,`text/event-stream`),t&&n.set(`last-event-id`,t);let r=await(this._fetch??fetch)(this._url,{method:`GET`,headers:n,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new Y(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(e){throw this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*n**+e,r)}_scheduleReconnection(e,t=0){let n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(n=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,n){if(!e)return;let{onresumptiontoken:r,replayMessageId:i}=t,a,o=!1,s=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new Jo({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(a=e.id,o=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=re.parse(JSON.parse(e.data));_e(t)&&(s=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`))}}})()}async start(){if(this._abortController)throw Error(`StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.`);this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new J(`No auth provider`);if(await Co(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new J(`Failed to authorize`)}async close(){this._reconnectionTimeout&&=(clearTimeout(this._reconnectionTimeout),void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{let{resumptionToken:n,onresumptiontoken:r}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:be(e)?e.id:void 0}).catch(e=>this.onerror?.(e));return}let i=await this._commonHeaders();i.set(`content-type`,`application/json`),i.set(`accept`,`application/json, text/event-stream`);let a={...this._requestInit,method:`POST`,headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,a),s=o.headers.get(`mcp-session-id`);if(s&&(this._sessionId=s),!o.ok){let t=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Y(401,`Server returned 401 after successful authentication`);let{resourceMetadataUrl:t,scope:n}=Do(o);if(this._resourceMetadataUrl=t,this._scope=n,await Co(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new J;return this._hasCompletedAuthFlow=!0,this.send(e)}if(o.status===403&&this._authProvider){let{resourceMetadataUrl:t,scope:n,error:r}=Do(o);if(r===`insufficient_scope`){let r=o.headers.get(`WWW-Authenticate`);if(this._lastUpscopingHeader===r)throw new Y(403,`Server returned 403 after trying upscoping`);if(n&&(this._scope=n),t&&(this._resourceMetadataUrl=t),this._lastUpscopingHeader=r??void 0,await Co(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!==`AUTHORIZED`)throw new J;return this.send(e)}}throw new Y(o.status,`Error POSTing to endpoint: ${t}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,o.status===202){await o.body?.cancel(),pe(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let c=(Array.isArray(e)?e:[e]).filter(e=>`method`in e&&`id`in e&&e.id!==void 0).length>0,l=o.headers.get(`content-type`);if(c)if(l?.includes(`text/event-stream`))this._handleSseStream(o.body,{onresumptiontoken:r},!1);else if(l?.includes(`application/json`)){let e=await o.json(),t=Array.isArray(e)?e.map(e=>re.parse(e)):[re.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await o.body?.cancel(),new Y(-1,`Unexpected content type: ${l}`);else await o.body?.cancel()}catch(e){throw this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:`DELETE`,headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,t);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Y(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};function Zo(e){return(t,n)=>{if((n?.method??`GET`).toUpperCase()===`GET`)return globalThis.fetch(t,n);let r=new AbortController,i=setTimeout(()=>r.abort(Error(`MCP request timed out after ${e}ms`)),e),a=n?.signal instanceof AbortSignal?AbortSignal.any([n.signal,r.signal]):r.signal;return globalThis.fetch(t,{...n,signal:a}).finally(()=>clearTimeout(i))}}function Qo(e){if(e===void 0||e===``)return;let t=Number.parseInt(e,10);if(!(Number.isNaN(t)||t<=0))return t}function $o(e){return e===`0.0.0.0`||e===`::`?`localhost`:e.includes(`:`)&&!e.startsWith(`[`)?`[${e}]`:e}function es(e,t){return`http://${$o(e)}:${t}/mcp`}function ts(e,t){return`ws://${$o(e)}:${t}`}function ns(e){let t=new URL(e);return t.protocol=t.protocol===`https:`?`wss:`:`ws:`,t.pathname=``,t.search=``,t.hash=``,t.toString().replace(/\/$/,``)}function rs(e,t){if(!(!e||e.port<=0)&&t(e.pid))return e.port}function is(e){return N(e)?P(e,`utf-8`).trim():``}function as(e,t){return`server did not start within ${e}ms${t?` stderr:\n${t}`:``}`}function os(e){if(e&&typeof e==`object`&&`method`in e&&`id`in e)return e.id}function ss(e){if(!e||typeof e!=`object`||!(`result`in e))return;let t=e.result;if(!t||typeof t!=`object`||!(`protocolVersion`in t))return;let n=t.protocolVersion;return typeof n==`string`?n:void 0}function cs(e,t){return{jsonrpc:`2.0`,id:e,error:{code:-32e3,message:t instanceof Error?t.message:String(t)}}}async function ls(e){let t=e.readLock??(()=>Ue(e.lockDir)),n=e.isAlive??w,r=e.sleep??(e=>Ut(e)),i=e.spawn??k,a=e.readErrorLog??is,o=e.openErrorLog??(e=>vt(e,`w`)),s=e.closeFd??pt,c=e.timeoutMs??5e3,l=e.pollIntervalMs??100;if(e.portOverride!==void 0){let t=Number.parseInt(e.portOverride,10);if(Number.isNaN(t)||t<=0)throw Error(`invalid --port value '${e.portOverride}' — HTTP MCP shim requires a positive port`);return es(`localhost`,t)}let u=rs(t(),n);if(u!==void 0)return es(`localhost`,u);if(e.envAutoStart===`0`)throw Error(`Open Knowledge server is not running and OK_MCP_AUTOSTART=0 disables auto-start.`);N(e.lockDir)||gt(e.lockDir,{recursive:!0});let d=j(e.lockDir,ie),f=o(d),p,m,h=Qe();try{try{p=i(h.command,[...h.prefixArgs,`start`],{detached:!0,stdio:[`ignore`,`ignore`,f],cwd:e.contentDir,env:{...process.env,OK_LOCK_KIND:`mcp-spawned`}}),p.on(`error`,e=>{m=e instanceof Error?e.message:String(e)}),p.unref()}catch(e){m=e instanceof Error?e.message:String(e)}}finally{try{s(f)}catch{}}let g=Date.now()+c;for(;Date.now()<g;){if(m){let e=a(d),t=e?` stderr:\n${e}`:``;throw Error(`spawn failed: ${m}${t}`)}await r(l);let e=rs(t(),n);if(e!==void 0)return es(`localhost`,e)}if(m){let e=a(d),t=e?` stderr:\n${e}`:``;throw Error(`spawn failed: ${m}${t}`)}throw Error(as(c,a(d)))}function us(e,t){if(e.portOverride!==void 0)return ns(t);let n=e.readLock??(()=>Ue(e.lockDir)),r=e.isAlive??w,i=rs(n(),r);if(i!==void 0)return ts(`localhost`,i)}async function ds(e,t={}){let n=t.stderr??process.stderr,r=t.requestTimeoutMs??12e4,i=t.createStdioTransport?t.createStdioTransport(t.stdin,t.stdout):new Ea(t.stdin,t.stdout),a=t.createHttpTransport?t.createHttpTransport(new URL(e)):new Xo(new URL(e),{fetch:Zo(r),...t.connectionId===void 0?{}:{requestInit:{headers:{[o]:t.connectionId}}}}),s=!1,c=async()=>{s||(s=!0,t.onclose?.(),await Promise.allSettled([i.close(),a.close()]))};i.onerror=e=>{n.write(`[mcp-shim] stdio error: ${e.message}\n`)},a.onerror=e=>{n.write(`[mcp-shim] HTTP transport error: ${e.message}\n`)},i.onclose=()=>{c()},a.onclose=()=>{c()};let l=Promise.resolve();i.onmessage=e=>{l=l.then(async()=>{try{await a.send(e)}catch(t){let r=os(e);if(r===void 0){n.write(`[mcp-shim] failed to forward stdio notification: ${t instanceof Error?t.message:String(t)}\n`);return}await i.send(cs(r,t)).catch(e=>{n.write(`[mcp-shim] failed to write stdio error response: ${e instanceof Error?e.message:String(e)}\n`)})}}).catch(e=>{n.write(`[mcp-shim] unexpected stdio forwarding failure: ${e instanceof Error?e.message:String(e)}\n`)})},a.onmessage=e=>{let t=ss(e);t&&a.setProtocolVersion?.(t),i.send(e).catch(e=>{n.write(`[mcp-shim] failed to write stdio response: ${e instanceof Error?e.message:String(e)}\n`)})};try{await a.start(),await i.start()}catch(e){throw await c(),e}return{close:c}}async function fs(e){let t=e.stderr??process.stderr,n=e.bridgeFn??ds,r=await ls(e),i=e.createConnectionId?.()??Vt(),a=!1,o=(e.startKeepalive??Sa)({connectionId:i,resolveWsUrl:async()=>us(e,r),log:e=>t.write(`[mcp-shim] keepalive: ${e}\n`)});t.write(`[mcp-shim] proxying stdio to ${r}\n`);let s;try{s=await n(r,{stderr:t,connectionId:i,onclose:()=>{a||(o.close(),process.exit(0))}})}catch(e){throw o.close(),e}let c=()=>{a=!0,o.close(),s.close().finally(()=>{process.exit(0)})};process.once(`SIGINT`,c),process.once(`SIGTERM`,c)}const ps=Ft(import.meta.url);function ms(e){let t=M(e);for(;;){if(Se(t))return t;let n=ut(t);if(n===t)throw Error(`No Open Knowledge project found at or above ${e}. Pass an explicit \`cwd\` argument that points inside an OK project (a directory with a \`${i}\`).`);t=n}}function hs(e){try{let t=new URL(e);return t.protocol===`file:`?Ft(t):void 0}catch{return}}async function gs(e){if(!e.getClientCapabilities()?.roots)return;let t;try{t=await e.listRoots()}catch(t){e.log?.(`listRoots fallback failed: ${t instanceof Error?t.message:String(t)}`);return}let n=t.roots??[];if(n.length!==1)return;let r=hs(n[0].uri);return r===void 0&&e.log?.(`single root URI not usable as fs path: ${n[0].uri}`),r}async function _s(e,t){if(e!==void 0)return ms(e);let n=await t();if(n!==void 0)return ms(n);throw Error("`cwd` is required for tool calls against the global MCP server. Pass an absolute path inside an Open Knowledge project, or have the MCP client advertise a single root.")}async function vs(e){let t=process.stderr,n=e.spawnTimeoutMs??Qo(process.env.OK_MCP_SPAWN_TIMEOUT_MS),r=e.envAutoStart??process.env.OK_MCP_AUTOSTART,i=Xe({startupCwd:e.startupCwd,startupConfig:e.startupConfig}),a=new le({name:ee,version:Ge},{instructions:ye({dir:`.`})});fe(a);let o=Vt(),s={current:{connectionId:o,displayName:o,colorSeed:o}},c=new Map,l=e=>{if(c.has(e))return;let n=m(e),r=s.current,i=Sa({connectionId:o,displayName:r.displayName,clientName:r.clientInfo?.name??r.displayName,colorSeed:r.colorSeed,resolveWsUrl:async()=>us({lockDir:n,contentDir:e},``),log:n=>t.write(`[mcp] keepalive[${e}]: ${n}\n`)});c.set(e,i)},u=()=>gs({getClientCapabilities:()=>a.server.getClientCapabilities(),listRoots:()=>a.server.listRoots(),log:e=>t.write(`[mcp] ${e}\n`)}),d=e=>_s(e,u),f=async e=>{let t;if(e===void 0){let e=await u();if(e===void 0)return;t=ms(e)}else t=ms(e);let a=await i(t),o=await ls({lockDir:m(t),contentDir:ne(a,t),envAutoStart:r,...n===void 0?{}:{timeoutMs:n}});return l(t),o.replace(/\/mcp$/,``)};a.server.oninitialized=()=>{let e=a.server.getClientVersion(),t=me(e?.name,o);s.current={connectionId:o,clientInfo:e?{name:t,version:e.version}:void 0,displayName:t,colorSeed:t}},h(a,{serverUrl:f,resolveCwd:d,config:i,identityRef:s});let p=new Ea,g=!1,_,v=async()=>{if(g)return;g=!0,_?.stop();for(let e of c.values())try{e.close()}catch(e){t.write(`[mcp] keepalive close error: ${e instanceof Error?e.message:String(e)}\n`)}c.clear();let e=await Promise.allSettled([a.close(),p.close()]);for(let n of e)if(n.status===`rejected`){let e=n.reason;t.write(`[mcp] shutdown close error: ${e instanceof Error?e.message:String(e)}\n`)}};await a.connect(p),t.write(`[mcp] global stdio server ready (per-call project routing)
|
|
62
62
|
`);let te=!1,y=()=>{te||(te=!0,setTimeout(()=>{t.write(`[mcp] shutdown deadline (5s) reached — forcing exit(1)
|
|
63
|
-
`),process.exit(1)},5e3).unref(),v().finally(()=>{process.exit(0)}))};if(process.once(`SIGINT`,y),process.once(`SIGTERM`,y),Aa({log:e=>t.write(`${e}\n`),transport:p,process,stdin:process.stdin}),process.platform===`darwin`){let e=ka(ps,{realpathSync:bt,statInoSync:e=>St(e).ino,log:e=>t.write(`${e}\n`)});if(e!==void 0){t.write(`[mcp] bundle identity anchor=${e.resolvedPath} inode=${e.inode} version=${Ge}\n`);let{resolvedPath:n,inode:r}=e;_=Oa({detect:()=>Da({bundleAnchorPath:ps,currentInode:r,platform:process.platform,realpath:bt,statInode:e=>St(e).ino}),onReplaced:e=>{t.write(`[mcp] bundle replaced anchor=${n} bootInode=${e.currentInode} onDiskInode=${e.onDiskInode} version=${Ge} — exiting for host respawn\n`),y()},log:e=>t.write(`[mcp] ${e}\n`)})}}return{close:v}}function ys(e){return new t(`mcp`).description(`Start MCP stdio server for project knowledge base`).option(`-p, --port <port>`,`Override per-call routing and proxy stdio to this HTTP MCP port (skips bundle proxy)`,void 0).option(`--no-bundle-proxy`,`Run the npm-fetched MCP server in-process instead of proxying to the macOS Desktop bundle (equivalent: OK_BUNDLE_PROXY=0)`).action(async t=>{try{let n=e(),r=process.cwd();if(t.port!==void 0){let e=Qo(process.env.OK_MCP_SPAWN_TIMEOUT_MS);await fs({lockDir:``,contentDir:``,portOverride:t.port,envAutoStart:process.env.OK_MCP_AUTOSTART,timeoutMs:e});return}let i=t.bundleProxy===!1?[...process.argv,`--no-bundle-proxy`]:process.argv,a=ya(process.env,i,process.platform);if(a.proxy){let e=va(process.platform,Dt(),{existsSync:N});if(e===null)ba({stderr:process.stderr,mode:`fallback-absent`,bundlePath:null,reason:`no installed Open Knowledge.app bundle found`});else try{await xa({bundlePath:e,argv:process.argv.slice(2),env:process.env,stderr:process.stderr});return}catch(t){ba({stderr:process.stderr,mode:`fallback-exec-failed`,bundlePath:e,reason:t instanceof Error?t.message:String(t)})}}else{let e=a.suppressedBy===`env`?`suppressed-env`:a.suppressedBy===`flag`?`suppressed-flag`:a.suppressedBy===`self`?`suppressed-self`:`suppressed-platform`;ba({stderr:process.stderr,mode:e,bundlePath:null,reason:null})}await vs({startupCwd:r,startupConfig:n})}catch(e){process.stderr.write(`MCP server failed to start: ${e instanceof Error?e.message:String(e)}\n`),process.exitCode=1}})}function bs(e){return new t(`preview`).description(`Show what content the watcher will track (read-only)`).action(async()=>{let{previewContent:t,formatPreviewBlock:n}=await import(`./preview-
|
|
63
|
+
`),process.exit(1)},5e3).unref(),v().finally(()=>{process.exit(0)}))};if(process.once(`SIGINT`,y),process.once(`SIGTERM`,y),Aa({log:e=>t.write(`${e}\n`),transport:p,process,stdin:process.stdin}),process.platform===`darwin`){let e=ka(ps,{realpathSync:bt,statInoSync:e=>St(e).ino,log:e=>t.write(`${e}\n`)});if(e!==void 0){t.write(`[mcp] bundle identity anchor=${e.resolvedPath} inode=${e.inode} version=${Ge}\n`);let{resolvedPath:n,inode:r}=e;_=Oa({detect:()=>Da({bundleAnchorPath:ps,currentInode:r,platform:process.platform,realpath:bt,statInode:e=>St(e).ino}),onReplaced:e=>{t.write(`[mcp] bundle replaced anchor=${n} bootInode=${e.currentInode} onDiskInode=${e.onDiskInode} version=${Ge} — exiting for host respawn\n`),y()},log:e=>t.write(`[mcp] ${e}\n`)})}}return{close:v}}function ys(e){return new t(`mcp`).description(`Start MCP stdio server for project knowledge base`).option(`-p, --port <port>`,`Override per-call routing and proxy stdio to this HTTP MCP port (skips bundle proxy)`,void 0).option(`--no-bundle-proxy`,`Run the npm-fetched MCP server in-process instead of proxying to the macOS Desktop bundle (equivalent: OK_BUNDLE_PROXY=0)`).action(async t=>{try{let n=e(),r=process.cwd();if(t.port!==void 0){let e=Qo(process.env.OK_MCP_SPAWN_TIMEOUT_MS);await fs({lockDir:``,contentDir:``,portOverride:t.port,envAutoStart:process.env.OK_MCP_AUTOSTART,timeoutMs:e});return}let i=t.bundleProxy===!1?[...process.argv,`--no-bundle-proxy`]:process.argv,a=ya(process.env,i,process.platform);if(a.proxy){let e=va(process.platform,Dt(),{existsSync:N});if(e===null)ba({stderr:process.stderr,mode:`fallback-absent`,bundlePath:null,reason:`no installed Open Knowledge.app bundle found`});else try{await xa({bundlePath:e,argv:process.argv.slice(2),env:process.env,stderr:process.stderr});return}catch(t){ba({stderr:process.stderr,mode:`fallback-exec-failed`,bundlePath:e,reason:t instanceof Error?t.message:String(t)})}}else{let e=a.suppressedBy===`env`?`suppressed-env`:a.suppressedBy===`flag`?`suppressed-flag`:a.suppressedBy===`self`?`suppressed-self`:`suppressed-platform`;ba({stderr:process.stderr,mode:e,bundlePath:null,reason:null})}await vs({startupCwd:r,startupConfig:n})}catch(e){process.stderr.write(`MCP server failed to start: ${e instanceof Error?e.message:String(e)}\n`),process.exitCode=1}})}function bs(e){return new t(`preview`).description(`Show what content the watcher will track (read-only)`).action(async()=>{let{previewContent:t,formatPreviewBlock:n}=await import(`./preview-xC9SBSxk.mjs`),r=e(),i=process.cwd(),a=ne(r,i),o;try{o=t({projectDir:i,contentDir:a})}catch(e){console.error(`Content preview failed: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1;return}process.stdout.write(`${n(o,i)}\n`),o.totalCount===0&&o.warnings.length>0&&(process.exitCode=1)})}function xs(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function Ss(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 Cs(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:Wi(r),command:r,isDesktop:xs(r)}}function ws(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Ts(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&ws(e)?`ui-orphan`:`stale`}const Es=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function Ds(e){switch(e){case`running`:return U.default.green(e);case`desktop`:return U.default.blue(e);case`foreign`:return U.default.cyan(e);case`ui-orphan`:return U.default.magenta(e);case`stale`:return U.default.yellow(e)}}function Os(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function ks(e){return`${Os(e.server.usage)} | ${Os(e.ui?.usage??null)}`}function As(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function js(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=Ts(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,As(e),ks(e),t,String(n),Ss(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=Ds(Ts(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=U.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
64
64
|
`)}async function Ms(e={}){let t=e.discover??Qi,n=e.inspect??V,r=e.log??(e=>console.log(e)),i=e.resolveCommand??Gi,a=e.resolveUsage??Ki,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=Cs(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:Ts(e)}));r(JSON.stringify(e,null,2));return}r(js(e.all?s:s.filter(e=>Es.has(Ts(e)))))}function Ns(){return new t(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await Ms({all:t.all===!0||e===`all`,json:t.json===!0})})}function X(e,t){e&&process.stdout.write(`${JSON.stringify(t)}\n`)}async function Ps(e,t,n=process.cwd()){let r=e.op??`sync`,i=Ue(xe(n));if(i&&i.port>0){let t=`http://127.0.0.1:${i.port}/api/sync/trigger`;e.json||process.stderr.write(`Triggering ${r} via running server (port ${i.port})\n`);try{let n=await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:r})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.title??e.error??e.message??`Server responded with ${n.status}`)}X(e.json,{type:`triggered`,op:r,port:i.port}),e.json||process.stderr.write(`✓ ${r} triggered\n`);return}catch(t){let n=t instanceof Error?t.message:String(t);e.json||process.stderr.write(`Server trigger failed (${n}), running directly\n`)}}e.json||process.stderr.write(`Running ${r} directly (no live server)\n`);let a=Ke({baseDir:n});if(r===`sync`||r===`pull`){X(e.json,{type:`step`,step:`pull`});let t=await a.pull();X(e.json,{type:`pull`,summary:t.summary}),e.json||process.stderr.write(` pull: ${t.summary.changes} changes\n`)}(r===`sync`||r===`push`)&&(X(e.json,{type:`step`,step:`push`}),await a.push(),X(e.json,{type:`push`,ok:!0}),e.json||process.stderr.write(` push: ok
|
|
65
65
|
`)),X(e.json,{type:`complete`,op:r}),e.json||process.stderr.write(`✓ ${r} complete\n`)}function Fs(e){return new t(`sync`).description(`Commit, pull, and push to the remote`).option(`--json`,`Output JSONL progress events`,!1).action(async t=>{try{await Ps({json:t.json,op:`sync`},e())}catch(e){let n=e instanceof Error?e.message:String(e);t.json?process.stdout.write(`${JSON.stringify({type:`error`,message:n})}\n`):process.stderr.write(`✗ sync failed: ${n}\n`),process.exit(1)}})}function Is(e){return new t(`pull`).description(`Pull changes from the remote`).option(`--json`,`Output JSONL progress events`,!1).action(async t=>{try{await Ps({json:t.json,op:`pull`},e())}catch(e){let n=e instanceof Error?e.message:String(e);t.json?process.stdout.write(`${JSON.stringify({type:`error`,message:n})}\n`):process.stderr.write(`✗ pull failed: ${n}\n`),process.exit(1)}})}function Ls(e){return new t(`push`).description(`Push commits to the remote`).option(`--json`,`Output JSONL progress events`,!1).action(async t=>{try{await Ps({json:t.json,op:`push`},e())}catch(e){let n=e instanceof Error?e.message:String(e);t.json?process.stdout.write(`${JSON.stringify({type:`error`,message:n})}\n`):process.stderr.write(`✗ push failed: ${n}\n`),process.exit(1)}})}function Rs(e){return typeof e==`string`&&d.includes(e)}async function zs(e={}){let t=M(e.cwd??process.cwd()),r=e.pack??`knowledge-base`;if(!oe[r])return{status:`failed`,message:`${D(`Error:`)} Unknown pack "${r}". Available: ${d.join(`, `)}`,exitCode:1};let i;try{i=await b({projectDir:t,rootDir:e.root,packId:r})}catch(e){return e instanceof u?{status:`prerequisite-missing`,message:`${D(`Error:`)} ${e.message}`,exitCode:1}:{status:`failed`,message:`${D(`Error:`)} ${e instanceof Error?e.message:String(e)}`,exitCode:1}}if(i.created.length===0){let e=oe[r].name;return{status:`no-op`,message:`${E(`Your ${e} pack is already seeded.`)}\n${T(`Nothing to do.`)}`,plan:i,exitCode:0}}if(e.dryRun)return{status:`dry-run`,message:`${O(`Plan (dry-run — no changes made):`)}\n\n${Vs(i,t)}`,plan:i,exitCode:0};if(!e.yes&&!await Hs(`${O(`Plan:`)}\n\n${Vs(i,t)}\n\n${O(`Apply?`)} ${T(`[Y/n] `)}`,e.confirmStream))return{status:`cancelled`,message:T(`Cancelled.`),plan:i,exitCode:0};let a=await n(i,{projectDir:t,packId:r});if(a.errors.length>0){let e=a.errors.map(e=>` ${D(`✗`)} ${e.path}: ${e.error}`);return{status:`failed`,message:[`${at(`Applied`)} ${a.applied} entries, ${at(String(a.errors.length))} error(s):`,...e].join(`
|
|
66
66
|
`),plan:i,exitCode:1}}let o=oe[r].name;return{status:`applied`,message:`${E(`✓ Seeded ${o}`)} ${T(`(${a.applied} entries, ${a.durationMs}ms)`)}`,plan:i,exitCode:0}}function Bs(){let e=[O(`Available packs:`)];for(let t of d){let n=oe[t];e.push(` ${E(t)} ${T(`—`)} ${n.name}: ${n.description}`)}return e.join(`
|
package/dist/config-schema.json
CHANGED
|
@@ -39,7 +39,11 @@
|
|
|
39
39
|
"additionalProperties": {}
|
|
40
40
|
},
|
|
41
41
|
"appearance": {
|
|
42
|
-
"default": {
|
|
42
|
+
"default": {
|
|
43
|
+
"preview": {
|
|
44
|
+
"autoOpen": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
43
47
|
"type": "object",
|
|
44
48
|
"properties": {
|
|
45
49
|
"theme": {
|
|
@@ -53,6 +57,22 @@
|
|
|
53
57
|
"agentSettable": false,
|
|
54
58
|
"defaultScope": "user"
|
|
55
59
|
},
|
|
60
|
+
"preview": {
|
|
61
|
+
"default": {
|
|
62
|
+
"autoOpen": true
|
|
63
|
+
},
|
|
64
|
+
"type": "object",
|
|
65
|
+
"properties": {
|
|
66
|
+
"autoOpen": {
|
|
67
|
+
"default": true,
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"scope": "user",
|
|
70
|
+
"agentSettable": false,
|
|
71
|
+
"defaultScope": "user"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"additionalProperties": {}
|
|
75
|
+
},
|
|
56
76
|
"sidebar": {
|
|
57
77
|
"type": "object",
|
|
58
78
|
"properties": {
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"properties": {
|
|
5
5
|
"appearance": {
|
|
6
|
-
"default": {
|
|
6
|
+
"default": {
|
|
7
|
+
"preview": {
|
|
8
|
+
"autoOpen": true
|
|
9
|
+
}
|
|
10
|
+
},
|
|
7
11
|
"type": "object",
|
|
8
12
|
"properties": {
|
|
9
13
|
"theme": {
|
|
@@ -16,6 +20,22 @@
|
|
|
16
20
|
"scope": "user",
|
|
17
21
|
"agentSettable": false,
|
|
18
22
|
"defaultScope": "user"
|
|
23
|
+
},
|
|
24
|
+
"preview": {
|
|
25
|
+
"default": {
|
|
26
|
+
"autoOpen": true
|
|
27
|
+
},
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"autoOpen": {
|
|
31
|
+
"default": true,
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"scope": "user",
|
|
34
|
+
"agentSettable": false,
|
|
35
|
+
"defaultScope": "user"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"additionalProperties": {}
|
|
19
39
|
}
|
|
20
40
|
},
|
|
21
41
|
"additionalProperties": {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,$n as t,$t as n,A as r,An as i,Ar as a,At as o,B as s,Bn as c,Br as l,Bt as u,C as d,Ci as f,Cn as p,Cr as m,Ct as h,D as g,Di as _,Dn as v,Dr as y,Dt as b,E as x,En as S,Er as C,Et as w,F as T,Fn as E,Fr as D,Ft as O,G as k,Gn as A,Gr as j,Gt as M,H as N,Hn as P,Hr as F,Ht as I,I as L,In as R,Ir as z,It as B,J as V,Jn as H,Jr as U,Jt as W,K as G,Kn as K,Kr as q,Kt as J,L as Y,Ln as X,Lr as Z,Lt as Q,M as $,Mn as ee,Mr as te,Mt as ne,N as re,Nn as ie,Nr as ae,Nt as oe,O as se,On as ce,Or as le,Ot as ue,P as de,Pn as fe,Pr as pe,Pt as me,Q as he,Qn as ge,Qt as _e,R as ve,Rn as ye,Rr as be,Rt as xe,S as Se,Sn as Ce,Sr as we,St as Te,T as Ee,Tn as De,Tr as Oe,Tt as ke,U as Ae,Un as je,Ur as Me,Ut as Ne,V as Pe,Vn as Fe,Vr as Ie,Vt as Le,W as Re,Wn as ze,Wr as Be,Wt as Ve,X as He,Xn as Ue,Xr as We,Xt as Ge,Y as Ke,Yn as qe,Yr as Je,Yt as Ye,Z as Xe,Zn as Ze,Zt as Qe,_ as $e,_n as et,_r as tt,_t as nt,a as rt,an as it,ar as at,at as ot,b as st,bn as ct,br as lt,bt as ut,c as dt,ci as ft,cn as pt,cr as mt,ct as ht,d as gt,dn as _t,dr as vt,dt as yt,en as bt,er as xt,et as St,f as Ct,fi as wt,fn as Tt,fr as Et,ft as Dt,g as Ot,gn as kt,gr as At,gt as jt,h as Mt,hn as Nt,hr as Pt,ht as Ft,i as It,in as Lt,ir as Rt,it as zt,j as Bt,jn as Vt,jr as Ht,jt as Ut,k as Wt,ki as Gt,kn as Kt,kr as qt,kt as Jt,l as Yt,li as Xt,ln as Zt,lr as Qt,lt as $t,m as en,mn as tn,mr as nn,mt as rn,n as an,nn as on,nr as sn,nt as cn,o as ln,on as un,or as dn,ot as fn,p as pn,pn as mn,pr as hn,pt as gn,q as _n,qn as vn,qr as yn,qt as bn,r as xn,rn as Sn,rr as Cn,rt as wn,s as Tn,sn as En,sr as Dn,st as On,t as kn,tn as An,tr as jn,tt as Mn,u as Nn,un as Pn,ur as Fn,ut as In,v as Ln,vn as Rn,vr as zn,vt as Bn,w as Vn,wi as Hn,wn as Un,wr as Wn,wt as Gn,x as Kn,xi as qn,xn as Jn,xr as Yn,xt as Xn,y as Zn,yi as Qn,yn as $n,yr as er,yt as tr,z as nr,zn as rr,zr as ir,zt as ar}from"./dist-
|
|
1
|
+
import{$ as e,$n as t,$t as n,A as r,An as i,Ar as a,At as o,B as s,Bn as c,Br as l,Bt as u,C as d,Ci as f,Cn as p,Cr as m,Ct as h,D as g,Di as _,Dn as v,Dr as y,Dt as b,E as x,En as S,Er as C,Et as w,F as T,Fn as E,Fr as D,Ft as O,G as k,Gn as A,Gr as j,Gt as M,H as N,Hn as P,Hr as F,Ht as I,I as L,In as R,Ir as z,It as B,J as V,Jn as H,Jr as U,Jt as W,K as G,Kn as K,Kr as q,Kt as J,L as Y,Ln as X,Lr as Z,Lt as Q,M as $,Mn as ee,Mr as te,Mt as ne,N as re,Nn as ie,Nr as ae,Nt as oe,O as se,On as ce,Or as le,Ot as ue,P as de,Pn as fe,Pr as pe,Pt as me,Q as he,Qn as ge,Qt as _e,R as ve,Rn as ye,Rr as be,Rt as xe,S as Se,Sn as Ce,Sr as we,St as Te,T as Ee,Tn as De,Tr as Oe,Tt as ke,U as Ae,Un as je,Ur as Me,Ut as Ne,V as Pe,Vn as Fe,Vr as Ie,Vt as Le,W as Re,Wn as ze,Wr as Be,Wt as Ve,X as He,Xn as Ue,Xr as We,Xt as Ge,Y as Ke,Yn as qe,Yr as Je,Yt as Ye,Z as Xe,Zn as Ze,Zt as Qe,_ as $e,_n as et,_r as tt,_t as nt,a as rt,an as it,ar as at,at as ot,b as st,bn as ct,br as lt,bt as ut,c as dt,ci as ft,cn as pt,cr as mt,ct as ht,d as gt,dn as _t,dr as vt,dt as yt,en as bt,er as xt,et as St,f as Ct,fi as wt,fn as Tt,fr as Et,ft as Dt,g as Ot,gn as kt,gr as At,gt as jt,h as Mt,hn as Nt,hr as Pt,ht as Ft,i as It,in as Lt,ir as Rt,it as zt,j as Bt,jn as Vt,jr as Ht,jt as Ut,k as Wt,ki as Gt,kn as Kt,kr as qt,kt as Jt,l as Yt,li as Xt,ln as Zt,lr as Qt,lt as $t,m as en,mn as tn,mr as nn,mt as rn,n as an,nn as on,nr as sn,nt as cn,o as ln,on as un,or as dn,ot as fn,p as pn,pn as mn,pr as hn,pt as gn,q as _n,qn as vn,qr as yn,qt as bn,r as xn,rn as Sn,rr as Cn,rt as wn,s as Tn,sn as En,sr as Dn,st as On,t as kn,tn as An,tr as jn,tt as Mn,u as Nn,un as Pn,ur as Fn,ut as In,v as Ln,vn as Rn,vr as zn,vt as Bn,w as Vn,wi as Hn,wn as Un,wr as Wn,wt as Gn,x as Kn,xi as qn,xn as Jn,xr as Yn,xt as Xn,y as Zn,yi as Qn,yn as $n,yr as er,yt as tr,z as nr,zn as rr,zr as ir,zt as ar}from"./dist-Ca54A9UG.mjs";import{_ as or,a as sr,c as cr,d as lr,f as ur,g as dr,i as fr,l as pr,m as mr,n as hr,o as gr,p as _r,r as vr,s as yr,t as br,u as xr}from"./server-lock-BniQ3qki-C_0QTo_r.mjs";export{kn as AGENT_ID_MAX_LEN,an as AGENT_ID_RE,xn as AGENT_WRITE_ORIGIN,It as AgentFocusBroadcaster,rt as AgentPresenceBroadcaster,ln as AgentSessionCapacityError,Tn as AgentSessionManager,dt as BacklinkIndex,Yt as CC1Broadcaster,wt as CC1_CONTRACT_VERSION,Nn as CONFIG_FILENAME,gt as CONFLICT_MARKER_RE,Ct as CURSOR_BUNDLE_PATHS_BY_PLATFORM,pn as ConfigSchema,en as DEFAULT_CHECKPOINT_RETENTION,Mt as DEFAULT_PACK_ID,Ot as FILE_SYSTEM_WRITER,$e as FILE_WATCHER_ORIGIN,Ln as GIT_UPSTREAM_WRITER,ft as GitDirAccessError,Zn as HOCUSPOCUS_AUTH_REJECTION_REASONS,st as HocuspocusAuthRejection,Kn as HocuspocusAuthTokenSchema,Se as INSTALLED_AGENTS_SCHEMES,d as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Vn as LOG_MD_TEMPLATE,Ee as MANAGED_RENAME_ORIGIN,x as MAX_AGENT_SESSIONS,g as MCP_CONNECTION_ID_HEADER,se as MCP_SERVER_NAME,Wt as MISSING_OK_CONFIG_MESSAGE,Xt as MalformedGitPointerError,r as McpLogger,Bt as MissingOkConfigError,$ as OBSERVER_SYNC_ORIGIN,re as OK_OKIGNORE_TEMPLATE,Qn as ORPHAN_MODES,de as PinoLogger,br as ProcessLockCollisionError,T as ProjectGitInitError,L as ROLLBACK_ORIGIN,hr as RUNTIME_VERSION,Y as SERVICE_WRITER,ve as SKILL_INSTALL_EVENTS_FILE_REL,qn as SKILL_STATE_TARGETS,nr as STARTER_FOLDERS,s as STARTER_FOLDER_FRONTMATTER_FILENAME,Pe as STARTER_PACKS,N as STARTER_PACK_IDS,Ae as STARTER_TEMPLATES,Re as STATE_MANIFEST_FILENAME,vr as STATE_SCHEMA_VERSION,f as SYSTEM_DOC_NAME,k as SeedPrerequisiteError,G as SeedRootDirError,fr as ServerLockCollisionError,_n as StateManifestError,V as TagIndex,Ke as UiLockCollisionError,sr as acquireProcessLock,gr as acquireServerLock,He as acquireUiLock,Xe as applyAgentMarkdownWrite,he as applyExternalChange,e as applySeed,St as assertCompatibleStateManifest,Mn as assertNeverDiskEvent,cn as attachIdleShutdown,wn as bootServer,zt as buildAndOpenSkill,ot as buildConfigYmlContent,fn as buildExecResult,On as buildInstructions,ht as buildSkillZip,$t as buildStarterFolderFrontmatterYaml,In as buildWipTree,yt as classifyEvents,Dt as classifyFsPath,gn as clearContributors,rn as coercePackId,Hn as colorFromSeed,Ft as commitUpstreamImport,jt as commitWip,nt as commitWipFromTree,Bn as containsConflictMarkers,tr as contentHash,ut as contributorCount,Xn as createApiExtension,Te as createAssetServeMiddleware,h as createContentFilter,Gn as createContentFilterAsync,ke as createExternalChangeHandler,w as createFileLogger,b as createLiveDerivedIndexExtension,ue as createMcpHttpHandler,Jt as createOsProbe,o as createPersistenceExtension,Ut as createServer,ne as createServerObserverExtension,oe as createStreamingErrorWriter,me as createTestLogger,O as detectClaudeDesktopPresence,B as detectProjectShape,Q as ensureProjectGit,xe as errorResponse,ar as evictStaleTrackerEntries,u as extractWikiLinksFromMarkdown,Le as findEnclosingGitRoot,I as findEnclosingProjectRoot,Ne as formatAuthRejectionWire,Ve as formatContributors,M as formatContributorsFrom,J as gcCheckpointRefs,bn as getCurrentMcpLogger,W as getLocalDir,Ye as getLogFilePath,Ge as getLogger,Qe as getLogsDir,_e as getMeter,n as getMetrics,bt as getTracer,An as handleCollabSocketError,on as handleSpawnCursor,_ as iconFromClientName,Sn as incrementCollabSocketFilteredError,Lt as incrementServerObserverFire,it as initContent,un as initShadowRepo,En as initTelemetry,pt as installPrettyZodErrors,Zt as installTestLoggers,Pn as installUserSkill,_t as isAllowedApiOrigin,Tt as isAllowedWorkspaceHostHeader,mn as isConfigDoc,tn as isHocuspocusAuthRejectionReason,Nt as isKnownPackId,kt as isLoopbackAddress,Gt as isOrphanMode,et as isPairedWriteOrigin,Rn as isPathWithinDir,yr as isProcessAlive,$n as isProjectRoot,ct as isSelfWrite,Jn as isSystemDoc,cr as isValidLockPid,Ce as lastKnownHash,p as listRescueCheckpoints,Un as listStarterPacks,De as loadPrincipal,pr as lockFilePath,S as loggerFactory,v as mountMcpAndApi,ce as normalizeFsPath,Kt as packageVersionMajorMinor,i as parseAuthRejectionWire,Vt as parseHocuspocusAuthToken,ee as parseKeepaliveConnectionId,ie as pathToDocName,fe as planSeed,E as readAllTargets,R as readBranchFromHead,xr as readProcessLock,lr as readProcessLockDetailed,ur as readServerLock,X as readServerPackageVersion,ye as readSkillInstallStateSnapshot,rr as readStateManifest,c as readTargetRecordedAt,Fe as readTargetVersion,P as readUiLock,je as reconcile,ze as recordContributor,A as recordSkillInstallEvent,K as registerAllTools,vn as registerWrite,_r as releaseProcessLock,mr as releaseServerLock,H as releaseUiLock,qe as removeLastKnownHash,Ue as resetMetrics,Ze as resolveBundledSkillDir,ge as resolveContentDir,t as resolveCursorBinaryDefault,xt as resolveCursorSpawnInvocation,jn as resolveLockDir,sn as resolvePack,Cn as resolvePackageVersion,Rt as restoreContributors,at as restoreLifecycleFromConflictsJson,dn as rewriteMarkdownLinksForDocumentRename,Dn as rewriteWikiLinksForDocumentRename,mt as runAuthReposSubprocess,Qt as runAuthStatusSubprocess,Fn as runCloneSubprocess,vt as runDeviceFlowSubprocess,Et as runWithMcpLogger,hn as safeContentPath,nn as safeSubdir,Pt as safetyCheckpoint,At as sanitizeClientName,tt as saveInMemoryCheckpoint,zn as saveVersion,er as seedBasenameIndex,lt as serializeError,Yn as setActiveSpanAttributes,we as shadowGit,m as shutdownTelemetry,Wn as spawnDetached,Oe as splitMarkdownBlocks,C as startWatcher,y as streamingProblemEvent,le as swapContributors,qt as toBroadcasterKey,a as tracedAppendFileSync,Ht as tracedLinkSync,te as tracedMkdir,ae as tracedMkdirSync,pe as tracedRename,D as tracedRenameSync,z as tracedRmSync,Z as tracedRmdirSync,be as tracedUnlinkSync,ir as tracedWriteFile,l as tracedWriteFileSync,Ie as updateLastKnownHash,dr as updateProcessLockPort,or as updateServerLockPort,F as updateUiLockPort,Me as validateAgentId,Be as validateCloneInputs,j as validateSkillZip,q as withSpan,yn as withSpanSync,U as writeStateManifest,Je as writeTargetVersion,We as writeTracker};
|