@inkeep/open-knowledge 0.88.12-beta.0 → 0.89.0-beta.0
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/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/{cli-CHOXNBzz.mjs → cli-DX1sz_k-.mjs} +76 -75
- package/dist/cli.mjs +1 -1
- package/dist/config-schema.json +1 -1
- package/dist/config.project-local.schema.json +1 -1
- package/dist/constants-d7jCg5-t.mjs +1 -0
- package/dist/dist-Bvds2-Dr.mjs +1 -0
- package/dist/{dist-BSNy29T3.mjs → dist-Czh3kWim.mjs} +515 -515
- package/dist/index.mjs +224 -224
- package/dist/init-BsFBWSSY.mjs +1 -0
- package/dist/{init-D7ht1hAb.mjs → init-Bwx1qRcH.mjs} +32 -32
- package/dist/{launch-json-removal-FsYm5bTy.mjs → launch-json-removal-B-Qj16eV.mjs} +1 -1
- package/dist/loader-Bdn_wGnC.mjs +1 -0
- package/dist/{loader-txqXuZkh.mjs → loader-Tugp8DGe.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-DCCfgLfC.mjs → md-manager-BGnqyqi1-BW5Abi4P.mjs} +131 -131
- package/dist/{open-browser-Bb2-wy79.mjs → open-browser-DOHM8swn.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-Dpv-rYA5.mjs → preview-Clni94CG.mjs} +1 -1
- package/dist/preview-HfVfcx_1.mjs +1 -0
- package/dist/public/assets/{AccountSection-Duudie77.js → AccountSection-Df3Gy0_p.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-BFhSaloX.js → ActivityModeContent-DRQEvQ4Y.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-GAQfaIq7.js → AddPropertiesButton-CqwC5KQo.js} +2 -2
- package/dist/public/assets/{AgentConnectionsSection-DYtfZ4WI.js → AgentConnectionsSection-t6Fpnhjm.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BnXkJkLz.js → AgentDiffPane-BqNmjT4D.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-H2HNwBzb.js → AttachmentsSection-ZeINZyCG.js} +1 -1
- package/dist/public/assets/{AuthModal--Pl-iyB3.js → AuthModal-CEKKOx6U.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-o8i3gLwL.js → CodeMirrorPropInput-BqwgGQax.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-a1UGdVsB.js → ContentRulesSection-SydZOZfh.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DbZpD4Dy.js → DiffViewBoundary-CS5Pw4WQ.js} +1 -1
- package/dist/public/assets/{DocumentContext-DqUuPSJl.js → DocumentContext-Dz83XSEN.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-Cxfu8vc1.js → EditorModeToggle-Bi7ACmef.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-BSFJkNBJ.js → ExcalidrawDocEditor-D4cke5xg.js} +1 -1
- package/dist/public/assets/FeedbackForm-XyK5xpO8.js +1 -0
- package/dist/public/assets/{GraphPanel-HRPYLSN9.js → GraphPanel-DGKZ04lM.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-Bmn1unrq.js → ImportSkillDialog-fw3xPfms.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-DrHVesDA.js → LinkPreviewsSection-Cral4IX7.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CH0JB3FB.js → LintConfigEditor-CMGYal8K.js} +1 -1
- package/dist/public/assets/{LintingSection-CnZdwesC.js → LintingSection-BA0-1oWs.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-B4sVqhYy.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-BPI-_chz.js → ManagedArtifactProperties-P9uG_NcV.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-Cs8EdBNv.js → McpConsentDialogBody-lYRZdfJ4.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-BpxupGz-.js → MermaidDocEditor-BJ3Bkwzx.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-D-Rln6zh.js → NetworkAccessSection-B34jZLlX.js} +1 -1
- package/dist/public/assets/{OkCliPathRow-Dn-a2z6P.js → OkCliPathRow-D2xYoRyE.js} +1 -1
- package/dist/public/assets/{ProjectTemplatesSection-CjX7q09w.js → ProjectTemplatesSection-Vt0-ODLw.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-Kh_HFzCs.js → PropertyDisplayRow-CNaOXgQU.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-DSLDhsry.js → PublishToGitHubDialog-BXG6yECv.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-3YdE9YD2.js → RegisteredAgentIcon-uXi2oPSE.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-Bi9hPC6W.js → ReportBugDialogBody-dwEhxWL8.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-YhgSFu20.js → ReportBugMenuTrigger-B3r2VnaW.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-ksF-0806.js → SchemaConfigEditor-C97Y9zOO.js} +1 -1
- package/dist/public/assets/SearchSection-ngXBfuZ0.js +1 -0
- package/dist/public/assets/{SessionsHost-CWOp3w3X.js → SessionsHost-BUq6jnLu.js} +2 -2
- package/dist/public/assets/SettingsDialogBody-DFhzxkq3.js +2 -0
- package/dist/public/assets/{ShareReceiveMissDialog-DGv07ytG.js → ShareReceiveMissDialog-bTyLJDra.js} +1 -1
- package/dist/public/assets/{SharingSection-RBUd50Bj.js → SharingSection-CiouM8fc.js} +1 -1
- package/dist/public/assets/{SkillCostValue-BcfssFYU.js → SkillCostValue-D-VQUaZz.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-BW2Zo604.js → SkillForkDialog-DcanSYND.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CpsFAIPJ.js → SkillInstallMenu-DHtst-Z3.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-Cqkfc2GK.js → SkillOriginInline-icYzVwfl.js} +1 -1
- package/dist/public/assets/{SkillPluginBundleDialog-CingGivw.js → SkillPluginBundleDialog-fDl9XkF_.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-USvBm9UK.js → SkillToolbarControls-gNMdIGj8.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-1FLLRX0x.js → SkillsManagerSection-B0O776zf.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-DY-38kph.js → SlidesToolbarControls-CvurVze_.js} +1 -1
- package/dist/public/assets/{SourceEditor-BgFJdC3x.js → SourceEditor-bK9TZQpV.js} +1 -1
- package/dist/public/assets/{SpellingSettings-CDk5F0uz.js → SpellingSettings-DpMhK41P.js} +1 -1
- package/dist/public/assets/{SyncSection-_5olS0th.js → SyncSection-Df-t0XVn.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-Ba3iUAco.js → SyncStatusBadge-BdgV544I.js} +1 -1
- package/dist/public/assets/{TemplateRow-Cs_8LNHD.js → TemplateRow-DGghua5F.js} +1 -1
- package/dist/public/assets/{TerminalLaunchContext-BiKZKemG.js → TerminalLaunchContext-yfig3-dd.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BZDwVc-Y.js → TerminalPanel-zhcx1hBA.js} +1 -1
- package/dist/public/assets/{TerminalSection-EfwpofBq.js → TerminalSection-j-xHqwph.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CYc01P_j.js → TerminalWindowApp-Di0tRI4d.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DXAWUTX-.js → TextDocEditor-udn7JWb-.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-DSJaRBB-.js → ThemePluginSection-DTQ7sQi5.js} +1 -1
- package/dist/public/assets/{ThreadView-C5yxNlst.js → ThreadView-D7q2a2En.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DlmD2E-E.js → TimelineDiffPane-fjnTj0PG.js} +1 -1
- package/dist/public/assets/{agent-connections-DofjYVxj.js → agent-connections-7HpNzYjL.js} +1 -1
- package/dist/public/assets/{agent-registry-Z4n6bROi.js → agent-registry-UV4Vx43J.js} +1 -1
- package/dist/public/assets/{bridge-C51UDIR0.js → bridge-B2_zG6bo.js} +1 -1
- package/dist/public/assets/{catalog-CLnUnyxw.js → catalog-C1Qnqxzu.js} +1 -1
- package/dist/public/assets/channel-cli-copy-Dpm61j4V.js +1 -0
- package/dist/public/assets/{client-version-Bf2iRqGU.js → client-version-3iNltPK1.js} +1 -1
- package/dist/public/assets/{comment-chips-DnVeee4D.js → comment-chips-BmuIxUdU.js} +1 -1
- package/dist/public/assets/{config-provider-f9PDyLDl.js → config-provider-JgBy6BlN.js} +1 -1
- package/dist/public/assets/config-schema-B-G3CmF9.js +1 -0
- package/dist/public/assets/{css-color-to-hex-pv-EKOQu.js → css-color-to-hex-BS2pwUpd.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-B4DcQrQB.js → doc-undo-manager-Bnzxfx_k.js} +1 -1
- package/dist/public/assets/{field-controls-pq-AYiCQ.js → field-controls-D8pFIo2I.js} +1 -1
- package/dist/public/assets/field-controls-DdToTHHk.js +1 -0
- package/dist/public/assets/{ime-composition-CjypcBXs.js → ime-composition-CNKa_WNE.js} +1 -1
- package/dist/public/assets/{index-7PTB0URg.js → index-B6GLN-QF.js} +7 -7
- package/dist/public/assets/{lint-config-client-CZ22hfd5.js → lint-config-client-DT6tLnal.js} +1 -1
- package/dist/public/assets/{lint-plugins-Cf5g-Z--.js → lint-plugins-BwpYFD1j.js} +1 -1
- package/dist/public/assets/{markdown-lint-D13AGXjm.js → markdown-lint-BQVK9PNE.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BIpAh6PU.js → markdownlint-rule-browser-Ezxrc6Kb.js} +1 -1
- package/dist/public/assets/messages-BUzCzOSi.js +1 -0
- package/dist/public/assets/messages-BneNCe6E.js +1 -0
- package/dist/public/assets/messages-C8Wz4aOx.js +1 -0
- package/dist/public/assets/messages-CSmmI25S.js +1 -0
- package/dist/public/assets/messages-CawokvkH.js +1 -0
- package/dist/public/assets/messages-CkEA1jgi.js +1 -0
- package/dist/public/assets/messages-ClH2XGSc.js +1 -0
- package/dist/public/assets/messages-CqfV38uB.js +1 -0
- package/dist/public/assets/messages-DIlUh7_2.js +1 -0
- package/dist/public/assets/messages-DQOOICZI.js +1 -0
- package/dist/public/assets/messages-DqKeJA0n.js +1 -0
- package/dist/public/assets/messages-M_y5P3Yx.js +1 -0
- package/dist/public/assets/messages-mbc4NQog.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-CrBdBGbd.js → pending-receive-nav-store-D6gDJmIQ.js} +1 -1
- package/dist/public/assets/{preferred-session-events-CVoAUx8-.js → preferred-session-events-BvEknk4f.js} +1 -1
- package/dist/public/assets/{progress-C1W-tvDC.js → progress-Bf5gsfvK.js} +1 -1
- package/dist/public/assets/{restart-collab-server-CHlRP7RK.js → restart-collab-server-CHNPKri_.js} +1 -1
- package/dist/public/assets/{saved-themes-client-B4QZmuf_.js → saved-themes-client-DLguKzSj.js} +1 -1
- package/dist/public/assets/{schema-section-Bn1HnUE0.js → schema-section-DrnHDoC0.js} +1 -1
- package/dist/public/assets/{schemas-api-WgoIuF0H.js → schemas-api-CqmliOdH.js} +1 -1
- package/dist/public/assets/{selection-context-CEEtGLdd.js → selection-context-CgIZ_TVy.js} +1 -1
- package/dist/public/assets/{skills-api-DBxDbkxz.js → skills-api-D9_3ttAz.js} +1 -1
- package/dist/public/assets/{src-BjC5FSTO.js → src-CfDopxhM.js} +1 -1
- package/dist/public/assets/storage-scope-BDcuM4d_.js +1 -0
- package/dist/public/assets/{tag-pill-input-DNcSO6rN.js → tag-pill-input-DFLCUQhM.js} +1 -1
- package/dist/public/assets/{telemetry-impl-Ccc0F1pQ.js → telemetry-impl-C9Xhqlnh.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BoeKP8Zc.js → telemetry-startup-CD6_boR3.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-aL5veMO9.js → terminal-launch-events-CJnkcylC.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-Br5ssjBk.js → typing-burst-detector-BP7LyrHe.js} +1 -1
- package/dist/public/assets/{uninstall-SVMQWWzy.js → uninstall-C3756IvU.js} +1 -1
- package/dist/public/assets/{use-activity-panel-C0CGEm7W.js → use-activity-panel-CzDYeCaI.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-CTtLraO9.js → use-apply-config-color-theme-CUQffyxt.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-9fLQZCsK.js → use-apply-config-language-atbAm0cM.js} +2 -2
- package/dist/public/assets/{use-conflicts-DEteFrWs.js → use-conflicts-DBMds-hY.js} +1 -1
- package/dist/public/assets/{use-installed-clis-APSgNRF8.js → use-installed-clis-BZPKReyc.js} +2 -2
- package/dist/public/assets/{use-live-xterm-theme-BPppvg06.js → use-live-xterm-theme-DpVou4uT.js} +1 -1
- package/dist/public/assets/{use-open-skill-Br25_0Zs.js → use-open-skill-C5yc0pWw.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-cvdZZNYA.js → use-semantic-search-status-Dd4pXwms.js} +1 -1
- package/dist/public/assets/{use-skill-origin-CFF_c9ld.js → use-skill-origin-Aw9Y3_sH.js} +1 -1
- package/dist/public/assets/{use-skill-targets-C5Tb5t_s.js → use-skill-targets--mN_luk9.js} +1 -1
- package/dist/public/assets/{use-skills-B6ndwLoW.js → use-skills-CHU2m8ND.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-B5u6V0Yi.js → use-terminal-enabled-Cc-CQOML.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-C3GRFvG6.js → use-timeline-entry-diff-DPlyisxx.js} +1 -1
- package/dist/public/assets/{use-workspace-5RavNejH.js → use-workspace-BTtr5NT8.js} +1 -1
- package/dist/public/index.html +53 -53
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-D3TQ7oxm.mjs → registry-probes-DzWaR5SV.mjs} +3 -3
- package/dist/{removal-file-path-C743cSZA.mjs → removal-file-path-D9-1wmfy.mjs} +1 -1
- package/dist/{repair-launch-json-C_3EMufn.mjs → repair-launch-json-BN9YLBiK.mjs} +1 -1
- package/dist/{repair-mcp-configs-B0FADin9.mjs → repair-mcp-configs-BXFxGkMn.mjs} +1 -1
- package/dist/schemas/v0/config.project-local.schema.json +1 -1
- package/dist/src-DJ8h2wMj.mjs +16 -0
- package/dist/src-fnIy5car.mjs +1 -0
- package/dist/start-BQgTW5ae.mjs +5 -0
- package/dist/start-DdZ_rs7g.mjs +1 -0
- package/package.json +5 -5
- package/dist/constants-DyVp9M0Z.mjs +0 -1
- package/dist/dist-Bfg_JABr.mjs +0 -1
- package/dist/init-DwPDs2bS.mjs +0 -1
- package/dist/loader-Btt-HfCX.mjs +0 -1
- package/dist/preview-uebUIBVB.mjs +0 -1
- package/dist/public/assets/FeedbackForm-OQoJz7rc.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DiuSEg5U.js +0 -1
- package/dist/public/assets/SearchSection-B0BR_xQy.js +0 -1
- package/dist/public/assets/SettingsDialogBody-BS4WQcpY.js +0 -2
- package/dist/public/assets/channel-cli-copy-BySq87hR.js +0 -1
- package/dist/public/assets/config-schema-DM88r6Wp.js +0 -1
- package/dist/public/assets/field-controls-C_LUFJDr.js +0 -1
- package/dist/public/assets/messages-B-J4Z2Yr.js +0 -1
- package/dist/public/assets/messages-BB8d9jn4.js +0 -1
- package/dist/public/assets/messages-BY7FXc1p.js +0 -1
- package/dist/public/assets/messages-BiYVPcog.js +0 -1
- package/dist/public/assets/messages-C7Sj-spy.js +0 -1
- package/dist/public/assets/messages-CBV_8Tbx.js +0 -1
- package/dist/public/assets/messages-CIQENxYJ.js +0 -1
- package/dist/public/assets/messages-CLhrlR3j.js +0 -1
- package/dist/public/assets/messages-CYZHw0xR.js +0 -1
- package/dist/public/assets/messages-CjUTocV-.js +0 -1
- package/dist/public/assets/messages-DVWfLKLP.js +0 -1
- package/dist/public/assets/messages-DlnDJqXj.js +0 -1
- package/dist/public/assets/messages-GTtZSPU8.js +0 -1
- package/dist/public/assets/storage-scope-sNHb4BCO.js +0 -1
- package/dist/src-5bKhSF8L.mjs +0 -1
- package/dist/src-Cn5ytgj-.mjs +0 -16
- package/dist/start-B0AH-f5N.mjs +0 -5
- package/dist/start-COZO7HSH.mjs +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-tZXQYakl.mjs";import{C as t,E as n,L as r,M as i,N as a,O as o,S as s,d as c,k as l,x as u}from"./constants-ok-dir-DZ25OS9-.mjs";import{Da as d,G as f,Oa as p,Rl as m,U as h,W as g,l as _,sf as v,u as ee,zl as y}from"./md-manager-BGnqyqi1-BW5Abi4P.mjs";import{$t as b,As as x,Bs as te,Ci as S,Cs as ne,Ds as C,Gi as re,Ho as w,Hs as ie,La as T,Ls as E,Ms as D,Pt as O,Rs as k,Si as A,So as j,Ss as ae,Ti as M,Ts as oe,Ui as N,Vs as se,ei as ce,ha as le,hi as ue,js as de,ks as fe,li as P,m as pe,na as me,pr as he,rr as F,va as ge,ws as _e,xi as ve,zs as I}from"./dist-Czh3kWim.mjs";import{t as ye}from"./yazl-BBz29IQN.mjs";import{t as be,y as L}from"./fs-find-project-root-BYV07wjn.mjs";import{ct as xe,gt as Se,ht as Ce,mt as we,pt as Te,st as Ee,wt as De}from"./init-Bwx1qRcH.mjs";import{o as Oe}from"./token-store-Bmb3_0hU.mjs";import{c as ke}from"./colors-r_owlCuY.mjs";import{t as Ae}from"./is-object-BGze3w87.mjs";import{l as je,u as Me}from"./registry-probes-DzWaR5SV.mjs";import{n as Ne}from"./constants-d7jCg5-t.mjs";import"./loader-Tugp8DGe.mjs";import"./preview-Clni94CG.mjs";import{basename as R,dirname as z,isAbsolute as Pe,join as B,relative as Fe,resolve as V,sep as H,win32 as Ie}from"node:path";import{closeSync as Le,cpSync as Re,createWriteStream as ze,existsSync as U,lstatSync as Be,mkdirSync as W,mkdtempSync as Ve,openSync as He,readFileSync as G,readSync as Ue,readdirSync as K,readlinkSync as We,realpathSync as Ge,rmSync as Ke,rmdirSync as qe,statSync as Je,writeFileSync as q}from"node:fs";import{arch as Ye,freemem as Xe,homedir as J,hostname as Ze,platform as Qe,release as $e,tmpdir as et,totalmem as tt,type as nt,uptime as rt}from"node:os";import{readFile as it,readdir as at,stat as ot}from"node:fs/promises";import{createHash as st}from"node:crypto";import{execFile as ct,execSync as lt,spawnSync as ut}from"node:child_process";function dt(e,t){let n=t.map(e=>[E(e),e]);for(let t of e){let e=E(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function ft(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=dt([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=dt(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function pt(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return`unknown`;let r=Math.floor(Math.max(0,t-n)/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const mt=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`audit`,`deinit`,`auth`]);function ht(e,t,n=be){if(e!==void 0&&!mt.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let gt=null;function _t(e){gt=e}function vt(){return gt??process.cwd()}const yt=`Open Knowledge`;function bt(e={}){let t=e.platformName??process.platform,n=e.productName??l().productName;return Ee(t).join(xe({...e,platformName:t}),n)}function xt(e={}){let t=e.platformName??process.platform,n=e.home??J(),r=e.env??process.env,i=Ee(t),a;return a=t===`win32`?r.LOCALAPPDATA||i.join(n,`AppData`,`Local`):t===`darwin`?i.join(n,`Library`,`Caches`):r.XDG_CACHE_HOME||i.join(n,`.cache`),i.join(a,`${l().packageName.replaceAll(`/`,``)}-updater`)}function St(e){if(typeof e!=`object`||!e)return null;let t=e.recentProjects;if(!Array.isArray(t))return null;let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e;typeof t.path==`string`&&typeof t.name==`string`&&n.push({path:t.path,name:t.name})}return n}function Ct(e){let t=B(e,`state.json`);if(!U(t))return[];let n;try{n=JSON.parse(G(t,`utf-8`))}catch{return[]}return St(n)??[]}function wt(e){let t=B(e,`state.json`);if(!U(t))return!1;try{return St(JSON.parse(G(t,`utf-8`)))!==null}catch{return!1}}const Tt=8192;function Et(e,t){if(e.outcome===`not-present`)return`not-present (no DiagnosticReports directory)`;if(e.outcome===`unreadable-directory`)return`unreadable (${e.directoryErrorCode??`unknown`} reading DiagnosticReports)`;let n=[`${e.windowDays}d`,`${e.foreignIgnored} other-process report(s) ignored`,`${e.unparseable} unparseable`];e.droppedOverCap>0&&n.push(`${e.droppedOverCap} older dropped over cap`);let r=e.files.length-t;return r>0&&n.push(`${r} vanished before staging`),e.outcome===`none-in-window`?`none found in window (${n.join(`; `)})`:`${t} collected (${n.join(`; `)})`}function Dt(e){return e.replace(/\\+\/?/g,e=>{if(!e.endsWith(`/`))return e;let t=e.length-1;return`${`\\`.repeat(t-t%2)}/`})}const Ot=RegExp(`("(?:${[`crashReporterKey`,`bootSessionUUID`,`deviceIdentifierForVendor`].join(`|`)})"\\s*:\\s*)"[^"]*"`,`g`);function kt(e){return e.replace(Ot,`$1"[REDACTED-DEVICE-ID]"`)}function At(e){return kt(Dt(e))}const jt=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})(\.\d+)? ([+-]\d{2})(\d{2})$/;function Mt(e){if(typeof e!=`string`)return null;let t=jt.exec(e.trim());if(t===null)return null;let[,n,r,i=``,a,o]=t,s=Date.parse(`${n}T${r}${i}${a}:${o}`);return Number.isNaN(s)?null:s}function Nt(e){let t=He(e,`r`);try{let e=Buffer.alloc(Tt),n=0,r=!1;for(;n<Tt;){let i=Ue(t,e,n,Tt-n,n);if(i===0){r=!0;break}let a=n;n+=i;let o=e.subarray(0,n).indexOf(10,a);if(o!==-1)return e.subarray(0,o).toString(`utf-8`)}return r?e.subarray(0,n).toString(`utf-8`):null}finally{Le(t)}}function Pt(e){try{let t=Nt(e);if(t===null)return{kind:`unreadable`};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{kind:`unreadable`};let{name:r,app_name:i,timestamp:a}=n,o=typeof r==`string`?r:typeof i==`string`?i:null;return o===null?{kind:`unreadable`}:{kind:`named`,name:o,timestampMs:Mt(a)}}catch{return{kind:`unreadable`}}}function Ft(e){return e===`OpenKnowledge`||e.startsWith(`OpenKnowledge `)}function It(e,t){let n={files:[],foreignIgnored:0,unparseable:0,droppedOverCap:0,windowDays:7},r;try{r=K(e,{withFileTypes:!0})}catch(e){let t=e.code;return t===`ENOENT`?{...n,outcome:`not-present`}:{...n,outcome:`unreadable-directory`,directoryErrorCode:t??`unknown`}}let i=t.getTime()-6048e5,a=[],o=0,s=0;for(let t of r){if(!t.isFile()||!t.name.endsWith(`.ips`))continue;let n=B(e,t.name),r;try{r=Je(n).mtimeMs}catch{continue}if(r<i)continue;let c=Pt(n),l=c.kind===`named`&&c.timestampMs!==null?c.timestampMs:r;if(c.kind===`unreadable`){s+=1;continue}if(!Ft(c.name)){o+=1;continue}a.push({path:n,atMs:l})}a.sort((e,t)=>t.atMs-e.atMs);let c=a.slice(0,25),l={foreignIgnored:o,unparseable:s,droppedOverCap:a.length-c.length,windowDays:7};return c.length===0?{...l,files:[],outcome:`none-in-window`}:{...l,files:c.map(e=>e.path),outcome:`collected`}}const Lt=`state/os-termination-evidence.json`,Rt=6048e5,zt=/openknowledge/i,Bt=n.map(e=>a(t[e]));function Vt(e={}){return(t,n)=>new Promise(r=>{try{ct(t,n,{encoding:`utf8`,timeout:e.timeoutMs??15e3,maxBuffer:e.maxBuffer??16777216,windowsHide:!0},(e,t,n)=>{r({...Ht(e),stdout:t,stderr:n})})}catch(e){let t=e.code;r({status:null,stdout:``,stderr:``,errorCode:typeof t==`string`?t:`spawn-failed`})}})}function Ht(e){return e===null?{status:0}:typeof e.code==`string`?{status:null,errorCode:e.code}:typeof e.code==`number`?{status:e.code}:e.killed===!0?{status:null,errorCode:`ETIMEDOUT`}:e.signal?{status:null,signal:e.signal}:{status:null}}function Ut(e){if(e.errorCode!==void 0)return e.errorCode;if(e.signal!==void 0)return`signal ${e.signal}`;let t=(e.stderr.trim().split(`
|
|
2
|
+
`)[0]??``).replace(/\S*\/journal\/\S*/g,`<journal path>`).replace(/\b[0-9a-f]{32}\b/gi,`<id>`);return`exit ${e.status}${t===``?``:`: ${t}`}`}function Wt(e,t,n){return{schemaVersion:1,platform:e,source:t,outcome:`none-in-window`,readFrom:n,windowDays:7,foreignIgnored:0,unparseable:0,droppedOverCap:0,events:[]}}function Gt(e,t){return{...e,outcome:`unavailable`,unavailableReason:t}}function Kt(e){return{...e,outcome:e.events.length>0?`collected`:`none-in-window`}}function qt(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Jt(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function Yt(e,t){let n=t.indexOf(`
|
|
3
|
+
`);if(n===-1)return null;let r,i;try{r=Jt(JSON.parse(t.slice(0,n))),i=Jt(JSON.parse(t.slice(n+1)))}catch{return null}if(r===null||i===null||!Array.isArray(i.processes))return null;let a=[];for(let e of i.processes){let t=Jt(e);t===null||typeof t.name!=`string`||!Ft(t.name)||a.push({name:t.name,pid:qt(t.pid),killReason:typeof t.reason==`string`?t.reason:null,residentPages:qt(t.rpages),lifetimeMaxPages:qt(t.lifetimeMax)})}let o=Mt(r.timestamp);return{kind:`jetsam`,at:o===null?null:new Date(o).toISOString(),file:e,pageSize:qt(Jt(i.memoryStatus)?.pageSize),largestProcessOwned:typeof i.largestProcess==`string`?Ft(i.largestProcess):null,ownedProcesses:a}}const Xt=/^JetsamEvent-.*\.ips$/;function Zt(e,t,n,r){let i=e.flatMap(({file:e,mtimeMs:n})=>n!==null&&n>=t?[{file:e,mtimeMs:n}]:[]);return i.sort((e,t)=>r===`newest-first`?t.mtimeMs-e.mtimeMs:e.mtimeMs-t.mtimeMs),{files:i.slice(0,n).map(({file:e})=>e),statFailed:e.filter(({mtimeMs:e})=>e===null).length,droppedOverCap:Math.max(0,i.length-n)}}async function Qt(e,t){let n=Wt(`darwin`,`macos-jetsam`,[B(e,`JetsamEvent-*.ips`)]),r;try{r=await at(e)}catch(e){return Gt(n,e.code??`unknown`)}let i=Zt(await Promise.all(r.filter(e=>Xt.test(e)).map(async t=>{try{return{file:t,mtimeMs:(await ot(B(e,t))).mtimeMs}}catch{return{file:t,mtimeMs:null}}})),t.getTime()-Rt,50,`newest-first`);n.unparseable+=i.statFailed,n.droppedOverCap=i.droppedOverCap;for(let t of i.files){let r=null;try{r=Yt(t,await it(B(e,t),`utf8`))}catch{}r===null?n.unparseable+=1:r.ownedProcesses.length===0?n.foreignIgnored+=1:n.events.push(r)}return Kt(n)}const $t=[`--no-pager`,`--output=short-iso-precise`,`--since=-7d`,`--grep=Out of memory|oom-kill|Killed process|Killed /|memory pressure`,`_TRANSPORT=kernel`,`+`,`_SYSTEMD_UNIT=systemd-oomd.service`],en=[`--user`,`--no-pager`,`--output=short-iso-precise`,`--since=-7d`,`--grep=Fatal Wayland communication error|Wayland protocol error|X IO error|Missing X server`],tn=/^(\S+) \S+ ([^:\s[]+)(?:\[\d+\])?: (.*)$/,nn=/\[(\d+)(?::\d+)?:\d{4}\/\d{6}\.\d+:[A-Z0-9]+:[^\]]*\]\s*(.*)$/,rn=/^desktop\.\d{4}-\d{2}-\d{2}\.log$/;async function an(e,t){let n=new Set,r;try{r=await at(e)}catch{return{pids:n,unreadable:!0}}let i=!1;for(let a of r){if(!rn.test(a))continue;let r=B(e,a);try{if(t.getTime()-(await ot(r)).mtimeMs>Rt)continue;for(let e of(await it(r,`utf8`)).split(`
|
|
4
|
+
`)){if(!e.includes(`"event":"desktop.boot"`))continue;let t=/"pid":(\d+)/.exec(e)?.[1];t!==void 0&&n.add(Number(t))}}catch{i=!0}}return{pids:n,unreadable:i}}function on(e,t){if(e===`systemd-oomd`){let e=/^Killed (\S+)/.exec(t);if(e===null)return null;let n=e[1]?.split(`/`).pop()??``;return{origin:`systemd-oomd`,action:`oomd-kill`,pid:null,processName:null,unit:zt.test(n)?n:null,trigger:/swap used/.test(t)?`swap`:/memory pressure/.test(t)?`memory-pressure`:null}}if(e!==`kernel`)return null;let n=/Killed process (\d+) \(([^)]+)\)/.exec(t);if(n!==null)return{origin:`kernel`,action:`oom-kill`,pid:Number(n[1]),processName:n[2]??null,unit:null,trigger:null};let r=/task=([^,]+),pid=(\d+)/.exec(t);if(r!==null)return{origin:`kernel`,action:`oom-kill`,pid:Number(r[2]),processName:r[1]??null,unit:null,trigger:null};let i=/^(\S+) invoked oom-killer/.exec(t);return i===null?null:{origin:`kernel`,action:`oom-invoked`,pid:null,processName:i[1]??null,unit:null,trigger:null}}function sn(e){let t=[],n=0,r=0;for(let i of e.split(`
|
|
5
|
+
`)){if(i.trim()===``||i.startsWith(`-- `))continue;let e=tn.exec(i);if(e===null){r+=1;continue}let[,a=``,o=``,s=``]=e;if(!zt.test(s)){n+=1;continue}let c=on(o,s);if(c===null){r+=1;continue}t.push({kind:`journal`,at:a,...c})}return{events:t,foreignIgnored:n,unparseable:r}}function cn(e){let t=[],n=0,r=0;for(let i of e.split(`
|
|
6
|
+
`)){if(i.trim()===``||i.startsWith(`-- `))continue;let e=tn.exec(i);if(e===null){r+=1;continue}let[,a=``,,o=``]=e,s=nn.exec(o);if(s===null){n+=1;continue}t.push({at:a,pid:Number(s[1]),detail:(s[2]??``).slice(0,200)})}return{lines:t,foreignIgnored:n,unparseable:r}}async function ln(e,t,n){let r=cn(e);if(r.lines.length===0)return{...r,events:[],unattributed:null};let i=await an(t,n),a=[],o=0;for(let e of r.lines){if(!i.pids.has(e.pid)){o+=1;continue}a.push({kind:`journal`,at:e.at,origin:`chromium`,action:`display-connection-lost`,pid:e.pid,processName:null,unit:null,trigger:/Wayland/.test(e.detail)?`wayland`:`x11`,detail:e.detail})}let s=i.pids.size>0&&!i.unreadable;if(o>0&&!s){let e=i.unreadable?`desktop logs unreadable`:`no desktop.boot pid in desktop logs`;return{events:a,foreignIgnored:r.foreignIgnored,unparseable:r.unparseable,unattributed:`${o} Chromium display line(s) not attributed, ${e}`}}return{events:a,foreignIgnored:r.foreignIgnored+o,unparseable:r.unparseable,unattributed:null}}function un(e){return e.status===0||e.status===1&&/^-- No entries --$/m.test(e.stdout)}async function dn(e,t,n){let r=Wt(`linux`,`linux-journal`,[`journalctl ${$t.join(` `)}`,`journalctl ${en.join(` `)}`]),[i,a]=await Promise.all([e(`journalctl`,[...$t]),e(`journalctl`,[...en])]),o=[];if(un(i)){let e=sn(i.stdout);r.droppedOverCap+=Math.max(0,e.events.length-50),r.events.push(...e.events.slice(-50)),r.foreignIgnored+=e.foreignIgnored,r.unparseable+=e.unparseable,/not seeing messages from other users/i.test(`${i.stdout}\n${i.stderr}`)&&(r.restrictedToCurrentUser=!0)}else o.push(`system journal: ${Ut(i)}`);if(un(a)){let e=await ln(a.stdout,n,t);r.droppedOverCap+=Math.max(0,e.events.length-50),r.events.push(...e.events.slice(-50)),r.foreignIgnored+=e.foreignIgnored,r.unparseable+=e.unparseable,e.unattributed!==null&&o.push(`user journal: ${e.unattributed}`)}else o.push(`user journal: ${Ut(a)}`);return o.length===2?Gt(r,o.join(`; `)):o.length===1?{...r,outcome:`partial`,unavailableReason:o.join(`; `)}:Kt(r)}const fn={41:`Microsoft-Windows-Kernel-Power`,1074:`User32`,2004:`Microsoft-Windows-Resource-Exhaustion-Detector`,6008:`EventLog`},pn={1e3:`Application Error`,1001:`Windows Error Reporting`,1002:`Application Hang`};function mn(e){return e===`System`?fn:pn}function hn(e){let t=`System[(${Object.keys(mn(e)).map(e=>`EventID=${e}`).join(` or `)}) and TimeCreated[timediff(@SystemTime) <= ${Rt}]]`;return e===`System`?`*[${t}]`:`*[${t} and EventData[${Bt.map(e=>`Data='${e}'`).join(` or `)}]]`}function gn(e){return[`qe`,e,`/q:${hn(e)}`,`/f:xml`,`/rd:true`,`/c:200`]}function _n(e){return Ie.join(e??`C:\\Windows`,`System32`,`wevtutil.exe`)}function vn(e){return e.replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&/g,`&`)}function yn(e){return/[\\/]/.test(e)||/^[a-z]:/i.test(e)}function bn(e,t){let n=RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)</${t}>`,`g`);return[...e.matchAll(n)].map(e=>vn(e[1]??``).trim())}function xn(e,t){let n=mn(e),r=[],i=0,a=0;for(let o of t.match(/<Event[\s>][\s\S]*?<\/Event>/g)??[]){let t=/<Provider\s+Name=['"]([^'"]+)['"]/.exec(o)?.[1],s=Number(/<EventID[^>]*>(\d+)<\/EventID>/.exec(o)?.[1]),c=/<TimeCreated\s+SystemTime=['"]([^'"]+)['"]/.exec(o)?.[1];if(t===void 0||!Number.isInteger(s)||c===void 0){a+=1;continue}if(n[s]!==t){i+=1;continue}let l=bn(o,`Data`),u=bn(o,`Name`),d=[...l,...u].some(e=>zt.test(e));if(e===`Application`&&!d){i+=1;continue}r.push({kind:`windows-event`,at:c,log:e,provider:t,eventId:s,mentionsOpenKnowledge:d,data:e===`Application`?l.filter(e=>e!==``&&!yn(e)):[]})}return{events:r,foreignIgnored:i,unparseable:a}}async function Sn(e,t){let n=_n(t),r=[`System`,`Application`],i=Wt(`win32`,`windows-event-log`,r.map(e=>`${n} ${gn(e).join(` `)}`)),a=await Promise.all(r.map(async t=>({log:t,result:await e(n,gn(t))}))),o=[];for(let{log:e,result:t}of a){if(t.status!==0){o.push(`${e}: ${Ut(t)}`);continue}let n=xn(e,t.stdout);i.droppedOverCap+=Math.max(0,n.events.length-50),i.events.push(...n.events.slice(0,50)),i.foreignIgnored+=n.foreignIgnored,i.unparseable+=n.unparseable}return o.length===r.length?Gt(i,o.join(`; `)):o.length>0?{...i,outcome:`partial`,unavailableReason:o.join(`; `)}:Kt(i)}async function Cn(e={}){let t=e.platform??process.platform,n=e.runCommand??Vt(),r=(e.now??(()=>new Date))();switch(t){case`darwin`:return Qt(e.macosReportsDir??`/Library/Logs/DiagnosticReports`,r);case`linux`:return dn(n,r,e.desktopLogsDir??B(L(),`logs`));case`win32`:return Sn(n,e.systemRoot??process.env.SystemRoot);default:return{...Wt(t,null,[]),outcome:`unsupported`}}}const wn={schemaVersion:1,outcome:`not-collected`};function Tn(e){return`${JSON.stringify(e??wn,null,2)}\n`}const En={"macos-jetsam":`macOS low-memory reports`,"linux-journal":`system and user journals`,"windows-event-log":`Windows event logs`};function Dn(e){let t=[`${e.windowDays}d`,`${e.events.length} kept`,`${e.foreignIgnored} other-process record(s) ignored`,`${e.unparseable} unparseable`];e.droppedOverCap>0&&t.push(`${e.droppedOverCap} older dropped over cap`);let n=e.source?` from ${En[e.source]}`:``,r=e.unavailableReason?`, ${e.unavailableReason}`:``;return`${e.outcome}${n}${r} (${t.join(`; `)})`}function On(){return B(L(),`bug-reports`)}function kn(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=On(),r=`${t}-bugreport`,i=B(n,`${r}.zip`);for(let e=2;U(i);e+=1)i=B(n,`${r}-${e}.zip`);return i}function An(e,t){let{scrubbed:n}=e;return n!==void 0&&n.patterns.length>0?{file:t,lineCount:n.lineCount,patterns:[...n.patterns]}:null}function jn(e,t){let n=B(e,`.ok`,`config.yml`);if(U(n))try{let e=G(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 U(B(e,`.ok`))?st(`sha256`).update(V(e)).digest(`hex`).slice(0,12):null}function Mn(){let e={timestamp:new Date().toISOString(),platform:Qe(),osType:nt(),osRelease:$e(),hostname:`[redacted]`,uptime:rt(),freeMem:Xe(),totalMem:tt(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=lt(`sw_vers -productVersion 2>/dev/null`,w({encoding:`utf8`})).trim()}catch{}try{let t=B(__dirname,`..`,`..`,`package.json`);U(t)&&(e.okVersion=JSON.parse(G(t,`utf8`)).version)}catch{}return e}const Nn=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Pn(e){let t=R(e);return Nn.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Fn(e,t){return Bn(e,t).files}const In=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Ln(e,t=Me){let n=B(e,`${t}.ShipIt`);if(!U(n))return[];let r;try{r=K(n)}catch{return[]}return In.flatMap(e=>r.map(t=>{if(t===e)return{entry:t,suffix:-1};if(!t.startsWith(`${e}.`))return null;let n=t.slice(e.length+1);return/^\d+$/.test(n)?{entry:t,suffix:Number(n)}:null}).filter(e=>e!==null).map(e=>{let t=B(n,e.entry);return{path:t,suffix:e.suffix,mtimeMs:Rn(t)}}).sort((e,t)=>t.mtimeMs-e.mtimeMs||t.suffix-e.suffix).slice(0,4).map(e=>e.path))}function Rn(e){try{return Je(e).mtimeMs}catch{return 0}}function zn(e){if(!U(e))return[];try{let t=new Map;for(let n of K(e).filter(e=>e.endsWith(`.yaml`)).sort()){let e=n.endsWith(`.sent.yaml`)?n.slice(0,-_.length):n.slice(0,-5),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t.values()].slice(-25).flat().map(t=>B(e,t))}catch{return[]}}function Bn(e,t){if(!U(t))return{files:[],excludedByProjectSlug:0};let n=K(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>B(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Pn),i=[],a=r.filter(t=>{try{return G(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!Pn(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Vn(e){let t=B(e,`.ok`,`local`);return U(t)?{files:[`server.lock`,te,k].map(e=>B(t,e)).filter(e=>U(e))}:{files:[]}}function Hn(e,t,n){let r=C(e),i=[],a=[];for(let e of t){let t=B(r,e),o=B(n,e),s=U(t);s&&i.push(t),U(o)&&(s?a:i).push(o)}return{files:i,legacyFiles:a}}function Un(e){let t=0,n=new Map,r=e.replace(/("(?:docName|doc\.name|documentName)"\s*:\s*")((?:[^"\\]|\\.)*)"/g,(e,r,i)=>{t+=1;let a=n.get(i);return a===void 0&&(a=`doc#${st(`sha256`).update(i).digest(`hex`).slice(0,12)}`,n.set(i,a)),`${r}${a}"`});for(let[e,i]of[...n].sort(([e],[t])=>t.length-e.length)){if(e.length===0||!r.includes(e))continue;let n=r.split(e);t+=n.length-1,r=n.join(i)}return{text:r,count:t}}function Wn(e){let t=e.revealDocNames?e.content:Un(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=p(t);e.zipfile.addBuffer(Buffer.from(n,`utf8`),e.name),e.bundleFiles.push(e.name),r.length>0&&e.redactions.push({file:e.name,lineCount:i,patterns:r})}else e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name)}function Y(e){for(let t of e.files)try{let n=G(t,`utf8`);Wn({zipfile:e.zipfile,name:`${e.prefix}/${R(t)}`,content:t.endsWith(`.ips`)?At(n):n,redact:e.redact,revealDocNames:e.revealDocNames,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function Gn(t){let{redact:n,outputPath:r,logger:i}=t,a=t.revealDocNames??!1,o=t.userLogsDir??B(L(),`logs`),s=t.projectDir?jn(t.projectDir,i):null;W(z(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let l=Mn();l.desktop=t.desktop??null,l.language=t.language??null;let{files:u,excludedByProjectSlug:f}=Bn(s,o),{files:p}=t.projectDir?Vn(t.projectDir):{files:[]},{files:m,legacyFiles:h}=t.projectDir?Hn(t.projectDir,[I.logsCurrent,I.logsPrevious],B(t.projectDir,`.ok`,`local`,`logs`)):{files:[],legacyFiles:[]},{files:g,legacyFiles:_}=t.projectDir?Hn(t.projectDir,[ie],B(t.projectDir,`.ok`,`local`)):{files:[],legacyFiles:[]},v=t.shipItLogFiles??[],y=t.diagnosticReports?.files??[];i?.info({logFileCount:u.length,logFilesExcludedByProjectSlug:f,lockFileCount:p.length+g.length+_.length,localSinkFileCount:m.length+h.length,shipItLogFileCount:v.length,diagnosticReportCount:y.length},`files collected`);let b=[],x=[],{ZipFile:te}=await import(`./yazl-BsCX6KWo.mjs`).then(t=>e(t.default,1)),S=new te;Y({zipfile:S,files:[...u,...v],prefix:`logs`,redact:n,revealDocNames:a,bundleFiles:x,redactions:b,logger:i}),Y({zipfile:S,files:[...p,...g],prefix:`lockdir`,redact:n,revealDocNames:a,bundleFiles:x,redactions:b,logger:i}),Y({zipfile:S,files:m,prefix:`local-logs`,redact:n,revealDocNames:a,bundleFiles:x,redactions:b,logger:i}),Y({zipfile:S,files:h,prefix:`legacy/local-logs`,redact:n,revealDocNames:a,bundleFiles:x,redactions:b,logger:i}),Y({zipfile:S,files:_,prefix:`legacy/lockdir`,redact:n,revealDocNames:a,bundleFiles:x,redactions:b,logger:i}),Y({zipfile:S,files:t.bugReportLedgerFiles??[],prefix:ee,redact:n,revealDocNames:a,bundleFiles:x,redactions:b,logger:i}),Y({zipfile:S,files:y,prefix:`diagnostic-reports`,redact:n,revealDocNames:a,bundleFiles:x,redactions:b,logger:i});for(let e of t.extraFiles??[])try{let t=G(e.sourcePath),n=`extra/${e.zipName??R(e.sourcePath)}`;S.addBuffer(t,n),x.push(n);let r=An(e,n);r!==null&&b.push(r)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Wn({zipfile:S,name:`note.txt`,content:t.note,redact:n,revealDocNames:a,bundleFiles:x,redactions:b});let ne=new Set(y.map(e=>`diagnostic-reports/${R(e)}`)),C=x.filter(e=>ne.has(e)),re=t.diagnosticReports===void 0?`not-collected (no collection attempted)`:Et(t.diagnosticReports,C.length);S.addBuffer(Buffer.from(`${re}\n`,`utf8`),`state/diagnostic-reports-status.txt`),x.push(`state/diagnostic-reports-status.txt`),Wn({zipfile:S,name:Lt,content:Tn(t.osTerminationEvidence),redact:n,revealDocNames:!0,bundleFiles:x,redactions:b});let w=JSON.stringify(l,null,2);S.addBuffer(Buffer.from(w,`utf8`),`sysinfo.json`),x.push(`sysinfo.json`);let T={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:x,redactions:b,sysinfo:l};S.addBuffer(Buffer.from(JSON.stringify(T,null,2),`utf8`),`MANIFEST.json`);let E=b.reduce((e,t)=>e+t.lineCount,0),D=new Set(v.map(e=>`logs/${R(e)}`)),O=x.filter(e=>D.has(e)),k=new Set((t.bugReportLedgerFiles??[]).map(e=>`${ee}/${R(e)}`)),A=x.filter(e=>k.has(e)),j=s?x.filter(e=>e.startsWith(`logs/`)&&!Pn(e)&&!D.has(e)):[],ae=C.length>0?[`Crash reports under diagnostic-reports/ are rewritten on the way in,`,`independently of this setting: escaped path separators are normalised`,`so the scrub above can read them, and the identifiers that link this`,`machine's bundles to each other are replaced. Nothing else is changed;`,`they are not byte-identical to the files macOS wrote.`]:[],M=ae.length>0?[`Redaction was disabled for this bundle; file contents are unmodified,`,`with one exception.`,...ae]:[`Redaction was disabled for this bundle; file contents are unmodified.`],oe=[`# Bug Report Bundle`,``,`Generated: ${T.generatedAt}`,`Project: ${s??`(unscoped)`}`,...t.projectDir?[`Project diagnostic source: ${c(`logs`,`projects`)} (current product only).`]:[],`Discipline version: ${T.disciplineVersion}`,``,`## Contents`,``,...x.map(e=>`- ${e}`),``,`## Privacy`,``,...j.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...j.map(e=>`- ${e}`),``]:[],...O.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...O.map(e=>`- ${e}`),``]:[],...C.length>0?[`Crash reports: written by macOS itself rather than by OpenKnowledge,`,`and machine-wide rather than scoped to any one project. They record`,`why the operating system ended a process of this app — the signal or`,`exception, the code-signing verdict, and whatever text the process`,`left behind as it died. They also carry machine details the OS puts`,`in every report: the account uid, the Mac model, and the name of the`,`process that launched this app, which on a managed machine can be`,`internal tooling. The identifiers that would link this machine's`,`bundles to each other are replaced before bundling. Only this`,`app's own reports are collected, never another application's, though`,`a report of ours still names the processes it ran alongside:`,...C.map(e=>`- ${e}`),``]:[],...(t.osTerminationEvidence?.events.length??0)>0?[`Termination records: read from the operating system's own logs, covering`,`the last 7 days, to explain an exit the app could not record itself. On`,`macOS: the memory-pressure (jetsam) reports`,`that list processes of this app, with each one's memory use and whether`,`it was killed. On Linux: kernel and systemd-oomd out-of-memory kills of`,`this app, as structured fields with the machine name, cgroup paths and`,`user id left out, plus display-connection errors this app's desktop`,`process wrote to the user's own journal, with Chromium's message cut to`,`200 characters. On Windows: crash and hang records for this app with`,`file paths left out, plus the time of every shutdown, restart, power`,`loss and low-memory warning on the machine, whatever caused it:`,`- ${Lt}`,``]:[],...A.length>0?[`Send history: a small record for each bug report previously generated`,`on this machine — when it was generated, whether sending it`,`succeeded, and why it failed if it did. This is what makes a failed`,`send diagnosable at all. It is machine-wide rather than scoped to`,`this project, so it names the other projects reports were filed`,`from. It carries no document content:`,...A.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${d.join(`, `)}`,E>0?`${E} line(s) were scrubbed across ${b.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,...ae,``,`This bundle is safe to attach to a GitHub issue.`]:M].join(`
|
|
7
|
+
`);S.addBuffer(Buffer.from(oe,`utf8`),`README.md`),S.end();let N=ze(r);return S.outputStream.pipe(N),await new Promise((e,t)=>{N.on(`close`,e),N.on(`error`,t)}),i?.info({bundlePath:r,fileCount:x.length,redactionCount:E},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:x,redactions:b,redactedLineCount:E,generatedAt:T.generatedAt}}}var Kn=u(),qn=e(ye(),1),X=e(ke(),1);function Jn(e){let t=D(`user`,e,e);return de({absPath:t,sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function Yn({home:e=J(),env:t=process.env}={}){let n=Jn(e),{override:r,preferenceList:i}=x(t),{locale:a,source:o}=ft({override:r,storedPreference:n,supportedLocales:y,preferenceList:i,autoDetectableLocales:m});return{preference:n,locale:a,source:o,systemLanguages:i}}function Xn(e){let t=new Set([e]);try{t.add(Ge.native(e))}catch{return[e].filter(e=>e.length>0)}return[...t].filter(e=>e.length>0).sort((e,t)=>t.length-e.length)}function Zn(e,t){let n=e;for(let e of t)n.includes(e)&&(n=n.split(e).join(`<CONTENT_DIR>`));return n}function Qn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $n(e,t){if(typeof e==`string`)return Zn(e,t.contentDirSpellings);if(Array.isArray(e))return e.map(e=>$n(e,t));if(!Qn(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=$n(i,t);return n}function er(e,t){let n=G(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
8
|
+
`),i=n.split(`
|
|
9
|
+
`),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=$n(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}let o=r?`${a.join(`
|
|
10
|
+
`)}\n`:a.join(`
|
|
11
|
+
`);q(e,o)}function tr(e,t){let n=G(e,`utf-8`);if(n.trim().length!==0)try{let r=$n(JSON.parse(n),t),i=n.endsWith(`
|
|
12
|
+
`)?`
|
|
13
|
+
`:``;q(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=Zn(n,t.contentDirSpellings);r!==n&&q(e,r)}}function nr(e,t){let n=G(e,`utf-8`),r=Zn(n,t.contentDirSpellings);r!==n&&q(e,r)}function rr(e){try{return K(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>B(e,t.name))}catch{return[]}}const ir=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function ar(e){return/\.log\.\d+$/.test(e)}function or(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||ar(e)}const sr=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function cr(e){let t={contentDirSpellings:Xn(e.contentDir)};for(let n of sr)for(let r of rr(B(e.stagingDir,n)))or(r)?er(r,t):r.endsWith(`.json`)?tr(r,t):nr(r,t);for(let n of rr(B(e.stagingDir,`state`))){let e=R(n);n.endsWith(`.jsonl`)?er(n,t):ir.has(e)?tr(n,t):nr(n,t)}}const lr=[`.ok`,`local`,`telemetry`],ur=[`.ok`,`local`,`logs`],dr=[`.ok`,`local`,`loss-capture`],fr=I.spansCurrent,pr=I.spansPrevious,mr=I.logsCurrent,hr=I.logsPrevious,gr=`loss-current.jsonl`,_r=`loss-prev.jsonl`;function vr(e){return B(e,...dr,gr)}function yr(e){return B(e,...dr,_r)}const br=1e3;async function xr(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(br)});return t.ok?await t.text():null}catch{return null}}async function Sr(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(br)});return t.ok?await t.text():null}catch{return null}}async function Cr(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(br)});return t.ok?await t.text():null}catch{return null}}function wr(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(`
|
|
14
|
+
`)}\n`:null}catch{return null}}function Tr(e){let t=B(e,`.git`,`ok`);if(!U(t))return null;let n=ut(`git`,[`-C`,t,`log`,`--oneline`,`-50`],w({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Er(e){let t=B(e,`.git`,`ok`);if(!U(t))return null;let n=ut(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],w({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Dr(){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 Or(){return{nodeVersion:process.version,platform:Qe(),arch:Ye()}}function kr(){return process.env.OTEL_SDK_DISABLED===`false`}function Ar(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jr(e){if(!U(e))return{};let t;try{t=(0,Kn.parse)(G(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(!Ar(t))return{};let n=t.telemetry;if(!Ar(n))return{};let r=n.localSink;return Ar(r)?r:{}}function Mr(e){return typeof e==`boolean`?e:void 0}function Nr(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Pr(e){if(Ar(e))return Nr(e.maxBytes)}function Fr(e){let t=jr(D(`project`,e)),n=jr(D(`project-local`,e));return{enabled:Mr(n.enabled)??Mr(t.enabled)??!0,spansMaxBytes:Pr(n.spans)??Pr(t.spans)??52428800,logsMaxBytes:Pr(n.logs)??Pr(t.logs)??26214400}}function Ir(e){return st(`sha256`).update(e).digest(`hex`)}function Lr(e){let t=G(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const Rr=[`"doc.name"`,`"docName"`];function zr(e){let t=G(e,`utf-8`),n=0;for(let e of Rr){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z(e,t){if(!U(e))return!1;try{return W(z(t),{recursive:!0}),e.endsWith(`.ips`)?q(t,At(G(e,`utf-8`))):Re(e,t),!0}catch{return!1}}function Q(e,t,n,r){let i=U(e);Z(e,B(n,r)),Z(t,i?B(n,`legacy`,r):B(n,r))}function Br(e){let t=[],n=e=>{let r=K(e,{withFileTypes:!0});for(let i of r){let r=B(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Vr=new Set([`.jsonl`]);function Hr(e){let t=e.lastIndexOf(`.`);return t!==-1&&Vr.has(e.slice(t))}const Ur=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function Wr(e){if(ar(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&Ur.has(e.slice(t))}function Gr(e){let t=[];for(let n of Br(e)){let r=Kr(e,n);if(!Wr(r))continue;let{redacted:i,patterns:a,lineCount:o}=p(G(n,`utf-8`));a.length!==0&&(q(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Kr(e,t){return Fe(e,t).split(H).join(`/`)}async function qr(e){let t=V(e.contentDir),n=V(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??xr,a=r.fetchAgentEffects??Sr,o=r.fetchWatcherRecent??Cr,s=r.readShadowHead??Tr,l=r.readCheckpointRefs??Er,u=r.now??(()=>new Date),d=r.okVersion??(()=>Ne),f=r.readDesktopEnv??Dr,p=r.readLanguage??Yn,m=r.readRuntime??Or,h=r.isOtlpPushEnabled??kr,g=Ve(B(et(),`ok-bundle-`));try{W(B(g,`telemetry`),{recursive:!0}),W(B(g,`logs`),{recursive:!0}),W(B(g,`state`),{recursive:!0}),Q(_e(n),B(n,...lr,fr),g,B(`telemetry`,fr)),Q(oe(n),B(n,...lr,pr),g,B(`telemetry`,pr)),Q(ae(n),B(n,...ur,mr),g,B(`logs`,mr)),Q(ne(n),B(n,...ur,hr),g,B(`logs`,hr));for(let t of e.userLogFiles??[])Z(t,B(g,`logs`,R(t)));for(let t of e.userStateFiles??[])Z(t,B(g,ee,R(t)));let _=0;for(let t of e.diagnosticReports?.files??[])Z(t,B(g,`diagnostic-reports`,R(t)))&&(_+=1);let v=B(n,`.ok`,`local`),y=B(v,`server.lock`),b=`not-running`,x=`no server.lock`,S=null;if(U(y)){Z(y,B(g,`state`,`server.lock`));try{let e=G(y,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?S=t.port:x=`lock present but no port`}catch{x=`lock present but unparseable`}}if(S!==null){let e=await i(S);e===null?x=`agent-presence endpoint at :${S} unreachable`:(q(B(g,`state`,`agent-presence.json`),e),b=`running`,x=``);let t=await a(S);t!==null&&q(B(g,`state`,`agent-effects.json`),t);let n=await o(S);if(n!==null){let e=wr(n);e!==null&&q(B(g,`state`,`watcher-recent.jsonl`),e)}}let C=s(t);C!==null&&q(B(g,`state`,`shadow-head.txt`),C);let re=l(t);re!==null&&q(B(g,`state`,`checkpoint-refs.txt`),re),Z(vr(n),B(g,`state`,gr)),Z(yr(n),B(g,`state`,_r)),Q(fe(n),B(v,ie),g,`state/last-spawn-error.log`),Z(B(v,se),B(g,`state`,se)),Z(B(v,te),B(g,`state`,te)),Z(B(v,k),B(g,`state`,k));let w=m(),T=f(),E=p(),D={ok:{version:d(),nodeVersion:w.nodeVersion,platform:w.platform,arch:w.arch},host:{desktop:T,language:E}};q(B(g,`state`,`runtime.json`),`${JSON.stringify(D,null,2)}\n`);let O=b===`running`?`running
|
|
15
|
+
`:`not-running (${x})\n`;q(B(g,`state`,`server-status.txt`),O);let A=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:Et(e.diagnosticReports,_);if(q(B(g,`state`,`diagnostic-reports-status.txt`),`${A}\n`),q(B(g,Lt),Tn(e.osTerminationEvidence)),e.processDir&&U(e.processDir)){let t=B(g,`process`);W(t,{recursive:!0}),Re(e.processDir,t,{recursive:!0})}let j=e.redact===!0;j&&(cr({stagingDir:g,contentDir:t}),cr({stagingDir:B(g,`legacy`),contentDir:t})),e.note&&q(B(g,`note.txt`),e.note);let M=null;e.scrubSecrets===!0&&(M=Gr(g));for(let t of e.extraFiles??[]){let e=t.zipName??R(t.sourcePath);if(!Z(t.sourcePath,B(g,`extra`,e))){r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);continue}let n=An(t,`extra/${e}`);n!==null&&(M??={redactions:[],redactedLineCount:0},M.redactions.push(n),M.redactedLineCount+=n.lineCount)}let N=Fr(n),ce=Br(g),le=[],ue=0,de=0;for(let e of ce){let t=Kr(g,e),n=Je(e).size,r=Hr(t)?Lr(e):0;le.push({path:t,bytes:n,lines:r}),ue+=n;let i=t.startsWith(`legacy/`)?t.slice(7):t;(i.startsWith(`telemetry/`)||i.startsWith(`logs/`))&&(de+=zr(e))}let P={applied:j};M!==null&&(P.secretScrub=M);let pe={schemaVersion:2,createdAt:u().toISOString(),ok:{version:d(),nodeVersion:w.nodeVersion,platform:w.platform,arch:w.arch},host:{desktop:T,language:E},contentDir:{pathSha256:Ir(t),absolutePath:j?`<CONTENT_DIR>`:t},telemetry:{localSink:{...N,directory:c(`logs`,`projects`)},otlpPushEnabled:h()},redaction:P,serverStatus:b,files:le};q(B(g,`manifest.json`),`${JSON.stringify(pe,null,2)}\n`);let me=Xn(t),he=ce.some(e=>{try{let t=G(e,`utf-8`);return me.some(e=>t.includes(e))}catch{return!1}}),F={stagedDiagnosticReports:_,totalBytes:ue,fileCount:le.length,docNameCount:de,contentDirVisible:he,redacted:j},ge=!1;return{stagingDir:g,manifest:pe,summary:F,cleanup:()=>{ge||(ge=!0,Ke(g,{recursive:!0,force:!0}))}}}catch(e){throw Ke(g,{recursive:!0,force:!0}),e}}async function Jr(e){let{collected:t,outputPath:n}=e,r=z(n);if(!U(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new qn.ZipFile,a=Br(t.stagingDir);for(let e of a){let n=Kr(t.stagingDir,e);i.addFile(e,n)}i.end();let o=ze(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 Yr(e,t){let n=B(e,`.ok`,`config.yml`);if(U(n))try{let t=(0,Kn.parse)(G(n,`utf-8`)),r=Ae(t)?t.content:void 0,i=Ae(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return V(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 V(e)}async function Xr(e,t,n,r,i,a){let o=jn(t,e.logger),s=await qr({contentDir:Yr(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...Fn(o,e.userLogsDir??B(L(),`logs`)),...Ln(e.cachesDir??B(J(),`Library`,`Caches`))],userStateFiles:zn(e.bugReportsDir??On()),diagnosticReports:i,osTerminationEvidence:a,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{W(z(e.outputPath),{recursive:!0}),await Jr({collected:s,outputPath:e.outputPath});let t=s.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:o,files:s.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:s.manifest.createdAt}}}finally{s.cleanup()}}async function Zr(e){let{projectDir:t}=e,n=e.readDesktopEnv??Dr,r=e.readLanguage??Yn,i=()=>It(e.diagnosticReportsDir??B(J(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return Xr(e,t,n,r,i(),await Cn(e.osTerminationEvidenceDeps));let{zipPath:a,summary:o}=await Gn({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:Ln(e.cachesDir??B(J(),`Library`,`Caches`)),bugReportLedgerFiles:zn(e.bugReportsDir??On()),diagnosticReports:e.level===`full`?i():void 0,osTerminationEvidence:e.level===`full`?await Cn(e.osTerminationEvidenceDeps):void 0,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:a,summary:{level:e.level,systemWide:t===void 0,projectSlug:o.projectSlug,files:o.files,redactions:o.redactions,redactedLineCount:o.redactedLineCount,generatedAt:o.generatedAt}}}function $(e,t,n={}){let r=S(e,t),i;try{i=G(r,`utf-8`)}catch(e){return e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`?{status:`missing`,lockPath:r}:{status:`read-error`,lockPath:r,error:e instanceof Error?e.message:String(e)}}let a;try{a=JSON.parse(i)}catch{return{status:`corrupt`,lockPath:r,text:i}}let o=a&&typeof a==`object`?a:{},s=le(o),c=s&&!ce(o,n);if(!a||typeof a!=`object`||!ue(a.pid))return{status:`corrupt`,lockPath:r,text:i,...c?{foreignHost:!0}:{}};let l=j(a),{pid:u}=l;if(c)return{status:`foreign-host`,lockPath:r,lock:l};let d=b(l,{isAlive:n.isAlive,readProcessStart:n.readProcessStart,readBootInstant:n.readBootInstant,sameMachine:s});switch(d.verdict){case`gone`:return{status:`dead-pid`,lockPath:r,lock:l,text:i};case`replaced`:return{status:`reused-pid`,lockPath:r,lock:l,text:i};case`unverified`:return d.cause===`unverified-owner`?{status:`unverified-owner`,lockPath:r,pid:u}:{status:`alive`,lockPath:r,lock:l};case`writer`:return{status:`alive`,lockPath:r,lock:l};default:return d}}function Qr(e){return`does not record its owning machine, and its recorded process ${e} is still running on this machine`}function $r(e){return typeof e.machineId==`string`?`records a machine ID different from the one in ${M()}`:`records only the host ${je(e.hostname)}, not this machine's ${Ze()}`}function ei(e){return e===`win32`?`USERPROFILE`:`HOME`}function ti(e){return e.processStart===void 0?` This lock records no process start; a server started by this release records one, which lets \`${o()} stop\` confirm it from any home folder.`:``}function ni(e,t){let n=`\`${o()} stop\``;return`If the server was started on this machine from another account, run ${n} as that account. If it was started from this account with a different home folder, run ${n} with \`${ei(t)}\` set to that folder. Otherwise stop it from the machine that owns the lock.${ti(e)}`}function ri(e,t){let n=o();return`If the server was started on this machine from another account, run \`${n} stop\` as that account while it is running, or \`${n} clean\` once it has exited. If it was started from this account with a different home folder, run the same command with \`${ei(t)}\` set to that folder. Otherwise run the same command on the machine that owns the lock.${ti(e)}`}function ii(e){return`Confirm that no OpenKnowledge server is using this directory on the owning machine or any other machine sharing it. Only then remove the stale lock file at ${e} and retry cleanup.`}function ai(e,t=process.platform){let{lock:n,lockPath:r}=e;return`${typeof n.machineId==`string`?ri(n,t):`If ${je(n.hostname)} is another machine, stop OpenKnowledge there; if it is an earlier name of this machine, stop OpenKnowledge here if it is still running.`} ${ii(r)}`}function oi(e,t=process.platform){let{lockPath:n}=e;return e.status===`unverified-owner`?`Cannot verify shutdown: the server lock at ${n} ${Qr(e.pid)}. Check whether process ${e.pid} is an OpenKnowledge server. If it is, stop it and retry. Do not remove the lock file while that process is running.`:e.status===`corrupt`?`Cannot verify shutdown: the server lock at ${n} records a machine ID or host name that is not this machine's, so its server may run on another machine, or on this one from another account, with a different home folder, or under an earlier host name. Stop OpenKnowledge wherever it was started. ${ii(n)}`:`Cannot verify shutdown: the server lock at ${n} ${$r(e.lock)}. ${ai(e,t)}`}function si(e){return e.replace(/:\d+$/,``)}function ci(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:si(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:si(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:si(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.\-~%]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}const li=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function ui(e,t=process.platform,n=process.env){return f(r(),e,t,n.XDG_CONFIG_HOME)}function di(){return g(r())}function fi(){let e=r();if(e===`stable`)return li;let t=h(e);return RegExp(`^# >>> ${t} >>>\\n[\\s\\S]*?^# <<< ${t} <<<\\n?`,`m`)}const pi={existsSync:e=>U(e),readFileSync:(e,t)=>G(e,t),lstatSync:e=>Be(e),readlinkSync:e=>We(e)};function mi(e,t=pi,n=process.platform,i=process.env){let a=r(),o=ui(e,n,i),s=f(a,e),c=t.existsSync(o)?o:a===`stable`&&n===`linux`&&t.existsSync(s)?s:null;if(c===null)return null;try{let e=JSON.parse(t.readFileSync(c,`utf8`));return e?.version===1?e:null}catch{return null}}function hi(e){let t=e.replace(fi(),``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function gi(e,t,n=pi){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}const _i=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],vi=[...O.map(e=>pe[e]),`open-knowledge`];function yi(e){if(!Pe(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=V(e);if(t===H||z(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function bi(e,t){let n=Fe(e,t);if(n.startsWith(`..`)||Pe(n))return!1;let r=e;for(let e of n.split(H)){r=B(r,e);try{if(!Be(r).isDirectory())return!1}catch{return!1}}return!0}function xi(e,t){try{return K(e).every(n=>t.has(B(e,n)))}catch{return!1}}function Si(e){let t=yi(e),n=[],r=[],i=new Set;for(let e of _i){let a=B(t,e.hostDir,`skills`);if(!bi(t,a))continue;let o=vi.map(e=>B(a,e)).filter(e=>U(e));n.push(...o);for(let e of o)i.add(e);let s=B(t,e.pruneRoot),c=a;for(;xi(c,i)&&(r.push(c),i.add(c),c!==s);){let e=z(c);if(e===c||e===t||!e.startsWith(t+H))break;c=e}}return{skillDirs:n,emptyDirs:r}}function Ci(e){try{if(!Be(e).isDirectory())return!1;let t=K(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function wi(e){let t=new Set,n=new Set;for(let r of _i){let i=B(e,r.hostDir,`skills`);for(let e of vi)t.add(B(i,e));let a=B(e,r.pruneRoot),o=i;for(;n.add(o),o!==a;){let t=z(o);if(t===o||t===e||!t.startsWith(e+H))break;o=t}}return{skillDirs:t,emptyDirs:n}}function Ti(e,t){let n=yi(e),r=wi(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(bi(n,e)&&Ci(e))try{Ke(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(bi(n,e))try{qe(e),a.push(e)}catch{}return a}function Ei(e){let t=yi(e),n=[];for(let e of O){let r=pe[e];n.push({path:B(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of v)n.push({path:B(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function Di(e,t){let n=[];for(let r of Ei(e))if(r.bundleId===t)try{Ke(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}function Oi(e){if(!e||typeof e!=`object`)return String(e);let t=typeof e.readProcessStart;return`${Ce(e)} readProcessStart=${t}`}function ki(e,t={}){if(!Number.isSafeInteger(e)||e<=0||e>4294967295)return null;let n=t.arch??process.arch,r=(e,n,r)=>{Te(n,r),t.onNativeFailure?.({kind:e,reason:we(n,r)})};try{let i=!1,a=Se(t.nativeResolver,(e,t)=>{i=!0,r(`unavailable`,e,t)});if(!a||typeof a!=`object`||!(`readProcessStart`in a)||typeof a.readProcessStart!=`function`){let e;return e=a==null?i?`no usable binding was returned`:`the addon was not found`:Oi(a),r(`unavailable`,`the Windows native addon (native-config.win32-${n}-msvc.node) did not load or does not export readProcessStart`,e),null}let o=a.readProcessStart(e);return typeof o==`number`&&Number.isSafeInteger(o)&&o>=0?o:(r(`unavailable`,`readProcessStart returned an invalid value`,Ce(o)),null)}catch(e){return r(`query-failed`,`readProcessStart failed`,e),null}}function Ai(e,t={}){return me(e,{platform:t.platform,readNative:e=>ki(e,{onNativeFailure:t.onNativeFailure})})}function ji(e){let{platform:t,pid:n,nativeFailures:r,causeRecorded:i}=e,a=r.some(e=>{switch(e.kind){case`unavailable`:return!0;case`query-failed`:return!1;default:return e.kind}}),o=r.length===0?``:a?`Reinstall OpenKnowledge to restore the Windows component that verifies process identity. `:`The Windows component loaded but the operating system refused the query, so reinstalling will not help; retry from an account that can inspect that process. `;return(t===`linux`?`Linux reads the process start from /proc/${n}/stat and /proc/stat; restore read access to /proc and retry. `:t===`darwin`?`macOS reads the process start with ps, and that read failed, as it does inside some sandboxes; retry from a shell where ps can run. `:t===`win32`?o:``)+(r.length>0&&i?`The failure detail is recorded in the CLI log under ${c(`logs`)}. `:``)}function Mi(e){let t=new Set;return ge(n=>{let r=[],i=ki(n,{onNativeFailure:e=>{r.push(e)}});for(let i of new Set(r.map(e=>e.kind)))t.has(i)||(t.add(i),(e??Oe())?.warn({event:`process-start-native-failure`,lockPid:n,kind:i,reasons:r.filter(e=>e.kind===i).map(e=>e.reason)},`the Windows process-start query failed, so lock holders cannot be verified; later failures of this kind are not recorded again`));return i})}function Ni(e){return e!=null&&e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function Pi(e,t=Date.now()){if(e===null)return`—`;let n=pt(e,t);return n===`unknown`?`—`:n}function Fi(e){let t=z(e);return R(e)===`local`&&R(t)===`.ok`?z(t):R(e)===`.ok`?t:null}function Ii(e,t,n,r){if(t.status===`missing`||t.status===`corrupt`||t.status===`read-error`)return null;if(t.status===`unverified-owner`)return{directory:Fi(e),server:{port:null,status:t.status,pid:t.pid,startedAt:null,usage:null},ui:null,hostname:null,lockPath:t.lockPath,binary:null,command:null,isDesktop:!1};let i=t.lock,a=t.status===`alive`&&ve(i)?{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r}:null;return{directory:i.worktreeRoot,server:{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r},ui:a,hostname:i.hostname,lockPath:t.lockPath,binary:n==null?null:he(n),command:n,isDesktop:Ni(n)}}function Li(e){let t=e.server.status;switch(t){case`unverified-owner`:return`unverified`;case`alive`:return e.isDesktop?`desktop`:`running`;case`foreign-host`:return e.isDesktop?`desktop`:`foreign`;case`dead-pid`:case`reused-pid`:return`stale`;default:return t}}const Ri=new Set([`running`,`desktop`,`foreign`,`unverified`]);function zi(e){switch(e){case`running`:return X.default.green(e);case`desktop`:return X.default.blue(e);case`foreign`:return X.default.cyan(e);case`unverified`:case`stale`:return X.default.yellow(e)}}function Bi(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function Vi(e){return`${Bi(e.server.usage)} | ${Bi(e.ui?.usage??null)}`}function Hi(e){return`${e.server.port===null?`—`:e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null?`—`:String(e.ui.port)}`}function Ui(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>[e.directory??`—`,Hi(e),Vi(e),Li(e),String(e.server.pid),Pi(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(),s=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=zi(Li(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),c=X.default.dim(`To stop a server: ${o()} stop <port|pid|directory|all>`);return[a,...s,``,c].join(`
|
|
16
|
+
`)}async function Wi(e={}){let t=e.discover??F,n=e.inspect??(e=>$(e,`server`)),r=e.log??(e=>console.log(e)),i=e.resolveCommand??N,a=e.resolveUsage??re,o=await t(),s=[];for(let e of o){let t=n(e),r=Ii(e,t,t.status===`missing`||t.status===`corrupt`||t.status===`read-error`||t.status===`unverified-owner`||t.status===`reused-pid`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`||t.status===`read-error`||t.status===`unverified-owner`||t.status===`reused-pid`?null:a(t.lock.pid));r!=null&&s.push(r)}if(e.json){let e=s.map(e=>({...e,displayStatus:Li(e)}));r(JSON.stringify(e,null,2));return}r(Ui(e.all?s:s.filter(e=>Ri.has(Li(e)))))}function Gi(){return new De(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale entries`).option(`--all`,`Include stale entries (foreign and unverified entries already show)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await Wi({all:t.all===!0||e===`all`,json:t.json===!0})})}async function Ki(e,t=Oe()){let n=$(e,`server`);if(n.status!==`alive`&&n.status!==`foreign-host`)return null;let r=A(n.lock);if(r===null)return null;try{let n=await fetch(`${r}/api/server-info`,{signal:AbortSignal.timeout(1500),redirect:`manual`});if(!n.ok)return t?.warn({lockDir:e,baseUrl:r,outcome:`http-error`,status:n.status},`stop client-probe failed`),null;let i=(await n.json())?.collabClients;return typeof i==`number`&&Number.isFinite(i)?i:(t?.warn({lockDir:e,baseUrl:r,outcome:`no-client-count`,received:typeof i},`stop client-probe failed`),null)}catch(n){return t?.warn({lockDir:e,baseUrl:r,outcome:`unreachable`,err:n},`stop client-probe failed`),null}}function qi(e,t={}){return ea(e,t.isAlive??P)?{targets:[{name:`server`,pid:e.lock.pid,port:e.lock.port}],lock:e.lock}:{targets:[]}}function Ji(e){try{return r()}catch(t){e?.warn({err:t},`stop channel check skipped: ${t instanceof Error?t.message:String(t)}`);return}}async function Yi(e){let t=e.inspect??(()=>$(e.lockDir,`server`)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),a=e.error??(e=>console.error(e)),c=e.probeClients??Ki,l=e.logger??Oe(),u=e.platform??process.platform,d=t(),f=qi(d,{isAlive:e.isAlive}),{lock:p}=f,m=[],h=[],g=(t,n)=>{l?.warn({lockDir:e.lockDir,lockPath:n.lockPath,lockPid:n.pid,platform:u,cause:n.cause,...`nativeFailures`in n&&n.nativeFailures.length>0?{nativeFailures:n.nativeFailures}:{}},`stop declined: lock holder identity unverified`),h.push({target:t,error:Qi(n,l!==void 0),unverified:n})},_=()=>{if(m.length>0){let e=m.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);r(`Stopped: ${e}`)}if(l?.info({lockDir:e.lockDir,signalled:m.map(e=>({name:e.name,pid:e.pid,port:e.port})),failed:h.map(({target:e,error:t})=>({pid:e.pid,error:t})),forced:e.force===!0},`stop signalled processes`),h.length>0){let e=h.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `);a(`Failed to stop: ${e}`)}return{stopped:m,failed:h,hadTargets:!0}};if(d.status===`unverified-owner`){let{pid:e,lockPath:t}=d;return g({name:`server`,pid:e},{cause:`unverified-owner`,pid:e,lockPath:t}),_()}if(p===void 0)return r(`No running open-knowledge processes.`),l?.info({lockDir:e.lockDir,targets:0},`stop found nothing to signal`),{stopped:[],failed:[],hadTargets:!1};let v=d.status===`alive`||d.status===`foreign-host`?d.lock.channel:void 0;if(e.force!==!0&&typeof v==`string`&&v.length>0){let t=e.selfChannel??Ji(l);if(t!==void 0&&v!==t)return a(`Not stopping: the server at ${e.lockDir} belongs to ${i(v)}. `+(v===`dev`?`Stop it from that dev build, or run \`${s} stop\` with OK_CHANNEL=dev set, or re-run with --force to terminate anyway.`:`Stop it from that app or its CLI, or re-run with --force to terminate anyway.`)),l?.warn({lockDir:e.lockDir,holderChannel:v,selfChannel:t,pids:f.targets.map(e=>e.pid)},`stop declined: server belongs to another channel`),{stopped:[],failed:[],hadTargets:!0,declined:{otherChannel:v}}}if(e.force!==!0){let t=await c(e.lockDir,l);if(t!==null&&t>0)return a(`Not stopping: ${t} collaboration client${t===1?``:`s`} (editor window${t===1?``:`s`} or agents) still connected to the server at ${e.lockDir}. Close them, or re-run with --force to terminate anyway.`),l?.warn({lockDir:e.lockDir,clients:t,pids:f.targets.map(e=>e.pid)},`stop declined: live collaboration clients`),{stopped:[],failed:[],hadTargets:!0,declined:{clients:t}}}for(let t of f.targets){let i=[],s=(e.readProcessStart??Ai)(t.pid,{platform:u,onNativeFailure:e=>{i.push(e)}}),c=b(p,{isAlive:e.isAlive??P,readProcessStart:()=>s,refuseHolderStartedAfterLock:e.refuseHolderStartedAfterLock,platform:u,readBootInstant:e.readBootInstant});switch(c.verdict){case`writer`:try{n(t.pid,`SIGTERM`),m.push(t)}catch(e){h.push({target:t,error:e instanceof Error?e.message:String(e)})}break;case`gone`:r(`${t.name} (pid=${t.pid}) had already exited`);break;case`replaced`:a(`Process ${t.pid} is no longer the server that wrote ${d.lockPath}; it was not signalled. Run \`${o()} clean\` to remove the stale lock.`);break;case`unverified`:g(t,Xi(c.cause,{pid:t.pid,lockPath:d.lockPath,lock:p,platform:u,nativeFailures:i}));break;default:return c}}return _()}function Xi(e,t){let{pid:n,lockPath:r}=t;switch(e){case`foreign-host`:return{cause:e,pid:n,lockPath:r,lock:t.lock,platform:t.platform};case`unverified-owner`:return{cause:e,pid:n,lockPath:r};default:return{cause:e,pid:n,lockPath:r,platform:t.platform,nativeFailures:t.nativeFailures}}}const Zi=`it was not signalled, and --force does not override this check.`;function Qi(e,t){let{pid:n,lockPath:r}=e;switch(e.cause){case`foreign-host`:{let{lock:t}=e;return typeof t.machineId==`string`?`The server lock at ${r} ${$r(t)}, so process ${n}, which is running on this machine, cannot be confirmed as the server that wrote it; ${Zi} ${ni(t,e.platform)}`:`The server lock at ${r} ${$r(t)}, and the start of process ${n}, which is running on this machine, does not confirm it as the server that wrote the lock; ${Zi} If ${je(t.hostname)} is another machine, stop the server there. If it is an earlier name of this machine, confirm that process ${n} is an OpenKnowledge server before ending it yourself, and once no OpenKnowledge server is running for this project, remove ${r}.`}case`unverified-owner`:return`The server lock at ${r} ${Qr(n)}, so it cannot be confirmed as the server that wrote the lock; ${Zi} Check whether process ${n} is an OpenKnowledge server, and if it is, stop it yourself. Do not remove the lock file while that process is running.`;default:{let n=$i(e,Zi,`Once you have confirmed no OpenKnowledge server is running for this project, remove ${r}.`,t);return e.cause===`writer-identity-unrecorded`?`${n} A server you start again with this release records its machine ID, so \`${o()} stop\` can confirm it.`:n}}}function $i(e,t,n,r){let{pid:i,lockPath:a,platform:o,nativeFailures:s}=e,c=`Before ending process ${i} yourself, confirm that it is an OpenKnowledge server.`;switch(e.cause){case`process-start-unreadable`:return`Could not read when process ${i} started, so it cannot be confirmed as the server that wrote ${a}; ${t} `+ji({platform:o,pid:i,nativeFailures:s,causeRecorded:r})+`${c} ${n}`;case`process-start-incomparable`:return`The start of process ${i} cannot be compared with the start recorded in ${a}, so it cannot be confirmed as the server that wrote the lock; ${t} ${c} ${n}`;case`process-start-mismatch`:return`Process ${i} started before the start recorded in ${a}, so it cannot be confirmed as the server that wrote the lock; ${t} ${c} ${n}`;case`process-started-after-lock`:return`Process ${i} started after the server lock at ${a} was written, so it cannot be confirmed as the server that wrote the lock; ${t} ${c} ${n}`;case`recorded-start-in-future`:return`The server lock at ${a} records a start later than the current time on this machine, so process ${i} cannot be confirmed as the server that wrote it; ${t} ${c} ${n}`;case`writer-identity-unrecorded`:return`The server lock at ${a} records neither a machine ID nor a process start, as locks written by version 0.25.0 and earlier do, so process ${i} cannot be confirmed as the server that wrote it; ${t} ${c} ${n}`;default:return e.cause}}function ea(e,t){return e.status===`alive`||e.status===`foreign-host`&&t(e.lock.pid)}async function ta(e,t=P){let n=await F(),r=null;for(let i of n){let n=$(i,`server`);if(ea(n,t)){if(n.lock.port===e)return i;r===null&&n.lock.pid===e&&(r=i)}}return r}function na(e){(e.failed.length>0||e.declined!==void 0)&&(process.exitCode=1)}async function ra(e,t){let n=await Yi({lockDir:e,force:t});return na(n),n}function ia(e,t,n={}){return t===0?`Nothing was running for ${e}, and no other open-knowledge servers are running.`:`Nothing was running for ${e}. ${t} other open-knowledge server${t===1?` is`:`s are`} running${n.listingFollows===!0?``:` — run \`${o()} ps\` to list them`}.`}async function aa(e){let t=await F(),n=0;for(let r of t)r!==e&&ea($(r,`server`),P)&&n++;return n}function oa(e){return new De(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the enclosing project — run it from anywhere inside the project. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).option(`--force`,`Stop even when the server belongs to another OpenKnowledge app (Stable, Beta or a dev build run from source) or editor windows or agents are still connected to it`).action(async(t,n)=>{let r=n.force===!0,i=t.length===0?void 0:t.join(` `);if(i===void 0){e();let t=T(process.cwd()),n=[],i=await Yi({lockDir:t,force:r,log:e=>n.push(e)});if(i.hadTargets){for(let e of n)console.log(e);na(i)}else{let e=await aa(t);console.log(ia(process.cwd(),e,{listingFollows:e>0})),e>0&&await Wi({})}return}if(i===`all`){let e=await F();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e)ea($(n,`server`),P)&&(await ra(n,r),t++);t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(i)){let e=Number.parseInt(i,10),t=await ta(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}await ra(t,r);return}let a=V(vt(),i),o=T(a),s=[],c=await Yi({lockDir:o,force:r,log:e=>s.push(e)});if(na(c),c.hadTargets)for(let e of s)console.log(e);else console.log(ia(a,await aa(o)))})}export{It as A,Zr as C,On as D,kn as E,Ct as F,wt as I,vt as L,yt as M,xt as N,Cn as O,bt as P,_t as R,$ as S,Jr as T,hi as _,Gi as a,$r as b,Ti as c,Ei as d,li as f,mi as g,di as h,oa as i,Et as j,Dn as k,Si as l,ui as m,Ki as n,Ai as o,gi as p,Yi as r,Mi as s,$i as t,Di as u,ci as v,qr as w,oi as x,ai as y,ht as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./md-manager-BGnqyqi1-BW5Abi4P.mjs";import"./src-DJ8h2wMj.mjs";import"./init-Bwx1qRcH.mjs";import"./token-store-Bmb3_0hU.mjs";import"./start-BQgTW5ae.mjs";import"./registry-probes-DzWaR5SV.mjs";import{n as e}from"./loader-Tugp8DGe.mjs";import"./preview-Clni94CG.mjs";import"./repair-mcp-configs-BXFxGkMn.mjs";export{e as loadConfig};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{O as e}from"./constants-ok-dir-DZ25OS9-.mjs";import{C as t,I as n,Q as r,Z as i,hl as a,i as o,pd as s}from"./md-manager-BGnqyqi1-BW5Abi4P.mjs";import{Ei as c,Ms as l,Vi as u,js as d,k as f,xi as p,ys as m}from"./dist-Czh3kWim.mjs";import{n as h}from"./fs-find-project-root-BYV07wjn.mjs";import{Et as g,R as _,Tt as v,Z as y,b,dt as x,wt as S,x as C,z as w}from"./init-Bwx1qRcH.mjs";import{i as T}from"./token-store-Bmb3_0hU.mjs";import{a as E,c as D,d as O,g as k,h as A,i as j,m as M,n as N,o as P,r as F,s as ee,t as I}from"./registry-probes-DzWaR5SV.mjs";import{n as te}from"./constants-d7jCg5-t.mjs";import{basename as L,dirname as R,resolve as z}from"node:path";import{existsSync as B,realpathSync as ne}from"node:fs";import{homedir as re,tmpdir as ie}from"node:os";import{rm as ae}from"node:fs/promises";import{execFileSync as oe,spawn as se}from"node:child_process";import{setTimeout as ce}from"node:timers/promises";const le=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`],ue={encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3,windowsHide:!0};function V(e,t={}){let{login:n}=t,r=t._exec??oe,i=H(t._fileExists??B),a=e?[`--hostname`,e]:[];if(n){let e=U(r,i,[`auth`,`token`,...a,`--user`,n]);if(e)return{available:!0,token:e,resolvedLogin:n,fallback:!1}}let o=U(r,i,[`auth`,`token`,...a]);return o?n?{available:!0,token:o,fallback:!0}:{available:!0,token:o}:{available:!1}}function H(e){return[`gh`,...le.filter(e)]}function U(e,t,n){for(let r of t)try{let t=e(r,n,ue).toString().trim();if(t.length>0)return t}catch{}}function de(e,t={}){let n=t._exec??oe,r=H(t._fileExists??B),i=[`auth`,`status`,...e?[`--hostname`,e]:[]],a=U(n,r,[...i,`--json`,`hosts`]);if(a!==void 0){let t=fe(a,e);if(t)return t}let o=U(n,r,i);if(o!==void 0){let e=_e(o);if(e.length>0)return e}}function W(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function fe(e,t){let n;try{n=JSON.parse(e)}catch{return}let r=W(W(n)?.hosts);if(!r||t!==void 0&&r[t]===void 0)return;let i=t===void 0?Object.values(r):[r[t]],a=[];for(let e of i){if(!Array.isArray(e))return;for(let t of e){let e=W(t);if(!e)continue;let n=e.login;typeof n==`string`&&n.length!==0&&a.push({login:n,active:e.active===!0})}}return a}const pe=/Logged in to \S+ account (\S+) \(/,me=/(?:Failed to log in to|Timeout trying to log in to) \S+/,he=/^\s*-\s*Active account:\s*true\s*$/,ge=/\u001b\[[0-9;]*m/g;function _e(e){let t=[],n;for(let r of e.split(`
|
|
2
|
+
`)){let e=r.replace(ge,``),i=pe.exec(e)?.[1];if(i){n={login:i,active:!1},t.push(n);continue}if(me.test(e)){n=void 0;continue}n&&he.test(e)&&(n.active=!0)}return t}const ve={mode:`published`,skipAvailabilityCheck:!0,replaceEntry:!0};function G(){return{action:`failed`,errorId:`write-failed`}}function K(){return{action:`skipped-missing`,errorId:`surface-missing`}}function q(e,t,n){m(`agent-integrations-apply`).warn({editor:e,path:t,reason:n},`skill write failed`)}function J(){return{action:`skipped-unsupported`,errorId:`no-writer`}}function ye(e){switch(e){case`removed`:return{action:`removed`};case`not-present`:return{action:`no-op`};case`left-foreign`:return{action:`skipped-foreign`,errorId:`foreign-artifact`};case`declined`:return{action:`declined`,errorId:`write-declined`}}}function be(e,t,n,r,i){let a=y[e];try{let o=P(a,t,n,r,i);return o.kind===`removed`&&o.trustDetail&&m(`agent-integrations-apply`).warn({editor:e,path:r??a.configPath(t,n),trust:o.trust,trustDetail:o.trustDetail},`MCP config removal retained Pi folder trust`),ye(o.kind)}catch(i){return m(`agent-integrations-apply`).warn({editor:e,path:r??a.configPath(t,n),reason:i instanceof Error?i.message:String(i)},`MCP config removal failed`),G()}}async function xe(e,t,n){if(y[e].scope!==`global`)return K();if(n===`absent`)return be(e,``,t.home,void 0,t.env);let r=(await C({editors:[e],home:t.home,replaceEntry:!0})).find(t=>t.editorId===e);if(r===void 0)return G();switch(r.action){case`written`:case`overwritten`:return{action:r.action};case`declined`:return{action:`declined`,errorId:`write-declined`};case`skipped-missing`:return K();case`skipped-flag`:return J();default:return G()}}function Se(e,t,n){let r=y[e].projectConfigPath?.(t.cwd);if(r===void 0)return K();if(n===`absent`)return be(e,t.cwd,t.home,r,t.env);let i=b(y[e],t.cwd,ve,void 0,r);switch(i.action){case`written`:case`overwritten`:return{action:i.action};case`declined`:return{action:`declined`,errorId:`write-declined`};default:return G()}}function Ce(e,t,n){let r=t.home??re();if(n===`absent`){let t=F(e,r);switch(t.action){case`removed`:return{action:`removed`};case`not-present`:return{action:`no-op`};case`skipped-unsupported`:return K();case`failed`:return q(e,t.path,t.error),G()}}let i=E(e,r);switch(i.action){case`written`:return{action:`written`};case`overwritten`:return{action:`overwritten`};case`skipped-unsupported`:return K();case`failed`:return q(e,i.path,i.error),G()}}function we(e,t,n){if(n===`absent`){let n=_(y[e],t.cwd);switch(n.action){case`removed`:return{action:`removed`};case`not-present`:return{action:`no-op`};case`skipped-unsupported`:return K();case`failed`:return q(e,n.path,n.error),G()}}let r=w(y[e],t.cwd);switch(r.action){case`written`:return{action:`written`};case`overwritten`:return{action:`overwritten`};case`skipped-unsupported`:return K();case`skipped-prerequisite`:return{action:`skipped-prerequisite`,errorId:`dependency-failed`};case`failed`:return q(e,r.path,r.error),G()}}function Te(e){return t=>{if(t.pathId===void 0)return J();let n=s(t.pathId);if(n===null||n.kind===`central-skill-store`)return J();switch(n.kind){case`editor-user-config`:return xe(n.editor,e,t.desired);case`editor-project-config`:return Se(n.editor,e,t.desired);case`editor-project-skill-root`:return we(n.editor,e,t.desired);case`editor-user-skill-root`:return Ce(n.editor,e,t.desired)}}}function Ee(e,t){return e.bind?.[0]??t.HOST??`127.0.0.1`}function De(e){if(e===`server`)return e;throw new v(`--only must be 'server'`)}function Oe(e=B,t=import.meta.dirname??new URL(`.`,import.meta.url).pathname){let n=[z(t,`public`),z(t,`../../app/dist`),z(t,`../../../app/dist`)];return e(z(t,`../../app.asar`))&&n.push(z(t,`../../app`)),n.find(t=>e(t))}function ke(e){if(e.explicitDir!==void 0)return{dir:e.explicitDir,missingBundle:!1};if(e.only===`server`)return{dir:void 0,missingBundle:!1};let t=e.findBundledDir();return{dir:t,missingBundle:t===void 0}}function Ae(e){if(e===`off`)return`off`;if(!a.test(e))throw new v(`--idle-shutdown must be 'off' or a duration like 90s, 30m, 2h`);return e}function je(e){return e===`localhost`||e===`::1`||e===`[::1]`||e.startsWith(`127.`)}function Me(e){return!e.flagBindSet&&!e.okBindSet&&e.hostEnvSet&&e.fileBindCount>1}function Ne(e){return!e.openBrowser||e.ephemeral||e.only===`server`||!e.servesUi?!1:(e.explicitOn||je(e.host))&&e.isTTY}function Pe(e,t){let n;try{n=new URL(t)}catch{throw new v(`${e} is not a valid URL: ${t}`)}if(n.protocol!==`http:`&&n.protocol!==`https:`)throw new v(`${e} must be an http(s) origin (got: ${t})`);return t}function Fe(e){return Pe(`--external-url`,e)}function Ie(e){let t=L(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var Y=class extends Error{cwd;constructor(t){super(`This directory isn't set up yet. Run \`${e()} init\` first, then \`${e()} start\` again.`),this.name=`OkDirMissingError`,this.cwd=t}},X=class extends Error{projectDir;constructor(t){super(`--project-dir must be a throwaway ${f}* directory under the OS temp dir. Refusing to write ephemeral session state into ${t}. Omit --project-dir to let ${e()} start create (and clean up) its own.`),this.name=`EphemeralProjectDirNotThrowawayError`,this.projectDir=t}};function Z(e,t={}){let n=t.tmpdirFn??ie,r=t.realpathFn??ne,i=e=>{try{return r(e)}catch(t){return t.code===`ENOENT`?z(e):null}},a=z(e),o;try{o=r(a)}catch(e){if(e.code===`ENOENT`){let e=i(R(a));o=e===null?null:z(e,L(a))}else o=null}if(o===null)return!1;let s=i(n());return s!==null&&R(o)===s&&L(o).startsWith(`ok-ephemeral-`)}function Le(e,t,n=e=>ae(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{if(Z(t))try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}else process.stderr.write(`[start] leaving ${t} in place: only ${f}* dirs under the OS temp dir are removed on ephemeral teardown\n`)}}}function Re(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:+!!i,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(+!!i)}}}async function Q(e){let{config:t,cwd:n,host:r}=e,i=e.skipAutoInit??!1,a=e.idleThresholdMs===void 0?18e5:e.idleThresholdMs,{existsSync:o,mkdirSync:s}=await import(`node:fs`),{basename:l,dirname:d,resolve:f}=await import(`node:path`),{bootServer:p,createEphemeralProjectDir:m,getLogger:g,resolveContentDir:_,resolveLockDir:v,seedEphemeralProjectDir:y,waitForServerLockDrain:b}=await import(`./dist-Bvds2-Dr.mjs`),S=e.log??g(`start`),C=e.singleFile!==void 0,w=C?u(e.singleFile).canonicalFilePath:void 0,E=w?d(w):void 0,O=w?l(w):void 0,k,A=!1;if(E!==void 0){if(e.projectDir!==void 0){if(k=e.projectDir,!Z(k))throw new X(k);o(f(k,`.ok`,`config.yml`))||y(k,E)}else k=m(E),A=!0}let M=async()=>{if(!(!A||k===void 0)){if(!Z(k)){S.warn({ephemeralProjectDir:k},`[start] refusing to reap self-provisioned ephemeral dir: no longer resolves to an ok-ephemeral-* temp dir`);return}try{await ae(k,{recursive:!0,force:!0})}catch(e){S.warn({err:e,ephemeralProjectDir:k},`[start] failed to reap self-provisioned ephemeral temp dir`)}}},P=k;if(!C){if(!i&&!h(n))throw new Y(n);let t=process.env.OK_RECLAIM_DISABLE??null,r=e=>{e.severity===`info`?S.debug({event:e},`[start] reclaim sweep event`):S.warn({event:e},`[start] reclaim sweep reported a problem`)};try{let i=(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-BXFxGkMn.mjs`)).repairMcpConfigs)({projectDir:n,reclaimDisableEnv:t,logger:r}).outcomes.filter(e=>e.outcome!==`no-entry`&&e.outcome!==`canonical`&&e.outcome!==`repaired`&&e.outcome!==`foreign`);i.length>0&&S.warn({unhealed:i},`[start] reclaim sweep left entries it could not heal`)}catch(e){S.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-BN9YLBiK.mjs`)).repairLaunchJson)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){S.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}}let F=E??_(t,n);!C&&!o(F)&&(s(F,{recursive:!0}),S.info({contentDir:F},`Created content directory`));let te=T(),L=c(),R;try{{let e=v(k??n),t=Date.now(),r=await b(e);r!==`no-drain`&&S.info({event:`start-waited-for-draining-predecessor`,outcome:r,waitedMs:Date.now()-t,drainLockDir:e},r===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}R=await p({config:t,contentDir:F,projectDir:k??n,contentRoot:C?void 0:t.content.dir,port:e.port,host:r,quiet:!1,detectGh:V,detectGhAccounts:de,tokenStore:te,embeddingsKeyStore:L,mcpTomlEditor:x(),...C?{ephemeral:!0,singleDocRelPath:O,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],probeHarnessManagedMcpEntry:(e,t)=>N(e,t),probePiAcpBridge:e=>D(e),ensurePiAcpBridge:(e,t)=>ee(e,void 0,void 0,void 0,t),agentIntegrations:(()=>{let e={cwd:k??n,home:re(),env:process.env};return{probe:I(e),execute:Te(e),userSkillPresentAnywhere:j}})(),idleShutdownMs:a,...e.serverRuntime===void 0?{}:{serverRuntime:e.serverRuntime},...e.bind===void 0?{}:{bind:e.bind},skipAutoInit:!0,idleShutdownHandler:t=>{let n=t;return Re(P===void 0?n:Le(n,P),{log:S,exit:e.idleExit})},log:S,...e.serveContentAssets===void 0?{}:{serveContentAssets:e.serveContentAssets},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{},...e.terminalAuthAvailable===!0?{terminalAuthAvailable:!0}:{}})}catch(e){throw await M(),e}let z=R.destroy,B=A?async(...e)=>{try{await z(...e)}finally{await M()}}:z;return{httpServer:R.httpServer,destroy:B,lockDir:R.lockDir,contentDir:F,port:R.port,ready:R.ready,degraded:R.degraded}}function ze(e,t,n=()=>d({absPath:l(`user`,process.cwd()),sideline:!1,warn:()=>{}}).value){return t===void 0?e:n()}function Be(e){if(e===`browser`||e===`app`)return e;throw new v(`--mode must be 'browser' or 'app'`)}function Ve(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function He(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function Ue(e,a){let s=ze(e,a.singleFile),c=Ve(process.env);c!==null&&(process.env.OK_CONSOLE_LEVEL=c);let{renderBanner:l}=await import(`./banner-kywHhVaC.mjs`),{accent:u,dim:d,error:f,warning:p}=await import(`./colors-SgU3JHQu.mjs`),m=process.cwd();process.title=Ie(m);let h;try{h=i(process.env)}catch(e){throw e instanceof o&&(console.error(f(e.message)),process.exit(78)),e}for(let e of h.diagnostics)console.warn(p(`[config] ${e.message}`));let g=t(s,h.layer),_=h.overrides.some(e=>e.envVar===`OK_BIND`),v=a.bind!==void 0&&a.bind.length>0?a.bind:void 0,y=process.env.HOST,b=y!==void 0&&y.trim()!==``?y:void 0,x=r(g),S=v??(_||b===void 0?[...x.bind]:[b]);Me({flagBindSet:v!==void 0,okBindSet:_,hostEnvSet:b!==void 0,fileBindCount:x.bind.length})&&console.warn(p(`[config] HOST=${b} overrides server.bind — dropping the file-configured addresses (${x.bind.join(`, `)}). Use OK_BIND with a space-separated list to keep multiple binds.`));let C=S[0]??`127.0.0.1`,w=S,T=a.externalUrl,E=r(t(g,{server:{bind:w,...T===void 0?{}:{externalUrl:T}}}));if(E.allowExternal&&(!E.loopbackOnly||E.externalUrl)){let e=E.externalUrl??E.bind.join(`, `);console.warn(p([``,`⚠ EXTERNAL ACCESS ENABLED (server.allowExternal) — no server-side authentication.`,` This server is reachable beyond this machine (${e}). Anyone who can`,` reach it has FULL control of this knowledge base — sync, publishing, GitHub`,` credentials, and local operations (clone, sign-in, repo spawn).`,` Restrict who can reach it at the edge: a Tailscale ACL, a reverse proxy with`,` auth (Cloudflare Access, oauth2-proxy), or a firewall.`,``].join(`
|
|
3
|
+
`)))}let D=a.port===void 0?void 0:Number(a.port),O=h.overrides.find(e=>e.envVar===`PORT`)?.value,k=D??O??s.server?.port,A=ke({explicitDir:a.reactShellDistDir,only:a.only,findBundledDir:Oe}),j=A.dir;A.missingBundle&&console.warn(`bundled web UI not found — serving /api and /mcp only. Reinstall @inkeep/open-knowledge, or build packages/app in a source checkout.`);let M;try{M=await Q({config:s,cwd:m,host:C,port:k,bind:w,...a.serveContentAssets===void 0?{}:{serveContentAssets:a.serveContentAssets},...j?{reactShellDistDir:j}:{},idleThresholdMs:n(a.idleShutdown??E.idleShutdown),serverRuntime:E,...a.singleFile?{singleFile:a.singleFile}:{},...a.projectDir?{projectDir:a.projectDir}:{},...a.terminalAuth===!0?{terminalAuthAvailable:!0}:{}})}catch(e){e instanceof Y&&(console.error(f(e.message)),process.exit(1)),e instanceof X&&(console.error(f(e.message)),process.exit(1));let t=await import(`./dist-Bvds2-Dr.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitProbeTimeoutError||e instanceof t.GitTooOldError)&&process.exit(78),e instanceof t.ExposureConsentError&&(console.error(f(e.message)),process.exit(78)),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(f(e.message)),process.exit(1)),(e instanceof t.MissingOkConfigError||e instanceof t.DocumentDurabilityStateError)&&(console.error(f(e.message)),process.exit(1)),Ke(e,t,m)){let e=t.resolveLockDir(m),n=null;try{n=await We({readServerLock:()=>t.readServerLock(e),now:Date.now,sleep:e=>ce(e),timeoutMs:3e3,pollIntervalMs:50})}catch(e){process.stderr.write(`[start] spawn-or-reuse: lock poll failed (${e instanceof Error?e.message:String(e)}) — falling back to the collision message\n`)}if(n!==null){let[e,...t]=Ge(n);console.log(u(e));for(let e of t)console.log(d(e));process.exit(0)}}let n=$(e,m,t);n!==null&&(console.error(f(n)),process.exit(1)),console.error(`${f(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let N=!1,P=async e=>{if(N)return;N=!0;let[t,...n]=He(e);console.log(u(`\n${t}`));for(let e of n)console.log(d(` ${e}`));try{await M.destroy(`external-signal`,{signal:e})}catch(e){console.error(`${f(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{P(`SIGINT`)}),process.once(`SIGTERM`,()=>{P(`SIGTERM`)});let F=`http://${C.includes(`:`)&&!C.startsWith(`[`)?`[${C}]`:C}:${M.port}`,ee=C===`0.0.0.0`||C===`::`?`http://0.0.0.0:${M.port}`:void 0,I=F;console.log(l({name:`open-knowledge`,version:te,localUrl:I,networkUrl:ee,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let L={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};M.ready.then(async()=>{if(M.degraded.length>0){console.log();for(let e of M.degraded){let t=L[e]??`${e} (check server logs for details)`;console.warn(` ${p(`⚠`)} ${p(e)}: ${d(t)}`)}console.log()}if(Ne({openBrowser:a.openBrowser!==!1&&E.openBrowser,explicitOn:a.openBrowser!==!1&&g.server?.openBrowser===!0,host:C,isTTY:process.stdout.isTTY===!0,ephemeral:a.singleFile!==void 0,only:a.only,servesUi:j!==void 0})){let{openBrowser:e}=await import(`./open-browser-DOHM8swn.mjs`);e(I)}}).catch(e=>{console.error(` ${f(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}async function We(e){let t=e.now()+e.timeoutMs,n=e.readServerLock();for(;n!==null&&n.draining!==!0&&n.port<=0&&e.now()<t;)await e.sleep(e.pollIntervalMs),n=e.readServerLock();return n===null||n.draining===!0||n.port<=0?null:p(n)&&n.url!==void 0?{url:n.url,kind:n.kind,pid:n.pid,servesUi:!0}:{url:n.url??`http://127.0.0.1:${n.port}`,kind:n.kind,pid:n.pid,servesUi:!1}}function Ge(t){return[`${t.kind===`mcp-spawned`?`An MCP-spawned OpenKnowledge server is already running on this project`:`OpenKnowledge is already running on this project`} (pid ${t.pid}).`,` ${t.url}`,`Leaving it running — run \`${e()} stop\` first if you want a fresh server.`]}function Ke(e,t,n){let r=t.ServerLockCollisionError;if(r!==void 0&&e instanceof r)return!0;let i=t.ServerAuthorityCollisionError;if(i===void 0||!(e instanceof i))return!1;try{return e.existing.scope.kind===`tree`&&ne.native(n)===e.existing.projectDir}catch{return!1}}function $(t,n,r){let i=r.ServerAuthorityCollisionError;if(i!==void 0&&t instanceof i)return t.message;let a=r.ServerAuthorityRegistryError;if(a!==void 0&&t instanceof a)return t.message;let o=r.ProcessLockFileError;if(o!==void 0&&t instanceof o)return t.message;let s=r.ServerLockCollisionError;if(s===void 0||!(t instanceof s))return null;try{let t=r.readServerLock(r.resolveLockDir(n)),i=e();return t?.kind===`mcp-spawned`?`An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run \`${i} stop\`.`:`OpenKnowledge server is already running on this project — check \`${i} status\` or \`${i} stop\`.`}catch{return null}}function qe(e){return new S(`start`).description(`Start the OpenKnowledge server (UI + API + MCP + collab on one port)`).option(`-p, --port <port>`,`Server port`,void 0).option(`--bind <address>`,`Bind address (repeatable; default 127.0.0.1 — loopback only)`,(e,t)=>[...t??[],e]).option(`--no-open-browser`,`Do not open the browser after start (interactive loopback starts open it by default)`).option(`--only <module>`,`Serve one module: 'server' (API + MCP only, no shell or browser)`,De).option(`--idle-shutdown <duration>`,`Shut the server down after this long with no connected clients ('off', or a duration like 90s, 30m, 2h; default 30m)`,Ae).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,Be).option(`--serve-content-assets`,`Serve content assets from this server (now the default; kept for compatibility)`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path>`).addOption(new g(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).hideHelp()).addOption(new g(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).hideHelp()).addOption(new g(`--terminal-auth`,`Tell in-app agents that this server's client can run terminal sign-ins (the desktop app passes it when it has a terminal)`).hideHelp()).option(`--external-url <url>`,`Canonical external origin clients dial (sets server.externalUrl for this run) — its host joins the Host/Origin allowlists (CORS + external-Host admission). External exposure additionally requires consent (OK_ALLOW_EXTERNAL=1 or server.allowExternal).`,Fe).action(async t=>{let n=e();if(t.only===`server`&&t.reactShellDistDir!==void 0&&(process.stderr.write(`error: option '--only server' cannot be combined with '--react-shell-dist-dir'
|
|
4
|
+
`),process.exit(2)),t.projectDir!==void 0&&t.singleFile===void 0&&(process.stderr.write(`error: option '--project-dir' requires '--single-file'
|
|
5
|
+
`),process.exit(2)),t.mode===`app`){let e=[];if(t.port!==void 0&&e.push(`--port`),t.bind!==void 0&&e.push(`--bind`),t.only!==void 0&&e.push(`--only`),t.idleShutdown!==void 0&&e.push(`--idle-shutdown`),t.openBrowser===!1&&e.push(`--no-open-browser`),t.externalUrl!==void 0&&e.push(`--external-url`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=M(O());if(n.available){A({spawn:se},n);return}console.error(k(n.reason)),process.exit(1)}await Ue(n,t)})}export{$ as C,de as D,V as E,qe as S,Re as T,Ve as _,Ge as a,Ne as b,Z as c,Ae as d,De as f,ze as g,We as h,Ie as i,Ke as l,Ee as m,Y as n,He as o,Oe as p,Q as r,je as s,X as t,Fe as u,ke as v,Le as w,Me as x,Ue as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,m as t,p as n,r}from"./start-BQgTW5ae.mjs";export{r as bootStartServer,n as resolveBundledReactShellDir,t as resolveHost,e as startCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/open-knowledge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0-beta.0",
|
|
4
4
|
"description": "Local-first, agent-friendly Markdown knowledge base with a cross-platform CLI and web editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"knowledge-base",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@inquirer/password": "^5.0.11",
|
|
45
45
|
"@inquirer/select": "^5.2.0",
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
47
|
-
"@napi-rs/keyring": "
|
|
47
|
+
"@napi-rs/keyring": "2.1.2",
|
|
48
48
|
"@octokit/auth-oauth-device": "^8.0.3",
|
|
49
49
|
"@octokit/request": "^10.0.8",
|
|
50
50
|
"@octokit/rest": "^22.0.1",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@parcel/watcher": "^2.5.6"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@inkeep/open-knowledge-app": "0.
|
|
69
|
-
"@inkeep/open-knowledge-core": "0.
|
|
68
|
+
"@inkeep/open-knowledge-app": "0.89.0-beta.0",
|
|
69
|
+
"@inkeep/open-knowledge-core": "0.89.0-beta.0",
|
|
70
70
|
"@inkeep/open-knowledge-native-config": "0.0.0",
|
|
71
|
-
"@inkeep/open-knowledge-server": "0.
|
|
71
|
+
"@inkeep/open-knowledge-server": "0.89.0-beta.0",
|
|
72
72
|
"@types/node": "^24.7.0",
|
|
73
73
|
"@types/proper-lockfile": "^4.1.4",
|
|
74
74
|
"@types/yazl": "^3.3.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./md-manager-BGnqyqi1-DCCfgLfC.mjs";var e=`0.88.12-beta.0`;const t=`config.yml`,n=e;export{n,t};
|
package/dist/dist-Bfg_JABr.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Cc as e,Et as t,Ot as n,Pc as r,S as i,X as a,_c as o,no as s,v as c}from"./md-manager-BGnqyqi1-DCCfgLfC.mjs";import{$ as l,$a as u,$i as d,$n as f,$r as p,$t as m,A as h,Aa as g,Ai as _,An as v,Ao as y,Ar as b,At as x,B as S,Ba as C,Bi as w,Bn as T,Bo as E,Br as D,Bt as O,C as k,Ca as A,Ci as j,Cn as M,Co as N,Cr as P,Cs as F,Ct as I,D as L,Da as R,Di as z,Dn as B,Do as V,Dr as H,Dt as U,E as W,Ea as G,Ei as K,En as q,Eo as J,Er as Y,Et as X,F as Z,Fa as Q,Fi as $,Fn as ee,Fo as te,Fr as ne,Ft as re,G as ie,Ga as ae,Gi as oe,Gn as se,Go as ce,Gr as le,Gs as ue,Gt as de,H as fe,Ha as pe,Hi as me,Hn as he,Ho as ge,Hr as _e,Ht as ve,I as ye,Ia as be,Ii as xe,In as Se,Io as Ce,Ir as we,It as Te,J as Ee,Ja as De,Ji as Oe,Jn as ke,Jo as Ae,Jr as je,Jt as Me,K as Ne,Ka as Pe,Ki as Fe,Kn as Ie,Ko as Le,Kr as Re,Ks as ze,Kt as Be,L as Ve,La as He,Li as Ue,Ln as We,Lo as Ge,Lr as Ke,Lt as qe,M as Je,Ma as Ye,Mi as Xe,Mn as Ze,Mo as Qe,Mr as $e,Mt as et,N as tt,Na as nt,Ni as rt,Nn as it,No as at,Nr as ot,Nt as st,O as ct,Oa as lt,Oi as ut,On as dt,Oo as ft,Or as pt,Ot as mt,P as ht,Pa as gt,Pi as _t,Pn as vt,Po as yt,Pr as bt,Pt as xt,Q as St,Qa as Ct,Qi as wt,Qn as Tt,Qr as Et,Qt as Dt,R as Ot,Ra as kt,Ri as At,Rn as jt,Ro as Mt,Rr as Nt,Rt as Pt,S as Ft,Sa as It,Si as Lt,Sn as Rt,So as zt,Sr as Bt,Ss as Vt,St as Ht,T as Ut,Ta as Wt,Ti as Gt,Tn as Kt,To as qt,Tr as Jt,Tt as Yt,U as Xt,Ua as Zt,Ui as Qt,Un as $t,Uo as en,Ur as tn,Us as nn,Ut as rn,V as an,Va as on,Vi as sn,Vn as cn,Vo as ln,Vr as un,Vt as dn,W as fn,Wa as pn,Wi as mn,Wn as hn,Wo as gn,Wr as _n,Ws as vn,Wt as yn,X as bn,Xa as xn,Xi as Sn,Xn as Cn,Xr as wn,Xt as Tn,Y as En,Ya as Dn,Yi as On,Yn as kn,Yo as An,Yr as jn,Yt as Mn,Z as Nn,Za as Pn,Zi as Fn,Zn as In,Zr as Ln,Zt as Rn,_ as zn,_a as Bn,_i as Vn,_n as Hn,_o as Un,_r as Wn,_s as Gn,_t as Kn,a as qn,aa as Jn,ai as Yn,an as Xn,ao as Zn,ar as Qn,at as $n,b as er,ba as tr,bi as nr,bn as rr,bo as ir,br as ar,bs as or,bt as sr,c as cr,ca as lr,ci as ur,cn as dr,co as fr,cr as pr,ct as mr,d as hr,da as gr,di as _r,dn as vr,do as yr,dr as br,ds as xr,dt as Sr,ea as Cr,ei as wr,en as Tr,eo as Er,er as Dr,et as Or,f as kr,fa as Ar,fi as jr,fn as Mr,fo as Nr,fr as Pr,fs as Fr,ft as Ir,g as Lr,ga as Rr,gi as zr,gn as Br,go as Vr,gr as Hr,gs as Ur,gt as Wr,h as Gr,ha as Kr,hi as qr,hn as Jr,ho as Yr,hr as Xr,ht as Zr,i as Qr,ia as $r,ii as ei,in as ti,io as ni,ir as ri,it as ii,j as ai,ja as oi,ji as si,jn as ci,jo as li,jr as ui,jt as di,k as fi,ka as pi,ki as mi,kn as hi,ko as gi,kr as _i,kt as vi,l as yi,la as bi,li as xi,ln as Si,lo as Ci,lr as wi,lt as Ti,m as Ei,ma as Di,mi as Oi,mn as ki,mo as Ai,mr as ji,mt as Mi,n as Ni,na as Pi,ni as Fi,nn as Ii,no as Li,nr as Ri,nt as zi,o as Bi,oa as Vi,oi as Hi,on as Ui,oo as Wi,or as Gi,ot as Ki,p as qi,pa as Ji,pi as Yi,pn as Xi,po as Zi,pr as Qi,pt as $i,q as ea,qa as ta,qi as na,qn as ra,qo as ia,qr as aa,qt as oa,r as sa,ra as ca,ri as la,rn as ua,ro as da,rr as fa,rt as pa,s as ma,sa as ha,si as ga,sn as _a,so as va,sr as ya,st as ba,t as xa,ta as Sa,ti as Ca,tn as wa,to as Ta,tr as Ea,tt as Da,u as Oa,ua as ka,ui as Aa,un as ja,uo as Ma,ur as Na,ut as Pa,v as Fa,va as Ia,vi as La,vn as Ra,vo as za,vr as Ba,vs as Va,vt as Ha,w as Ua,wa as Wa,wi as Ga,wn as Ka,wo as qa,wr as Ja,ws as Ya,wt as Xa,x as Za,xa as Qa,xi as $a,xn as eo,xo as to,xr as no,xs as ro,xt as io,y as ao,ya as oo,yi as so,yn as co,yo as lo,yr as uo,ys as fo,yt as po,z as mo,za as ho,zi as go,zn as _o,zo as vo,zr as yo,zt as bo}from"./dist-BSNy29T3.mjs";import{f as xo,h as So,m as Co,n as wo,p as To,t as Eo}from"./fs-find-project-root-BYV07wjn.mjs";export{xa as AGENT_ID_MAX_LEN,Ni as AGENT_ID_RE,sa as AGENT_WRITE_ORIGIN,s as AUDIT_EMPTY_SCOPE_WARNING,Qr as AcpPermissionStore,qn as AcpRegistry,Bi as AcpThreadManager,ma as AgentFocusBroadcaster,cr as AgentPresenceBroadcaster,yi as AgentSessionCapacityError,Oa as AgentSessionManager,hr as AutoStartDisabledError,kr as BUNDLE_IDS,qi as BUNDLE_SCOPE,Ei as BUNDLE_SKILL_NAME,Gr as BacklinkIndex,Lr as CC1Broadcaster,e as CC1_CONTRACT_VERSION,zn as CONCURRENT_REPLACE_WINDOW_MS,Fa as CONFIG_FILENAME,ao as CONFLICT_MARKER_RE,er as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Za as ConfigSchema,Ft as ConflictAuthority,k as DEFAULT_CHECKPOINT_RETENTION,Ua as DEFAULT_EMBEDDINGS_DIMENSIONS,Ut as DEFAULT_PACK_ID,W as DocumentDurabilityState,L as DocumentDurabilityStateError,ct as EMBEDDINGS_API_KEY_ENV,fi as EPHEMERAL_PROJECT_DIR_PREFIX,h as ExposureConsentError,ai as FEATURED_AGENT_IDS,Je as FILE_SYSTEM_WRITER,tt as FILE_WATCHER_ORIGIN,ht as FileEmbeddingsBackend,Z as FilesystemRootProjectError,ye as GIT_PREFLIGHT_FAIL_SPAN_NAME,Ve as GIT_UPSTREAM_WRITER,xr as GitDirAccessError,Ot as GitNotAvailableError,mo as GitProbeTimeoutError,S as GitTooOldError,an as HOCUSPOCUS_AUTH_REJECTION_REASONS,fe as HocuspocusAuthRejection,Xt as HocuspocusAuthTokenSchema,fn as HomeProjectRootError,ie as INSTALLED_AGENTS_SCHEMES,Ne as JSON_SCHEMA_DIALECT_2020_12,ue as LINEAGE_EPOCH_KEY,ea as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Ee as LOCK_FILE_ACCESS_REMEDY,En as MANAGED_RENAME_ORIGIN,bn as MAX_ACP_THREADS,Nn as MAX_AGENT_SESSIONS,St as MCP_CONNECTION_ID_HEADER,o as MCP_SERVER_NAME,l as MIN_EVICTABLE_IDLE_MS,Or as MIN_GIT_VERSION,Fr as MalformedGitPointerError,Da as McpLogger,zi as MissingOkConfigError,pa as OBSERVER_SYNC_ORIGIN,ii as OK_OKIGNORE_TEMPLATE,$n as ONBOARDING_BUNDLE_IDS,nn as ORPHAN_MODES,ze as PROTOCOL_VERSION,Ur as PinoLogger,Ki as ProcessLockCollisionError,ba as ProcessLockFileError,mr as ProjectGitInitError,Ti as ROLLBACK_ORIGIN,Pa as ROOT_GITIGNORE_TEMPLATE,Sr as RUNTIME_VERSION,Ir as SERVICE_WRITER,$i as SKILL_INSTALL_EVENTS_FILENAME,c as SKILL_STATE_TARGETS,Mi as STARTER_FOLDER_FRONTMATTER_FILENAME,Zr as STARTER_PACKS,Wr as STARTER_PACK_IDS,Kn as STATE_MANIFEST_FILENAME,Ha as STATE_SCHEMA_VERSION,po as SYMLINK_MERGE_MIN_GIT_LABEL,sr as SYMLINK_MERGE_MIN_GIT_VERSION,r as SYSTEM_DOC_NAME,io as SeedPrerequisiteError,Ht as SeedRootDirError,I as ServerAuthorityCollisionError,Xa as ServerAuthorityRegistryError,Yt as ServerLockCollisionError,X as SingleFileNotAFileError,U as SingleFileNotFoundError,mt as SingleFileNotMarkdownError,vi as SingleFileProjectOverrideError,x as StateManifestError,i as TEST_LOOP_CORE_MARKER,di as TEST_LOOP_SERVER_MARKER,et as TagIndex,st as USER_GLOBAL_BUNDLE_IDS,xt as UnsafeIncomingSymlinkError,re as __getShowAllWalkStatsForTesting,Te as __resetShowAllWalkStatsForTesting,qe as acpThreadStoreRoots,Pt as acpThreadsDir,bo as acquireProcessLock,O as acquireServerLock,dn as applyAgentMarkdownWrite,ve as applyExternalChange,rn as applySeed,yn as assertCheckoutSymlinksSafe,de as assertCompatibleStateManifest,Be as assertGitAvailable,oa as assertIncomingSymlinksSafe,Me as assertMergeNameResolvesTo,Mn as assertNeverDiskEvent,Tn as assertRepoCheckoutSymlinksSafe,Rn as assertSafeProjectRoot,Dt as assessLockHolder,m as attachAcpThreadSocket,Tr as attachCollabClientCounter,wa as attachIdleShutdown,Ii as auditScopeNotFoundTitle,ua as bindConflictAuthority,ti as bootServer,Xn as buildAndOpenSkill,Ui as buildConfigYmlContent,_a as buildExecResult,dr as buildIngressPolicy,Si as buildOkMcpStdioCommand,ja as buildSkillZip,vr as buildStarterFolderFrontmatterYaml,Mr as buildWipTree,Xi as bundleSkillMdPath,ki as canonicalProjectKey,Jr as canonicalizeForCompare,Br as classifyEvents,Hn as classifyFsPath,Ra as classifyLockHolder,co as clearAllEmbeddingsKeys,rr as coercePackId,eo as collectServerHostSnapshot,t as colorFromSeed,Rt as commitUpstreamImport,M as commitWip,Ka as commitWipFromTree,Kt as compareSemver,q as composeEffectiveLinterConfig,B as composeFrontmatterSchemasConfig,dt as containsConflictMarkers,hi as contentHash,v as contributorCount,ci as countShadowObjects,Ze as countStaleAgentWipRefs,it as countWipRefs,vt as createApiExtension,ee as createAssetServeMiddleware,Se as createCollaborationHost,We as createContentFilter,jt as createContentFilterAsync,_o as createEmbeddingsSecretStore,T as createEphemeralProjectDir,cn as createExternalChangeHandler,xo as createFileLogger,he as createLiveDerivedIndexExtension,$t as createMcpHttpHandler,hn as createOsProbe,se as createPersistenceExtension,Ie as createProbeFailureReporter,ra as createServer,ke as createServerObserverExtension,kn as createServerProbeResolver,Cn as createStreamingErrorWriter,Gn as createTestLogger,In as describeStoredEmbeddingsKey,Tt as detectClaudeDesktopPresence,f as detectGit,Dr as detectProjectShape,Ea as detectUserSkillHosts,Ri as discoverLockDirs,fa as discoverMarkdownlintConfig,ri as emitPreflightFailureSpan,Qn as encodeDocName,Gi as encodeFolderRoute,ya as encodeSkillRoute,pr as ensureProjectGit,wi as errorResponse,Na as evictStaleTrackerEntries,br as extractHeadings,Pr as extractOkBinaryPath,Qi as extractWikiLinksFromMarkdown,ji as fallbackPaths,Xr as findEnclosingGitRoot,Eo as findEnclosingProjectRoot,Hr as findNativeMarkdownlintFile,To as flushFileLogger,Wn as formatAuditBrokenLinkSuppressionLine,Ba as formatAuthRejectionWire,uo as formatContributorsFrom,ar as formatPackRationale,no as gcCheckpointRefs,Bt as getCurrentMcpLogger,P as getIngressContext,Ja as getLocalDir,Co as getLogFilePath,Va as getLogger,So as getLogsDir,Jt as getMachineId,Y as getMeter,H as getMetrics,pt as getTracer,_i as handleCollabSocketError,b as handleSpawnCursor,ui as hasForwardingHeaders,$e as hasGcLogLatch,n as iconFromClientName,ot as incrementCollabSocketFilteredError,bt as incrementServerObserverFire,ne as initContent,we as initShadowRepo,Ke as initTelemetry,Nt as initToleranceTelemetryWriter,yo as installJsonSchemaDialect,D as installPrettyZodErrors,fo as installTestLoggers,un as installUserSkill,_e as isAllowedApiOrigin,tn as isAllowedWorkspaceHostHeader,_n as isConfigDoc,le as isDefunctProcess,Re as isDocInConflict,aa as isFilesystemRoot,je as isHocuspocusAuthRejectionReason,jn as isHomeDir,wn as isHostAdmitted,Ln as isKnownPackId,Et as isLinkIndexExcludedDoc,p as isLockFromThisMachine,wr as isLockProcessRunning,Ca as isLoopbackAddress,Fi as isManagedArtifactDoc,la as isMintedThreadId,ei as isOriginAdmitted,vn as isOrphanMode,Yn as isPairedWriteOrigin,Hi as isPathWithinDir,ga as isPeerAdmitted,ur as isProcessAlive,wo as isProjectRoot,xi as isReservedForUserTree,Aa as isSelfWrite,_r as isSkillInstallReportEnvOptOut,jr as isSystemDoc,Yi as isToleranceTelemetryEnabled,Oi as isValidLockPid,qr as lastKnownHash,zr as listRescueCheckpoints,Vn as listStarterPacks,La as loadCustomAgents,so as loadPrincipal,nr as lockAdvertisesUi,$a as lockBaseUrl,Lt as lockFilePath,or as loggerFactory,j as loginShapedUserinfoUser,ro as logsCurrentPath,Vt as logsPreviousPath,Ga as machineIdFilePath,Gt as makeLazyEmbeddingsKeyStore,K as markServerLockDraining,z as missingOkConfigMessage,ut as mountMcpAndApi,mi as normalizeFsPath,_ as observeReadiness,si as packageVersionMajorMinor,Xe as parseAuthRejectionWire,rt as parseGitVersion,_t as parseHocuspocusAuthToken,$ as parseKeepaliveConnectionId,xe as parseProcessStartToken,Ue as pathToDocName,At as planSeed,go as prepareProjectLogsDir,w as prepareSingleFileOpen,sn as prepareSpawnProjectLogsDir,me as processCommand,Qt as processStartToken,mn as processUsage,oe as readAgentBrowserTools,Fe as readAllTargets,na as readBootStartedAtMs,Oe as readBundleDecision,On as readDeclaredGitHubHosts,Sn as readOriginCredentialHost,Fn as readOriginGitHubRepo,wt as readOwnNativeRules,d as readProcessLock,Cr as readProcessLockDetailed,Sa as readProcessStart,Pi as readProcessState,ca as readProjectHeadState,$r as readProjectLocalSemanticConfig,Jn as readServerLock,Vi as readServerPackageVersion,ha as readSkillInstallStateSnapshot,lr as readStateManifest,bi as readTargetRecordedAt,ka as readTargetVersion,gr as reconcile,Ar as recordContributor,Ji as recordSkillInstallEvent,Di as recordsLockOwner,Kr as redactShareSubprocessStderr,Rr as registerAllTools,Bn as registerNativeProcessStartReader,Ia as registerWrite,oo as releaseProcessLock,tr as releaseServerLock,Qa as removeLastKnownHash,It as removeLockIfUnchanged,A as removeProjectSkillGitignoreBlock,Wa as reportSkillInstall,Wt as resetMetrics,G as resolveAuditScope,R as resolveBuiltinSkillHosts,a as resolveBundleEnabled,lt as resolveBundledSkillDir,pi as resolveContentDir,g as resolveCursorBinaryDefault,oi as resolveCursorSpawnInvocation,Ye as resolveEffectiveLinterConfig,nt as resolveEmbeddingsCredential,gt as resolveGitHubAccountFromUrl,Q as resolveGitHubAuthHost,be as resolveLockDir,He as resolveNativeConfigForDoc,kt as resolveNativeMarkdownlintConfig,ho as resolvePack,C as resolvePackageVersion,on as resolveSkillInstallReportSettings,pe as resolveUiInfo,Zt as restoreContributors,pn as rewriteMarkdownLinksForDocumentRename,ae as rewriteWikiLinksForDocumentRename,Pe as runAuthReposSubprocess,ta as runAuthStatusSubprocess,De as runCloneSubprocess,Dn as runDeviceFlowSubprocess,xn as runWithMcpLogger,Pn as safeContentPath,Ct as safeSubdir,u as safetyCheckpoint,Er as sameGitHubLogin,Ta as sanitizeClientName,Li as saveInMemoryCheckpoint,da as saveVersion,ni as scanLockProcesses,Zn as seedBasenameIndex,Wi as seedEphemeralProjectDir,va as serializeError,fr as setActiveSpanAttributes,Ci as setupServerObservers,Ma as shadowGit,yr as shutdownTelemetry,F as spansCurrentPath,Ya as spansPreviousPath,Nr as spawnDetached,Zi as splitMarkdownBlocks,Ai as startWatcher,Yr as strategiesFor,Vr as streamedChunkOf,Un as streamingProblemEvent,za as swapContributors,lo as teardownToleranceTelemetryWriter,ir as toBroadcasterKey,to as toProcessLockMetadata,zt as tracedAppendFileSync,N as tracedLinkSync,qa as tracedMkdir,qt as tracedMkdirSync,J as tracedRename,V as tracedRenameSync,ft as tracedRmSync,gi as tracedRmdirSync,y as tracedUnlinkSync,li as tracedWriteFile,Qe as tracedWriteFileSync,at as trustSystemCertificates,yt as updateLastKnownHash,te as updateProcessLockPort,Ce as updateServerLockPort,Ge as validateAgentId,Mt as validateCloneInputs,vo as validateSkillZip,E as waitForServerLockDrain,ln as withHiddenWindowsConsole,ge as withSpan,en as withSpanSync,gn as writeBundleDecision,ce as writeMarkdownlintRule,Le as writeRootGitignoreForNewRepo,ia as writeStateManifest,Ae as writeTargetVersion,An as writeTracker};
|
package/dist/init-DwPDs2bS.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./dist-BSNy29T3.mjs";import{v as e}from"./init-D7ht1hAb.mjs";export{e as runInit};
|
package/dist/loader-Btt-HfCX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./loader-txqXuZkh.mjs";export{e as loadConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-Dpv-rYA5.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./index-7PTB0URg.js";export{e as FeedbackForm};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ManagedArtifactProperties-BPI-_chz.js";export{e as ManagedArtifactProperties};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o,r as s,t as c}from"./collapsible-BKbszYZV.js";import{t as l}from"./switch-BKZTXkzu.js";import{t as u}from"./button-DzgjsZzC.js";import{n as d}from"./dist-BGzUo_18.js";import{n as f}from"./config-errors-d-4C2SfD.js";import{r as p}from"./_envelope-DuFpUEag-Beu481Zb.js";import{C as m,Y as h,Z as g}from"./schemas-api-WgoIuF0H.js";import{i as _}from"./use-apply-config-theme-CYFG76sS.js";import{t as v}from"./chevron-right-Bofu4lib.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./dialog-CAxu_6pu.js";import{o as D,r as O,t as k}from"./field-DtEiTjHS.js";import"./config-provider-f9PDyLDl.js";import{d as A,f as j,g as M,h as N,l as P,m as F,u as ee,x as te}from"./saved-themes-client-B4QZmuf_.js";import{t as ne}from"./input-CgydZJoC.js";import{n as I}from"./channel-cli-copy-BySq87hR.js";import{t as re}from"./use-semantic-search-status-cvdZZNYA.js";import{t as ie}from"./SettingsSectionHeader-2iTSJQHd.js";import"./config-schema-DM88r6Wp.js";var L=e(n(),1),R=a();async function z(e){try{let t=p.safeParse(await e.json());if(t.success)return t.data.title}catch{}}async function B(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.ok?{ok:!0}:{ok:!1,error:await z(n)}}catch{return{ok:!1}}}function ae(){return{setKey:e=>B(`/api/local-op/embeddings/set-key`,{key:e}),clearKey:()=>B(`/api/local-op/embeddings/clear-key`,{}),async testConnection(){try{let e=await fetch(`/api/local-op/embeddings/test`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`});if(!e.ok)return null;let t=m.safeParse(await e.json());return t.success?t.data:null}catch{return null}}}}var V=t(),oe=[2500,5e3],se=`settings-search-performance-clear-hint`;function H(e){let t=(0,R.c)(189),{transport:n}=e,{_:a}=i(),{projectLocalConfig:p,projectLocalSynced:m,projectLocalBinding:h}=_(),{status:g,refresh:y}=re(),b;t[0]===n?b=t[1]:(b=n??ae(),t[0]=n,t[1]=b);let x=b,[S,C]=(0,L.useState)(!1),[w,T]=(0,L.useState)(null),[E,D]=(0,L.useState)(!1),O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[2]=O):O=t[2];let k=(0,L.useRef)(O),M,N;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>{for(let e of k.current)clearTimeout(e)},N=[],t[3]=M,t[4]=N):(M=t[3],N=t[4]),(0,L.useEffect)(M,N);let F=p?.search?.semantic?.baseUrl??`https://api.openai.com/v1`,I=p?.search?.semantic?.model??`text-embedding-3-small`,z=p?.search?.semantic?.maxBatchSize??96,B=p?.search?.semantic?.maxBatchChars??96e3,H=p?.search?.semantic?.docTimeoutMs??3e4,[U,W]=(0,L.useState)(F),[G,K]=(0,L.useState)(I),[q,he]=(0,L.useState)(null),[ge,_e]=(0,L.useState)(null),[ve,ye]=(0,L.useState)(null),[J,be]=(0,L.useState)(!1),[xe,Se]=(0,L.useState)(null),Ce;t[5]!==F||t[6]!==I?(Ce={baseUrl:F,model:I},t[5]=F,t[6]=I,t[7]=Ce):Ce=t[7];let[we,Te]=(0,L.useState)(Ce);(F!==we.baseUrl||I!==we.model)&&(Te({baseUrl:F,model:I}),W(F),K(I),D(!1),T(null),Se(null));let Y=p?.search?.semantic?.enabled??!1,X=m&&h!==null,Ee=F!==`https://api.openai.com/v1`||I!==`text-embedding-3-small`,De=z!==96||B!==96e3||H!==3e4,Oe=ge??Ee,ke=ve??De,Ae;t[8]===y?Ae=t[9]:(Ae=function(){for(let e of k.current)clearTimeout(e);k.current=oe.map(e=>setTimeout(y,e))},t[8]=y,t[9]=Ae);let Z=Ae,je;t[10]!==y||t[11]!==Z?(je=function(){y(),Z()},t[10]=y,t[11]=Z,t[12]=je):je=t[12];let Q=je,Me;t[13]!==a||t[14]!==h||t[15]!==y||t[16]!==Z?(Me=function(e){if(h===null)return d.error(a({id:`YW7Q86`})),!1;let t=h.patch({search:{semantic:{enabled:e}}});if(!t.ok){let n=f(t.error);return d.error(a(e?{id:`LYufDw`,values:{detail:n}}:{id:`5mksg0`,values:{detail:n}})),!1}return y(),Z(),!0},t[13]=a,t[14]=h,t[15]=y,t[16]=Z,t[17]=Me):Me=t[17];let Ne=Me,Pe;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=function(e){return e.trim()||`https://api.openai.com/v1`},t[18]=Pe):Pe=t[18];let Fe=Pe,Ie;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(e){return e.trim()||`text-embedding-3-small`},t[19]=Ie):Ie=t[19];let Le=Ie,Re;t[20]!==a||t[21]!==h||t[22]!==y||t[23]!==Z?(Re=function(e){if(h===null)return d.error(a({id:`YW7Q86`})),!1;let t=h.patch({search:{semantic:{baseUrl:e.baseUrl,model:e.model}}});if(!t.ok){let e=f(t.error);return d.error(a({id:`aQD_86`,values:{detail:e}})),!1}return Se(null),y(),Z(),!0},t[20]=a,t[21]=h,t[22]=y,t[23]=Z,t[24]=Re):Re=t[24];let ze=Re,Be;t[25]!==F||t[26]!==I?(Be=function(e){e.baseUrl===F&&e.model===I||he(e)},t[25]=F,t[26]=I,t[27]=Be):Be=t[27];let Ve=Be,He;t[28]!==q||t[29]!==ze?(He=function(){q&&ze(q)&&he(null)},t[28]=q,t[29]=ze,t[30]=He):He=t[30];let Ue=He,We;t[31]!==F||t[32]!==I?(We=function(){he(null),W(F),K(I),T(null)},t[31]=F,t[32]=I,t[33]=We):We=t[33];let Ge=We,Ke;t[34]!==x||t[35]!==J?(Ke=async function(){if(J)return;be(!0),Se(null);let e;try{e=await x.testConnection()}catch{e=null}be(!1),Se({response:e})},t[34]=x,t[35]=J,t[36]=Ke):Ke=t[36];let qe=Ke,Je;t[37]===Ne?Je=t[38]:(Je=function(e){if(e){C(!0);return}Ne(!1)},t[37]=Ne,t[38]=Je);let Ye=Je,Xe;t[39]===Ne?Xe=t[40]:(Xe=function(){Ne(!0)&&C(!1)},t[39]=Ne,t[40]=Xe);let Ze=Xe,Qe;t[41]===a?Qe=t[42]:(Qe=function(e){let t=e.trim();if(!t)return null;let n=te(t);return n===null?null:a(n===`invalid-url`?{id:`2j1kfc`}:{id:`Zj6JL8`})},t[41]=a,t[42]=Qe);let $e=Qe,et;t[43]!==$e||t[44]!==E?(et=function(e){W(e),E&&T($e(e))},t[43]=$e,t[44]=E,t[45]=et):et=t[45];let tt=et,nt;t[46]!==U||t[47]!==$e||t[48]!==G||t[49]!==Ve?(nt=function(){D(!0);let e=$e(U);T(e),e===null&&Ve({baseUrl:Fe(U),model:Le(G)})},t[46]=U,t[47]=$e,t[48]=G,t[49]=Ve,t[50]=nt):nt=t[50];let $=nt,rt=g?.keyPresent??!1,it=g?.keyNotRequired??!1,at=g?.keyHint??null,ot=g?.keySource??null,st=g?.total??0,ct;t[51]===F?ct=t[52]:(ct=pe(F)??F,t[51]=F,t[52]=ct);let lt=ct,ut;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,V.jsx)(r,{id:`3y6XTb`}),t[53]=ut):ut=t[53];let dt;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,V.jsx)(ie,{titleId:`settings-search-title`,title:ut,scope:`project-local`,children:(0,V.jsx)(r,{id:`1NKoc6`})}),t[54]=dt):dt=t[54];let ft;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,V.jsx)(`label`,{htmlFor:`settings-search-semantic-toggle`,className:`text-sm font-medium`,children:(0,V.jsx)(r,{id:`3y6XTb`})}),t[55]=ft):ft=t[55];let pt;t[56]===Y?pt=t[57]:(pt=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[ft,(0,V.jsx)(`p`,{id:`settings-search-semantic-toggle-description`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-body`,children:Y?(0,V.jsx)(r,{id:`stlgky`}):(0,V.jsx)(r,{id:`kdzzOK`})})]}),t[56]=Y,t[57]=pt);let mt=!X,ht;t[58]!==a||t[59]!==Y?(ht=a(Y?{id:`fNr-MX`}:{id:`Aif3E7`}),t[58]=a,t[59]=Y,t[60]=ht):ht=t[60];let gt;t[61]!==Y||t[62]!==Ye||t[63]!==mt||t[64]!==ht?(gt=(0,V.jsx)(l,{id:`settings-search-semantic-toggle`,"aria-describedby":`settings-search-semantic-toggle-description`,checked:Y,disabled:mt,onCheckedChange:Ye,"aria-label":ht,"data-testid":`settings-search-semantic-toggle`}),t[61]=Y,t[62]=Ye,t[63]=mt,t[64]=ht,t[65]=gt):gt=t[65];let _t;t[66]!==pt||t[67]!==gt?(_t=(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[pt,gt]}),t[66]=pt,t[67]=gt,t[68]=_t):_t=t[68];let vt;t[69]!==Y||t[70]!==g?(vt=Y?(0,V.jsx)(ue,{status:g}):null,t[69]=Y,t[70]=g,t[71]=vt):vt=t[71];let yt;t[72]!==_t||t[73]!==vt?(yt=(0,V.jsxs)(`div`,{className:`rounded-md border p-3`,children:[_t,vt]}),t[72]=_t,t[73]=vt,t[74]=yt):yt=t[74];let bt=g!==null,xt;t[75]!==lt||t[76]!==at||t[77]!==it||t[78]!==rt||t[79]!==ot||t[80]!==y||t[81]!==x||t[82]!==bt?(xt=(0,V.jsx)(le,{transport:x,refresh:y,endpointHost:lt,keyPresent:rt,keyHint:at,keySource:ot,keyNotRequired:it,loaded:bt}),t[75]=lt,t[76]=at,t[77]=it,t[78]=rt,t[79]=ot,t[80]=y,t[81]=x,t[82]=bt,t[83]=xt):xt=t[83];let St;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(St=(0,V.jsxs)(s,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`settings-search-custom-endpoint-trigger`,children:[(0,V.jsx)(r,{id:`Hp4rRh`}),(0,V.jsx)(v,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[84]=St):St=t[84];let Ct;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,V.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,V.jsx)(r,{id:`kRTXGw`})}),t[85]=Ct):Ct=t[85];let wt;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(wt=(0,V.jsx)(`label`,{htmlFor:`settings-search-base-url`,className:`block text-sm font-medium`,children:(0,V.jsx)(r,{id:`FCKppt`})}),t[86]=wt):wt=t[86];let Tt;t[87]===tt?Tt=t[88]:(Tt=e=>tt(e.currentTarget.value),t[87]=tt,t[88]=Tt);let Et;t[89]===$?Et=t[90]:(Et=e=>{e.key===`Enter`&&(e.preventDefault(),$())},t[89]=$,t[90]=Et);let Dt=!X,Ot=w!==null,kt;t[91]!==U||t[92]!==$||t[93]!==Tt||t[94]!==Et||t[95]!==Dt||t[96]!==Ot?(kt=(0,V.jsx)(ne,{id:`settings-search-base-url`,value:U,onChange:Tt,onBlur:$,onKeyDown:Et,placeholder:P,disabled:Dt,spellCheck:!1,autoComplete:`off`,"aria-invalid":Ot,"aria-describedby":`settings-search-base-url-message`,"data-testid":`settings-search-base-url`,className:`h-8 font-mono text-sm`}),t[91]=U,t[92]=$,t[93]=Tt,t[94]=Et,t[95]=Dt,t[96]=Ot,t[97]=kt):kt=t[97];let At=w?`text-1sm text-destructive`:`text-muted-foreground text-1sm`,jt=w?`settings-search-base-url-error`:`settings-search-base-url-help`,Mt;t[98]===w?Mt=t[99]:(Mt=w??(0,V.jsx)(r,{id:`lHCR4I`}),t[98]=w,t[99]=Mt);let Nt;t[100]!==At||t[101]!==jt||t[102]!==Mt?(Nt=(0,V.jsx)(`p`,{id:`settings-search-base-url-message`,"aria-live":`polite`,className:At,"data-testid":jt,children:Mt}),t[100]=At,t[101]=jt,t[102]=Mt,t[103]=Nt):Nt=t[103];let Pt;t[104]!==kt||t[105]!==Nt?(Pt=(0,V.jsxs)(`div`,{className:`space-y-2`,children:[wt,kt,Nt]}),t[104]=kt,t[105]=Nt,t[106]=Pt):Pt=t[106];let Ft;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,V.jsx)(`label`,{htmlFor:`settings-search-model`,className:`block text-sm font-medium`,children:(0,V.jsx)(r,{id:`scu3wk`})}),t[107]=Ft):Ft=t[107];let It;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(It=e=>K(e.currentTarget.value),t[108]=It):It=t[108];let Lt;t[109]===$?Lt=t[110]:(Lt=e=>{e.key===`Enter`&&(e.preventDefault(),$())},t[109]=$,t[110]=Lt);let Rt=!X,zt;t[111]!==$||t[112]!==G||t[113]!==Lt||t[114]!==Rt?(zt=(0,V.jsx)(ne,{id:`settings-search-model`,value:G,onChange:It,onBlur:$,onKeyDown:Lt,placeholder:j,disabled:Rt,spellCheck:!1,autoComplete:`off`,"aria-describedby":`settings-search-model-help`,"data-testid":`settings-search-model`,className:`h-8 font-mono text-sm`}),t[111]=$,t[112]=G,t[113]=Lt,t[114]=Rt,t[115]=zt):zt=t[115];let Bt;t[116]===Symbol.for(`react.memo_cache_sentinel`)?(Bt=(0,V.jsx)(`p`,{id:`settings-search-model-help`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-model-help`,children:(0,V.jsx)(r,{id:`C-mmmK`,values:{DEFAULT_EMBEDDINGS_MODEL:j}})}),t[116]=Bt):Bt=t[116];let Vt;t[117]===zt?Vt=t[118]:(Vt=(0,V.jsxs)(`div`,{className:`space-y-2`,children:[Ft,zt,Bt]}),t[117]=zt,t[118]=Vt);let Ht;t[119]===qe?Ht=t[120]:(Ht=()=>void qe(),t[119]=qe,t[120]=Ht);let Ut=J||!X,Wt;t[121]===J?Wt=t[122]:(Wt=J?(0,V.jsx)(r,{id:`qIJIrD`}):(0,V.jsx)(r,{id:`e2zZ3E`}),t[121]=J,t[122]=Wt);let Gt;t[123]!==Ht||t[124]!==Ut||t[125]!==Wt?(Gt=(0,V.jsx)(u,{variant:`outline`,onClick:Ht,disabled:Ut,"data-testid":`settings-search-test-connection`,children:Wt}),t[123]=Ht,t[124]=Ut,t[125]=Wt,t[126]=Gt):Gt=t[126];let Kt;t[127]!==F||t[128]!==I||t[129]!==xe||t[130]!==J?(Kt=(0,V.jsx)(de,{result:xe,testing:J,configuredBaseUrl:F,configuredModel:I}),t[127]=F,t[128]=I,t[129]=xe,t[130]=J,t[131]=Kt):Kt=t[131];let qt;t[132]!==Gt||t[133]!==Kt?(qt=(0,V.jsxs)(`div`,{className:`space-y-2`,children:[Gt,Kt]}),t[132]=Gt,t[133]=Kt,t[134]=qt):qt=t[134];let Jt;t[135]!==Pt||t[136]!==Vt||t[137]!==qt?(Jt=(0,V.jsxs)(o,{className:`space-y-4 border-t px-3 py-3`,children:[Ct,Pt,Vt,qt]}),t[135]=Pt,t[136]=Vt,t[137]=qt,t[138]=Jt):Jt=t[138];let Yt;t[139]!==Oe||t[140]!==Jt?(Yt=(0,V.jsxs)(c,{open:Oe,onOpenChange:_e,className:`rounded-md border`,"data-testid":`settings-search-custom-endpoint`,children:[St,Jt]}),t[139]=Oe,t[140]=Jt,t[141]=Yt):Yt=t[141];let Xt;t[142]===Symbol.for(`react.memo_cache_sentinel`)?(Xt=(0,V.jsxs)(s,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`settings-search-performance-trigger`,children:[(0,V.jsx)(r,{id:`cTrVa1`}),(0,V.jsx)(v,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[142]=Xt):Xt=t[142];let Zt;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=()=>ye(!0),t[143]=Zt):Zt=t[143];let Qt;t[144]===Symbol.for(`react.memo_cache_sentinel`)?(Qt=(0,V.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,V.jsx)(r,{id:`uwzRx4`})}),t[144]=Qt):Qt=t[144];let $t;t[145]===Symbol.for(`react.memo_cache_sentinel`)?($t=(0,V.jsx)(`p`,{id:se,className:`text-muted-foreground text-1sm`,children:(0,V.jsx)(r,{id:`ChdabN`})}),t[145]=$t):$t=t[145];let en,tn;t[146]===Symbol.for(`react.memo_cache_sentinel`)?(en=(0,V.jsx)(r,{id:`zqQlBg`}),tn=(0,V.jsx)(r,{id:`9wIf0H`}),t[146]=en,t[147]=tn):(en=t[146],tn=t[147]);let nn;t[148]!==X||t[149]!==z||t[150]!==Q||t[151]!==h?(nn=(0,V.jsx)(ce,{id:`settings-search-max-batch-size`,label:en,help:tn,configKey:`maxBatchSize`,configuredValue:z,defaultValue:96,binding:h,bindingReady:X,onCommitted:Q}),t[148]=X,t[149]=z,t[150]=Q,t[151]=h,t[152]=nn):nn=t[152];let rn,an;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(rn=(0,V.jsx)(r,{id:`kUgGPO`}),an=(0,V.jsx)(r,{id:`Xafwko`}),t[153]=rn,t[154]=an):(rn=t[153],an=t[154]);let on;t[155]!==X||t[156]!==B||t[157]!==Q||t[158]!==h?(on=(0,V.jsx)(ce,{id:`settings-search-max-batch-chars`,label:rn,help:an,configKey:`maxBatchChars`,configuredValue:B,defaultValue:A,binding:h,bindingReady:X,onCommitted:Q}),t[155]=X,t[156]=B,t[157]=Q,t[158]=h,t[159]=on):on=t[159];let sn,cn;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,V.jsx)(r,{id:`QRSdsO`}),cn=(0,V.jsx)(r,{id:`h-RPqa`}),t[160]=sn,t[161]=cn):(sn=t[160],cn=t[161]);let ln;t[162]!==X||t[163]!==H||t[164]!==Q||t[165]!==h?(ln=(0,V.jsx)(ce,{id:`settings-search-doc-timeout-seconds`,label:sn,help:cn,configKey:`docTimeoutMs`,configuredValue:H,defaultValue:ee,binding:h,bindingReady:X,onCommitted:Q}),t[162]=X,t[163]=H,t[164]=Q,t[165]=h,t[166]=ln):ln=t[166];let un;t[167]!==nn||t[168]!==on||t[169]!==ln?(un=(0,V.jsxs)(o,{className:`flex flex-col gap-4 border-t px-3 py-3`,onFocusCapture:Zt,children:[Qt,$t,nn,on,ln]}),t[167]=nn,t[168]=on,t[169]=ln,t[170]=un):un=t[170];let dn;t[171]!==ke||t[172]!==un?(dn=(0,V.jsxs)(c,{open:ke,onOpenChange:ye,className:`rounded-md border`,"data-testid":`settings-search-performance`,"data-field":`search.semantic.maxBatchSize`,children:[Xt,un]}),t[171]=ke,t[172]=un,t[173]=dn):dn=t[173];let fn;t[174]!==S||t[175]!==Ze?(fn=(0,V.jsx)(me,{open:S,onOpenChange:C,onConfirm:Ze}),t[174]=S,t[175]=Ze,t[176]=fn):fn=t[176];let pn;t[177]!==Ge||t[178]!==Ue||t[179]!==q||t[180]!==st?(pn=(0,V.jsx)(fe,{pending:q,pageCount:st,onCancel:Ge,onConfirm:Ue}),t[177]=Ge,t[178]=Ue,t[179]=q,t[180]=st,t[181]=pn):pn=t[181];let mn;return t[182]!==yt||t[183]!==xt||t[184]!==Yt||t[185]!==dn||t[186]!==fn||t[187]!==pn?(mn=(0,V.jsxs)(`section`,{"aria-labelledby":`settings-search-title`,className:`space-y-3`,"data-testid":`settings-search`,children:[dt,yt,xt,Yt,dn,fn,pn]}),t[182]=yt,t[183]=xt,t[184]=Yt,t[185]=dn,t[186]=fn,t[187]=pn,t[188]=mn):mn=t[188],mn}var U={maxBatchSize:{min:1,max:M},maxBatchChars:{min:1,max:N},docTimeoutMs:{min:1,max:F,displayDivisor:1e3}};function ce(e){let t=(0,R.c)(52),{id:n,label:a,help:o,configKey:s,configuredValue:c,defaultValue:l,binding:u,bindingReady:p,onCommitted:m}=e,{_:h,i18n:g}=i(),_=U[s],v=_.displayDivisor??1,y=c/v,b=l/v,x=_.min/v,S=_.max/v,[C,w]=(0,L.useState)(String(y)),[T,E]=(0,L.useState)(null),[A,j]=(0,L.useState)(null),[M,N]=(0,L.useState)(y);y!==M&&(N(y),w(String(y)),E(null),A!==c&&j(null));let P,F;t[0]===A?(P=t[1],F=t[2]):(P=()=>{if(A===null)return;let e=setTimeout(()=>j(null),1500);return()=>clearTimeout(e)},F=[A],t[0]=A,t[1]=P,t[2]=F),(0,L.useEffect)(P,F);let ee=v>1,te;t[3]!==h||t[4]!==ee||t[5]!==u||t[6]!==s||t[7]!==c||t[8]!==v||t[9]!==b||t[10]!==S||t[11]!==x||t[12]!==C||t[13]!==g||t[14]!==m?(te=function(){let e=C.trim(),t=e===``?String(b):e,n=ee?/^\d+(?:\.\d+)?$/:/^\d+$/,r=Number(t),i=Math.round(r*v);if(!n.test(t)||!Number.isSafeInteger(i)||r<x||r>S){let e=new Intl.NumberFormat(g.locale),t=e.format(x),n=e.format(S);E(h(ee?{id:`L7NFTZ`,values:{minimum:t,maximum:n}}:{id:`zkkEFa`,values:{minimum:t,maximum:n}}));return}if(u===null){E(h({id:`YW7Q86`}));return}if(i===c){w(String(r)),E(null);return}let a={[s]:i},o=u.patch({search:{semantic:a}});if(!o.ok){let e=h({id:`Bgaa_U`,values:{detail:f(o.error)}});E(e),d.error(e);return}w(String(r)),E(null),j(i),m()},t[3]=h,t[4]=ee,t[5]=u,t[6]=s,t[7]=c,t[8]=v,t[9]=b,t[10]=S,t[11]=x,t[12]=C,t[13]=g,t[14]=m,t[15]=te):te=t[15];let I=te,re=`${n}-message`,ie=`${n}-help`,z=T!==null,B=!p,ae;t[16]!==n||t[17]!==a?(ae=(0,V.jsx)(D,{htmlFor:n,children:a}),t[16]=n,t[17]=a,t[18]=ae):ae=t[18];let oe;t[19]===T?oe=t[20]:(oe=e=>{w(e.currentTarget.value),j(null),T!==null&&E(null)},t[19]=T,t[20]=oe);let H;t[21]===I?H=t[22]:(H=e=>{e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),I())},t[21]=I,t[22]=H);let ce=!p,le=ee?`decimal`:`numeric`,ue=T!==null,de=`${ie} ${re} ${se}`,W;t[23]!==I||t[24]!==C||t[25]!==n||t[26]!==le||t[27]!==ue||t[28]!==de||t[29]!==oe||t[30]!==H||t[31]!==ce?(W=(0,V.jsx)(ne,{id:n,value:C,onChange:oe,onBlur:I,onKeyDown:H,disabled:ce,inputMode:le,autoComplete:`off`,spellCheck:!1,"aria-invalid":ue,"aria-describedby":de,"data-testid":n,className:`h-8 font-mono text-sm`}),t[23]=I,t[24]=C,t[25]=n,t[26]=le,t[27]=ue,t[28]=de,t[29]=oe,t[30]=H,t[31]=ce,t[32]=W):W=t[32];let G=`${n}-help`,fe;t[33]!==o||t[34]!==ie||t[35]!==G?(fe=(0,V.jsx)(O,{id:ie,className:`nth-last-2:mt-0`,"data-testid":G,children:o}),t[33]=o,t[34]=ie,t[35]=G,t[36]=fe):fe=t[36];let pe=T?`text-1sm text-destructive`:`text-muted-foreground text-1sm`,me=T?`${n}-error`:`${n}-saved`,K;t[37]!==T||t[38]!==A?(K=T??(A===null?null:(0,V.jsx)(r,{id:`idD8Ev`})),t[37]=T,t[38]=A,t[39]=K):K=t[39];let q;t[40]!==re||t[41]!==pe||t[42]!==me||t[43]!==K?(q=(0,V.jsx)(O,{id:re,"aria-live":`polite`,"aria-atomic":`true`,className:pe,"data-testid":me,children:K}),t[40]=re,t[41]=pe,t[42]=me,t[43]=K,t[44]=q):q=t[44];let he;return t[45]!==W||t[46]!==fe||t[47]!==q||t[48]!==z||t[49]!==B||t[50]!==ae?(he=(0,V.jsxs)(k,{"data-invalid":z,"data-disabled":B,className:`gap-2`,children:[ae,W,fe,q]}),t[45]=W,t[46]=fe,t[47]=q,t[48]=z,t[49]=B,t[50]=ae,t[51]=he):he=t[51],he}function le(e){let t=(0,R.c)(32),{transport:n,refresh:a,endpointHost:o,keyPresent:s,keyHint:c,keySource:l,keyNotRequired:d,loaded:f}=e,{_:p}=i(),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=I(`secrets.yml`),t[0]=m):m=t[0];let h=m,[g,_]=(0,L.useState)(``),[v,y]=(0,L.useState)(!1),[b,x]=(0,L.useState)(null),S;t[1]!==p||t[2]!==v||t[3]!==g||t[4]!==a||t[5]!==n?(S=async function(){let e=g.trim();if(!e||v)return;y(!0),x(null);let t=await n.setKey(e);y(!1),t.ok?(_(``),a()):x(t.error??p({id:`Ck9XRt`}))},t[1]=p,t[2]=v,t[3]=g,t[4]=a,t[5]=n,t[6]=S):S=t[6];let C=S,w;t[7]!==p||t[8]!==v||t[9]!==a||t[10]!==n?(w=async function(){if(v)return;y(!0),x(null);let e=await n.clearKey();y(!1),e.ok?a():x(e.error??p({id:`CSL0l1`}))},t[7]=p,t[8]=v,t[9]=a,t[10]=n,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,V.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,V.jsx)(r,{id:`2pR7ad`})}),t[12]=E):E=t[12];let D;t[13]!==o||t[14]!==d?(D=(0,V.jsxs)(`div`,{className:`space-y-1`,children:[E,(0,V.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:d?(0,V.jsx)(r,{id:`tUVRDy`,values:{endpointHost:o},components:{0:(0,V.jsx)(`span`,{className:`font-medium`})}}):(0,V.jsx)(r,{id:`Rh_duv`,values:{endpointHost:o,secretsPath:h},components:{0:(0,V.jsx)(`span`,{className:`font-medium`}),1:(0,V.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]}),t[13]=o,t[14]=d,t[15]=D):D=t[15];let O;t[16]!==p||t[17]!==v||t[18]!==c||t[19]!==g||t[20]!==s||t[21]!==l||t[22]!==f||t[23]!==T||t[24]!==C?(O=l===`env`?(0,V.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-key-env`,children:(0,V.jsx)(r,{id:`KH5bQi`,components:{0:(0,V.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}):(0,V.jsxs)(V.Fragment,{children:[s?(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,"data-testid":`settings-search-key-set`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`mb-1.5 text-sm font-medium`,children:(0,V.jsx)(r,{id:`AqnqMJ`})}),c?(0,V.jsxs)(`p`,{className:`truncate font-mono text-muted-foreground text-xs`,title:p({id:`qEIFZu`,values:{keyHint:c}}),"data-testid":`settings-search-key-hint`,children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`••••••••`}),c]}):null]}),(0,V.jsx)(u,{variant:`outline`,onClick:()=>void T(),disabled:v,"data-testid":`settings-search-key-clear`,children:(0,V.jsx)(r,{id:`xCJdfg`})})]}):null,(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`settings-search-key-input`,className:`mb-2 block text-sm font-medium`,children:s?(0,V.jsx)(r,{id:`UW93oq`}):(0,V.jsx)(r,{id:`K6jxcj`})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(ne,{id:`settings-search-key-input`,type:`password`,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),C())},placeholder:p({id:`tsiTqO`}),autoComplete:`off`,spellCheck:!1,disabled:v||!f,"data-testid":`settings-search-key-input`,className:`h-8 font-mono text-sm`}),(0,V.jsx)(u,{onClick:()=>void C(),disabled:v||g.trim().length===0,"data-testid":`settings-search-key-save`,children:v?(0,V.jsx)(r,{id:`uF9ruK`}):(0,V.jsx)(r,{id:`tfDRzk`})})]})]})]}),t[16]=p,t[17]=v,t[18]=c,t[19]=g,t[20]=s,t[21]=l,t[22]=f,t[23]=T,t[24]=C,t[25]=O):O=t[25];let k;t[26]===b?k=t[27]:(k=b?(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-search-key-error`,children:b}):null,t[26]=b,t[27]=k);let A;return t[28]!==D||t[29]!==O||t[30]!==k?(A=(0,V.jsxs)(`section`,{className:`space-y-3 rounded-md border p-3`,"data-testid":`settings-search-key`,children:[D,O,k]}),t[28]=D,t[29]=O,t[30]=k,t[31]=A):A=t[31],A}function ue(e){let t=(0,R.c)(14),{status:n}=e;if(!n?.enabled){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-1sm mt-2`,"data-testid":`settings-search-settling`,children:(0,V.jsx)(r,{id:`AdcGcG`})}),t[0]=e):e=t[0],e}if(!g(n)){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-warning/40 px-3 py-2 text-1sm text-foreground`,"data-testid":`settings-search-needs-key`,children:(0,V.jsx)(r,{id:`x4pGVR`})}),t[1]=e):e=t[1],e}let{ready:i,capable:a,embedded:o,total:s}=n,c=h(n);if(c===`restart_required`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-warning/40 px-3 py-2 text-1sm text-foreground`,"data-testid":`settings-search-restart-required`,children:(0,V.jsx)(r,{id:`mmNeqE`})}),t[2]=e):e=t[2],e}if(c===`incapable`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-warning/40 px-3 py-2 text-1sm text-foreground`,"data-testid":`settings-search-dimensions-mismatch`,children:(0,V.jsx)(r,{id:`5Szq6N`,components:{0:(0,V.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}),t[3]=e):e=t[3],e}if(i&&!a){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-warning/40 px-3 py-2 text-1sm text-foreground`,"data-testid":`settings-search-provider-error`,children:(0,V.jsx)(r,{id:`Oj-JV8`,components:{0:(0,V.jsx)(`span`,{className:`font-medium`})}})}),t[4]=e):e=t[4],e}if(!i){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`p`,{role:`status`,className:`text-muted-foreground text-1sm mt-2`,"data-testid":`settings-search-pending`,children:(0,V.jsx)(r,{id:`VZSBXL`})}),t[5]=e):e=t[5],e}let l;t[6]!==o||t[7]!==s?(l=(0,V.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,V.jsx)(r,{id:`lVWEIL`,values:{embedded:o,total:s}})}),t[6]=o,t[7]=s,t[8]=l):l=t[8];let u;t[9]===o?u=t[10]:(u=o===0?(0,V.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,V.jsx)(r,{id:`ku0yLQ`})}):null,t[9]=o,t[10]=u);let d;return t[11]!==l||t[12]!==u?(d=(0,V.jsxs)(`div`,{className:`mt-2 space-y-0.5`,"data-testid":`settings-search-coverage`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function de(e){let t=(0,R.c)(6),{result:n,testing:i,configuredBaseUrl:a,configuredModel:o}=e;if(i||n===null)return null;let{response:s}=n;if(s===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(G,{tone:`error`,testId:`settings-search-test-unreachable`,children:(0,V.jsx)(r,{id:`uNGmQn`})}),t[0]=e):e=t[0],e}if(s.endpoint!==a||s.model!==o){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(G,{tone:`warn`,testId:`settings-search-test-stale`,children:(0,V.jsx)(r,{id:`psl2Sj`})}),t[1]=e):e=t[1],e}if(s.ok){let e;return t[2]===s.dimensions?e=t[3]:(e=(0,V.jsx)(G,{tone:`ok`,testId:`settings-search-test-ok`,children:(0,V.jsx)(r,{id:`D-_B7l`,values:{0:s.dimensions}})}),t[2]=s.dimensions,t[3]=e),e}let c;return t[4]===s?c=t[5]:(c=(0,V.jsx)(G,{tone:`error`,testId:`settings-search-test-error`,children:(0,V.jsx)(W,{response:s})}),t[4]=s,t[5]=c),c}function W(e){let t=(0,R.c)(9),{response:n}=e;switch(n.reason){case`no_key`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(r,{id:`7cAW1G`}),t[0]=e):e=t[0],e}case`invalid_endpoint`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(r,{id:`HQzk0t`}),t[1]=e):e=t[1],e}case`rate_limit`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(r,{id:`xDEcka`}),t[2]=e):e=t[2],e}case`timeout`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(r,{id:`PpJy-V`}),t[3]=e):e=t[3],e}case`network`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(r,{id:`yFr-5x`}),t[4]=e):e=t[4],e}case`dims_mismatch`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(r,{id:`5Szq6N`,components:{0:(0,V.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}}),t[5]=e):e=t[5],e}case`malformed_response`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(r,{id:`AwLCZA`}),t[6]=e):e=t[6],e}default:{let e;return t[7]===n.status?e=t[8]:(e=n.status===void 0?(0,V.jsx)(r,{id:`tN5WTS`}):(0,V.jsx)(r,{id:`v_cQn_`,values:{0:n.status}}),t[7]=n.status,t[8]=e),e}}}function G(e){let t=(0,R.c)(7),{tone:n,testId:r,children:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={ok:`border-success/40 text-foreground`,warn:`border-warning/40 text-foreground`,error:`border-destructive/50 text-destructive`},t[0]=a):a=t[0];let o=a[n],s=n===`error`?`alert`:`status`,c=n===`error`?`assertive`:`polite`,l=`rounded-md border px-3 py-2 text-1sm ${o}`,u;return t[1]!==i||t[2]!==s||t[3]!==c||t[4]!==l||t[5]!==r?(u=(0,V.jsx)(`p`,{role:s,"aria-live":c,className:l,"data-testid":r,children:i}),t[1]=i,t[2]=s,t[3]=c,t[4]=l,t[5]=r,t[6]=u):u=t[6],u}function fe(e){let t=(0,R.c)(32),{pending:n,pageCount:i,onCancel:a,onConfirm:o}=e,s;t[0]===n?s=t[1]:(s=n?pe(n.baseUrl)??n.baseUrl:``,t[0]=n,t[1]=s);let c=s,l=n!==null,d;t[2]===a?d=t[3]:(d=e=>{e||a()},t[2]=a,t[3]=d);let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(b,{children:(0,V.jsx)(r,{id:`_GRWOJ`})}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsxs)(T,{children:[f,(0,V.jsx)(y,{children:(0,V.jsx)(r,{id:`EKwNEe`})})]}),t[5]=p):p=t[5];let m;t[6]!==c||t[7]!==i?(m={pageCount:i,host:c},t[6]=c,t[7]=i,t[8]=m):m=t[8];let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h={0:(0,V.jsx)(`span`,{className:`font-medium`}),1:(0,V.jsx)(`span`,{className:`font-medium`})},t[9]=h):h=t[9];let g;t[10]===m?g=t[11]:(g=(0,V.jsx)(`li`,{children:(0,V.jsx)(r,{id:`darW93`,values:m,components:h})}),t[10]=m,t[11]=g);let _=n?.model,v;t[12]===_?v=t[13]:(v={0:_},t[12]=_,t[13]=v);let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D={0:(0,V.jsx)(`span`,{className:`font-mono`})},t[14]=D):D=t[14];let O;t[15]===v?O=t[16]:(O=(0,V.jsx)(`li`,{children:(0,V.jsx)(r,{id:`sweBEk`,values:v,components:D})}),t[15]=v,t[16]=O);let k;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,V.jsx)(`li`,{children:(0,V.jsx)(r,{id:`cD3aew`})}),t[17]=k):k=t[17];let A;t[18]!==O||t[19]!==g?(A=(0,V.jsx)(S,{children:(0,V.jsx)(`div`,{role:`alert`,className:`rounded-md border border-warning/40 px-3 py-2.5 text-sm text-foreground`,children:(0,V.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[g,O,k]})})}),t[18]=O,t[19]=g,t[20]=A):A=t[20];let j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,V.jsx)(w,{asChild:!0,children:(0,V.jsx)(u,{variant:`outline`,children:(0,V.jsx)(r,{id:`dEgA5A`})})}),t[21]=j):j=t[21];let M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,V.jsx)(r,{id:`9aVlF2`}),t[22]=M):M=t[22];let N;t[23]===o?N=t[24]:(N=(0,V.jsxs)(C,{children:[j,(0,V.jsx)(u,{onClick:o,"data-testid":`settings-search-provider-confirm-apply`,children:M})]}),t[23]=o,t[24]=N);let P;t[25]!==A||t[26]!==N?(P=(0,V.jsxs)(x,{className:`sm:max-w-lg`,"data-testid":`settings-search-provider-confirm`,children:[p,A,N]}),t[25]=A,t[26]=N,t[27]=P):P=t[27];let F;return t[28]!==P||t[29]!==l||t[30]!==d?(F=(0,V.jsx)(E,{open:l,onOpenChange:d,children:P}),t[28]=P,t[29]=l,t[30]=d,t[31]=F):F=t[31],F}function pe(e){try{return new URL(e).host}catch{return null}}function me(e){let t=(0,R.c)(13),{open:n,onOpenChange:i,onConfirm:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(b,{children:(0,V.jsx)(r,{id:`vhAnzJ`})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsxs)(T,{children:[o,(0,V.jsx)(y,{children:(0,V.jsx)(r,{id:`aENGMB`})})]}),t[1]=s):s=t[1];let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(`p`,{className:`mb-2 font-medium`,children:(0,V.jsx)(r,{id:`7PNNNs`})}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`li`,{children:(0,V.jsx)(r,{id:`UfW9Kr`})}),t[3]=l):l=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,V.jsx)(S,{children:(0,V.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-warning/40 px-3 py-2.5 text-sm text-foreground`,children:[c,(0,V.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[l,(0,V.jsx)(`li`,{children:(0,V.jsx)(r,{id:`Emz5BG`,components:{0:(0,V.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}),(0,V.jsx)(`li`,{children:(0,V.jsx)(r,{id:`DKYW1G`})})]})]})}),t[4]=d):d=t[4];let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(w,{asChild:!0,children:(0,V.jsx)(u,{variant:`outline`,children:(0,V.jsx)(r,{id:`dEgA5A`})})}),t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsx)(r,{id:`iMkWoF`}),t[6]=p):p=t[6];let m;t[7]===a?m=t[8]:(m=(0,V.jsxs)(x,{className:`sm:max-w-lg`,"data-testid":`settings-search-confirm`,children:[s,d,(0,V.jsxs)(C,{children:[f,(0,V.jsx)(u,{onClick:a,"data-testid":`settings-search-confirm-enable`,children:p})]})]}),t[7]=a,t[8]=m);let h;return t[9]!==i||t[10]!==n||t[11]!==m?(h=(0,V.jsx)(E,{open:n,onOpenChange:i,children:m}),t[9]=i,t[10]=n,t[11]=m,t[12]=h):h=t[12],h}export{H as SearchSection};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AboutSection-Ckx7jZHN.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./label-CvMpFFbN.js","./dist-DTFuvKje.js","./dist-CSCUSbQc.js","./react-dom-DPxgxlDT.js","./compiler-runtime-BfE3aGVn.js","./utils-CPqDy6Hr.js","./bundle-mjs-SHeFpKGC.js","./switch-BKZTXkzu.js","./dist-DBXmXNZF.js","./dist-CRjqnzU7.js","./arrow-up-right-nJaICi16.js","./createLucideIcon-DdBzwsHe.js","./spinner-Bx8xD6f8.js","./SettingsSectionHeader-2iTSJQHd.js","./tooltip-BjuCvy5N.js","./dist-DXjgFhPl2.js","./floating-ui.dom-BYl7JZd0.js","./dist-CxbWbOvU.js","./badge-DcyFOLs8.js","./dist-BsJYDohW.js","./external-link-DxgIpECR.js","./button-DzgjsZzC.js","./SharingSection-RBUd50Bj.js","./radio-group-G1GR05Rb.js","./dist-uiDX6Nr9.js","./dist-BKgU0kag.js","./dist-BGzUo_18.js","./ConfigSharingInfoTooltip-CJywmyrk.js","./info-CyR0W2SK.js","./skeleton-2Ewnato7.js","./channel-cli-copy-BySq87hR.js","./constants-product-BVSOzxVs.js","./AccountSection-Duudie77.js","./SyncStatusBadge-Ba3iUAco.js","./config-provider-f9PDyLDl.js","./trace-api-nQInEDYS.js","./status-CUwkWWLj.js","./dist-PQ5KMVDh.js","./schemas-api-WgoIuF0H.js","./schemas-CxFhJLAM.js","./_envelope-DuFpUEag-Beu481Zb.js","./share-D-LUU2aX-rZ2lBHef.js","./util-doc-name-DRKmy6g9.js","./constants-cc1-Bt4QPTUe.js","./constants-github-B7yhDvQc.js","./doc-extensions-CcO7K8uD-DG9uHV54.js","./logging-renderer-log-CqIZVUIQ.js","./skill-targets-schema-DIfTaAkM.js","./constants-editors-DmmORwNP.js","./use-apply-config-language-9fLQZCsK.js","./preload-helper-Chd9yIcd.js","./dist-C_FzPxEX2.js","./messages-BY7FXc1p.js","./client-version-Bf2iRqGU.js","./css-color-to-hex-pv-EKOQu.js","./use-apply-config-color-theme-CTtLraO9.js","./use-apply-config-theme-CYFG76sS.js","./saved-themes-client-B4QZmuf_.js","./constants-upload-DZP-sCdl.js","./select-BsDvTs6I.js","./es2015-Dtr4fzLT.js","./check-B2OLRY33.js","./chevron-down-CEv6N8LG.js","./collapsible-BKbszYZV.js","./arrow-up-BGHhPj4y.js","./chevron-right-Bofu4lib.js","./settings-2-DoBlNQMk.js","./git-merge-VDBzSZBV.js","./refresh-cw-BVQchE6b.js","./terminal-B38K-KMo.js","./triangle-alert-DFWRwfH7.js","./DisclosureWarning-P2FKhrj3.js","./terminal-command-events-coVvkJmV.js","./handoff-DsHaP2rA.js","./dialog-CAxu_6pu.js","./electron-drag-strip-D9GZhMg_.js","./x-wldAHzfP.js","./popover-Dxc5JyiN.js","./dist-Cj3Bpren.js","./use-conflicts-DEteFrWs.js","./documents-events-C1uYbecE.js","./schemas-cc1-DAVdMZdU.js","./config-errors-d-4C2SfD.js","./use-git-sync-status-DB3RSBj5.js","./doc-hash-BT2I193z.js","./reveal-editor-CoucRZz8.js","./use-settings-route-BGtkup9E.js","./keyboard-shortcuts-D5fo2XHL.js","./dist-Dc8tD1th.js","./w3c-keyname-C7Rznu6R.js","./trash-2-Blf9Cydx.js","./AuthModal--Pl-iyB3.js","./copy-DpWa6i2v.js","./input-CgydZJoC.js","./auth-state-cache-MEl9L_dR.js","./AgentConnectionsSection-DYtfZ4WI.js","./useQuery-ZeEDLtxh.js","./RegisteredAgentIcon-3YdE9YD2.js","./cursor-pH0WlPzE.js","./agent-registry-Z4n6bROi.js","./search-BoiwnBpA.js","./TerminalLaunchContext-BiKZKemG.js","./agent-connections-DofjYVxj.js","./alert-dialog-Mwvu63aS.js","./checkbox-CKD8LETI.js","./minus-DdRxss3A.js","./folder-QqUoFRPR.js","./monitor-IXzxTnmk.js","./sparkles-lfxw6YO9.js","./AgentIconCluster-B9rTFji5.js","./OpenInAgentMenuItem-N6xIhi4p.js","./dropdown-menu-DH6UNmuX.js","./dist-C0nuYMFu.js","./dist-d2WYntJB.js","./copilot-CmkvU8CH.js","./utils-random-uuid-CE1X6bNM.js","./mascot-outline-CtS592mc.js","./field-DtEiTjHS.js","./separator-D7s_9ZwH.js","./tool-list-format-ahklHT7Z.js","./constants-skills-Coq7kn_k.js","./bool-pref-pcNhKZb_.js","./storage-scope-sNHb4BCO.js","./bridge-C51UDIR0.js","./structural-freshness-C6rR7cV3-VXiZX15w.js","./terminal-cli-display-CHuCou07.js","./settings-section-labels-Dxz-paTy.js","./catalog-CLnUnyxw.js","./use-workspace-5RavNejH.js","./AttachmentsSection-H2HNwBzb.js","./field-controls-pq-AYiCQ.js","./toggle-group-aEGkM0EG.js","./circle-alert-eBm4JPxY.js","./ThemePicker-pc5gwEur.js","./plus-CXQ-oViZ.js","./rotate-ccw-DeMl2ou7.js","./form-CRIbPJu7.js","./textarea-DkcNoPBJ.js","./config-schema-DM88r6Wp.js","./config-validation-events-88awVkQh.js","./ContentRulesSection-a1UGdVsB.js","./markdown-lint-D13AGXjm.js","./lib-CZXZ01YL.js","./ccount-s_UaBrax.js","./syntax-UjZu5532.js","./markdownit-B0tzyo4f.js","./field-controls-C_LUFJDr.js","./HotkeysSection-DFkUTrJc.js","./settings-host-gates-mRhjEC1s.js","./kbd-Cg1nrB7U.js","./IntegrationsSection-It1Oo7dY.js","./InstallInClaudeDesktopDialog-CRXgqpq1.js","./arrow-right-NOQZeKIW.js","./circle-check-nK1yRBIw.js","./download-BouT3__0.js","./LinkPreviewsSection-DrHVesDA.js","./LintingSection-CnZdwesC.js","./CodeMirrorPropInput-o8i3gLwL.js","./dist-W5hM-kQ3.js","./dist-CoJBCixp.js","./dist-BtC2yORW.js","./dist-B1rPVlDX.js","./dist-OHM7P10P.js","./dist-ldcsP3Wx.js","./dist-kajsw8zD.js","./dist-CNHpRWc3.js","./dist-OiK6QmuG.js","./dist-DLTuJxuQ2.js","./stex-CmWau-0j.js","./lib-Csk2IQWH.js","./space-separated-tokens-B2o5P1Kh.js","./trim-lines-CzojgEjk.js","./folder-open-COGOeTzI.js","./with-selector-zVo3Fruj.js","./navigation-targets-Cu84E97-.js","./file-tree-utils-w-NVNUx5.js","./doc-paths-C1iU3JM4.js","./cm-theme-DpKmjLo0.js","./desktop-bridge-D6pSqrSU.js","./page-list-cache-duzt_bxz.js","./documents-fetch-ZX1mUge_.js","./note-window-mode-CI3Yju9B.js","./DocumentContext-DqUuPSJl.js","./propagation-api-dgM6YInk.js","./context-api-CMjojwfb.js","./lib-o_ZJ5rsY.js","./lib-D3PsW6H5.js","./lib-DxyUjQpt.js","./git-branch-CeTudSak.js","./Mermaid-DH1HLMlB.js","./maximize-2-DjzhPUDZ.js","./ime-composition-CjypcBXs.js","./prop-types-ZtKgQMRh.js","./hash-C4CJQURT.js","./local-menu-action-bus-Dyh2UJJF.js","./paperclip-FfP_WlTp.js","./react-error-boundary-6ac6QM6R.js","./CopyButton-BT2YHECh.js","./PageListContext-NRWi1wh0.js","./parse-api-error-CeEVOj25.js","./startup-marks-C403iSh4.js","./perf-CYJlqBBt.js","./diagnostic-breadcrumb-Mg7sdCfQ.js","./file-tree-rename-validation-BZbYm35X.js","./use-collab-url-DbvOg54A.js","./api-config-C0OrJP9L.js","./excalidraw-scene-Dgb0SaoB.js","./known-skill-dirs-CErGS26P.js","./single-file-mode-DURp6aom.js","./skill-scope-DjqrCXkR.js","./skills-api-DBxDbkxz.js","./DocumentContext-B0sQn39F.css","./lint-plugin-meta-CtDE2R0v.js","./square-pen-DU3t-IcD.js","./DeleteConfirmationDialog-CN6XZx5m.js","./SkillPluginBundleDialog-CingGivw.js","./SkillInstallMenu-CpsFAIPJ.js","./ChangedOutsideBadge-BeJ4Reff.js","./context-menu-DFxnhV9i.js","./dist-BzicVdNV.js","./use-skills-B6ndwLoW.js","./use-skill-targets-C5Tb5t_s.js","./markdownlint-rule-browser-BIpAh6PU.js","./tag-pill-input-DNcSO6rN.js","./lint-config-client-CZ22hfd5.js","./use-open-skill-Br25_0Zs.js","./open-managed-artifact-tab-BcMHQbeA.js","./schema-fields-view-intent-CfSR46vf.js","./NetworkAccessSection-D-Rln6zh.js","./restart-collab-server-CHlRP7RK.js","./OkignoreSection-BDDJUSqF.js","./sortable.esm-CnIkmeTY.js","./grip-vertical-DNbkgWZL.js","./config-ignore-nested-error-events-BbuOaRMz.js","./save-held-message-D5H7vOp3.js","./ProjectTemplatesSection-CjX7q09w.js","./TemplateRow-Cs_8LNHD.js","./file-plus-DKxOZh2k.js","./folder-config-api-C6LhS3Cf.js","./SearchSection-B0BR_xQy.js","./use-semantic-search-status-cvdZZNYA.js","./SkillsManagerSection-1FLLRX0x.js","./SlidesPluginSection-B_E2apho.js","./input-group-CBuVp6zh.js","./SyncSection-_5olS0th.js","./PublishToGitHubDialog-DSLDhsry.js","./clipboard-adapter-FO6gFDPG.js","./TerminalSection-EfwpofBq.js","./use-terminal-enabled-B5u6V0Yi.js","./ThemePluginSection-DSJaRBB-.js","./schema-section-Bn1HnUE0.js","./settings-fields-DaMWswre.js","./lint-plugins-Cf5g-Z--.js","./OkCliPathRow-Dn-a2z6P.js","./SpellingSettings-CDk5F0uz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./triangle-alert-DFWRwfH7.js";import{t as c}from"./lazy-with-preload-D3RC_59J.js";import{n as l,r as u,t as d}from"./alert-BEwM2iOp.js";import{r as f}from"./settings-host-gates-mRhjEC1s.js";import{n as p}from"./settings-fields-DaMWswre.js";import{t as m}from"./SettingsSectionHeader-2iTSJQHd.js";var h=o(),g=e(r(),1),_=n();function v(e){return(0,g.lazy)(async()=>({default:await e()}))}var y=v(async()=>(await t(async()=>{let{AboutSection:e}=await import(`./AboutSection-Ckx7jZHN.js`);return{AboutSection:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]),import.meta.url)).AboutSection),b=v(async()=>(await t(async()=>{let{SharingSection:e}=await import(`./SharingSection-RBUd50Bj.js`);return{SharingSection:e}},__vite__mapDeps([27,1,2,3,4,28,6,7,8,29,30,13,14,9,10,11,31,32,19,20,21,22,33,16,18,15,23,24,25,26,34,35,36]),import.meta.url)).SharingSection),x=v(async()=>(await t(async()=>{let{AccountSection:e}=await import(`./AccountSection-Duudie77.js`);return{AccountSection:e}},__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,11,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,57,58,59,60,61,62,63,64,20,21,14,29,22,65,19,13,16,66,67,68,69,15,70,71,72,17,73,74,75,76,77,78,23,24,26,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,25,18,34,99,35]),import.meta.url)).AccountSection),S=v(async()=>(await t(async()=>{let{AgentConnectionsSection:e}=await import(`./AgentConnectionsSection-DYtfZ4WI.js`);return{AgentConnectionsSection:e}},__vite__mapDeps([100,1,56,2,3,4,12,6,7,8,13,14,9,10,11,101,16,15,102,103,104,43,44,45,46,47,48,49,50,51,52,53,36,78,66,17,105,75,106,107,108,80,22,65,26,24,109,110,5,19,20,21,111,33,112,113,81,114,115,116,117,118,29,30,70,42,119,120,121,23,79,122,123,124,125,126,127,128,129,130,18,25,131,98,132,133]),import.meta.url)).AgentConnectionsSection),C=v(async()=>(await t(async()=>{let{AttachmentsSection:e}=await import(`./AttachmentsSection-H2HNwBzb.js`);return{AttachmentsSection:e}},__vite__mapDeps([134,1,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,8,57,58,59,60,61,2,62,63,135,64,20,21,6,7,14,29,22,65,19,10,11,13,16,66,67,12,136,30,24,137,138,28,112,139,140,95,75,141,5,26,79,80,81,122,123,98,34,142,87,143,18,15,23,25,144]),import.meta.url)).AttachmentsSection),w=v(async()=>(await t(async()=>{let{ContentRulesSection:e}=await import(`./ContentRulesSection-a1UGdVsB.js`);return{ContentRulesSection:e}},__vite__mapDeps([145,39,1,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,8,57,58,59,60,61,2,62,63,64,20,21,6,7,14,29,22,65,19,10,11,13,16,66,67,5,12,146,147,148,149,150,18,15,23,24,25,87]),import.meta.url)).ContentRulesSection),T=v(async()=>(await t(async()=>{let{SectionSkeleton:e}=await import(`./field-controls-C_LUFJDr.js`);return{SectionSkeleton:e}},__vite__mapDeps([151,135,1,2,3,4,40,64,20,21,6,7,8,14,29,22,65,19,9,10,11,13,16,66,67,12,136,30,24,137,138,28,112,61,42,139,140,95,75,141,5,31,43,44,45,46,47,48,49,50,51,52,53,36,26,79,80,81,122,123,98,34,142,54,55,56,57,60,62,63,87,143]),import.meta.url)).SectionSkeleton),E=v(async()=>(await t(async()=>{let{HotkeysSection:e}=await import(`./HotkeysSection-DFkUTrJc.js`);return{HotkeysSection:e}},__vite__mapDeps([152,2,1,3,4,9,18,19,20,21,6,7,8,14,22,10,11,15,16,23,24,25,153,154,92,93,94]),import.meta.url)).HotkeysSection),D=v(async()=>(await t(async()=>{let{IntegrationsSection:e}=await import(`./IntegrationsSection-It1Oo7dY.js`);return{IntegrationsSection:e}},__vite__mapDeps([155,1,2,3,4,156,16,157,158,97,159,17,9,10,11,31,8,26,7,24,79,80,6,22,65,81,25,18,19,20,21,14,15,23]),import.meta.url)).IntegrationsSection),O=v(async()=>(await t(async()=>{let{LinkPreviewsSection:e}=await import(`./LinkPreviewsSection-DrHVesDA.js`);return{LinkPreviewsSection:e}},__vite__mapDeps([160,1,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,8,57,58,59,60,61,2,62,63,12,6,7,13,14,10,11,18,19,20,21,22,15,16,23,24,25,26,79,80,65,81,87]),import.meta.url)).LinkPreviewsSection),k=v(async()=>(await t(async()=>{let{MarkdownlintPluginSection:e}=await import(`./LintingSection-CnZdwesC.js`);return{MarkdownlintPluginSection:e}},__vite__mapDeps([161,1,162,55,163,164,94,165,166,167,168,169,170,171,172,173,21,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,56,31,8,57,58,59,60,61,2,62,63,93,147,148,174,175,176,149,16,177,95,178,179,180,181,182,183,184,25,89,185,186,129,108,6,7,80,22,65,26,24,11,10,5,12,13,14,187,188,189,64,20,29,19,66,67,68,190,128,191,192,193,69,194,157,195,75,79,81,70,137,158,97,159,196,71,197,198,33,17,110,199,200,139,105,113,201,202,203,85,86,87,204,205,206,207,208,23,98,154,82,83,34,209,210,211,92,212,90,213,214,125,215,127,133,120,216,146,150,15,217,72,218,219,76,220,109,221,116,117,118,30,111,114,115,103,119,121,222,223,224,225,226,18,227,140,122,123,228,229,230,231,232,91]),import.meta.url)).MarkdownlintPluginSection),A=v(async()=>(await t(async()=>{let{ProjectPluginsManageSection:e}=await import(`./LintingSection-CnZdwesC.js`);return{ProjectPluginsManageSection:e}},__vite__mapDeps([161,1,162,55,163,164,94,165,166,167,168,169,170,171,172,173,21,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,56,31,8,57,58,59,60,61,2,62,63,93,147,148,174,175,176,149,16,177,95,178,179,180,181,182,183,184,25,89,185,186,129,108,6,7,80,22,65,26,24,11,10,5,12,13,14,187,188,189,64,20,29,19,66,67,68,190,128,191,192,193,69,194,157,195,75,79,81,70,137,158,97,159,196,71,197,198,33,17,110,199,200,139,105,113,201,202,203,85,86,87,204,205,206,207,208,23,98,154,82,83,34,209,210,211,92,212,90,213,214,125,215,127,133,120,216,146,150,15,217,72,218,219,76,220,109,221,116,117,118,30,111,114,115,103,119,121,222,223,224,225,226,18,227,140,122,123,228,229,230,231,232,91]),import.meta.url)).ProjectPluginsManageSection),j=v(async()=>(await t(async()=>{let{UserPluginsManageSection:e}=await import(`./LintingSection-CnZdwesC.js`);return{UserPluginsManageSection:e}},__vite__mapDeps([161,1,162,55,163,164,94,165,166,167,168,169,170,171,172,173,21,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,56,31,8,57,58,59,60,61,2,62,63,93,147,148,174,175,176,149,16,177,95,178,179,180,181,182,183,184,25,89,185,186,129,108,6,7,80,22,65,26,24,11,10,5,12,13,14,187,188,189,64,20,29,19,66,67,68,190,128,191,192,193,69,194,157,195,75,79,81,70,137,158,97,159,196,71,197,198,33,17,110,199,200,139,105,113,201,202,203,85,86,87,204,205,206,207,208,23,98,154,82,83,34,209,210,211,92,212,90,213,214,125,215,127,133,120,216,146,150,15,217,72,218,219,76,220,109,221,116,117,118,30,111,114,115,103,119,121,222,223,224,225,226,18,227,140,122,123,228,229,230,231,232,91]),import.meta.url)).UserPluginsManageSection),M=v(async()=>(await t(async()=>{let{NetworkAccessSection:e}=await import(`./NetworkAccessSection-D-Rln6zh.js`);return{NetworkAccessSection:e}},__vite__mapDeps([233,1,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,8,57,58,59,60,61,2,62,63,108,6,7,80,22,65,26,24,11,10,5,28,29,30,13,14,12,18,19,20,21,15,16,23,25,98,35,234,87,143]),import.meta.url)).NetworkAccessSection),N=v(async()=>(await t(async()=>{let{OkignoreSection:e}=await import(`./OkignoreSection-BDDJUSqF.js`);return{OkignoreSection:e}},__vite__mapDeps([235,1,236,8,4,2,3,19,20,21,6,7,14,22,9,10,11,66,16,237,75,81,31,203,56,179,180,48,47,181,63,50,184,85,86,44,87,36,185,204,205,206,207,51,18,15,23,24,25,238,26,98,34,144,239]),import.meta.url)).OkignoreSection),P=v(async()=>(await t(async()=>{let{ProjectTemplatesSection:e}=await import(`./ProjectTemplatesSection-CjX7q09w.js`);return{ProjectTemplatesSection:e}},__vite__mapDeps([240,1,2,3,4,139,16,9,241,56,108,6,7,8,80,22,65,26,24,11,10,116,117,118,20,21,14,29,30,66,70,242,95,81,31,43,44,45,46,47,48,49,50,51,52,53,36,219,17,79,122,5,123,98,142,85,86,87,243,204,18,19,15,23,25,34,231,89,91,92,93,94]),import.meta.url)).ProjectTemplatesSection),F=v(async()=>(await t(async()=>{let{SearchSection:e}=await import(`./SearchSection-B0BR_xQy.js`);return{SearchSection:e}},__vite__mapDeps([244,1,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,8,57,58,59,60,61,2,62,63,68,6,7,12,13,14,10,11,70,16,245,85,86,87,18,19,20,21,22,15,23,24,25,26,79,80,65,81,122,5,123,98,35,143]),import.meta.url)).SearchSection),I=v(async()=>(await t(async()=>{let{SkillsManagerSection:e}=await import(`./SkillsManagerSection-1FLLRX0x.js`);return{SkillsManagerSection:e}},__vite__mapDeps([246,1,2,3,4,108,6,7,8,80,22,65,9,26,24,11,10,16,157,116,117,118,20,21,14,29,30,66,70,97,95,31,114,19,111,113,115,42,103,119,120,121,53,36,222,18,15,23,25,79,81,98,34,226,56,43,44,45,46,47,48,49,50,51,52,85,86,87,204,215,225,212,231,89,206,207,214,125,124]),import.meta.url)).SkillsManagerSection),L=v(async()=>(await t(async()=>{let{SlidesPluginSection:e}=await import(`./SlidesPluginSection-B_E2apho.js`);return{SlidesPluginSection:e}},__vite__mapDeps([247,1,2,3,4,15,16,74,9,202,19,20,21,6,7,8,14,22,10,11,66,97,26,24,77,78,45,44,46,47,18,23,25,248,98,142,91,92,93,94]),import.meta.url)).SlidesPluginSection),R=v(async()=>(await t(async()=>{let{SyncSection:e}=await import(`./SyncSection-_5olS0th.js`);return{SyncSection:e}},__vite__mapDeps([249,1,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,8,57,58,59,60,61,2,62,63,64,20,21,6,7,14,29,22,65,19,10,11,13,16,66,67,68,136,30,24,38,69,15,70,71,72,17,73,74,75,76,77,78,23,26,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,96,97,98,25,250,5,28,187,163,164,165,166,167,168,169,170,171,172,173,162,147,148,174,175,176,149,177,95,178,179,180,181,182,183,184,185,186,129,188,189,12,190,128,191,192,193,194,157,195,137,158,159,196,197,198,33,110,199,200,139,105,113,201,202,203,204,205,206,207,208,154,34,209,210,211,212,213,214,125,215,127,133,120,216,122,123,142,251,18]),import.meta.url)).SyncSection),z=v(async()=>(await t(async()=>{let{TerminalSection:e}=await import(`./TerminalSection-EfwpofBq.js`);return{TerminalSection:e}},__vite__mapDeps([252,1,39,40,41,42,4,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,55,56,31,8,57,58,59,60,61,2,62,63,12,6,7,13,14,10,11,18,19,20,21,22,15,16,23,24,25,253,87,35]),import.meta.url)).TerminalSection),B=v(async()=>(await t(async()=>{let{ThemePluginSection:e}=await import(`./ThemePluginSection-DSJaRBB-.js`);return{ThemePluginSection:e}},__vite__mapDeps([254,1,2,3,4,5,6,7,8,9,10,11,15,16,42,31,43,44,45,46,47,48,49,50,51,52,53,36,255,141,135,40,64,20,21,14,29,22,65,19,13,66,67,12,136,30,24,137,138,28,112,61,139,140,95,75,26,79,80,81,122,123,98,34,142,54,55,56,57,60,62,63,87,143,18,23,25,144,239,256]),import.meta.url)).ThemePluginSection),V=v(async()=>{let{LINT_PLUGIN_UI:e}=await t(async()=>{let{LINT_PLUGIN_UI:e}=await import(`./lint-plugins-Cf5g-Z--.js`);return{LINT_PLUGIN_UI:e}},__vite__mapDeps([257,217,16,1,4,161,162,55,163,164,94,165,166,167,168,169,170,171,172,173,21,39,40,41,42,9,3,43,44,45,46,47,48,49,50,51,52,53,36,54,56,31,8,57,58,59,60,61,2,62,63,93,147,148,174,175,176,149,177,95,178,179,180,181,182,183,184,25,89,185,186,129,108,6,7,80,22,65,26,24,11,10,5,12,13,14,187,188,189,64,20,29,19,66,67,68,190,128,191,192,193,69,194,157,195,75,79,81,70,137,158,97,159,196,71,197,198,33,17,110,199,200,139,105,113,201,202,203,85,86,87,204,205,206,207,208,23,98,154,82,83,34,209,210,211,92,212,90,213,214,125,215,127,133,120,216,146,150,15,72,218,219,76,220,109,221,116,117,118,30,111,114,115,103,119,121,222,223,224,225,226,18,227,140,122,123,228,229,230,231,232,91]),import.meta.url);return function({id:t}){let n=e.find(e=>e.id===t);if(!n)return null;let r=n.Section;return(0,_.jsx)(r,{})}}),H=c(async()=>{let[{BoundSchemaSection:e},{OkCliPathRow:n},{SpellingSettings:r}]=await Promise.all([t(()=>import(`./schema-section-Bn1HnUE0.js`),__vite__mapDeps([255,1,2,3,4,141,7,5,6,8,9,10,11,31,135,40,64,20,21,14,29,22,65,19,13,16,66,67,12,136,30,24,137,138,28,112,61,42,139,140,95,75,43,44,45,46,47,48,49,50,51,52,53,36,26,79,80,81,122,123,98,34,142,54,55,56,57,60,62,63,87,143,18,15,23,25,144,239]),import.meta.url),t(()=>import(`./OkCliPathRow-Dn-a2z6P.js`),__vite__mapDeps([258,1,2,3,4,109,6,7,8,13,14,66,16,110,9,10,11,5,19,20,21,22,33,31,26,24,35,36]),import.meta.url),t(()=>import(`./SpellingSettings-CDk5F0uz.js`),__vite__mapDeps([259,1,21,20,6,7,4,8,3,14,56,2,12,13,9,10,11,19,22,66,16,140,81,31,178,135,40,64,29,65,67,136,30,24,137,138,28,112,61,42,139,95,75,141,5,43,44,45,46,47,48,49,50,51,52,53,36,26,79,80,122,123,98,34,142,54,55,57,60,62,63,87,143,153]),import.meta.url)]);return{default:function({title:t,description:i,binding:a}){return(0,_.jsx)(e,{title:t,description:i,scope:`user`,scopeBadge:`user`,binding:a,fields:p,slotsAfter:{"appearance.theme":(0,_.jsx)(n,{}),"appearance.language":(0,_.jsx)(r,{})}})}}}),U=H.preload;function W(e){let t=(0,h.c)(4),{loadFailed:n}=e;if(!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(T,{}),t[0]=e):e=t[0],e}let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,_.jsx)(s,{"aria-hidden":`true`}),t[1]=r):r=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,_.jsx)(u,{children:(0,_.jsx)(i,{id:`PXg8xK`})}),t[2]=a):a=t[2];let o;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,_.jsxs)(d,{"data-testid":`settings-user-config-unavailable`,children:[r,a,(0,_.jsx)(l,{children:(0,_.jsx)(i,{id:`rFbQzX`})})]}),t[3]=o):o=t[3],o}function G(e){let t=(0,h.c)(37),{activeId:n,userBinding:r,userLoadFailed:o,okignoreBinding:s,okignoreSynced:c,markdownlintRuleQuery:l}=e,u=o===void 0?!1:o,{_:d}=a();if(n===`preferences`){let e;return t[0]!==d||t[1]!==r||t[2]!==u?(e=r?(0,_.jsx)(H,{title:d({id:`Q6hhn8`}),description:d({id:`Y_kL7X`}),binding:r}):(0,_.jsx)(W,{loadFailed:u}),t[0]=d,t[1]=r,t[2]=u,t[3]=e):e=t[3],e}if(n===`project-preferences`){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(i,{id:`Q6hhn8`}),t[4]=e):e=t[4];let n;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,_.jsxs)(`section`,{"aria-labelledby":`settings-project-preferences-title`,className:`space-y-8`,"data-testid":`settings-project-preferences`,children:[(0,_.jsx)(m,{titleId:`settings-project-preferences-title`,title:e,scope:`project`,children:(0,_.jsx)(i,{id:`FKVmcC`})}),(0,_.jsx)(C,{}),(0,_.jsx)(w,{}),f()?(0,_.jsx)(z,{}):null]}),t[5]=n):n=t[5],n}if(n===`agent-connections`){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(S,{}),t[6]=e):e=t[6],e}if(n===`hotkeys`){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(E,{}),t[7]=e):e=t[7],e}if(n===`account`){let e;return t[8]!==r||t[9]!==u?(e=r?(0,_.jsx)(x,{userBinding:r}):(0,_.jsx)(W,{loadFailed:u}),t[8]=r,t[9]=u,t[10]=e):e=t[10],e}if(n===`sync`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsxs)(`section`,{"aria-labelledby":`settings-sync-sharing-title`,className:`space-y-8`,"data-testid":`settings-sync-sharing`,children:[(0,_.jsx)(m,{titleId:`settings-sync-sharing-title`,title:(0,_.jsx)(i,{id:`AznQ2V`}),children:(0,_.jsx)(i,{id:`HADdBA`})}),(0,_.jsx)(R,{}),(0,_.jsx)(b,{})]}),t[11]=e):e=t[11],e}if(n===`search`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(F,{}),t[12]=e):e=t[12],e}if(n===`link-previews`){let e;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(O,{}),t[13]=e):e=t[13],e}if(n===`plugins-manage`){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(A,{}),t[14]=e):e=t[14],e}if(n===`user-plugins-manage`){let e;return t[15]===r?e=t[16]:(e=(0,_.jsx)(j,{userBinding:r}),t[15]=r,t[16]=e),e}if(n===`plugin:theme`){let e;return t[17]!==r||t[18]!==u?(e=r?(0,_.jsx)(B,{userBinding:r}):(0,_.jsx)(W,{loadFailed:u}),t[17]=r,t[18]=u,t[19]=e):e=t[19],e}if(n===`plugin:slides`){let e;return t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(L,{}),t[20]=e):e=t[20],e}if(n===`plugin:markdownlint`){let e=l??null,n;return t[21]===e?n=t[22]:(n=(0,_.jsx)(k,{initialRuleQuery:e}),t[21]=e,t[22]=n),n}if(n.startsWith(`plugin:`)){let e;t[23]===n?e=t[24]:(e=n.slice(7),t[23]=n,t[24]=e);let r;return t[25]!==n||t[26]!==e?(r=(0,_.jsx)(V,{id:e},n),t[25]=n,t[26]=e,t[27]=r):r=t[27],r}if(n===`project-templates`){let e;return t[28]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(P,{}),t[28]=e):e=t[28],e}if(n===`skills`){let e;return t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(I,{scope:`project`}),t[29]=e):e=t[29],e}if(n===`user-skills`){let e;return t[30]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(I,{scope:`global`}),t[30]=e):e=t[30],e}if(n===`okignore`){let e;return t[31]!==s||t[32]!==c?(e=(0,_.jsx)(N,{binding:s,synced:c}),t[31]=s,t[32]=c,t[33]=e):e=t[33],e}if(n===`network-access`){let e;return t[34]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(M,{}),t[34]=e):e=t[34],e}if(n===`claude-desktop`){let e;return t[35]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(D,{}),t[35]=e):e=t[35],e}if(n===`about`){let e;return t[36]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(y,{}),t[36]=e):e=t[36],e}return null}export{G as SettingsDialogBody,U as preloadPreferencesSection};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t}from"./constants-product-BVSOzxVs.js";function n(){return e(typeof window>`u`?null:window.okDesktop?.cliCommandName)}function r(){return n().cliCommandNames[0]}function i(...e){return t(n(),...e)}export{i as n,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./saved-themes-client-B4QZmuf_.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./field-controls-pq-AYiCQ.js";export{e as SectionSkeleton};
|