@inkeep/open-knowledge 0.77.9-beta.1 → 0.77.9-beta.2
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/{chunk-XKWWSDBF-D2uvTQ0O.mjs → chunk-XKWWSDBF-CiyukTrj.mjs} +2 -2
- package/dist/cli.mjs +55 -55
- package/dist/config-schema.json +1 -1
- package/dist/config.user.schema.json +1 -1
- package/dist/constants-D7ISUGXs.mjs +1 -0
- package/dist/{dist-DcJArHq7.mjs → dist-CdMoMubk.mjs} +483 -479
- package/dist/{dist-DEDXRbh0.mjs → dist-CupHag_I.mjs} +1 -1
- package/dist/{flag-coverage-6JEX67RU-DTi4Xp7_.mjs → flag-coverage-6JEX67RU-Byy8DkC9.mjs} +1 -1
- package/dist/index.mjs +190 -190
- package/dist/init-BnNTdvEi.mjs +1 -0
- package/dist/{init-CbXAMIbD.mjs → init-Co_mDPzI.mjs} +34 -34
- package/dist/{js-exec-VXN6TZ7U-CMKRxSof.mjs → js-exec-VXN6TZ7U-D--44jnh.mjs} +3 -3
- package/dist/{js-exec-VXN6TZ7U-DW1z0_f3.mjs → js-exec-VXN6TZ7U-Z8_USGOo.mjs} +4 -4
- package/dist/{launch-json-removal-CP7tSZPj.mjs → launch-json-removal-BAhghBP0.mjs} +1 -1
- package/dist/loader-DpmPmZs_.mjs +1 -0
- package/dist/{loader-D2-o7csT.mjs → loader-RbdwxE-e.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-CofDfbRH.mjs → md-manager-BGnqyqi1-RmPtbV-6.mjs} +153 -153
- package/dist/{open-browser-CxyHo50J.mjs → open-browser-yaMqhpHT.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-SCS9uRyV.mjs → preview-D4W9ISBt.mjs} +1 -1
- package/dist/preview-h82xr4fS.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-CKuIA-vj.js → ActivityModeContent-BATxSUxv.js} +1 -1
- package/dist/public/assets/AddPropertiesButton-Bhz5D_tP.js +2 -0
- package/dist/public/assets/{AgentDiffPane-B5RiGMoL.js → AgentDiffPane-BcLct3Tk.js} +1 -1
- package/dist/public/assets/{AgentIconCluster-0UCRKo29.js → AgentIconCluster-DOtER7-F.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-CCxqYyJC.js → AgentThreadClientBinder-DadOvih9.js} +1 -1
- package/dist/public/assets/{BugReportHistory-DxvYMoq8.js → BugReportHistory-D_OEmcqh.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-T_quySbG.js → BugReportHistoryDialog-ZGMDK7sk.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-zaXO57hT.js → CodeMirrorPropInput-Dvk3snLM.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-D3s62I9H.js → ConsentDialogBody-CDquCfjj.js} +1 -1
- package/dist/public/assets/{DeleteConfirmationDialog-C5r0h_Ud.js → DeleteConfirmationDialog-DaZfyQd8.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-C6M7WbN7.js → DiffViewBoundary-DbhDbXy8.js} +1 -1
- package/dist/public/assets/{DocumentContext-UFOE2JWI.js → DocumentContext-MH9fqXuW.js} +11 -11
- package/dist/public/assets/{EditorModeToggle-of13PGw3.js → EditorModeToggle-DClfDUEr.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CyQt5yIK.js → EnableSyncConfirmDialog-Cdv3n1kf.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-w-ELObJ2.js → ExcalidrawDocEditor-DngKrGvf.js} +1 -1
- package/dist/public/assets/FeedbackForm-XP78idFj.js +1 -0
- package/dist/public/assets/{GraphPanel-DXdturwZ.js → GraphPanel--beNjRT-.js} +1 -1
- package/dist/public/assets/{ImageAttachments-CiNpc4OD.js → ImageAttachments-CIihp_JJ.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DzwS-_gT.js → ImportSkillDialog-DFsIu8AB.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-3-bEQ38f.js → LintConfigEditor-OucnKI9n.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BvP7p4Fn.js → ManagedArtifactProperties-CJpHReke.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-dVdeWrTE.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DGUB9_es.js → MermaidDocEditor-DAQKQTIg.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-CIgeKbxm.js → OpenInAgentMenuItem-BzgmEFwX.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-Ca_QJFFO.js → PropertyDisplayRow-CR4LTYHm.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-Dt6m0JWd.js → RegisteredAgentIcon-2cwevuRg.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-3mxOVavv.js → ReportBugDialogBody-B4etLNwK.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-BOQJthK2.js → ReportBugMenuTrigger-Bc5z0-Fu.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-Cva8N_Vx.js → SchemaConfigEditor-DfMcNdGA.js} +1 -1
- package/dist/public/assets/{SessionsHost-BEdlvzTb.js → SessionsHost-DS7-1kuO.js} +2 -2
- package/dist/public/assets/SettingsDialogBody-BFPgfIw-.js +12 -0
- package/dist/public/assets/{ShareBranchSwitchDialog-CqSvdNYn.js → ShareBranchSwitchDialog-CGaCBOnF.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DjUoZWSP.js → ShareReceiveDialog-DFRKvuQJ.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-Bmm-LBUo.js → ShareReceiveMissDialog-BXrtIcx4.js} +1 -1
- package/dist/public/assets/{SkillCostValue-B1jRndjn.js → SkillCostValue-CaXVQav1.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-Dg8_RY9w.js → SkillEditBanner-D_7WTsJ7.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-BmygC534.js → SkillForkDialog-DQQGuXv8.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BvdiguPV.js → SkillInstallMenu-UGZNOesd.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-CtSexbCD.js → SkillOriginInline-wHAllLhh.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-BnOTw0g5.js → SkillToolbarControls-dPfL3r5J.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-DxXFhc_a.js → SlidesToolbarControls-C_5MgL5R.js} +1 -1
- package/dist/public/assets/{SourceEditor-Do6LuSl-.js → SourceEditor-DgBYiBut.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CsFd9pep.js → TerminalPanel-CXjN_98-.js} +3 -3
- package/dist/public/assets/{TerminalWindowApp-Cvu8cLGl.js → TerminalWindowApp-CQzuZYuY.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Bfu8j-OT.js → TextDocEditor-Gj93hBqH.js} +1 -1
- package/dist/public/assets/ThreadView-C7sqK0is.js +21 -0
- package/dist/public/assets/{TimelineDiffPane-D64_zZAN.js → TimelineDiffPane-CRlgrJ2D.js} +1 -1
- package/dist/public/assets/{agent-connection-status-DHhTS7mm.js → agent-connection-status-DSp5AbZq.js} +1 -1
- package/dist/public/assets/{auth-state-cache-BoBofHh-.js → auth-state-cache-CglXQ28p.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-pKm1r3MP.js → bug-report-send-manager-IdWBPFHN.js} +1 -1
- package/dist/public/assets/{client-version-VcA1CS9y.js → client-version-Cfeq3w2f.js} +1 -1
- package/dist/public/assets/{comment-chips-B2XxLI4U.js → comment-chips-BDBYUGDo.js} +1 -1
- package/dist/public/assets/{config-provider-KvgyFqbI.js → config-provider-CB8Idy6z.js} +1 -1
- package/dist/public/assets/{css-color-to-hex-Dn6DirAJ.js → css-color-to-hex-CMHRbt5X.js} +1 -1
- package/dist/public/assets/{diagnostic-breadcrumb-BK7w-wbl.js → diagnostic-breadcrumb-DtVIthxV.js} +1 -1
- package/dist/public/assets/{dist-C-xa487z.js → dist-DDq2bd0-.js} +10 -10
- package/dist/public/assets/{doc-paths-CiKYU4qz.js → doc-paths-CWMCOiOb.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-xnWvYKmd.js → doc-undo-manager-Dgd_R1wH.js} +1 -1
- package/dist/public/assets/{documents-events-BzjTnFaj.js → documents-events-BNOxHubi.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Cvq5dIQn.js → file-tree-adapter-CQyVXMVG.js} +1 -1
- package/dist/public/assets/{file-tree-utils-tm22NIqT.js → file-tree-utils-BgnPOQNb.js} +1 -1
- package/dist/public/assets/{folder-config-api-BYHJ-2CJ.js → folder-config-api-CnTUk9rh.js} +1 -1
- package/dist/public/assets/{index-BoV4ZgCO.js → index-C-M9IPeM.js} +18 -18
- package/dist/public/assets/{launch-agent-thread-BTIPj2wd.js → launch-agent-thread-CE4umI5d.js} +1 -1
- package/dist/public/assets/{lint-config-client-Dutmij5k.js → lint-config-client-D_KJIdJ0.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BcpMbocU.js → markdownlint-rule-browser-Dbi_T41A.js} +1 -1
- package/dist/public/assets/{messages-D_JXKK6K.js → messages-BBniyOLF.js} +1 -1
- package/dist/public/assets/{messages-Dba8d9Jv.js → messages-C-1V9628.js} +1 -1
- package/dist/public/assets/{messages-CTHXCi99.js → messages-C-ujGeuR.js} +1 -1
- package/dist/public/assets/{messages-OAfaaxsv.js → messages-CK2HIOIp.js} +1 -1
- package/dist/public/assets/{messages-C2RvwrlQ.js → messages-CNb9VVVF.js} +1 -1
- package/dist/public/assets/{messages-BNMfFbl0.js → messages-CP9Uo9SK.js} +1 -1
- package/dist/public/assets/{messages-BaRzw5BK.js → messages-CXQO0cdG.js} +1 -1
- package/dist/public/assets/{messages-zt85fQDE.js → messages-CduVnYUK.js} +1 -1
- package/dist/public/assets/{messages-BHhMAkK_.js → messages-CzRStuhZ.js} +1 -1
- package/dist/public/assets/{messages-DQRWgXkq.js → messages-DlYEa7go.js} +1 -1
- package/dist/public/assets/{messages-D7fA0LQr.js → messages-Dmkb0uPj.js} +1 -1
- package/dist/public/assets/{messages-DPPth-dJ.js → messages-G0BZY30Q.js} +1 -1
- package/dist/public/assets/{navigation-targets-BL5wW6Pq.js → navigation-targets-Czs2lfGZ.js} +1 -1
- package/dist/public/assets/{page-list-cache-D3JYubhG.js → page-list-cache-C-TRKOCs.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CuH4lWq3.js → pending-receive-nav-store-DU0fd5HG.js} +1 -1
- package/dist/public/assets/{preferred-session-events-5P5vFEmA.js → preferred-session-events-DmNk8hX1.js} +1 -1
- package/dist/public/assets/{progress-01dDXuWD.js → progress-92g2HE0r.js} +3 -3
- package/dist/public/assets/{project-paths-DJMqNt89.js → project-paths-D5u5ETp2.js} +1 -1
- package/dist/public/assets/{prop-types-CN6SItze.js → prop-types-DrIWG3Gx.js} +1 -1
- package/dist/public/assets/{receive-store-mjPNDOwU.js → receive-store-KjyHtK2Z.js} +1 -1
- package/dist/public/assets/{selection-context-3hqQN4uG.js → selection-context-Dr8Dwtss.js} +1 -1
- package/dist/public/assets/{skill-scope-DQRx7jdL.js → skill-scope-PQ-EaBPe.js} +1 -1
- package/dist/public/assets/{skills-api-CA8SmuDI.js → skills-api-Bp10td_R.js} +1 -1
- package/dist/public/assets/{src-BHYeoZko.js → src-D45teqFC.js} +1 -1
- package/dist/public/assets/{startup-marks-B-g3E2Nd.js → startup-marks-CrtY-I8L.js} +1 -1
- package/dist/public/assets/{tag-pill-input-zmNsl2tf.js → tag-pill-input-ChT0p3uH.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CRrGgZfN.js → target-navigation-intent-Dxn3CEpi.js} +1 -1
- package/dist/public/assets/{telemetry-startup-06i4tjpG.js → telemetry-startup-CNWCAxA7.js} +1 -1
- package/dist/public/assets/{terminal-command-events-BKSe5MpD.js → terminal-command-events-BtEB1nJF.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BN3VcLCe.js → terminal-launch-events-z128lGYy.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-tq_aM2-R.js → terminal-telemetry-DWYzbPMs.js} +1 -1
- package/dist/public/assets/thread-client-DWy51KvB.js +3 -0
- package/dist/public/assets/{typing-burst-detector-BRbbn7RW.js → typing-burst-detector-C5hbfIC1.js} +1 -1
- package/dist/public/assets/{uninstall-CzGXcf8z.js → uninstall-BJ0ruD6y.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BAF-Ucz2.js → use-activity-panel-B0hBttlz.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-DlfoA7DK.js → use-apply-config-language-B0buol98.js} +2 -2
- package/dist/public/assets/{use-collab-url-DBIPcV7i.js → use-collab-url-oh5407bM.js} +1 -1
- package/dist/public/assets/{use-conflicts-DPj0GwSi.js → use-conflicts-DlwnAZby.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-Cg6WeiJo.js → use-live-xterm-theme-kTh86ROJ.js} +1 -1
- package/dist/public/assets/{use-open-skill-Cio74U1q.js → use-open-skill-CfG5l4pa.js} +1 -1
- package/dist/public/assets/{use-settings-route-CyhF9ifY.js → use-settings-route-kXDIfwuP.js} +1 -1
- package/dist/public/assets/{use-skill-origin-DuSzEzyo.js → use-skill-origin-nNSEYBhk.js} +1 -1
- package/dist/public/assets/{use-skills-BpBiRwqs.js → use-skills-BjbaVkdM.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CW9xf1Ty.js → use-terminal-enabled-Bz_EEFKW.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-595jKiGo.js → use-timeline-entry-diff-CxWiRlcf.js} +1 -1
- package/dist/public/assets/{use-workspace-B6pir6UE.js → use-workspace-B5fRmw0K.js} +1 -1
- package/dist/public/index.html +58 -58
- package/dist/public/uninstall.html +4 -4
- package/dist/{python3-DNGS4G3E-Dpff_XiH.mjs → python3-DNGS4G3E-CRyO5yp1.mjs} +2 -2
- package/dist/{python3-DNGS4G3E-DSWx_2Ia.mjs → python3-DNGS4G3E-CixyRGKv.mjs} +3 -3
- package/dist/{registry-probes-DcQmklSR.mjs → registry-probes-BjsDFB65.mjs} +2 -2
- package/dist/{removal-file-path-Bm-2uQPi.mjs → removal-file-path-D6OEqNBM.mjs} +1 -1
- package/dist/{repair-launch-json-b1UC0Z9Y.mjs → repair-launch-json-BLnKg19X.mjs} +1 -1
- package/dist/{repair-mcp-configs-Boh7ga7s.mjs → repair-mcp-configs-hy238Kt4.mjs} +1 -1
- package/dist/schemas/v0/config.user.schema.json +1 -1
- package/dist/{sqlite3-TE5AIOTF-ButYCorg.mjs → sqlite3-TE5AIOTF-BK092fD6.mjs} +1 -1
- package/dist/{sqlite3-TE5AIOTF-D4yhY7wL.mjs → sqlite3-TE5AIOTF-DVwda1Ow.mjs} +3 -3
- package/dist/src-DUyBP196.mjs +1 -0
- package/dist/src-tuHpjXRh.mjs +11 -0
- package/dist/start-BWVT5n3j.mjs +1 -0
- package/dist/{start-B81qeDBS.mjs → start-DWDyuoi5.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-DjcsE1aU.mjs +0 -1
- package/dist/init-B-sAo7zD.mjs +0 -1
- package/dist/loader-D1l3w-4T.mjs +0 -1
- package/dist/preview-CmAl4v3q.mjs +0 -1
- package/dist/public/assets/AddPropertiesButton-DO1jEnTz.js +0 -2
- package/dist/public/assets/FeedbackForm-BTos6Q47.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Boovg5M3.js +0 -1
- package/dist/public/assets/SettingsDialogBody-J6zZfbkq.js +0 -12
- package/dist/public/assets/ThreadView-BupzJ5yH.js +0 -20
- package/dist/public/assets/thread-client-BS0s_MKD.js +0 -4
- package/dist/src-73Vc4tlm.mjs +0 -11
- package/dist/src-uidD5ZLv.mjs +0 -1
- package/dist/start-Rczs5F9g.mjs +0 -1
package/dist/src-73Vc4tlm.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-tZXQYakl.mjs";import{Bs as t,Gd as n,Hn as r,Jc as i,Nn as a,Oo as o,Pn as s,Pu as c,Xc as l,ks as u,qc as d,wc as ee}from"./md-manager-BGnqyqi1-CofDfbRH.mjs";import{$n as f,Ci as te,Fo as p,Kr as m,No as h,Po as g,Qr as _,Si as v,Tt as y,Yn as b,ai as x,fr as S,ia as C,ii as w,m as T,oi as E,so as D,zn as O}from"./dist-DcJArHq7.mjs";import{t as k}from"./yazl-BBz29IQN.mjs";import{St as A,at as j,ot as M}from"./init-CbXAMIbD.mjs";import{b as N,l as ne}from"./registry-probes-DcQmklSR.mjs";import{c as P}from"./colors-r_owlCuY.mjs";import{t as re}from"./is-object-BGze3w87.mjs";import{n as ie}from"./constants-DjcsE1aU.mjs";import"./loader-D2-o7csT.mjs";import"./preview-SCS9uRyV.mjs";import{execSync as ae,spawnSync as F}from"node:child_process";import{basename as I,dirname as L,isAbsolute as oe,join as R,relative as z,resolve as B,sep as V}from"node:path";import{closeSync as se,cpSync as ce,createWriteStream as le,existsSync as H,lstatSync as ue,mkdirSync as U,mkdtempSync as de,openSync as fe,readFileSync as W,readSync as pe,readdirSync as G,rmSync as K,rmdirSync as me,statSync as he,writeFileSync as q}from"node:fs";import{arch as ge,freemem as _e,homedir as J,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import"node:fs/promises";import{createHash as Te}from"node:crypto";const Ee=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function De(e,t,n=f){if(e!==void 0&&!Ee.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Oe=null;function ke(e){Oe=e}function Ae(){return Oe??process.cwd()}const je=`Open Knowledge`;function Me(e={}){let t=e.platformName??process.platform,n=e.productName??`OpenKnowledge`;return j(t).join(M({...e,platformName:t}),n)}function Ne(e={}){let t=e.platformName??process.platform,n=e.home??J(),r=e.env??process.env,i=j(t),a;return a=t===`win32`?r.LOCALAPPDATA||i.join(n,`AppData`,`Local`):t===`darwin`?i.join(n,`Library`,`Caches`):r.XDG_CACHE_HOME||i.join(n,`.cache`),i.join(a,`@inkeepopen-knowledge-desktop-updater`)}function Pe(e){if(typeof e!=`object`||!e)return null;let t=e.recentProjects;if(!Array.isArray(t))return null;let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e;typeof t.path==`string`&&typeof t.name==`string`&&n.push({path:t.path,name:t.name})}return n}function Fe(e){let t=R(e,`state.json`);if(!H(t))return[];let n;try{n=JSON.parse(W(t,`utf-8`))}catch{return[]}return Pe(n)??[]}function Ie(e){let t=R(e,`state.json`);if(!H(t))return!1;try{return Pe(JSON.parse(W(t,`utf-8`)))!==null}catch{return!1}}const Le=8192;function Re(e,t){if(e.outcome===`not-present`)return`not-present (no DiagnosticReports directory)`;if(e.outcome===`unreadable-directory`)return`unreadable (${e.directoryErrorCode??`unknown`} reading DiagnosticReports)`;let n=[`${e.windowDays}d`,`${e.foreignIgnored} other-process report(s) ignored`,`${e.unparseable} unparseable`];e.droppedOverCap>0&&n.push(`${e.droppedOverCap} older dropped over cap`);let r=e.files.length-t;return r>0&&n.push(`${r} vanished before staging`),e.outcome===`none-in-window`?`none found in window (${n.join(`; `)})`:`${t} collected (${n.join(`; `)})`}function ze(e){return e.replace(/\\+\/?/g,e=>{if(!e.endsWith(`/`))return e;let t=e.length-1;return`${`\\`.repeat(t-t%2)}/`})}const Be=RegExp(`("(?:${[`crashReporterKey`,`bootSessionUUID`,`deviceIdentifierForVendor`].join(`|`)})"\\s*:\\s*)"[^"]*"`,`g`);function Ve(e){return e.replace(Be,`$1"[REDACTED-DEVICE-ID]"`)}function He(e){return Ve(ze(e))}const Ue=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})(\.\d+)? ([+-]\d{2})(\d{2})$/;function We(e){if(typeof e!=`string`)return null;let t=Ue.exec(e.trim());if(t===null)return null;let[,n,r,i=``,a,o]=t,s=Date.parse(`${n}T${r}${i}${a}:${o}`);return Number.isNaN(s)?null:s}function Ge(e){let t=fe(e,`r`);try{let e=Buffer.alloc(Le),n=0,r=!1;for(;n<Le;){let i=pe(t,e,n,Le-n,n);if(i===0){r=!0;break}let a=n;n+=i;let o=e.subarray(0,n).indexOf(10,a);if(o!==-1)return e.subarray(0,o).toString(`utf-8`)}return r?e.subarray(0,n).toString(`utf-8`):null}finally{se(t)}}function Ke(e){try{let t=Ge(e);if(t===null)return{kind:`unreadable`};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{kind:`unreadable`};let{name:r,app_name:i,timestamp:a}=n,o=typeof r==`string`?r:typeof i==`string`?i:null;return o===null?{kind:`unreadable`}:{kind:`named`,name:o,timestampMs:We(a)}}catch{return{kind:`unreadable`}}}function qe(e){return e===`OpenKnowledge`||e.startsWith(`OpenKnowledge `)}function Je(e,t){let n={files:[],foreignIgnored:0,unparseable:0,droppedOverCap:0,windowDays:7},r;try{r=G(e,{withFileTypes:!0})}catch(e){let t=e.code;return t===`ENOENT`?{...n,outcome:`not-present`}:{...n,outcome:`unreadable-directory`,directoryErrorCode:t??`unknown`}}let i=t.getTime()-6048e5,a=[],o=0,s=0;for(let t of r){if(!t.isFile()||!t.name.endsWith(`.ips`))continue;let n=R(e,t.name),r;try{r=he(n).mtimeMs}catch{continue}if(r<i)continue;let c=Ke(n),l=c.kind===`named`&&c.timestampMs!==null?c.timestampMs:r;if(c.kind===`unreadable`){s+=1;continue}if(!qe(c.name)){o+=1;continue}a.push({path:n,atMs:l})}a.sort((e,t)=>t.atMs-e.atMs);let c=a.slice(0,25),l={foreignIgnored:o,unparseable:s,droppedOverCap:a.length-c.length,windowDays:7};return c.length===0?{...l,files:[],outcome:`none-in-window`}:{...l,files:c.map(e=>e.path),outcome:`collected`}}function Y(){return R(J(),`.ok`,`bug-reports`)}function Ye(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Y(),r=`${t}-bugreport`,i=R(n,`${r}.zip`);for(let e=2;H(i);e+=1)i=R(n,`${r}-${e}.zip`);return i}function Xe(e,t){let n=R(e,`.ok`,`config.yml`);if(H(n))try{let e=W(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return H(R(e,`.ok`))?Te(`sha256`).update(B(e)).digest(`hex`).slice(0,12):null}function Ze(){let e={timestamp:new Date().toISOString(),platform:ye(),osType:Ce(),osRelease:be(),hostname:`[redacted]`,uptime:we(),freeMem:_e(),totalMem:Se(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ae(`sw_vers -productVersion 2>/dev/null`,D({encoding:`utf8`})).trim()}catch{}try{let t=R(__dirname,`..`,`..`,`package.json`);H(t)&&(e.okVersion=JSON.parse(W(t,`utf8`)).version)}catch{}return e}const Qe=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function $e(e){let t=I(e);return Qe.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function et(e,t){return it(e,t).files}const tt=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function nt(e,t=ne){let n=R(e,`${t}.ShipIt`);if(!H(n))return[];let r;try{r=G(n)}catch{return[]}return tt.flatMap(e=>r.map(t=>{if(t===e)return{entry:t,suffix:-1};if(!t.startsWith(`${e}.`))return null;let n=t.slice(e.length+1);return/^\d+$/.test(n)?{entry:t,suffix:Number(n)}:null}).filter(e=>e!==null).sort((e,t)=>e.suffix-t.suffix).slice(0,4).map(e=>R(n,e.entry)))}function rt(e){if(!H(e))return[];try{let t=new Map;for(let n of G(e).filter(e=>e.endsWith(`.yaml`)).sort()){let e=n.endsWith(`.sent.yaml`)?n.slice(0,-a.length):n.slice(0,-5),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t.values()].slice(-25).flat().map(t=>R(e,t))}catch{return[]}}function it(e,t){if(!H(t))return{files:[],excludedByProjectSlug:0};let n=G(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>R(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter($e),i=[],a=r.filter(t=>{try{return W(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!$e(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function at(e){let t=R(e,`.ok`,`local`);return H(t)?{files:[`server.lock`,`last-spawn-error.log`,d].map(e=>R(t,e)).filter(e=>H(e))}:{files:[]}}function ot(e){let t=R(e,`.ok`,`local`,`logs`);return H(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>R(t,e)).filter(e=>H(e))}:{files:[]}}function st(e){let t=0,n=new Map,r=e.replace(/("(?:docName|doc\.name|documentName)"\s*:\s*")((?:[^"\\]|\\.)*)"/g,(e,r,i)=>{t+=1;let a=n.get(i);return a===void 0&&(a=`doc#${Te(`sha256`).update(i).digest(`hex`).slice(0,12)}`,n.set(i,a)),`${r}${a}"`});for(let[e,i]of[...n].sort(([e],[t])=>t.length-e.length)){if(e.length===0||!r.includes(e))continue;let n=r.split(e);t+=n.length-1,r=n.join(i)}return{text:r,count:t}}function ct(e){let t=e.revealDocNames?e.content:st(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=u(t);e.zipfile.addBuffer(Buffer.from(n,`utf8`),e.name),e.bundleFiles.push(e.name),r.length>0&&e.redactions.push({file:e.name,lineCount:i,patterns:r})}else e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name)}function X(e){for(let t of e.files)try{let n=W(t,`utf8`);ct({zipfile:e.zipfile,name:`${e.prefix}/${I(t)}`,content:t.endsWith(`.ips`)?He(n):n,redact:e.redact,revealDocNames:e.revealDocNames,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function lt(t){let{redact:n,outputPath:i,logger:a}=t,o=t.revealDocNames??!1,c=t.userLogsDir??R(J(),`.ok`,`logs`),l=t.projectDir?Xe(t.projectDir,a):null;U(L(i),{recursive:!0}),a?.info({projectSlug:l},`gathering diagnostic data`);let u=Ze();u.desktop=t.desktop??null,u.language=t.language??null;let{files:d,excludedByProjectSlug:ee}=it(l,c),{files:f}=t.projectDir?at(t.projectDir):{files:[]},{files:te}=t.projectDir?ot(t.projectDir):{files:[]},p=t.shipItLogFiles??[],m=t.diagnosticReports?.files??[];a?.info({logFileCount:d.length,logFilesExcludedByProjectSlug:ee,lockFileCount:f.length,localSinkFileCount:te.length,shipItLogFileCount:p.length,diagnosticReportCount:m.length},`files collected`);let h=[],g=[],{ZipFile:_}=await import(`./yazl-BsCX6KWo.mjs`).then(t=>e(t.default,1)),v=new _;X({zipfile:v,files:[...d,...p],prefix:`logs`,redact:n,revealDocNames:o,bundleFiles:g,redactions:h,logger:a}),X({zipfile:v,files:f,prefix:`lockdir`,redact:n,revealDocNames:o,bundleFiles:g,redactions:h,logger:a}),X({zipfile:v,files:te,prefix:`local-logs`,redact:n,revealDocNames:o,bundleFiles:g,redactions:h,logger:a}),X({zipfile:v,files:t.bugReportLedgerFiles??[],prefix:s,redact:n,revealDocNames:o,bundleFiles:g,redactions:h,logger:a}),X({zipfile:v,files:m,prefix:`diagnostic-reports`,redact:n,revealDocNames:o,bundleFiles:g,redactions:h,logger:a});for(let e of t.extraFiles??[])try{let t=W(e.sourcePath),n=`extra/${e.zipName??I(e.sourcePath)}`;v.addBuffer(t,n),g.push(n)}catch(t){a?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&ct({zipfile:v,name:`note.txt`,content:t.note,redact:n,revealDocNames:o,bundleFiles:g,redactions:h});let y=new Set(m.map(e=>`diagnostic-reports/${I(e)}`)),b=g.filter(e=>y.has(e)),x=t.diagnosticReports===void 0?`not-collected (no collection attempted)`:Re(t.diagnosticReports,b.length);v.addBuffer(Buffer.from(`${x}\n`,`utf8`),`state/diagnostic-reports-status.txt`),g.push(`state/diagnostic-reports-status.txt`);let S=JSON.stringify(u,null,2);v.addBuffer(Buffer.from(S,`utf8`),`sysinfo.json`),g.push(`sysinfo.json`);let C={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:l,files:g,redactions:h,sysinfo:u};v.addBuffer(Buffer.from(JSON.stringify(C,null,2),`utf8`),`MANIFEST.json`);let w=h.reduce((e,t)=>e+t.lineCount,0),T=new Set(p.map(e=>`logs/${I(e)}`)),E=g.filter(e=>T.has(e)),D=new Set((t.bugReportLedgerFiles??[]).map(e=>`${s}/${I(e)}`)),O=g.filter(e=>D.has(e)),k=l?g.filter(e=>e.startsWith(`logs/`)&&!$e(e)&&!T.has(e)):[],A=b.length>0?[`Crash reports under diagnostic-reports/ are rewritten on the way in,`,`independently of this setting: escaped path separators are normalised`,`so the scrub above can read them, and the identifiers that link this`,`machine's bundles to each other are replaced. Nothing else is changed;`,`they are not byte-identical to the files macOS wrote.`]:[],j=A.length>0?[`Redaction was disabled for this bundle; file contents are unmodified,`,`with one exception.`,...A]:[`Redaction was disabled for this bundle; file contents are unmodified.`],M=[`# Bug Report Bundle`,``,`Generated: ${C.generatedAt}`,`Project: ${l??`(unscoped)`}`,`Discipline version: ${C.disciplineVersion}`,``,`## Contents`,``,...g.map(e=>`- ${e}`),``,`## Privacy`,``,...k.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...k.map(e=>`- ${e}`),``]:[],...E.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...E.map(e=>`- ${e}`),``]:[],...b.length>0?[`Crash reports: written by macOS itself rather than by OpenKnowledge,`,`and machine-wide rather than scoped to any one project. They record`,`why the operating system ended a process of this app — the signal or`,`exception, the code-signing verdict, and whatever text the process`,`left behind as it died. They also carry machine details the OS puts`,`in every report: the account uid, the Mac model, and the name of the`,`process that launched this app, which on a managed machine can be`,`internal tooling. The identifiers that would link this machine's`,`bundles to each other are replaced before bundling. Only this`,`app's own reports are collected, never another application's, though`,`a report of ours still names the processes it ran alongside:`,...b.map(e=>`- ${e}`),``]:[],...O.length>0?[`Send history: a small record for each bug report previously generated`,`on this machine — when it was generated, whether sending it`,`succeeded, and why it failed if it did. This is what makes a failed`,`send diagnosable at all. It is machine-wide rather than scoped to`,`this project, so it names the other projects reports were filed`,`from. It carries no document content:`,...O.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${r.join(`, `)}`,w>0?`${w} line(s) were scrubbed across ${h.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,...A,``,`This bundle is safe to attach to a GitHub issue.`]:j].join(`
|
|
2
|
-
`);v.addBuffer(Buffer.from(M,`utf8`),`README.md`),v.end();let N=le(i);return v.outputStream.pipe(N),await new Promise((e,t)=>{N.on(`close`,e),N.on(`error`,t)}),a?.info({bundlePath:i,fileCount:g.length,redactionCount:w},`bundle written`),{zipPath:i,summary:{projectSlug:l,files:g,redactions:h,redactedLineCount:w,generatedAt:C.generatedAt}}}var ut=c(),dt=e(k(),1),Z=e(P(),1);function ft(e){let t=p(`user`,e,e);return h({absPath:t,sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function pt({home:e=J(),env:n=process.env}={}){let r=ft(e),{override:i,preferenceList:a}=g(n),{locale:o,source:s}=t({override:i,storedPreference:r,supportedLocales:l,preferenceList:a,autoDetectableLocales:ee});return{preference:r,locale:o,source:s,systemLanguages:a}}function mt(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function ht(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gt(e,t){if(typeof e==`string`)return mt(e,t.contentDir);if(Array.isArray(e))return e.map(e=>gt(e,t));if(!ht(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=gt(i,t);return n}function _t(e,t){let n=W(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
3
|
-
`),i=n.split(`
|
|
4
|
-
`),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(e!==i.length-1||n!==``){if(n.length===0){a.push(``);continue}try{let e=gt(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}let o=r?`${a.join(`
|
|
5
|
-
`)}\n`:a.join(`
|
|
6
|
-
`);q(e,o)}function vt(e,t){let n=W(e,`utf-8`);if(n.trim().length!==0)try{let r=gt(JSON.parse(n),t),i=n.endsWith(`
|
|
7
|
-
`)?`
|
|
8
|
-
`:``;q(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=mt(n,t.contentDir);r!==n&&q(e,r)}}function yt(e,t){let n=W(e,`utf-8`),r=mt(n,t.contentDir);r!==n&&q(e,r)}function bt(e){try{return G(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>R(e,t.name))}catch{return[]}}const xt=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function St(e){return/\.log\.\d+$/.test(e)}function Ct(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||St(e)}const wt=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function Tt(e){let t={contentDir:e.contentDir};for(let n of wt)for(let r of bt(R(e.stagingDir,n)))Ct(r)?_t(r,t):r.endsWith(`.json`)?vt(r,t):yt(r,t);for(let n of bt(R(e.stagingDir,`state`))){let e=I(n);n.endsWith(`.jsonl`)?_t(n,t):xt.has(e)?vt(n,t):yt(n,t)}}const Et=[`.ok`,`local`,`telemetry`],Dt=[`.ok`,`local`,`logs`],Ot=[`.ok`,`local`,`loss-capture`],kt=`spans-current.jsonl`,At=`spans-prev.jsonl`,jt=`server-current.jsonl`,Mt=`server-prev.jsonl`,Nt=`loss-current.jsonl`,Pt=`loss-prev.jsonl`;function Ft(e){return R(e,...Et,kt)}function It(e){return R(e,...Et,At)}function Lt(e){return R(e,...Dt,jt)}function Rt(e){return R(e,...Dt,Mt)}function zt(e){return R(e,...Ot,Nt)}function Bt(e){return R(e,...Ot,Pt)}const Vt=1e3;async function Ht(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(Vt)});return t.ok?await t.text():null}catch{return null}}async function Ut(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(Vt)});return t.ok?await t.text():null}catch{return null}}async function Wt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(Vt)});return t.ok?await t.text():null}catch{return null}}function Gt(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
|
|
9
|
-
`)}\n`:null}catch{return null}}function Kt(e){let t=R(e,`.git`,`ok`);if(!H(t))return null;let n=F(`git`,[`-C`,t,`log`,`--oneline`,`-50`],D({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function qt(e){let t=R(e,`.git`,`ok`);if(!H(t))return null;let n=F(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],D({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Jt(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Yt(){return{nodeVersion:process.version,platform:ye(),arch:ge()}}function Xt(){return process.env.OTEL_SDK_DISABLED===`false`}function Zt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Qt(e){if(!H(e))return{};let t;try{t=(0,ut.parse)(W(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!Zt(t))return{};let n=t.telemetry;if(!Zt(n))return{};let r=n.localSink;return Zt(r)?r:{}}function $t(e){return typeof e==`boolean`?e:void 0}function en(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function tn(e){if(Zt(e))return en(e.maxBytes)}function nn(e){let t=Qt(p(`project`,e)),n=Qt(p(`project-local`,e));return{enabled:$t(n.enabled)??$t(t.enabled)??!0,spansMaxBytes:tn(n.spans)??tn(t.spans)??52428800,logsMaxBytes:tn(n.logs)??tn(t.logs)??26214400}}function rn(e){return Te(`sha256`).update(e).digest(`hex`)}function an(e){let t=W(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const on=[`"doc.name"`,`"docName"`];function sn(e){let t=W(e,`utf-8`),n=0;for(let e of on){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Q(e,t){if(!H(e))return!1;try{return U(L(t),{recursive:!0}),e.endsWith(`.ips`)?q(t,He(W(e,`utf-8`))):ce(e,t),!0}catch{return!1}}function cn(e){let t=[],n=e=>{let r=G(e,{withFileTypes:!0});for(let i of r){let r=R(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const ln=new Set([`.jsonl`]);function un(e){let t=e.lastIndexOf(`.`);return t!==-1&&ln.has(e.slice(t))}const dn=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function fn(e){if(St(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&dn.has(e.slice(t))}function pn(e){let t=[];for(let n of cn(e)){let r=mn(e,n);if(!fn(r))continue;let{redacted:i,patterns:a,lineCount:o}=u(W(n,`utf-8`));a.length!==0&&(q(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function mn(e,t){return z(e,t).split(V).join(`/`)}async function hn(e){let t=B(e.contentDir),n=B(e.projectDir??e.contentDir),r=e.deps??{},a=r.fetchAgentPresence??Ht,o=r.fetchAgentEffects??Ut,c=r.fetchWatcherRecent??Wt,l=r.readShadowHead??Kt,u=r.readCheckpointRefs??qt,ee=r.now??(()=>new Date),f=r.okVersion??(()=>ie),te=r.readDesktopEnv??Jt,p=r.readLanguage??pt,m=r.readRuntime??Yt,h=r.isOtlpPushEnabled??Xt,g=de(R(xe(),`ok-bundle-`));try{U(R(g,`telemetry`),{recursive:!0}),U(R(g,`logs`),{recursive:!0}),U(R(g,`state`),{recursive:!0}),Q(Ft(n),R(g,`telemetry`,kt)),Q(It(n),R(g,`telemetry`,At)),Q(Lt(n),R(g,`logs`,jt)),Q(Rt(n),R(g,`logs`,Mt));for(let t of e.userLogFiles??[])Q(t,R(g,`logs`,I(t)));for(let t of e.userStateFiles??[])Q(t,R(g,s,I(t)));let _=0;for(let t of e.diagnosticReports?.files??[])Q(t,R(g,`diagnostic-reports`,I(t)))&&(_+=1);let v=R(n,`.ok`,`local`),y=R(v,`server.lock`),b=`not-running`,x=`no server.lock`,S=null;if(H(y)){Q(y,R(g,`state`,`server.lock`));try{let e=W(y,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?S=t.port:x=`lock present but no port`}catch{x=`lock present but unparseable`}}if(S!==null){let e=await a(S);e===null?x=`agent-presence endpoint at :${S} unreachable`:(q(R(g,`state`,`agent-presence.json`),e),b=`running`,x=``);let t=await o(S);t!==null&&q(R(g,`state`,`agent-effects.json`),t);let n=await c(S);if(n!==null){let e=Gt(n);e!==null&&q(R(g,`state`,`watcher-recent.jsonl`),e)}}let C=l(t);C!==null&&q(R(g,`state`,`shadow-head.txt`),C);let w=u(t);w!==null&&q(R(g,`state`,`checkpoint-refs.txt`),w),Q(zt(n),R(g,`state`,Nt)),Q(Bt(n),R(g,`state`,Pt)),Q(R(v,`last-spawn-error.log`),R(g,`state`,`last-spawn-error.log`)),Q(R(v,i),R(g,`state`,i)),Q(R(v,d),R(g,`state`,d));let T=m(),E=te(),D=p(),O={ok:{version:f(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D}};q(R(g,`state`,`runtime.json`),`${JSON.stringify(O,null,2)}\n`);let k=b===`running`?`running
|
|
10
|
-
`:`not-running (${x})\n`;q(R(g,`state`,`server-status.txt`),k);let A=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:Re(e.diagnosticReports,_);if(q(R(g,`state`,`diagnostic-reports-status.txt`),`${A}\n`),e.processDir&&H(e.processDir)){let t=R(g,`process`);U(t,{recursive:!0}),ce(e.processDir,t,{recursive:!0})}let j=e.redact===!0;j&&Tt({stagingDir:g,contentDir:t}),e.note&&q(R(g,`note.txt`),e.note);let M=null;e.scrubSecrets===!0&&(M=pn(g));for(let t of e.extraFiles??[])Q(t.sourcePath,R(g,`extra`,t.zipName??I(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let N=nn(n),ne=cn(g),P=[],re=0,ie=0;for(let e of ne){let t=mn(g,e),n=he(e).size,r=un(t)?an(e):0;P.push({path:t,bytes:n,lines:r}),re+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(ie+=sn(e))}let ae={applied:j};M!==null&&(ae.secretScrub=M);let F={schemaVersion:2,createdAt:ee().toISOString(),ok:{version:f(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D},contentDir:{pathSha256:rn(t),absolutePath:j?`<CONTENT_DIR>`:t},telemetry:{localSink:N,otlpPushEnabled:h()},redaction:ae,serverStatus:b,files:P};q(R(g,`manifest.json`),`${JSON.stringify(F,null,2)}\n`);let L=ne.some(e=>{try{return W(e,`utf-8`).includes(t)}catch{return!1}}),oe={stagedDiagnosticReports:_,totalBytes:re,fileCount:P.length,docNameCount:ie,contentDirVisible:L,redacted:j},z=!1;return{stagingDir:g,manifest:F,summary:oe,cleanup:()=>{z||(z=!0,K(g,{recursive:!0,force:!0}))}}}catch(e){throw K(g,{recursive:!0,force:!0}),e}}async function gn(e){let{collected:t,outputPath:n}=e,r=L(n);if(!H(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new dt.ZipFile,a=cn(t.stagingDir);for(let e of a){let n=mn(t.stagingDir,e);i.addFile(e,n)}i.end();let o=le(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function _n(e,t){let n=R(e,`.ok`,`config.yml`);if(H(n))try{let t=(0,ut.parse)(W(n,`utf-8`)),r=re(t)?t.content:void 0,i=re(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return B(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return B(e)}async function vn(e,t,n,r,i){let a=Xe(t,e.logger),o=await hn({contentDir:_n(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...et(a,e.userLogsDir??R(J(),`.ok`,`logs`)),...nt(e.cachesDir??R(J(),`Library`,`Caches`))],userStateFiles:rt(e.bugReportsDir??Y()),diagnosticReports:i,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{U(L(e.outputPath),{recursive:!0}),await gn({collected:o,outputPath:e.outputPath});let t=o.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:a,files:o.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:o.manifest.createdAt}}}finally{o.cleanup()}}async function yn(e){let{projectDir:t}=e,n=e.readDesktopEnv??Jt,r=e.readLanguage??pt,i=()=>Je(e.diagnosticReportsDir??R(J(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return vn(e,t,n,r,i());let{zipPath:a,summary:o}=await lt({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:nt(e.cachesDir??R(J(),`Library`,`Caches`)),bugReportLedgerFiles:rt(e.bugReportsDir??Y()),diagnosticReports:e.level===`full`?i():void 0,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:a,summary:{level:e.level,systemWide:t===void 0,projectSlug:o.projectSlug,files:o.files,redactions:o.redactions,redactedLineCount:o.redactedLineCount,generatedAt:o.generatedAt}}}function $(e,t,n={}){let r=E(e,t),i;try{i=W(r,`utf-8`)}catch(e){return e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`?{status:`missing`,lockPath:r}:{status:`read-error`,lockPath:r,error:e instanceof Error?e.message:String(e)}}let a;try{a=JSON.parse(i)}catch{return{status:`corrupt`,lockPath:r}}let o=a&&typeof a==`object`?a:{},s=`machineId`in o&&typeof o.machineId==`string`?o.machineId!==(n.machineId??S()):`hostname`in o&&typeof o.hostname==`string`&&o.hostname!==(n.host??ve());if(!a||typeof a!=`object`||!_(a.pid))return{status:`corrupt`,lockPath:r,...s?{foreignHost:!0}:{}};let c=a.pid,l=`machineId`in o&&typeof o.machineId==`string`||`hostname`in o&&typeof o.hostname==`string`;return s?{status:`foreign-host`,lockPath:r,lock:a}:(n.isAlive??m)(c)?l?{status:`alive`,lockPath:r,lock:a}:{status:`unverified-owner`,lockPath:r,pid:c}:{status:`dead-pid`,lockPath:r,lock:a}}function bn(e){return e.status===`unverified-owner`?`Cannot verify shutdown: the server lock at ${e.lockPath} does not record its owning machine, and its recorded process ${e.pid} is still running on this machine. Check whether process ${e.pid} is an OpenKnowledge server. If it is, stop it and retry. Do not remove the lock file while that process is running.`:`Cannot verify shutdown: the server lock at ${e.lockPath} belongs to another machine. Stop OpenKnowledge on the owning machine. Confirm that no OpenKnowledge server is using this directory on the owning machine or any other machine sharing it. Only then remove the stale lock file at ${e.lockPath} and retry cleanup.`}function xn(e){return e.replace(/:\d+$/,``)}function Sn(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:xn(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:xn(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:xn(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.\-~%]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}const Cn=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],wn=[...y.map(e=>T[e]),`open-knowledge`];function Tn(e){if(!oe(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=B(e);if(t===V||L(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function En(e,t){let n=z(e,t);if(n.startsWith(`..`)||oe(n))return!1;let r=e;for(let e of n.split(V)){r=R(r,e);try{if(!ue(r).isDirectory())return!1}catch{return!1}}return!0}function Dn(e,t){try{return G(e).every(n=>t.has(R(e,n)))}catch{return!1}}function On(e){let t=Tn(e),n=[],r=[],i=new Set;for(let e of Cn){let a=R(t,e.hostDir,`skills`);if(!En(t,a))continue;let o=wn.map(e=>R(a,e)).filter(e=>H(e));n.push(...o);for(let e of o)i.add(e);let s=R(t,e.pruneRoot),c=a;for(;Dn(c,i)&&(r.push(c),i.add(c),c!==s);){let e=L(c);if(e===c||e===t||!e.startsWith(t+V))break;c=e}}return{skillDirs:n,emptyDirs:r}}function kn(e){try{if(!ue(e).isDirectory())return!1;let t=G(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function An(e){let t=new Set,n=new Set;for(let r of Cn){let i=R(e,r.hostDir,`skills`);for(let e of wn)t.add(R(i,e));let a=R(e,r.pruneRoot),o=i;for(;n.add(o),o!==a;){let t=L(o);if(t===o||t===e||!t.startsWith(e+V))break;o=t}}return{skillDirs:t,emptyDirs:n}}function jn(e,t){let n=Tn(e),r=An(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(En(n,e)&&kn(e))try{K(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(En(n,e))try{me(e),a.push(e)}catch{}return a}function Mn(e){let t=Tn(e),r=[];for(let e of y){let i=T[e];r.push({path:R(t,`.agents`,`skills`,i),bundleId:e,scope:`central`});for(let a of n)r.push({path:R(t,a.skillsRoot,i),bundleId:e,scope:`host`,hostDir:a.hostDir})}return r}function Nn(e,t){let n=[];for(let r of Mn(e))if(r.bundleId===t)try{K(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}function Pn(e){return e!=null&&e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function Fn(e,t=Date.now()){if(e===null)return`—`;let n=o(e,t);return n===`unknown`?`—`:n}function In(e){let t=L(e);return I(e)===`local`&&I(t)===`.ok`?L(t):I(e)===`.ok`?t:null}function Ln(e,t,n,r){if(t.status===`missing`||t.status===`corrupt`||t.status===`read-error`)return null;if(t.status===`unverified-owner`)return{directory:In(e),server:{port:null,status:t.status,pid:t.pid,startedAt:null,usage:null},ui:null,hostname:null,lockPath:t.lockPath,binary:null,command:null,isDesktop:!1};let i=t.lock,a=t.status===`alive`&&w(i)?{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r}:null;return{directory:i.worktreeRoot,server:{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r},ui:a,hostname:i.hostname,lockPath:t.lockPath,binary:n==null?null:b(n),command:n,isDesktop:Pn(n)}}function Rn(e){let t=e.server.status;switch(t){case`unverified-owner`:return`unverified`;case`alive`:return e.isDesktop?`desktop`:`running`;case`foreign-host`:return e.isDesktop?`desktop`:`foreign`;case`dead-pid`:return`stale`;default:return t}}const zn=new Set([`running`,`desktop`,`foreign`,`unverified`]);function Bn(e){switch(e){case`running`:return Z.default.green(e);case`desktop`:return Z.default.blue(e);case`foreign`:return Z.default.cyan(e);case`unverified`:case`stale`:return Z.default.yellow(e)}}function Vn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function Hn(e){return`${Vn(e.server.usage)} | ${Vn(e.ui?.usage??null)}`}function Un(e){return`${e.server.port===null?`—`:e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null?`—`:String(e.ui.port)}`}function Wn(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=>[e.directory??`—`,Un(e),Hn(e),Rn(e),String(e.server.pid),Fn(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=Bn(Rn(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=Z.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
11
|
-
`)}async function Gn(e={}){let t=e.discover??O,n=e.inspect??(e=>$(e,`server`)),r=e.log??(e=>console.log(e)),i=e.resolveCommand??v,a=e.resolveUsage??te,o=await t(),s=[];for(let e of o){let t=n(e),r=Ln(e,t,t.status===`missing`||t.status===`corrupt`||t.status===`read-error`||t.status===`unverified-owner`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`||t.status===`read-error`||t.status===`unverified-owner`?null:a(t.lock.pid));r!=null&&s.push(r)}if(e.json){let e=s.map(e=>({...e,displayStatus:Rn(e)}));r(JSON.stringify(e,null,2));return}r(Wn(e.all?s:s.filter(e=>zn.has(Rn(e)))))}function Kn(){return new A(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale entries (foreign and unverified entries already show)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await Gn({all:t.all===!0||e===`all`,json:t.json===!0})})}async function qn(e,t=N()){let n=$(e,`server`);if(n.status!==`alive`&&n.status!==`foreign-host`)return null;let r=x(n.lock);if(r===null)return null;try{let n=await fetch(`${r}/api/server-info`,{signal:AbortSignal.timeout(1500),redirect:`manual`});if(!n.ok)return t?.warn({lockDir:e,baseUrl:r,outcome:`http-error`,status:n.status},`stop client-probe failed`),null;let i=(await n.json())?.collabClients;return typeof i==`number`&&Number.isFinite(i)?i:(t?.warn({lockDir:e,baseUrl:r,outcome:`no-client-count`,received:typeof i},`stop client-probe failed`),null)}catch(n){return t?.warn({lockDir:e,baseUrl:r,outcome:`unreachable`,err:n},`stop client-probe failed`),null}}function Jn(e,t={}){return{targets:Xn(e,t.isAlive??m)?[{name:`server`,pid:e.lock.pid,port:e.lock.port}]:[]}}async function Yn(e){let t=e.inspect??(()=>$(e.lockDir,`server`)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=e.probeClients??qn,o=e.logger??N(),s=Jn(t(),{isAlive:e.isAlive});if(s.targets.length===0)return r(`No running open-knowledge processes.`),o?.info({lockDir:e.lockDir,targets:0},`stop found nothing to signal`),{stopped:[],failed:[],hadTargets:!1};if(e.force!==!0){let t=await a(e.lockDir,o);if(t!==null&&t>0)return i(`Not stopping: ${t} collaboration client${t===1?``:`s`} (editor window${t===1?``:`s`} or agents) still connected to the server at ${e.lockDir}. Close them, or re-run with --force to terminate anyway.`),o?.warn({lockDir:e.lockDir,clients:t,pids:s.targets.map(e=>e.pid)},`stop declined: live collaboration clients`),{stopped:[],failed:[],hadTargets:!0,declined:{clients:t}}}let c=[],l=[];for(let e of s.targets)try{n(e.pid,`SIGTERM`),c.push(e)}catch(t){l.push({target:e,error:t instanceof Error?t.message:String(t)})}return c.length>0&&r(`Stopped: ${c.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),o?.info({lockDir:e.lockDir,signalled:c.map(e=>({name:e.name,pid:e.pid,port:e.port})),failed:l.map(({target:e,error:t})=>({pid:e.pid,error:t})),forced:e.force===!0},`stop signalled processes`),l.length>0&&i(`Failed to stop: ${l.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:c,failed:l,hadTargets:!0}}function Xn(e,t){return e.status===`alive`||e.status===`foreign-host`&&t(e.lock.pid)}async function Zn(e,t=m){let n=await O(),r=null;for(let i of n){let n=$(i,`server`);if(Xn(n,t)){if(n.lock.port===e)return i;r===null&&n.lock.pid===e&&(r=i)}}return r}async function Qn(e,t){let n=await Yn({lockDir:e,force:t});return(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1),n}function $n(e,t,n={}){return t===0?`Nothing was running for ${e}, and no other open-knowledge servers are running.`:`Nothing was running for ${e}. ${t} other open-knowledge server${t===1?` is`:`s are`} running${n.listingFollows===!0?``:" — run `ok ps` to list them"}.`}async function er(e){let t=await O(),n=0;for(let r of t)r!==e&&Xn($(r,`server`),m)&&n++;return n}function tr(e){return new A(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the enclosing project — run it from anywhere inside the project. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).option(`--force`,`Stop even when editor windows or agents are still connected to the server`).action(async(t,n)=>{let r=n.force===!0,i=t.length===0?void 0:t.join(` `);if(i===void 0){e();let t=C(process.cwd()),n=await Yn({lockDir:t,force:r,log:()=>{}});if(n.hadTargets){if(n.stopped.length>0){let e=n.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1)}else{let e=await er(t);console.log($n(process.cwd(),e,{listingFollows:e>0})),e>0&&await Gn({})}return}if(i===`all`){let e=await O();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e)Xn($(n,`server`),m)&&(await Qn(n,r),t++);t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(i)){let e=Number.parseInt(i,10),t=await Zn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}await Qn(t,r);return}let a=B(Ae(),i),o=C(a),s=[],c=await Yn({lockDir:o,force:r,log:e=>s.push(e)});if((c.failed.length>0||c.declined!==void 0)&&(process.exitCode=1),c.hadTargets)for(let e of s)console.log(e);else console.log($n(a,await er(o)))})}export{Ie as C,De as E,Fe as S,ke as T,Je as _,jn as a,Ne as b,Mn as c,$ as d,yn as f,Y as g,Ye as h,Kn as i,Sn as l,gn as m,Yn as n,On as o,hn as p,tr as r,Nn as s,qn as t,bn as u,Re as v,Ae as w,Me as x,je as y};
|
package/dist/src-uidD5ZLv.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./md-manager-BGnqyqi1-CofDfbRH.mjs";import"./init-CbXAMIbD.mjs";import"./registry-probes-DcQmklSR.mjs";import"./src-73Vc4tlm.mjs";import"./start-B81qeDBS.mjs";import{n as e}from"./loader-D2-o7csT.mjs";import"./preview-SCS9uRyV.mjs";import"./cli.mjs";import"./repair-mcp-configs-Boh7ga7s.mjs";export{e as loadConfig};
|
package/dist/start-Rczs5F9g.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,m as t,p as n,r}from"./start-B81qeDBS.mjs";export{r as bootStartServer,n as resolveBundledReactShellDir,t as resolveHost,e as startCommand};
|