@inkeep/open-knowledge 0.42.0-beta.1 → 0.42.0-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/{acp-harness-probe-DZnPEf9-.mjs → acp-harness-probe-Du_PVB_P.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +50 -50
- package/dist/constants-Jq21Pm6p.mjs +2 -0
- package/dist/{git-handle-DhB8pMxn.mjs → git-handle-JgY8Ytwb.mjs} +2 -2
- package/dist/git-handle-maG17s4k.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-BBYxg46o.mjs +1 -0
- package/dist/{init-uTdz87X5.mjs → init-DEzyD1YK.mjs} +4 -4
- package/dist/{launch-json-removal-CTzoVeAw.mjs → launch-json-removal-CbMg4I0R.mjs} +2 -2
- package/dist/{loader-DBXt4kCU.mjs → loader-DO9rcR2q.mjs} +2 -2
- package/dist/loader-DtiWOOTx.mjs +1 -0
- package/dist/md-manager-BHEZ9tjn.mjs +2 -0
- package/dist/{open-browser-BF9asHW5.mjs → open-browser-BqBGMi_2.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-Boysj7-C.mjs → preview-7FhIhdGC.mjs} +2 -2
- package/dist/preview-Bt_EkZoA.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-u68UWz8E.js → ActivityModeContent-5kzpB8WF.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-CErSjrIY.js → AgentDiffPane-CH_Uedi-.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-hugsIbIJ.js → AgentThreadClientBinder-D_oI6JYB.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-W-HrSfG7.js → CodeMirrorPropInput-C5y2rXYX.js} +1 -1
- package/dist/public/assets/{DocumentContext-_tX3qKOV.js → DocumentContext-fuUQIepk.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CxwGEx10.js → EditorModeToggle-v_8_QyqL.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-lEN_ISsR.js → EnableSyncConfirmDialog-DGzRLORN.js} +1 -1
- package/dist/public/assets/FeedbackForm-CZgsAWY7.js +1 -0
- package/dist/public/assets/{GraphPanel-DNpPt3pH.js → GraphPanel-Bp-rgKAp.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BGWTI23n.js → LintConfigEditor-P94jXYrX.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DZFmC3zE.js → ManagedArtifactProperties-fjWoKeUA.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-eMZVa1ck.js → McpConsentDialogBody-DQKGlIrW.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-B1xJVObm.js → MermaidDocEditor-LMmhg9P3.js} +1 -1
- package/dist/public/assets/{PropertyPanel-D7GPDQvx.js → PropertyPanel-DP1c3fMs.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-DOpoiIZq.js → ReportBugDialogBody-CN9m_7Kk.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-D7uWNsYS.js → SchemaConfigEditor-DgQ8bbvw.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-XnQB6Kg7.js → SettingsDialogBody-tm_Zr9wy.js} +2 -2
- package/dist/public/assets/{ShareBranchSwitchDialog-BngT6P81.js → ShareBranchSwitchDialog-C5BWlfbq.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-CZ2dEnM4.js → ShareReceiveDialog-CI2Mloot.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-CpSIFfUD.js → ShareReceiveMissDialog-ohgoelQ3.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-D27NbOxm.js → SkillEditorActions-B3vkquAC.js} +1 -1
- package/dist/public/assets/{SourceEditor-Bvj8S3c9.js → SourceEditor-BS9xKRLC.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CFhSnAHT.js → TerminalPanel-BNrFiNj3.js} +1 -1
- package/dist/public/assets/{TerminalSessionsHost-ckPCPa6U.js → TerminalSessionsHost-1SkLbZxP.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-Cxh49lHL.js → TerminalWindowApp-CcIKz82K.js} +1 -1
- package/dist/public/assets/{ThreadView-Dsj07V5d.js → ThreadView-DbEiSAgi.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-Ha27073_.js → TimelineDiffPane-BRIL_hOz.js} +1 -1
- package/dist/public/assets/{agent-diff-store-DcsR3_eA.js → agent-diff-store-CL1zJhM8.js} +1 -1
- package/dist/public/assets/{agent-visibility-CwhjaNJb.js → agent-visibility-DboUkSIR.js} +1 -1
- package/dist/public/assets/{auth-state-cache-9L3Z7bPO.js → auth-state-cache-CnTQSDtz.js} +1 -1
- package/dist/public/assets/{client-version-eWqygX6S.js → client-version-Cx5VddNZ.js} +1 -1
- package/dist/public/assets/{config-provider-B1jegIaK.js → config-provider-BvRqIV8_.js} +1 -1
- package/dist/public/assets/dist-CRnLx168.js +565 -0
- package/dist/public/assets/{doc-hash-TU56lovV.js → doc-hash-DaHNz5tZ.js} +1 -1
- package/dist/public/assets/{documents-events-BmGxWE_O.js → documents-events-CO5GMB1j.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-CW0zULZ8.js → file-tree-adapter-CMkAk18U.js} +1 -1
- package/dist/public/assets/{file-tree-utils-20SGrAJE.js → file-tree-utils-DW5kpGI7.js} +1 -1
- package/dist/public/assets/{globals-CezyNKpk.js → globals-CXEWtNVL.js} +1 -1
- package/dist/public/assets/{index-CoO-My9V.js → index-lO6NOXfq.js} +7 -7
- package/dist/public/assets/{lint-config-client-CLEuUXrL.js → lint-config-client-ClOK3XHG.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-Bywm5wAG.js → markdownlint-rule-browser-BkNWMW9T.js} +1 -1
- package/dist/public/assets/{navigation-targets-52MmC1_U.js → navigation-targets-BvMgbXSl.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-BfTDReRw.js → open-managed-artifact-tab-uWUnYmu7.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-B16WQsP1.js → pending-receive-nav-store-ZP5ClzoO.js} +1 -1
- package/dist/public/assets/{prop-types-B1Zd-BzE.js → prop-types-CaVq0ILj.js} +1 -1
- package/dist/public/assets/{receive-store-DaCyGWZ8.js → receive-store-O26Klsmj.js} +1 -1
- package/dist/public/assets/{selection-context-Z-mIEBtM.js → selection-context-D1dfmp_3.js} +1 -1
- package/dist/public/assets/{skill-actions-DgZAwY3f.js → skill-actions-BOEtYQao.js} +1 -1
- package/dist/public/assets/{skills-api-DrpuRRFg.js → skills-api-BxZRuTIF.js} +1 -1
- package/dist/public/assets/{src-4_jgKSnl.js → src-BPnSaHfB.js} +1 -1
- package/dist/public/assets/{tag-pill-input-B5NBVMwu.js → tag-pill-input-D3yKn_j2.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BnHZKEcs.js → target-navigation-intent-DKN8qckv.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-6T2WclE5.js → terminal-launch-events-cbz64adZ.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-BZJHsXjJ.js → terminal-telemetry-B-8TrAWX.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-Cw8nGlH3.js → typing-burst-detector-u3Nddbn5.js} +1 -1
- package/dist/public/assets/{uninstall-DTN6KyP_.js → uninstall-B_24eCu8.js} +1 -1
- package/dist/public/assets/{use-activity-panel-m-VKqzJo.js → use-activity-panel-DfbfDD9Z.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-CJg7IlZP.js → use-apply-config-color-theme-CsOxA7Ln.js} +1 -1
- package/dist/public/assets/{use-collab-url-Xoq2t6gH.js → use-collab-url-DKVO0F_k.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-00y4JcIq.js → use-live-xterm-theme-DxXMX-ZB.js} +1 -1
- package/dist/public/assets/{use-settings-route-_m9ufge3.js → use-settings-route-R3f95s9q.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-D5uTKwRh.js → use-terminal-enabled-FmmwhtBs.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CbMf4FDN.js → use-timeline-entry-diff-B4mNkRPy.js} +1 -1
- package/dist/public/assets/{use-workspace-DoPR3NIK.js → use-workspace-DQ7VjlT1.js} +1 -1
- package/dist/public/assets/{workspace-paths-Yyh63AfX.js → workspace-paths-CFyvLimb.js} +1 -1
- package/dist/public/index.html +36 -36
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-CWBFyOaT.mjs → repair-launch-json-LkGq6bbj.mjs} +2 -2
- package/dist/{repair-mcp-configs-B5YsljOY.mjs → repair-mcp-configs-xbGF2ooR.mjs} +2 -2
- package/dist/{repair-skills-D_L4icfW.mjs → repair-skills-C0Geadpr.mjs} +2 -2
- package/dist/repair-skills-D19a_XVe.mjs +1 -0
- package/dist/server-lock-DUfHjP3M.mjs +1 -0
- package/dist/{server-lock-3q7_tD5g.mjs → server-lock-rqh-yT8R.mjs} +2 -2
- package/dist/src-DF_K89lg.mjs +1 -0
- package/dist/{src-BQaNxllH.mjs → src-Dex2lDDb.mjs} +6 -6
- package/dist/{src-yGbbbpwJ.mjs → src-Q2mWJGdH.mjs} +57 -57
- package/dist/src-phea8qFf.mjs +3265 -0
- package/dist/{start-c-jWIYo0.mjs → start-BprUXI6x.mjs} +2 -2
- package/dist/start-kk-goUtr.mjs +1 -0
- package/dist/{write-project-skill-DkFkNyml.mjs → write-project-skill-CG87XS-d.mjs} +4 -4
- package/package.json +4 -4
- package/dist/constants-BfUYZ4Q7.mjs +0 -2
- package/dist/git-handle-Cwo_S7Qi.mjs +0 -1
- package/dist/init-DXtkD181.mjs +0 -1
- package/dist/loader-BDzsgerB.mjs +0 -1
- package/dist/md-manager-Bwf8zjhw.mjs +0 -2
- package/dist/preview-CIyXvNJf.mjs +0 -1
- package/dist/public/assets/FeedbackForm-BfvH-Ple.js +0 -1
- package/dist/public/assets/dist-CCI-dTBQ.js +0 -565
- package/dist/repair-skills-ShDwT2mc.mjs +0 -1
- package/dist/server-lock-CnaEYj4j.mjs +0 -1
- package/dist/src-DjVPGYhD.mjs +0 -3265
- package/dist/src-GHWmVUxv.mjs +0 -1
- package/dist/start-CQVSYXiP.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{Yt as r}from"./dist-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{Yt as r}from"./dist-CRnLx168.js";var i=n(),a=e(t(),1);function o(){let e=(0,i.c)(3),[t,n]=(0,a.useState)(l),o,u;return e[0]===t?(o=e[1],u=e[2]):(o=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let i=await t.json().catch(c);if(!e||!t.ok)return;let a=r.safeParse(i);a.success&&n({contentDir:a.data.contentDir,pathSeparator:a.data.pathSeparator})}).catch(s),()=>{e=!1}},u=[t],e[0]=t,e[1]=o,e[2]=u),(0,a.useEffect)(o,u),t}function s(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function c(){return null}function l(){return u()}function u(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./createLucideIcon-DAkhoPjT.js";import{Mn as i}from"./dist-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./createLucideIcon-DAkhoPjT.js";import{Mn as i}from"./dist-CRnLx168.js";var a=r(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),o=r(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),s=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),c=[`global`,`project`];function l(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var u=`open-knowledge-pack-`;function d(e){return e.startsWith(u)?e.slice(20):e}function f(){let{_:e}=n();return{project:e({id:`e0NrBM`}),global:e({id:`2GT3Hf`})}}function p(){let{_:e}=n();return{project:e({id:`HyvSqq`}),global:e({id:`C7XjNB`})}}var m=e(t(),1);function h(){let[e]=(0,m.useState)(g);return e}function g(){return i()!=null}function _(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var v=/\.(md|mdx)$/i;function y(e){return v.test(e)?e:`${e}.md`}export{d as a,p as c,a as d,c as i,s as l,_ as n,l as o,h as r,f as s,y as t,o as u};
|
package/dist/public/index.html
CHANGED
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
-->
|
|
59
59
|
<script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let ct = null; try { const c = localStorage.getItem('ok-color-theme-v1'); if (c && ['dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', 'custom'].includes(c)) ct = c; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let customCss = null; if (ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (o?.css) { customCss = o.css; dark = !!o.dark; } } } catch {} if (!customCss) ct = null; } else if (ct) { dark = !['catppuccin-latte'].includes(ct); } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (customCss) { const s = document.createElement('style'); s.id = 'ok-custom-theme'; s.textContent = customCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
|
|
60
60
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
61
|
-
<script type="module" crossorigin src="./assets/index-
|
|
61
|
+
<script type="module" crossorigin src="./assets/index-lO6NOXfq.js"></script>
|
|
62
62
|
<link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
|
|
63
63
|
<link rel="modulepreload" crossorigin href="./assets/dist-q14fBS3T.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-DPxgxlDT.js">
|
|
66
|
-
<link rel="modulepreload" crossorigin href="./assets/globals-
|
|
66
|
+
<link rel="modulepreload" crossorigin href="./assets/globals-CXEWtNVL.js">
|
|
67
67
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-Chd9yIcd.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-DtWCia6R.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="./assets/dist-DNwOaDhC.js">
|
|
@@ -80,14 +80,14 @@
|
|
|
80
80
|
<link rel="modulepreload" crossorigin href="./assets/trace-api-DHyWZzIa.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="./assets/lib-Iu39CNZE.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-YwcN3EvW.js">
|
|
83
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
83
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-CRnLx168.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="./assets/dist-PQ5KMVDh.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BfE3aGVn.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin href="./assets/client-version-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-
|
|
87
|
+
<link rel="modulepreload" crossorigin href="./assets/client-version-Cx5VddNZ.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-CsOxA7Ln.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="./assets/config-context-gd3BC-iY.js">
|
|
90
|
-
<link rel="modulepreload" crossorigin href="./assets/config-provider-
|
|
90
|
+
<link rel="modulepreload" crossorigin href="./assets/config-provider-BvRqIV8_.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="./assets/bundle-mjs-SHeFpKGC.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="./assets/createLucideIcon-DAkhoPjT.js">
|
|
@@ -125,20 +125,20 @@
|
|
|
125
125
|
<link rel="modulepreload" crossorigin href="./assets/folder-open-wLd69QUc.js">
|
|
126
126
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-BUuL4OCw.js">
|
|
127
127
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-Clgvyc7B.js">
|
|
128
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-utils-
|
|
129
|
-
<link rel="modulepreload" crossorigin href="./assets/doc-hash-
|
|
130
|
-
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-
|
|
128
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-utils-DW5kpGI7.js">
|
|
129
|
+
<link rel="modulepreload" crossorigin href="./assets/doc-hash-DaHNz5tZ.js">
|
|
130
|
+
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-BvMgbXSl.js">
|
|
131
131
|
<link rel="modulepreload" crossorigin href="./assets/external-link-T4Nj1gcG.js">
|
|
132
132
|
<link rel="modulepreload" crossorigin href="./assets/documents-fetch-CLL0O1of.js">
|
|
133
|
-
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-
|
|
133
|
+
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-C5y2rXYX.js">
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/git-branch-CMJAiYLz.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/copy-9EDFYcyR.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/CopyButton-1Q6Wnnjb.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/documents-events-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/documents-events-CO5GMB1j.js">
|
|
138
138
|
<link rel="modulepreload" crossorigin href="./assets/parse-api-error-C_gwkKmG.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/startup-marks-CqVzdU1y.js">
|
|
140
|
-
<link rel="modulepreload" crossorigin href="./assets/prop-types-
|
|
141
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-
|
|
140
|
+
<link rel="modulepreload" crossorigin href="./assets/prop-types-CaVq0ILj.js">
|
|
141
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-CFyvLimb.js">
|
|
142
142
|
<link rel="modulepreload" crossorigin href="./assets/eye-CASw1HTi.js">
|
|
143
143
|
<link rel="modulepreload" crossorigin href="./assets/hash-DNKDqZ18.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/info-yKMseklR.js">
|
|
@@ -149,15 +149,15 @@
|
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-wADtjYEi.js">
|
|
150
150
|
<link rel="modulepreload" crossorigin href="./assets/badge-Dba4cvJR.js">
|
|
151
151
|
<link rel="modulepreload" crossorigin href="./assets/input-D0ZW0Opq.js">
|
|
152
|
-
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-
|
|
153
|
-
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-
|
|
152
|
+
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-DKVO0F_k.js">
|
|
153
|
+
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-fuUQIepk.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/format-BVhfvqw3.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/braces-DwnwFx_V.js">
|
|
156
|
-
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-
|
|
157
|
-
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-
|
|
158
|
-
<link rel="modulepreload" crossorigin href="./assets/selection-context-
|
|
159
|
-
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-
|
|
156
|
+
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-uWUnYmu7.js">
|
|
157
|
+
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-ClOK3XHG.js">
|
|
158
|
+
<link rel="modulepreload" crossorigin href="./assets/selection-context-D1dfmp_3.js">
|
|
159
|
+
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-DP1c3fMs.js">
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-DGzRLORN.js">
|
|
161
161
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-right-obRIg3Sv.js">
|
|
162
162
|
<link rel="modulepreload" crossorigin href="./assets/cursor-C1n4GZG0.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-8Tcfr3WP.js">
|
|
@@ -165,40 +165,40 @@
|
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/chevron-left-BQ6OM94c.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-BfeWGCsv.js">
|
|
167
167
|
<link rel="modulepreload" crossorigin href="./assets/copilot-BAzfPGty.js">
|
|
168
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-
|
|
169
|
-
<link rel="modulepreload" crossorigin href="./assets/use-settings-route-
|
|
168
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-DboUkSIR.js">
|
|
169
|
+
<link rel="modulepreload" crossorigin href="./assets/use-settings-route-R3f95s9q.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/clipboard-adapter--Ja4oXEM.js">
|
|
171
|
-
<link rel="modulepreload" crossorigin href="./assets/skills-api-
|
|
172
|
-
<link rel="modulepreload" crossorigin href="./assets/use-workspace-
|
|
173
|
-
<link rel="modulepreload" crossorigin href="./assets/skill-actions-
|
|
171
|
+
<link rel="modulepreload" crossorigin href="./assets/skills-api-BxZRuTIF.js">
|
|
172
|
+
<link rel="modulepreload" crossorigin href="./assets/use-workspace-DQ7VjlT1.js">
|
|
173
|
+
<link rel="modulepreload" crossorigin href="./assets/skill-actions-BOEtYQao.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/square-pen-C1vIlMAW.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/field-DVIFAnvR.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/textarea-RSYJwPz9.js">
|
|
177
|
-
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-
|
|
177
|
+
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-CnTQSDtz.js">
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-Bx4JLuKB.js">
|
|
179
|
-
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-
|
|
180
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-
|
|
179
|
+
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-ZP5ClzoO.js">
|
|
180
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-cbz64adZ.js">
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/panel-right-open-B7ziq39V.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-CYckprSS.js">
|
|
183
183
|
<link rel="modulepreload" crossorigin href="./assets/form-D-z6QdLf.js">
|
|
184
|
-
<link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-
|
|
184
|
+
<link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-v_8_QyqL.js">
|
|
185
185
|
<link rel="modulepreload" crossorigin href="./assets/wrench-BfoTvqT9.js">
|
|
186
186
|
<link rel="modulepreload" crossorigin href="./assets/lint-plugin-meta-B3N1DKgL.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/panel-Cyobla0Z.js">
|
|
188
188
|
<link rel="modulepreload" crossorigin href="./assets/skeleton-HLkcMp95.js">
|
|
189
|
-
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-
|
|
189
|
+
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-u3Nddbn5.js">
|
|
190
190
|
<link rel="modulepreload" crossorigin href="./assets/ConfigSharingInfoTooltip-DMbsfWD9.js">
|
|
191
191
|
<link rel="modulepreload" crossorigin href="./assets/project-paths-Dwo4Of8C.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/follow-file-DBnmqlyk.js">
|
|
193
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-
|
|
194
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-
|
|
195
|
-
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-
|
|
196
|
-
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-
|
|
193
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-CMkAk18U.js">
|
|
194
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-CL1zJhM8.js">
|
|
195
|
+
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-DKN8qckv.js">
|
|
196
|
+
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-DxXMX-ZB.js">
|
|
197
197
|
<link rel="modulepreload" crossorigin href="./assets/use-installed-clis-B_nDAq7A.js">
|
|
198
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-
|
|
198
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-B-8TrAWX.js">
|
|
199
199
|
<link rel="modulepreload" crossorigin href="./assets/agent-presence-CTJkQnoU.js">
|
|
200
200
|
<link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-Xk9UA_MB.js">
|
|
201
|
-
<link rel="modulepreload" crossorigin href="./assets/receive-store-
|
|
201
|
+
<link rel="modulepreload" crossorigin href="./assets/receive-store-O26Klsmj.js">
|
|
202
202
|
<link rel="modulepreload" crossorigin href="./assets/worktree-store-LSx9q9Ga.js">
|
|
203
203
|
<link rel="stylesheet" crossorigin href="./assets/globals-GYHxaktb.css">
|
|
204
204
|
<link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
script above.
|
|
33
33
|
-->
|
|
34
34
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
35
|
-
<script type="module" crossorigin src="./assets/uninstall-
|
|
35
|
+
<script type="module" crossorigin src="./assets/uninstall-B_24eCu8.js"></script>
|
|
36
36
|
<link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="./assets/dist-q14fBS3T.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-DPxgxlDT.js">
|
|
40
|
-
<link rel="modulepreload" crossorigin href="./assets/globals-
|
|
40
|
+
<link rel="modulepreload" crossorigin href="./assets/globals-CXEWtNVL.js">
|
|
41
41
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-Chd9yIcd.js">
|
|
42
42
|
<link rel="modulepreload" crossorigin href="./assets/trace-api-DHyWZzIa.js">
|
|
43
43
|
<link rel="modulepreload" crossorigin href="./assets/lib-Iu39CNZE.js">
|
|
44
44
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-YwcN3EvW.js">
|
|
45
45
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-DtWCia6R.js">
|
|
46
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
46
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-CRnLx168.js">
|
|
47
47
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
|
|
48
48
|
<link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
|
|
49
49
|
<link rel="modulepreload" crossorigin href="./assets/bundle-mjs-SHeFpKGC.js">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./launch-json-removal-
|
|
2
|
-
//# sourceMappingURL=repair-launch-json-
|
|
1
|
+
import{t as e}from"./launch-json-removal-CbMg4I0R.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
|
|
2
|
+
//# sourceMappingURL=repair-launch-json-LkGq6bbj.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as e,l as t,v as n}from"./write-project-skill-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{d as e,l as t,v as n}from"./write-project-skill-CG87XS-d.mjs";import{d as r,v as i}from"./init-DEzyD1YK.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=e[o],s=c(()=>t.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),t.projectConfigPath){let e=t.projectConfigPath,i=c(()=>e(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:t,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
|
|
2
|
+
//# sourceMappingURL=repair-mcp-configs-xbGF2ooR.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e}from"./src-
|
|
1
|
+
import{C as e}from"./src-Q2mWJGdH.mjs";import{Ar as t,Er as n,Fr as r,Or as i,Pr as a,Tr as o,br as s,wr as c,xr as l}from"./src-phea8qFf.mjs";import{C as u,a as d,d as f,f as p,o as m,s as h,t as g}from"./write-project-skill-CG87XS-d.mjs";import{n as _,s as v,t as y}from"./colors-BsmVIwfM.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>t(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>t(e,{checkDesktop:!1}),readBundledVersion:()=>l(),readRecordedVersion:e=>c(e,`cli-hosts`),writeRecordedVersion:(e,t)=>n(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>i(e),readBundleDecision:(e,t)=>s(e,t),writeBundleDecision:(e,t,n)=>o(e,t,n),removeBundleFromDisk:(e,t)=>h(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=r.existsSync(s),l=!1;try{I(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}let d=r.existsSync(u);try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:l}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&z(l,n);if(!c&&!u){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{g(o,e),I(i,o,n);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function V(t,n,i,o){let s=e=>{n.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await n.readRecordedVersion(t)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of r)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let r of d){let s=a[r.id],c=i.existsSync(x(t,`.agents`,`skills`,s)),l=await n.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{n.removeBundleFromDisk(t,r.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:r.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}p.push(r)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>i.existsSync(x(t,`.agents`,`skills`,a[e.id])));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===r.length,_=!0;for(let{id:e,sourceDir:n}of p){let r=R(t,a[e],n,i,o,l);h.push(...r.entries),r.centralWritten||(_=!1)}let v=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(g&&_&&v){let e=null;try{await n.writeRecordedVersion(t,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:l,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=m(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=d(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function U(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function W(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`reclaimed`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} reclaimed, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
|
|
2
2
|
`)}function G(){return new u(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").option(`-y, --yes`,`Skip the confirmation prompt for removing directories left by a pre-0.42 install.`).action(async e=>{let t=await H({projectDir:C(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null,confirmLegacyCleanup:t=>K(t,{yes:e.yes===!0})});process.stdout.write(`${W(t)}\n`),process.exitCode=U(t)})}async function K(e,t){let n=j(),r=e=>`~/${S(n,e)}`,i=t.input??process.stdin,a=[``,y(`A previous version of OpenKnowledge installed its skill into agent tools you may never have used.`),_(`(Versions before 0.42 wrote to every host a third-party installer knew about — see issue #820.)`)];if(e.skillDirs.length>0&&a.push(``,`${y(`Remove OpenKnowledge skills:`)} ${e.skillDirs.length}`,...e.skillDirs.map(e=>` ${r(e)}`)),e.emptyDirs.length>0){let t=e.skillDirs.length>0?`Then remove these, which hold nothing else once the above are gone:`:`Remove these empty directories, left behind by that install:`;a.push(``,`${y(t)} ${e.emptyDirs.length}`,...e.emptyDirs.map(e=>` ${r(e)}`))}if(a.push(``,_(`Nothing outside these paths is touched. A directory that still holds anything is kept.`)),process.stdout.write(`${a.join(`
|
|
3
3
|
`)}\n`),t.yes)return!0;if(!i.isTTY)return process.stdout.write(`${v("Not a terminal — skipping cleanup. Re-run with `ok repair-skills --yes` to remove these.")}\n`),!1;let o=M({input:i,output:process.stdout});try{let e=(await o.question(`\n${y(`Remove them?`)} ${_(`[y/N] `)}`)).trim().toLowerCase();return e===`y`||e===`yes`}finally{o.close()}}export{G as n,H as t};
|
|
4
|
-
//# sourceMappingURL=repair-skills-
|
|
4
|
+
//# sourceMappingURL=repair-skills-C0Geadpr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./repair-skills-C0Geadpr.mjs";export{e as repairSkills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,o as t,r as n}from"./server-lock-rqh-yT8R.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./src-
|
|
2
|
-
//# sourceMappingURL=server-lock-
|
|
1
|
+
import"./src-Q2mWJGdH.mjs";import{r as e}from"./logger-B7Z8XO-z.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{closeSync as i,existsSync as a,mkdirSync as o,openSync as s,readFileSync as c,unlinkSync as l,writeFileSync as u,writeSync as d}from"node:fs";import{homedir as f,hostname as p}from"node:os";import{fileURLToPath as m}from"node:url";import{randomUUID as h}from"node:crypto";function g(e){return new URL(e.url??``,`http://localhost`).searchParams}function _(e){let t=e?.code;return typeof t==`string`?t:void 0}const v=/^[A-Za-z0-9-]{8,64}$/;let y=null;function b(e){return n(e??f(),`.ok`,`machine-id`)}function x(n){if(n===void 0&&y!==null)return y;let r=b(n),i=null;try{let e=c(r,`utf-8`).trim();v.test(e)&&(i=e)}catch{}if(i===null){i=h();try{o(t(r),{recursive:!0}),u(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(y=i),i}function S(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function C(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function w(){try{let e=r(t(m(import.meta.url)),`..`,`package.json`),n=JSON.parse(c(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const T=w(),E=1,D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===x():e.hostname===p()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(c(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==x()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==p())continue;l(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(c(e,`utf-8`));return n&&typeof n==`object`&&C(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,c=`[${t}-lock]`;o(n,{recursive:!0});let f=k(n,t),m={pid:process.pid,hostname:p(),port:r.port,startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:x(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??T},h=JSON.stringify(m,null,2);for(let e=0;e<3;e++){if(!a(f))try{let e=s(f,`wx`,384);try{d(e,h)}finally{i(e)}return j(f),I(f),z({lockName:t,lockDir:n,lockPath:f})}catch(e){if(_(e)!==`EEXIST`)throw e}let e=L(f,c);if(e){if(N(e)&&e.pid===process.pid)return u(f,h,{encoding:`utf-8`,mode:384}),j(f),I(f),z({lockName:t,lockDir:n,lockPath:f});if(S(e.pid))throw new O(e,f,t);D.warn({pid:e.pid,host:e.hostname},`${c} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{l(f)}catch{}}throw Error(`${c} Failed to acquire ${f} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>G({lockName:t,lockDir:n}),updatePort:e=>B({lockName:t,lockDir:n,port:e})}}function B(e){let{lockName:t,lockDir:n,port:r}=e,i=`[${t}-lock]`,o=k(n,t);if(!a(o)){D.warn({lockPath:o},`${i} Lock file missing at ${o} during port update — skipping`);return}let s;try{let e=JSON.parse(c(o,`utf-8`));if(!e||typeof e!=`object`||!C(e.pid)){D.warn({lockPath:o},`${i} Corrupt lock at ${o} during port update — skipping`);return}s=e}catch{D.warn({lockPath:o},`${i} Unreadable lock at ${o} during port update — skipping`);return}if(s.pid===process.pid&&N(s)){s.port=r;try{u(o,JSON.stringify(s,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:o,err:e},`${i} Failed to update port in ${o}: ${e instanceof Error?e.message:String(e)}`)}}}function V(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(c(i,`utf-8`));if(!e||typeof e!=`object`||!C(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){_(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{u(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function H(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!a(r))return null;let i;try{let e=JSON.parse(c(r,`utf-8`));if(!e||typeof e!=`object`||!C(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!S(i.pid)){try{l(r)}catch{}return null}return i}function U(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!a(r))return{status:`absent`};let i;try{i=JSON.parse(c(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let o=i;if(!C(o.pid)||typeof o.hostname!=`string`||typeof o.port!=`number`||typeof o.startedAt!=`string`||typeof o.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:o.pid,hostname:o.hostname,port:o.port,startedAt:o.startedAt,worktreeRoot:o.worktreeRoot,machineId:typeof o.machineId==`string`?o.machineId:void 0,draining:o.draining===!0?!0:void 0,protocolVersion:typeof o.protocolVersion==`number`?o.protocolVersion:void 0,runtimeVersion:typeof o.runtimeVersion==`string`?o.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!S(s.pid)){try{l(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function W(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>H({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function G(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,o=k(n,t);if(M(o)){if(r){V({lockName:t,lockDir:n});return}if(a(o))try{let e=JSON.parse(c(o,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;l(o),P.delete(o)}catch(e){D.warn({lockPath:o,err:e},`${i} Failed to release ${o}: ${e instanceof Error?e.message:String(e)}`)}}}var K=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function q(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new K(e.existing,e.lockPath):e}}function J(e,t){B({lockName:`server`,lockDir:e,port:t})}function Y(e){return H({lockName:`server`,lockDir:e})}function X(e,t){G({lockName:`server`,lockDir:e,...t})}function Z(e){V({lockName:`server`,lockDir:e})}function Q(e,t){return W({lockName:`server`,lockDir:e,...t})}export{g as S,E as _,X as a,x as b,O as c,V as d,H as f,T as g,B as h,Y as i,R as l,G as m,q as n,J as o,U as p,Z as r,Q as s,K as t,k as u,S as v,_ as x,C as y};
|
|
2
|
+
//# sourceMappingURL=server-lock-rqh-yT8R.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Aa as e,C as t,Ka as n,Oa as r,Wa as i,d as a,ka as o,l as s,mo as c,no as l,y as u}from"./src-Q2mWJGdH.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dr as P,Dt as F,E as I,Ei as L,En as R,Er as z,Et as B,F as V,Fi as H,Fn as U,Fr as W,Ft as G,G as K,Gi as q,Gn as J,Gr as Y,Gt as X,H as Z,Hi as Q,Hn as $,Hr as ee,Ht as te,I as ne,Ii as re,In as ie,Ir as ae,It as oe,J as se,Ji as ce,Jn as le,Jt as ue,K as de,Ki as fe,Kn as pe,Kr as me,Kt as he,L as ge,Li as _e,Ln as ve,Lr as ye,Lt as be,M as xe,Mi as Se,Mn as Ce,Mr as we,Mt as Te,N as Ee,Ni as De,Nn as Oe,Nr as ke,Nt as Ae,O as je,Oi as Me,On as Ne,Or as Pe,Ot as Fe,P as Ie,Pi as Le,Pn as Re,Pr as ze,Pt as Be,Q as Ve,Qi as He,Qn as Ue,Qr as We,Qt as Ge,R as Ke,Ri as qe,Rn as Je,Rr as Ye,Rt as Xe,S as Ze,Si as Qe,Sn as $e,Sr as et,St as tt,T as nt,Ti as rt,Tn as it,Tr as at,Tt as ot,U as st,Ui as ct,Un as lt,Ur as ut,Ut as dt,V as ft,Vi as pt,Vn as mt,Vr as ht,Vt as gt,W as _t,Wi as vt,Wn as yt,Wr as bt,Wt as xt,X as St,Xi as Ct,Xn as wt,Xt as Tt,Y as Et,Yi as Dt,Yn as Ot,Yt as kt,Z as At,Zi as jt,Zn as Mt,Zt as Nt,_ as Pt,_i as Ft,_n as It,_r as Lt,a as Rt,aa as zt,ai as Bt,an as Vt,ar as Ht,at as Ut,b as Wt,bi as Gt,bn as Kt,br as qt,bt as Jt,c as Yt,ca as Xt,ci as Zt,cn as Qt,cr as $t,ct as en,d as tn,da as nn,di as rn,dn as an,dr as on,dt as sn,ea as cn,ei as ln,en as un,er as dn,et as fn,f as pn,fa as mn,fi as hn,fn as gn,fr as _n,ft as vn,g as yn,gi as bn,gn as xn,gr as Sn,h as Cn,ha as wn,hi as Tn,hn as En,hr as Dn,i as On,ia as kn,ii as An,in as jn,ir as Mn,it as Nn,j as Pn,ji as Fn,jn as In,jr as Ln,jt as Rn,k as zn,ki as Bn,kn as Vn,kr as Hn,kt as Un,l as Wn,la as Gn,li as Kn,ln as qn,lr as Jn,lt as Yn,m as Xn,ma as Zn,mi as Qn,mn as $n,mr as er,n as tr,na as nr,ni as rr,nn as ir,nr as ar,nt as or,o as sr,oa as cr,oi as lr,on as ur,or as dr,ot as fr,p as pr,pa as mr,pi as hr,pn as gr,pr as _r,q as vr,qi as yr,qn as br,qt as xr,r as Sr,ra as Cr,ri as wr,rn as Tr,rr as Er,rt as Dr,s as Or,sa as kr,si as Ar,sn as jr,sr as Mr,st as Nr,t as Pr,ta as Fr,ti as Ir,tn as Lr,tr as Rr,tt as zr,u as Br,ua as Vr,ui as Hr,un as Ur,ur as Wr,ut as Gr,v as Kr,vi as qr,vn as Jr,vr as Yr,w as Xr,wi as Zr,wn as Qr,wr as $r,wt as ei,x as ti,xi as ni,xn as ri,xr as ii,xt as ai,y as oi,yi as si,yn as ci,yr as li,yt as ui,z as di,zi as fi,zn as pi,zr as mi,zt as hi}from"./src-phea8qFf.mjs";import{C as gi,E as _i,T as vi,_ as yi,b as bi,c as xi,d as Si,g as Ci,i as wi,l as Ti,m as Ei,n as Di,p as Oi,s as ki,t as Ai,u as ji,v as Mi,w as Ni,x as Pi,y as Fi}from"./fs-traced-Cc6WsRtP.mjs";import{a as Ii,d as Li,f as Ri,i as zi,l as Bi,n as Vi,r as Hi,t as Ui,u as Wi}from"./logger-B7Z8XO-z.mjs";import{_ as Gi,a as Ki,b as qi,c as Ji,f as Yi,g as Xi,h as Zi,i as Qi,l as $i,m as ea,n as ta,o as na,p as ra,r as ia,s as aa,t as oa,u as sa,v as ca,y as la}from"./server-lock-rqh-yT8R.mjs";export{cr as AGENT_ID_MAX_LEN,kr as AGENT_ID_RE,S as AGENT_WRITE_ORIGIN,mr as AcpPermissionStore,Vr as AcpRegistry,_e as AcpThreadManager,H as AgentFocusBroadcaster,Le as AgentPresenceBroadcaster,pt as AgentSessionCapacityError,Q as AgentSessionManager,Jt as AutoStartDisabledError,we as BUNDLE_IDS,ke as BUNDLE_SCOPE,ze as BUNDLE_SKILL_NAME,Mt as BacklinkIndex,Dt as CC1Broadcaster,n as CC1_CONTRACT_VERSION,jr as CONFIG_FILENAME,pe as CONFLICT_MARKER_RE,rr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Pt as ConfigSchema,In as DEFAULT_CHECKPOINT_RETENTION,qr as DEFAULT_EMBEDDINGS_DIMENSIONS,Xe as DEFAULT_PACK_ID,K as DocumentDurabilityState,si as EMBEDDINGS_API_KEY_ENV,nn as FEATURED_AGENT_IDS,Ce as FILE_SYSTEM_WRITER,wt as FILE_WATCHER_ORIGIN,hn as FileEmbeddingsBackend,ir as GIT_PREFLIGHT_FAIL_SPAN_NAME,Oe as GIT_UPSTREAM_WRITER,Zn as GitDirAccessError,Mn as GitNotAvailableError,Ht as GitTooOldError,ai as HOCUSPOCUS_AUTH_REJECTION_REASONS,tt as HocuspocusAuthRejection,A as HocuspocusAuthTokenSchema,Zt as INSTALLED_AGENTS_SCHEMES,i as LINEAGE_EPOCH_KEY,Z as LIVE_DERIVED_INDEX_DEBOUNCE_MS,hi as LOG_MD_TEMPLATE,Un as MANAGED_RENAME_ORIGIN,qe as MAX_ACP_THREADS,ct as MAX_AGENT_SESSIONS,sn as MCP_CONNECTION_ID_HEADER,r as MCP_SERVER_NAME,vt as MIN_EVICTABLE_IDLE_MS,dr as MIN_GIT_VERSION,de as MISSING_OK_CONFIG_MESSAGE,wn as MalformedGitPointerError,Dr as McpLogger,vr as MissingOkConfigError,V as OBSERVER_SYNC_ORIGIN,Qt as OK_OKIGNORE_TEMPLATE,o as ORPHAN_MODES,c as PROTOCOL_VERSION,Ui as PinoLogger,Ji as ProcessLockCollisionError,Wn as ProjectGitInitError,b as ROLLBACK_ORIGIN,qn as ROOT_GITIGNORE_TEMPLATE,Xi as RUNTIME_VERSION,Re as SERVICE_WRITER,P as SKILL_INSTALL_EVENTS_FILE_REL,u as SKILL_STATE_TARGETS,T as STARTER_FOLDERS,gt as STARTER_FOLDER_FRONTMATTER_FILENAME,te as STARTER_PACKS,dt as STARTER_PACK_IDS,xt as STARTER_TEMPLATES,I as STATE_MANIFEST_FILENAME,Gi as STATE_SCHEMA_VERSION,l as SYSTEM_DOC_NAME,Tt as SeedPrerequisiteError,Nt as SeedRootDirError,oa as ServerLockCollisionError,Pr as SingleFileNotAFileError,tr as SingleFileNotFoundError,Sr as SingleFileNotMarkdownError,j as StateManifestError,nt as TagIndex,W as USER_GLOBAL_BUNDLE_IDS,p as UiLockCollisionError,Rn as __getShowAllWalkStatsForTesting,Te as __resetShowAllWalkStatsForTesting,$i as acquireProcessLock,ta as acquireServerLock,dn as acquireUiLock,q as applyAgentMarkdownWrite,Vn as applyExternalChange,be as applySeed,je as assertCompatibleStateManifest,Mr as assertGitAvailable,It as assertNeverDiskEvent,re as attachAcpThreadSocket,ui as attachIdleShutdown,Kr as bootServer,Sn as buildAndOpenSkill,Ur as buildConfigYmlContent,Ve as buildExecResult,fi as buildOkMcpStdioCommand,Hn as buildSkillZip,X as buildStarterFolderFrontmatterYaml,U as buildWipTree,ae as bundleSkillMdPath,hr as canonicalProjectKey,Jr as classifyEvents,Ai as classifyFsPath,Qn as clearAllEmbeddingsKeys,ni as clearContributors,he as coercePackId,s as colorFromSeed,ie as commitUpstreamImport,ve as commitWip,Je as commitWipFromTree,$t as compareSemver,mi as composeEffectiveLinterConfig,w as composeFrontmatterSchemasConfig,br as containsConflictMarkers,ci as contentHash,Qe as contributorCount,Ke as countShadowObjects,di as countStaleAgentWipRefs,x as countWipRefs,Ae as createApiExtension,Fn as createAssetServeMiddleware,We as createContentFilter,m as createContentFilterAsync,Tn as createEmbeddingsSecretStore,On as createEphemeralProjectDir,v as createExternalChangeHandler,pn as createFileLogger,st as createLiveDerivedIndexExtension,St as createMcpHttpHandler,Kn as createOsProbe,Ie as createPersistenceExtension,E as createServer,xe as createServerObserverExtension,fe as createStreamingErrorWriter,Vi as createTestLogger,bn as describeStoredEmbeddingsKey,yn as detectClaudeDesktopPresence,Jn as detectGit,zn as detectProjectShape,Lt as detectUserSkillHosts,fr as discoverLockDirs,ut as discoverMarkdownlintConfig,Tr as emitPreflightFailureSpan,d as encodeDocName,fn as encodeFolderRoute,zr as encodeSkillRoute,Br as ensureProjectGit,an as ensureProjectSkillGitignore,yr as errorResponse,Kt as evictStaleTrackerEntries,Nr as extractOkBinaryPath,Ue as extractWikiLinksFromMarkdown,Wr as fallbackPaths,tn as findEnclosingGitRoot,En as findEnclosingProjectRoot,bt as findNativeMarkdownlintFile,pr as flushFileLogger,ei as formatAuthRejectionWire,D as formatContributors,Zr as formatContributorsFrom,G as formatPackRationale,pi as gcCheckpointRefs,Nn as getCurrentMcpLogger,Me as getLocalDir,Xn as getLogFilePath,Hi as getLogger,Cn as getLogsDir,qi as getMachineId,Fi as getMeter,Fr as getMetrics,bi as getTracer,nr as handleCollabSocketError,wr as handleSpawnCursor,ft as hasGcLogLatch,a as iconFromClientName,Cr as incrementCollabSocketFilteredError,kn as incrementServerObserverFire,gn as initContent,C as initShadowRepo,Pi as initTelemetry,Wt as initToleranceTelemetryWriter,Gr as installPrettyZodErrors,zi as installTestLoggers,Yr as installUserSkill,De as isAllowedApiOrigin,Ge as isAllowedWorkspaceHostHeader,Ct as isConfigDoc,ot as isHocuspocusAuthRejectionReason,xr as isKnownPackId,jt as isLinkIndexExcludedDoc,h as isLoopbackAddress,He as isManagedArtifactDoc,e as isOrphanMode,ne as isPairedWriteOrigin,An as isPathWithinDir,ca as isProcessAlive,xn as isProjectRoot,_n as isProjectSkillManaged,f as isReservedForUserTree,ri as isSelfWrite,cn as isSystemDoc,ti as isToleranceTelemetryEnabled,la as isValidLockPid,$e as lastKnownHash,mt as listRescueCheckpoints,ue as listStarterPacks,mn as loadCustomAgents,Ee as loadPrincipal,sa as lockFilePath,Ii as loggerFactory,Bi as logsCurrentPath,Wi as logsPreviousPath,Ft as makeLazyEmbeddingsKeyStore,ia as markServerLockDraining,se as mountMcpAndApi,Di as normalizeFsPath,ye as originGitHubHost,gr as packageVersionMajorMinor,B as parseAuthRejectionWire,on as parseGitVersion,F as parseHocuspocusAuthToken,Et as parseKeepaliveConnectionId,O as pathToDocName,oe as planSeed,Rt as prepareSingleFileOpen,en as processCommand,Yn as processUsage,li as readAllTargets,qt as readBundleDecision,Y as readOwnNativeRules,Yi as readProcessLock,ra as readProcessLockDetailed,_t as readProjectHeadState,rn as readProjectLocalSemanticConfig,Qi as readServerLock,ii as readServerPackageVersion,et as readSkillInstallStateSnapshot,_r as readSkillManagement,g as readStateManifest,k as readTargetRecordedAt,$r as readTargetVersion,Rr as readUiLock,le as reconcile,rt as recordContributor,Pe as recordSkillInstallEvent,At as registerAllTools,Qr as registerWrite,ea as releaseProcessLock,Ki as releaseServerLock,ar as releaseUiLock,it as removeLastKnownHash,zt as resetMetrics,t as resolveBundleEnabled,y as resolveBundledSkillDir,Bn as resolveContentDir,Bt as resolveCursorBinaryDefault,lr as resolveCursorSpawnInvocation,ht as resolveEffectiveLinterConfig,Gt as resolveEmbeddingsCredential,_ as resolveLockDir,ee as resolveNativeConfigForDoc,me as resolveNativeMarkdownlintConfig,kt as resolvePack,Or as resolvePackageVersion,or as resolveUiInfo,L as restoreContributors,oi as restoreLifecycleFromConflictsJson,ln as rewriteMarkdownLinksForDocumentRename,Ir as rewriteWikiLinksForDocumentRename,jn as runAuthReposSubprocess,Vt as runAuthStatusSubprocess,un as runCloneSubprocess,ur as runDeviceFlowSubprocess,Ut as runWithMcpLogger,Se as safeContentPath,Be as safeSubdir,$ as safetyCheckpoint,vn as sanitizeClientName,lt as saveInMemoryCheckpoint,yt as saveVersion,Fe as seedBasenameIndex,sr as serializeError,gi as setActiveSpanAttributes,ge as setupServerObservers,J as shadowGit,Ni as shutdownTelemetry,er as skillManagementPath,Li as spansCurrentPath,Ri as spansPreviousPath,Ar as spawnDetached,Ot as splitMarkdownBlocks,R as startWatcher,ce as streamingProblemEvent,M as swapContributors,Ze as teardownToleranceTelemetryWriter,Xt as toBroadcasterKey,wi as tracedAppendFileSync,ki as tracedLinkSync,xi as tracedMkdir,Ti as tracedMkdirSync,ji as tracedRename,Si as tracedRenameSync,Oi as tracedRmSync,Ei as tracedRmdirSync,Ci as tracedUnlinkSync,yi as tracedWriteFile,Mi as tracedWriteFileSync,Xr as trustSystemCertificates,Yt as untrackTrackedProjectSkillProjection,N as updateLastKnownHash,Zi as updateProcessLockPort,na as updateServerLockPort,Er as updateUiLockPort,Gn as validateAgentId,Lr as validateCloneInputs,Ln as validateSkillZip,aa as waitForServerLockDrain,Hr as withHiddenWindowsConsole,vi as withSpan,_i as withSpanSync,at as writeBundleDecision,Ye as writeMarkdownlintRule,$n as writeRootGitignoreForNewRepo,Dn as writeSkillManagement,Pn as writeStateManifest,z as writeTargetVersion,Ne as writeTracker};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{F as t,I as n,Na as r}from"./src-Q2mWJGdH.mjs";import{Ai as i,ct as a,hn as o,lt as s,ot as c,st as l,ui as u,ya as d}from"./src-phea8qFf.mjs";import{K as f}from"./sleep-B2L0pvp4.mjs";import{O as p,P as m}from"./fs-traced-Cc6WsRtP.mjs";import{b as h,u as g,v as _,y as v}from"./server-lock-rqh-yT8R.mjs";import{t as y}from"./yazl-BafwB467.mjs";import{C as b,d as x,i as ee,v as te,y as S}from"./write-project-skill-CG87XS-d.mjs";import{c as ne}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-Du_PVB_P.mjs";import{D as re,E as ie,S as C,T as w,_ as ae,b as oe,o as T,v as E}from"./init-DEzyD1YK.mjs";import{n as D}from"./constants-Jq21Pm6p.mjs";import{t as O}from"./is-object-ByG7RnjH.mjs";import"./loader-DO9rcR2q.mjs";import"./preview-7FhIhdGC.mjs";import{execSync as se,spawnSync as k}from"node:child_process";import{basename as A,dirname as j,isAbsolute as M,join as N,relative as ce,resolve as P,sep as le}from"node:path";import{cpSync as ue,createWriteStream as de,existsSync as F,lstatSync as fe,mkdirSync as I,mkdtempSync as pe,readFileSync as L,readdirSync as me,readlinkSync as he,rmSync as ge,statSync as _e,writeFileSync as R}from"node:fs";import{arch as ve,freemem as ye,homedir as be,hostname as xe,platform as Se,release as Ce,tmpdir as we,totalmem as Te,type as Ee,uptime as De}from"node:os";import{realpath as z}from"node:fs/promises";import{createHash as B}from"node:crypto";var V=f();const Oe=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function ke(e,t,n=o){if(e!==void 0&&!Oe.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Ae=null;function je(e){Ae=e}function Me(){return Ae??process.cwd()}const Ne=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],Pe=Ne.map(e=>e.name);function H(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
2
2
|
`).map(e=>{let r=e;for(let{name:e,regex:i,replacement:a}of Ne)i.lastIndex=0,i.test(r)&&(t.add(e),n++,i.lastIndex=0,r=r.replace(i,a));return r}).join(`
|
|
3
|
-
`),patterns:[...t],lineCount:n}}function Fe(){return N(be(),`.ok`,`bug-reports`)}function Ie(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Fe(),r=`${t}-bugreport`,i=N(n,`${r}.zip`);for(let e=2;F(i);e+=1)i=N(n,`${r}-${e}.zip`);return i}function Le(e,t){let n=N(e,`.ok`,`config.yml`);if(F(n))try{let e=L(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return F(N(e,`.ok`))?B(`sha256`).update(P(e)).digest(`hex`).slice(0,12):null}function Re(){let e={timestamp:new Date().toISOString(),platform:Se(),osType:Ee(),osRelease:Ce(),hostname:`[redacted]`,uptime:De(),freeMem:ye(),totalMem:Te(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=se(`sw_vers -productVersion 2>/dev/null`,u({encoding:`utf8`})).trim()}catch{}try{let t=N(__dirname,`..`,`..`,`package.json`);F(t)&&(e.okVersion=JSON.parse(L(t,`utf8`)).version)}catch{}return e}function ze(e,t){if(!F(t))return{files:[]};let n=me(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>N(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return L(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let
|
|
3
|
+
`),patterns:[...t],lineCount:n}}function Fe(){return N(be(),`.ok`,`bug-reports`)}function Ie(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Fe(),r=`${t}-bugreport`,i=N(n,`${r}.zip`);for(let e=2;F(i);e+=1)i=N(n,`${r}-${e}.zip`);return i}function Le(e,t){let n=N(e,`.ok`,`config.yml`);if(F(n))try{let e=L(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return F(N(e,`.ok`))?B(`sha256`).update(P(e)).digest(`hex`).slice(0,12):null}function Re(){let e={timestamp:new Date().toISOString(),platform:Se(),osType:Ee(),osRelease:Ce(),hostname:`[redacted]`,uptime:De(),freeMem:ye(),totalMem:Te(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=se(`sw_vers -productVersion 2>/dev/null`,u({encoding:`utf8`})).trim()}catch{}try{let t=N(__dirname,`..`,`..`,`package.json`);F(t)&&(e.okVersion=JSON.parse(L(t,`utf8`)).version)}catch{}return e}function ze(e,t){if(!F(t))return{files:[]};let n=me(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>N(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return L(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let n=N(e,`.ok`,`local`);return F(n)?{files:[`server.lock`,`last-spawn-error.log`,t].map(e=>N(n,e)).filter(e=>F(e))}:{files:[]}}function Ve(e){let t=N(e,`.ok`,`local`,`logs`);return F(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>N(t,e)).filter(e=>F(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=H(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function U(e){for(let t of e.files)try{He({zipfile:e.zipfile,name:`${e.prefix}/${A(t)}`,content:L(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function Ue(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??N(be(),`.ok`,`logs`),o=t.projectDir?Le(t.projectDir,i):null;I(j(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Re();s.desktop=t.desktop??null;let{files:c}=ze(o,a),{files:l}=t.projectDir?Be(t.projectDir):{files:[]},{files:u}=t.projectDir?Ve(t.projectDir):{files:[]};i?.info({logFileCount:c.length,lockFileCount:l.length,localSinkFileCount:u.length},`files collected`);let d=[],f=[],{ZipFile:p}=await import(`./yazl-vwTkB7U0.mjs`).then(t=>e(t.default,1)),m=new p;U({zipfile:m,files:c,prefix:`logs`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:l,prefix:`lockdir`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:u,prefix:`local-logs`,redact:n,bundleFiles:f,redactions:d,logger:i});for(let e of t.extraFiles??[])try{let t=L(e.sourcePath),n=`extra/${e.zipName??A(e.sourcePath)}`;m.addBuffer(t,n),f.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:m,name:`note.txt`,content:t.note,redact:n,bundleFiles:f,redactions:d});let h=JSON.stringify(s,null,2);m.addBuffer(Buffer.from(h,`utf8`),`sysinfo.json`),f.push(`sysinfo.json`);let g={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:f,redactions:d,sysinfo:s};m.addBuffer(Buffer.from(JSON.stringify(g,null,2),`utf8`),`MANIFEST.json`);let _=d.reduce((e,t)=>e+t.lineCount,0),v=[`# Bug Report Bundle`,``,`Generated: ${g.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${g.disciplineVersion}`,``,`## Contents`,``,...f.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${Pe.join(`, `)}`,_>0?`${_} line(s) were scrubbed across ${d.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
4
4
|
`);m.addBuffer(Buffer.from(v,`utf8`),`README.md`),m.end();let y=de(r);return m.outputStream.pipe(y),await new Promise((e,t)=>{y.on(`close`,e),y.on(`error`,t)}),i?.info({bundlePath:r,fileCount:f.length,redactionCount:_},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:f,redactions:d,redactedLineCount:_,generatedAt:g.generatedAt}}}var We=e(y(),1),W=e(ne(),1);const Ge=new Set([`doc.name`,`currentDoc`]);function Ke(e){return`doc:${B(`sha256`).update(e).digest(`hex`).slice(0,8)}`}function qe(e,t,n){let r=e.docNameMap[n];if(r===void 0){e.docNameMap[n]=t;return}if(r===t)return;let i=e.docNameCollisions[n];i?i.includes(t)||i.push(t):e.docNameCollisions[n]=[t]}function Je(e,t){let n=t.originalToHashed.get(e);if(n!==void 0)return n;let r=Ke(e);return t.originalToHashed.set(e,r),qe(t,e,r),r}function G(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e,t){if(typeof e==`string`)return G(e,t.contentDir);if(Array.isArray(e))return e.map(e=>q(e,t));if(!K(e))return e;let n=typeof e.key==`string`&&Ge.has(e.key)&&K(e.value)&&typeof e.value.stringValue==`string`?e.value.stringValue:null,r={};for(let[i,a]of Object.entries(e))if(n!==null&&i===`value`&&K(a)){let e=Je(n,t);r[i]={...a,stringValue:e}}else Ge.has(i)&&typeof a==`string`?r[i]=Je(a,t):r[i]=q(a,t);return r}function Ye(e,t){if(t.originalToHashed.size===0)return e;let n=Array.from(t.originalToHashed.entries()).sort(([e],[t])=>t.length-e.length),r=e;for(let[e,t]of n)e.length!==0&&r.includes(e)&&(r=r.split(e).join(t));return r}function Xe(e,t){let n=L(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
5
5
|
`),i=n.split(`
|
|
6
6
|
`),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=q(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}R(e,r?`${a.join(`
|
|
@@ -8,8 +8,8 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{Aa as t,F as n,I as r}from"./src
|
|
|
8
8
|
`))}function Ze(e,t){let n=L(e,`utf-8`);if(n.trim().length!==0)try{let r=q(JSON.parse(n),t),i=n.endsWith(`
|
|
9
9
|
`)?`
|
|
10
10
|
`:``;R(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=Ye(G(n,t.contentDir),t);r!==n&&R(e,r)}}function Qe(e,t){let n=L(e,`utf-8`),r=G(n,t.contentDir);r!==n&&R(e,r)}function $e(e){try{return me(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const et=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function tt(e){let t={contentDir:e.contentDir,docNameMap:{},originalToHashed:new Map,docNameCollisions:{}};for(let n of[`telemetry`,`logs`,`process`])for(let r of $e(N(e.stagingDir,n)))r.endsWith(`.jsonl`)?Xe(r,t):r.endsWith(`.json`)?Ze(r,t):Qe(r,t);for(let n of $e(N(e.stagingDir,`state`))){let e=A(n);n.endsWith(`.jsonl`)?Xe(n,t):et.has(e)?Ze(n,t):Qe(n,t)}return{docNameMap:t.docNameMap,docNameCollisions:t.docNameCollisions}}const nt=[`.ok`,`local`,`telemetry`],rt=[`.ok`,`local`,`logs`],it=`spans-current.jsonl`,at=`spans-prev.jsonl`,ot=`server-current.jsonl`,st=`server-prev.jsonl`;function ct(e){return N(e,...nt,it)}function lt(e){return N(e,...nt,at)}function ut(e){return N(e,...rt,ot)}function dt(e){return N(e,...rt,st)}const ft=1e3;async function pt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(ft)});return t.ok?await t.text():null}catch{return null}}async function mt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(ft)});return t.ok?await t.text():null}catch{return null}}async function ht(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(ft)});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(`
|
|
11
|
-
`)}\n`:null}catch{return null}}function _t(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=k(`git`,[`-C`,t,`log`,`--oneline`,`-50`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vt(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=k(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function yt(){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 bt(){return{nodeVersion:process.version,platform:Se(),arch:ve()}}function xt(){return process.env.OTEL_SDK_DISABLED===`false`}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function St(e){if(!F(e))return{};let t;try{t=(0,V.parse)(L(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!J(t))return{};let n=t.telemetry;if(!J(n))return{};let r=n.localSink;return J(r)?r:{}}function Ct(e){return typeof e==`boolean`?e:void 0}function wt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y(e){if(J(e))return wt(e.maxBytes)}function Tt(e){let t=St(p(`project`,e)),n=St(p(`project-local`,e));return{enabled:Ct(n.enabled)??Ct(t.enabled)??!0,spansMaxBytes:Y(n.spans)??Y(t.spans)??52428800,logsMaxBytes:Y(n.logs)??Y(t.logs)??26214400}}function Et(e){return B(`sha256`).update(e).digest(`hex`)}function Dt(e){let t=L(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Ot(e){let t=L(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X(e,t){return F(e)?(I(j(t),{recursive:!0}),ue(e,t),!0):!1}function kt(e){let t=[],n=e=>{let r=me(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const At=new Set([`.jsonl`]);function jt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:At.has(e.slice(t))}const Mt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Nt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Mt.has(e.slice(t))}function Pt(e){let t=[];for(let n of kt(e)){let r=Ft(e,n);if(!Nt(r))continue;let{redacted:i,patterns:a,lineCount:o}=H(L(n,`utf-8`));a.length!==0&&(R(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Ft(e,t){return ce(e,t).split(le).join(`/`)}async function It(e){let
|
|
12
|
-
`:`not-running (${b})\n`;if(R(N(g,`state`,`server-status.txt`),ie),e.processDir&&F(e.processDir)){let t=N(g,`process`);I(t,{recursive:!0}),ue(e.processDir,t,{recursive:!0})}let C=null;e.redact===!0&&(C=tt({stagingDir:g,contentDir:
|
|
11
|
+
`)}\n`:null}catch{return null}}function _t(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=k(`git`,[`-C`,t,`log`,`--oneline`,`-50`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vt(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=k(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function yt(){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 bt(){return{nodeVersion:process.version,platform:Se(),arch:ve()}}function xt(){return process.env.OTEL_SDK_DISABLED===`false`}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function St(e){if(!F(e))return{};let t;try{t=(0,V.parse)(L(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!J(t))return{};let n=t.telemetry;if(!J(n))return{};let r=n.localSink;return J(r)?r:{}}function Ct(e){return typeof e==`boolean`?e:void 0}function wt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y(e){if(J(e))return wt(e.maxBytes)}function Tt(e){let t=St(p(`project`,e)),n=St(p(`project-local`,e));return{enabled:Ct(n.enabled)??Ct(t.enabled)??!0,spansMaxBytes:Y(n.spans)??Y(t.spans)??52428800,logsMaxBytes:Y(n.logs)??Y(t.logs)??26214400}}function Et(e){return B(`sha256`).update(e).digest(`hex`)}function Dt(e){let t=L(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Ot(e){let t=L(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X(e,t){return F(e)?(I(j(t),{recursive:!0}),ue(e,t),!0):!1}function kt(e){let t=[],n=e=>{let r=me(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const At=new Set([`.jsonl`]);function jt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:At.has(e.slice(t))}const Mt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Nt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Mt.has(e.slice(t))}function Pt(e){let t=[];for(let n of kt(e)){let r=Ft(e,n);if(!Nt(r))continue;let{redacted:i,patterns:a,lineCount:o}=H(L(n,`utf-8`));a.length!==0&&(R(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Ft(e,t){return ce(e,t).split(le).join(`/`)}async function It(e){let r=P(e.contentDir),i=P(e.projectDir??e.contentDir),a=e.deps??{},o=a.fetchAgentPresence??pt,s=a.fetchAgentEffects??mt,c=a.fetchWatcherRecent??ht,l=a.readShadowHead??_t,u=a.readCheckpointRefs??vt,d=a.now??(()=>new Date),f=a.okVersion??(()=>D),p=a.readDesktopEnv??yt,m=a.readRuntime??bt,h=a.isOtlpPushEnabled??xt,g=pe(N(we(),`ok-bundle-`));try{I(N(g,`telemetry`),{recursive:!0}),I(N(g,`logs`),{recursive:!0}),I(N(g,`state`),{recursive:!0}),X(ct(i),N(g,`telemetry`,it)),X(lt(i),N(g,`telemetry`,at)),X(ut(i),N(g,`logs`,ot)),X(dt(i),N(g,`logs`,st));let _=N(i,`.ok`,`local`),v=N(_,`server.lock`),y=`not-running`,b=`no server.lock`,x=null;if(F(v)){X(v,N(g,`state`,`server.lock`));try{let e=L(v,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?x=t.port:b=`lock present but no port`}catch{b=`lock present but unparseable`}}if(x!==null){let e=await o(x);e===null?b=`agent-presence endpoint at :${x} unreachable`:(R(N(g,`state`,`agent-presence.json`),e),y=`running`,b=``);let t=await s(x);t!==null&&R(N(g,`state`,`agent-effects.json`),t);let n=await c(x);if(n!==null){let e=gt(n);e!==null&&R(N(g,`state`,`watcher-recent.jsonl`),e)}}let ee=l(r);ee!==null&&R(N(g,`state`,`shadow-head.txt`),ee);let te=u(r);te!==null&&R(N(g,`state`,`checkpoint-refs.txt`),te),X(N(_,`last-spawn-error.log`),N(g,`state`,`last-spawn-error.log`)),X(N(_,n),N(g,`state`,n)),X(N(_,t),N(g,`state`,t));let S=m(),ne=p(),re={ok:{version:f(),nodeVersion:S.nodeVersion,platform:S.platform,arch:S.arch},host:{desktop:ne}};R(N(g,`state`,`runtime.json`),`${JSON.stringify(re,null,2)}\n`);let ie=y===`running`?`running
|
|
12
|
+
`:`not-running (${b})\n`;if(R(N(g,`state`,`server-status.txt`),ie),e.processDir&&F(e.processDir)){let t=N(g,`process`);I(t,{recursive:!0}),ue(e.processDir,t,{recursive:!0})}let C=null;e.redact===!0&&(C=tt({stagingDir:g,contentDir:r})),e.note&&R(N(g,`note.txt`),e.note);let w=null;e.scrubSecrets===!0&&(w=Pt(g));for(let t of e.extraFiles??[])X(t.sourcePath,N(g,`extra`,t.zipName??A(t.sourcePath)))||a.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ae=Tt(i),oe=kt(g),T=[],E=0,D=0;for(let e of oe){let t=Ft(g,e),n=_e(e).size,r=jt(t)?Dt(e):0;T.push({path:t,bytes:n,lines:r}),E+=n,t.startsWith(`telemetry/`)&&jt(t)&&(D+=Ot(e))}let O=C===null?{applied:!1,docNameMapSidecar:null}:Object.keys(C.docNameCollisions).length>0?{applied:!0,docNameMapSidecar:null,docNameCollisions:C.docNameCollisions}:{applied:!0,docNameMapSidecar:null};w!==null&&(O.secretScrub=w);let se={schemaVersion:1,createdAt:d().toISOString(),ok:{version:f(),nodeVersion:S.nodeVersion,platform:S.platform,arch:S.arch},host:{desktop:ne},contentDir:{pathSha256:Et(r),absolutePath:C===null?r:`<CONTENT_DIR>`},telemetry:{localSink:ae,otlpPushEnabled:h()},redaction:O,serverStatus:y,files:T};R(N(g,`manifest.json`),`${JSON.stringify(se,null,2)}\n`);let k=oe.some(e=>{try{return L(e,`utf-8`).includes(r)}catch{return!1}}),j={totalBytes:E,fileCount:T.length,docNameCount:D,contentDirVisible:k,redacted:C!==null},M=!1;return{stagingDir:g,manifest:se,summary:j,redactionMapPayload:C===null?null:{docNameMap:C.docNameMap,docNameCollisions:C.docNameCollisions},cleanup:()=>{M||(M=!0,ge(g,{recursive:!0,force:!0}))}}}catch(e){throw ge(g,{recursive:!0,force:!0}),e}}async function Lt(e){let{collected:t,outputPath:n}=e,r=j(n);if(!F(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);if(t.redactionMapPayload!==null){let e=`${A(n,`.zip`)}.docnames.json`,r={...t.manifest,redaction:{...t.manifest.redaction,applied:!0,docNameMapSidecar:e}};R(N(t.stagingDir,`manifest.json`),`${JSON.stringify(r,null,2)}\n`)}let i=new We.ZipFile,a=kt(t.stagingDir);for(let e of a){let n=Ft(t.stagingDir,e);i.addFile(e,n)}i.end(),t.redactionMapPayload!==null&&R(N(r,`${A(n,`.zip`)}.docnames.json`),`${JSON.stringify({docNameMap:t.redactionMapPayload.docNameMap,docNameCollisions:t.redactionMapPayload.docNameCollisions},null,2)}\n`,{mode:384});let o=de(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 Rt(e,t){let n=N(e,`.ok`,`config.yml`);if(F(n))try{let t=(0,V.parse)(L(n,`utf-8`)),r=O(t)?t.content:void 0,i=O(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return P(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 P(e)}async function zt(e,t,n){let r=await It({contentDir:Rt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,deps:{readDesktopEnv:n,logger:e.logger}});try{I(j(e.outputPath),{recursive:!0}),await Lt({collected:r,outputPath:e.outputPath});let n=r.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:Le(t,e.logger),files:r.manifest.files.map(e=>e.path),redactions:n?.redactions??[],redactedLineCount:n?.redactedLineCount??0,generatedAt:r.manifest.createdAt}}}finally{r.cleanup()}}async function Bt(e){let{projectDir:t}=e,n=e.readDesktopEnv??yt;if(e.level===`full`&&t!==void 0)return zt(e,t,n);let{zipPath:r,summary:i}=await Ue({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n()});return{zipPath:r,summary:{level:e.level,systemWide:t===void 0,projectSlug:i.projectSlug,files:i.files,redactions:i.redactions,redactedLineCount:i.redactedLineCount,generatedAt:i.generatedAt}}}function Z(e,t,n={}){let r=g(e,t);if(!F(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(L(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!v(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??_)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??h())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??xe();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function Vt(e){return e.replace(/:\d+$/,``)}function Ht(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Vt(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Vt(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Vt(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function Ut(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=r(t.hostname);if(n===null)return null;let i=t.pathname.split(`/`).filter(e=>e.length>0);if(i.length<5||i[2]!==`blob`)return null;let a,o,s,c;try{a=decodeURIComponent(i[0]),o=decodeURIComponent(i[1]),s=decodeURIComponent(i[3]),c=i.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.length===0||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function Wt(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=r(t.hostname);if(n===null)return null;let i=t.pathname.split(`/`);if(i.length<5||i[0]!==``||i[3]!==`tree`)return null;let a=i.slice(5);a.length===1&&a[0]===``&&a.pop();let o,s,c,l;try{o=decodeURIComponent(i[1]),s=decodeURIComponent(i[2]),c=decodeURIComponent(i[4]),l=a.map(e=>decodeURIComponent(e))}catch{return null}return!o||!s||!c||l.some(e=>e.length===0)?null:{host:n,owner:o,repo:s,branch:c,path:l.join(`/`)}}function Gt(e){let t=Ut(e);if(t)return{kind:`doc`,...t};let n=Wt(e);return n?{kind:`folder`,...n}:null}const Kt=`# >>> open-knowledge cli >>>`,qt=`# <<< open-knowledge cli <<<`,Jt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Yt(e){return N(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const Xt={existsSync:e=>F(e),readFileSync:(e,t)=>L(e,t),lstatSync:e=>fe(e),readlinkSync:e=>he(e)};function Zt(e,t=Xt){let n=Yt(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function Qt(e){let t=e.replace(Jt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function $t(e,t,n=Xt){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function en(e){return te(e)||S(e)||C(e)}const tn=10*1024*1024;function nn(e,t,n,r){let i=T(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!en(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);return e.format===`file`?(ge(a,{force:!0}),{kind:`removed`}):e.format===`toml`?on(a,o):e.format===`yaml`?an(a,e.topLevelKey,o):rn(a,e.topLevelKey,e.serverMapSubKey,o)}function rn(e,t,n,r){let i;try{i=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>tn)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=re(i,ae(t,n,r));return o?(m(e,a,{mode:w(e)}),{kind:`removed`}):{kind:`not-present`}}function an(e,t,n){let r;try{r=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>tn)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,V.parseDocument)(a);if(o.errors.length>0)return{kind:`declined`,reason:`unparseable`};let s=[t,n];if(!o.hasIn(s))return{kind:`not-present`};o.deleteIn(s);let c=o.toString(),l=ie(a);a.trim()===``||a.endsWith(`
|
|
13
13
|
`)?c.endsWith(`
|
|
14
14
|
`)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
|
|
15
15
|
`).replace(/\n/g,`\r
|
|
@@ -18,5 +18,5 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{Aa as t,F as n,I as r}from"./src
|
|
|
18
18
|
`)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
|
|
19
19
|
`).replace(/\n/g,`\r
|
|
20
20
|
`));let u=`${i?``:``}${l}`;return u!==r&&m(e,u,{mode:w(e)}),{kind:`removed`}}function sn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function cn(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 ln(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:l(r),command:r,isDesktop:sn(r)}}function un(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&un(e)?`ui-orphan`:`stale`}const dn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function fn(e){switch(e){case`running`:return W.default.green(e);case`desktop`:return W.default.blue(e);case`foreign`:return W.default.cyan(e);case`ui-orphan`:return W.default.magenta(e);case`stale`:return W.default.yellow(e)}}function pn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function mn(e){return`${pn(e.server.usage)} | ${pn(e.ui?.usage??null)}`}function hn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function gn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,hn(e),mn(e),t,String(n),cn(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=fn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=W.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
21
|
-
`)}async function _n(e={}){let t=e.discover??c,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??a,o=e.resolveUsage??s,l=await t(),u=[];for(let e of l){let t=n(e,`server`),r=n(e,`ui`),a=ln(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:o(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:o(r.lock.pid));a!=null&&u.push(a)}if(e.json){let e=u.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(gn(e.all?u:u.filter(e=>dn.has(Q(e)))))}function vn(){return new b(`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 _n({all:t.all===!0||e===`all`,json:t.json===!0})})}function yn(e,t,n={}){let r=n.isAlive??_,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function bn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=yn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function xn(e,t=_){let n=await c(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function Sn(e){let t=bn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Cn(e){return new b(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=bn({lockDir:i(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await _n({});return}if(n===`all`){let e=await c();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,_)&&!$(r,_)||(Sn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await xn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}Sn(t);return}Sn(i(P(Me(),n)))})}function wn(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Tn(e,
|
|
22
|
-
//# sourceMappingURL=src-
|
|
21
|
+
`)}async function _n(e={}){let t=e.discover??c,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??a,o=e.resolveUsage??s,l=await t(),u=[];for(let e of l){let t=n(e,`server`),r=n(e,`ui`),a=ln(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:o(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:o(r.lock.pid));a!=null&&u.push(a)}if(e.json){let e=u.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(gn(e.all?u:u.filter(e=>dn.has(Q(e)))))}function vn(){return new b(`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 _n({all:t.all===!0||e===`all`,json:t.json===!0})})}function yn(e,t,n={}){let r=n.isAlive??_,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function bn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=yn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function xn(e,t=_){let n=await c(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function Sn(e){let t=bn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Cn(e){return new b(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=bn({lockDir:i(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await _n({});return}if(n===`all`){let e=await c();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,_)&&!$(r,_)||(Sn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await xn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}Sn(t);return}Sn(i(P(Me(),n)))})}function wn(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Tn(e,t){let n,i;try{n=await z(P(e)),i=await z(P(j(e)))}catch{return{kind:`not-git`}}if(!En(n,i))return{kind:`symlink-escape`};let a=N(n,`.git`),o;try{o=_e(a)}catch{return{kind:`not-git`}}if(o.isDirectory()){let e;try{e=await z(a)}catch{return{kind:`not-git`}}if(!En(e,n))return{kind:`symlink-escape`}}else if(!o.isFile())return{kind:`not-git`};let s=d(n);if(s.kind!==`repository`)return{kind:`not-git`};let c=s.repository.readRemoteUrl(`origin`);if(c.kind===`unreadable`)return{kind:`not-git`};if(c.kind===`absent`)return c.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let l=c.url,u=Ht(l);if(u===null)return{kind:`non-github`};let f=r(u.hostname);if(f===null)return{kind:`non-github`};let p=f===t.host.toLowerCase(),m=u.owner.toLowerCase()===t.owner.toLowerCase(),h=u.name.toLowerCase()===t.repo.toLowerCase();return!p&&m&&h?{kind:`wrong-host`,actualHost:f}:!p||!m||!h?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://${f}/${u.owner}/${u.name}.git`}}function En(e,t){if(e===t)return!0;let n=ce(t,e);return n.length>0&&!n.startsWith(`..`)&&!M(n)}const Dn=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=E(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=ee(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function On(e,t,n={},r=Dn){let i=[];for(let a of t){let t=x[a];for(let a of r)i.push(a.write(t,e,n))}return i}function kn(e,t,n={}){return{integrations:On(e,t,n)}}export{Ie as C,je as D,Me as E,ke as O,Lt as S,H as T,Wt as _,Cn as a,Bt as b,Kt as c,$t as d,Yt as f,Gt as g,Ut as h,bn as i,Jt as l,Qt as m,Tn as n,vn as o,Zt as p,wn as r,nn as s,kn as t,qt as u,Ht as v,Fe as w,It as x,Z as y};
|
|
22
|
+
//# sourceMappingURL=src-Dex2lDDb.mjs.map
|