@inkeep/open-knowledge 0.75.0 → 0.76.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/{chunk-XKWWSDBF-CiyukTrj.mjs → chunk-XKWWSDBF-D2uvTQ0O.mjs} +2 -2
- package/dist/cli.mjs +56 -56
- package/dist/constants-CqleiXu2.mjs +1 -0
- package/dist/dist-BYaz0taZ.mjs +1 -0
- package/dist/{dist-CwMAFvDv.mjs → dist-D0pUzrgW.mjs} +467 -467
- package/dist/{flag-coverage-6JEX67RU-Byy8DkC9.mjs → flag-coverage-6JEX67RU-DTi4Xp7_.mjs} +1 -1
- package/dist/index.mjs +55 -55
- package/dist/init-CzdH5YhF.mjs +1 -0
- package/dist/{init-DLDxilxo.mjs → init-D35_7qCz.mjs} +14 -14
- package/dist/{js-exec-VXN6TZ7U-D--44jnh.mjs → js-exec-VXN6TZ7U-CMKRxSof.mjs} +3 -3
- package/dist/{js-exec-VXN6TZ7U-Z8_USGOo.mjs → js-exec-VXN6TZ7U-DW1z0_f3.mjs} +4 -4
- package/dist/{launch-json-removal-Dne2MJOy.mjs → launch-json-removal-DfVWRHc2.mjs} +1 -1
- package/dist/{loader-0uPLVRGr.mjs → loader-Il_r9h-s.mjs} +1 -1
- package/dist/loader-TircuzL8.mjs +1 -0
- package/dist/{md-manager-BGnqyqi1-Bwg54lLG.mjs → md-manager-BGnqyqi1-BZhj8566.mjs} +1 -1
- package/dist/{open-browser-BhyyMblU.mjs → open-browser-5wS5161m.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-Bs9fHq-d.mjs → preview-B_F6SpZs.mjs} +1 -1
- package/dist/preview-D14ciGsV.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-CzSm_J9T.js → ActivityModeContent-CdOOmDnv.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-BSIajwKD.js → AddPropertiesButton-D94DERhh.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-Vp3earvv.js → AgentDiffPane-BYWv05nU.js} +1 -1
- package/dist/public/assets/{AgentIconCluster-CfR3DGT6.js → AgentIconCluster-BjhMMJvg.js} +1 -1
- package/dist/public/assets/AgentThreadClientBinder-9BUeCC2i.js +1 -0
- package/dist/public/assets/{BugReportHistory-wGv5lBCh.js → BugReportHistory-DRk2wfmX.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-BO-UIVXb.js → BugReportHistoryDialog-BRt_mvxb.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-s4NvdTOo.js → CodeMirrorPropInput-BfFHUIPT.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-Bf0K9cnD.js → ConsentDialogBody-LH1oK-K1.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DBwmHY1V.js → DiffViewBoundary-CHGMiI3o.js} +1 -1
- package/dist/public/assets/{DocumentContext-VTBMqEb0.js → DocumentContext-CmobwhDV.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-Cpv-xFsl.js → EditorModeToggle-Ceb7UENC.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-rknOqm6H.js → EnableSyncConfirmDialog-3Y8YTBbR.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-CBg9Pna8.js → ExcalidrawDocEditor-BGifKKc5.js} +1 -1
- package/dist/public/assets/FeedbackForm-DcQmM7vN.js +1 -0
- package/dist/public/assets/{GraphPanel-m6aQydCS.js → GraphPanel-7OJGN-lc.js} +1 -1
- package/dist/public/assets/{ImageAttachments-D7kmZzVk.js → ImageAttachments-NcjC3Vh7.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-BI9tnsOw.js → ImportSkillDialog-uibV-E0W.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CfOGOym9.js → LintConfigEditor-oHvdt6bD.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BPFT0XnN.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-DRTI5JKU.js → ManagedArtifactProperties-DYixzgyO.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-QKcOaTIl.js → MermaidDocEditor-BAXy9Wq3.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-eAQLnvt7.js → OpenInAgentMenuItem-BOkiSyJj.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-C9msjkJt.js → PropertyDisplayRow-CpY_83p_.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-Dgk7CcwE.js → RegisteredAgentIcon-wza-YtV5.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-BveANp3B.js → ReportBugDialogBody-DzspPXQX.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-NLoVL3Gm.js → ReportBugMenuTrigger-lEPMbjE8.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-bEeFeqG6.js → SchemaConfigEditor-eP12D_vE.js} +1 -1
- package/dist/public/assets/SessionsHost-CzyeLm35.js +2 -0
- package/dist/public/assets/{SettingsDialogBody-DFXMWMS1.js → SettingsDialogBody-C2rIl4ig.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-jrcdgIkL.js → ShareBranchSwitchDialog-Cf-6mqfV.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-CDTgu8xc.js → ShareReceiveDialog-BhARlQ5y.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BykGxE_N.js → ShareReceiveMissDialog-gQIfuuKz.js} +1 -1
- package/dist/public/assets/{SkillCostValue-r8mvVMOq.js → SkillCostValue-yjmq3zbE.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-c7ur7sSM.js → SkillEditBanner-Dm70GN3t.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-Ic7tntCg.js → SkillForkDialog-C11FyNmp.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BGASnDM4.js → SkillInstallMenu-B6dyzecr.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DwtGd5e7.js → SkillOriginInline-DE7ODwX7.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-B8D29s9Q.js → SkillToolbarControls-BIaHc8_B.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-BgRd-P2G.js → SlidesToolbarControls-DFQKJb27.js} +1 -1
- package/dist/public/assets/{SourceEditor-Ctz1tHsS.js → SourceEditor-CFRWKhn6.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BJyuuxKR.js → TerminalPanel-DJScfB1V.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Y7aeyyGV.js → TerminalWindowApp-BeR-4EEA.js} +1 -1
- package/dist/public/assets/{TextDocEditor-BLQhPeRb.js → TextDocEditor-DzoiPoBH.js} +1 -1
- package/dist/public/assets/ThreadView-NfCjKVQa.js +18 -0
- package/dist/public/assets/{TimelineDiffPane-wNltJ4Ra.js → TimelineDiffPane-BY_OH8iK.js} +1 -1
- package/dist/public/assets/{agent-connection-status-B2_APHCy.js → agent-connection-status-GVtpWcVR.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DCTSUKSp.js → auth-state-cache-DjjuYX83.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-Bo0jFt7g.js → bug-report-send-manager-nPQrCST0.js} +1 -1
- package/dist/public/assets/client-version-BEkfNJSO.js +1 -0
- package/dist/public/assets/{comment-chips-Ow_-FlnX.js → comment-chips-Bk3eU3-K.js} +1 -1
- package/dist/public/assets/{config-provider-C_s4gZBL.js → config-provider-CMsrN7B5.js} +1 -1
- package/dist/public/assets/{css-color-to-hex-B5CKvtuo.js → css-color-to-hex-SSX32gXw.js} +1 -1
- package/dist/public/assets/{dist-C7TUqndm.js → dist-868Gd8gd.js} +1 -1
- package/dist/public/assets/{doc-paths-DVIJKJSX.js → doc-paths-ZgPMU9hv.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-Djgkf6Ty.js → doc-undo-manager-B9iAscTZ.js} +1 -1
- package/dist/public/assets/{documents-events-Bns9VJKK.js → documents-events-DyVmV0Qo.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BmZKZ3bW.js → file-tree-adapter-gYa-13I5.js} +1 -1
- package/dist/public/assets/{file-tree-utils-C1D_vfHU.js → file-tree-utils-Cz4iVcHq.js} +1 -1
- package/dist/public/assets/{folder-config-api-BfxvdHun.js → folder-config-api-CL7I86xK.js} +1 -1
- package/dist/public/assets/{index-BnGYK33w.js → index-CqL8TQF5.js} +8 -8
- package/dist/public/assets/{launch-agent-thread-BwjhT4xd.js → launch-agent-thread-CssNYKh8.js} +1 -1
- package/dist/public/assets/{lint-config-client-CGzxmNPs.js → lint-config-client-DkLK3D4G.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DMrzttBP.js → markdownlint-rule-browser-D9Z_1KbZ.js} +1 -1
- package/dist/public/assets/messages-BAMdRODV.js +1 -0
- package/dist/public/assets/messages-BAY3MkPp.js +1 -0
- package/dist/public/assets/messages-BDdtHSCo.js +1 -0
- package/dist/public/assets/messages-BEF3wxiG.js +1 -0
- package/dist/public/assets/messages-BT0aZGab.js +1 -0
- package/dist/public/assets/messages-BmlevpVU.js +1 -0
- package/dist/public/assets/messages-CR-7ufDn.js +1 -0
- package/dist/public/assets/messages-CYKphHSL.js +1 -0
- package/dist/public/assets/messages-DiEzyUul.js +1 -0
- package/dist/public/assets/messages-gadlKE8F.js +1 -0
- package/dist/public/assets/messages-phBEtaqq.js +1 -0
- package/dist/public/assets/messages-q0qKAdXk.js +1 -0
- package/dist/public/assets/{navigation-targets-BgJZCIoO.js → navigation-targets-Dz7Mj6yW.js} +1 -1
- package/dist/public/assets/{page-list-cache-BZw1nTat.js → page-list-cache-CLQGWEib.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BdbD8RKg.js → pending-receive-nav-store-BIPhAGuN.js} +1 -1
- package/dist/public/assets/{progress-aeBz2HU-.js → progress-65clsNyb.js} +1 -1
- package/dist/public/assets/{project-paths-DuOPax72.js → project-paths-BXwPEPQG.js} +1 -1
- package/dist/public/assets/{prop-types-Dftq6RlG.js → prop-types-xcUPxUpJ.js} +1 -1
- package/dist/public/assets/{receive-store-BbICc2Yx.js → receive-store-C_l3XIQE.js} +1 -1
- package/dist/public/assets/{selection-context-DP-78Xcc.js → selection-context-Daqo73OD.js} +1 -1
- package/dist/public/assets/{skill-scope-CkRSHwP9.js → skill-scope-BUi8busH.js} +1 -1
- package/dist/public/assets/{skills-api-GG_S3DLj.js → skills-api-Cx2rJHH9.js} +1 -1
- package/dist/public/assets/{src-Ct05JYMM.js → src-CsTdoUyS.js} +1 -1
- package/dist/public/assets/{startup-marks-CKAHlbx0.js → startup-marks-C-4hCO0g.js} +1 -1
- package/dist/public/assets/{tag-pill-input-A3lclZkc.js → tag-pill-input-nlqSiq7s.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DQczLMCj.js → target-navigation-intent-B26HXIhC.js} +1 -1
- package/dist/public/assets/{telemetry-impl-FpJNQg4h.js → telemetry-impl-D_RVw4yU.js} +1 -1
- package/dist/public/assets/{telemetry-startup-Djr7mtRi.js → telemetry-startup-DP4JWcg4.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BJNZ23_x.js → terminal-cli-display-OF8nDzxb.js} +1 -1
- package/dist/public/assets/{terminal-command-events-D8Y8z7dv.js → terminal-command-events-DQbD5--h.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-QgAdHjFE.js → terminal-launch-events-BI8c6JIE.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-CRewSDIM.js → terminal-telemetry-BiZK7c9d.js} +1 -1
- package/dist/public/assets/thread-client-CIJy1Jbh.js +4 -0
- package/dist/public/assets/{typing-burst-detector-CgSdfwf_.js → typing-burst-detector-CoSim2VF.js} +1 -1
- package/dist/public/assets/{uninstall-DUiCf7pq.js → uninstall-DxE_1wQZ.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DyfkOyNE.js → use-activity-panel-BMVu95Hl.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-CVLULaMd.js → use-apply-config-language-DmbZDqgv.js} +2 -2
- package/dist/public/assets/{use-collab-url-DwsJjcme.js → use-collab-url-Bm6gv2VZ.js} +1 -1
- package/dist/public/assets/{use-conflicts-DA5fcbwd.js → use-conflicts-D-6loWer.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-CD1keqML.js → use-live-xterm-theme-BSNONOSQ.js} +1 -1
- package/dist/public/assets/{use-open-skill-DTAAdX5Q.js → use-open-skill-DpbstiSZ.js} +1 -1
- package/dist/public/assets/{use-settings-route-1U5FeWiG.js → use-settings-route-Dmjvvjxd.js} +1 -1
- package/dist/public/assets/{use-skill-origin-B5IZoMvy.js → use-skill-origin-BJ_uQdjo.js} +1 -1
- package/dist/public/assets/{use-skills-BBxerxq6.js → use-skills-CpkfrpBl.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BpShfZnI.js → use-terminal-enabled-3W1PH2lM.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-B64sKe7y.js → use-timeline-entry-diff-CmQbpKDX.js} +1 -1
- package/dist/public/assets/{use-workspace-Bs75Zv0f.js → use-workspace-uVXshHxD.js} +1 -1
- package/dist/public/index.html +56 -56
- package/dist/public/uninstall.html +4 -4
- package/dist/{python3-DNGS4G3E-CixyRGKv.mjs → python3-DNGS4G3E-DSWx_2Ia.mjs} +3 -3
- package/dist/{python3-DNGS4G3E-CRyO5yp1.mjs → python3-DNGS4G3E-Dpff_XiH.mjs} +2 -2
- package/dist/{registry-probes-CExYC4JQ.mjs → registry-probes-DNinJw94.mjs} +9 -9
- package/dist/{removal-file-path-C4FKyv5P.mjs → removal-file-path-dEH5rj0t.mjs} +1 -1
- package/dist/{repair-launch-json-q0aPdNfe.mjs → repair-launch-json-C_rI6C8x.mjs} +1 -1
- package/dist/{repair-mcp-configs-B_953vzu.mjs → repair-mcp-configs-CrbbtGdf.mjs} +1 -1
- package/dist/{sqlite3-TE5AIOTF-BK092fD6.mjs → sqlite3-TE5AIOTF-ButYCorg.mjs} +1 -1
- package/dist/{sqlite3-TE5AIOTF-DVwda1Ow.mjs → sqlite3-TE5AIOTF-D4yhY7wL.mjs} +3 -3
- package/dist/{src-CW_nJTbi.mjs → src-B76XllMS.mjs} +5 -5
- package/dist/src-BRZrtrdn.mjs +1 -0
- package/dist/start-BJfBxH26.mjs +5 -0
- package/dist/start-Dyk3zIJw.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-DKYqY2-e.mjs +0 -1
- package/dist/dist-Cv5tSkiZ.mjs +0 -1
- package/dist/init-CbL29jRL.mjs +0 -1
- package/dist/loader-CI812yys.mjs +0 -1
- package/dist/preview-OfoLn7xp.mjs +0 -1
- package/dist/public/assets/AgentThreadClientBinder-CdZPAsLH.js +0 -1
- package/dist/public/assets/FeedbackForm-Du0fmw9j.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DaAHI3fg.js +0 -1
- package/dist/public/assets/SessionsHost-B_1YvEBI.js +0 -2
- package/dist/public/assets/ThreadView-0u0o8ib8.js +0 -18
- package/dist/public/assets/client-version-f7m94OcB.js +0 -1
- package/dist/public/assets/messages-B1nSTUib.js +0 -1
- package/dist/public/assets/messages-Bpy2LxD1.js +0 -1
- package/dist/public/assets/messages-CX7QlbB5.js +0 -1
- package/dist/public/assets/messages-ChaFm4nX.js +0 -1
- package/dist/public/assets/messages-ClP1rPcb.js +0 -1
- package/dist/public/assets/messages-DSWauZRi.js +0 -1
- package/dist/public/assets/messages-DYZGu9n6.js +0 -1
- package/dist/public/assets/messages-DZlA_YKm.js +0 -1
- package/dist/public/assets/messages-Dg6rGsBw.js +0 -1
- package/dist/public/assets/messages-DrhSLGBr.js +0 -1
- package/dist/public/assets/messages-M06K4cBB.js +0 -1
- package/dist/public/assets/messages-ZbMG_CHm.js +0 -1
- package/dist/public/assets/thread-client-B90HGYWT.js +0 -4
- package/dist/src-D2iK9raE.mjs +0 -1
- package/dist/start-2RZWW7tN.mjs +0 -1
- package/dist/start-BbiKYI_Y.mjs +0 -5
|
@@ -1 +1 @@
|
|
|
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{t as o}from"./AgentIconCluster-CfR3DGT6.js";import{t as s}from"./button-Cym3gapE.js";import{i as c,n as l,t as u}from"./tooltip-BnyyQDRs.js";import{a as d,c as f,i as p,n as m,o as h,s as g,t as _}from"./dialog-DgIQr9zS.js";import{a as v,c as y,i as b,l as x,n as S,o as C,r as w,s as T,t as E}from"./alert-dialog-CrZSZ5Zj.js";import{t as D}from"./checkbox-Crs_F_Np.js";import{t as O}from"./label-D-K3fWtj.js";import{$r as k,Cc as A,Gc as j,Gi as M,Jc as N,Kc as P,Os as F,Sc as I,Tn as L,Wc as R,a as ee,jn as z,kc as B,mc as V,qc as H,wc as U,xc as W}from"./dist-C7TUqndm.js";import{t as G}from"./dist-Cr4-nBVI.js";import{t as te}from"./folder-C4F4ia-z.js";import{t as K}from"./info-CilGMBpP.js";import{t as ne}from"./monitor-BZlB-tXl.js";import{t as q}from"./sparkles-CKoBZZKl.js";import{t as re}from"./triangle-alert-CCeXtPLU.js";import{t as J}from"./x-DIayTyoR.js";import{t as ie}from"./badge-Ct5y0ScC.js";import{t as Y}from"./tool-list-format-CAqZbZya.js";import{c as ae,l as X,n as oe,s as se,t as ce}from"./field-CuGdn_wl.js";var Z={actions:[],conflicts:[],withheld:[]};function Q(e){return{ok:!1,report:Z,snapshot:null,error:e}}function le(e){return e.conflicts.length===0&&e.actions.every(e=>e.errorId===void 0)}async function ue(e){let t=globalThis.window?.okDesktop;if(t!==void 0)try{let n=await t.agentIntegrations.apply({intents:e});return n.ok?{ok:!0,report:n.report,snapshot:n.snapshot}:{ok:!1,report:n.report,snapshot:n.snapshot,error:n.error,...n.unavailable===!0?{unavailable:!0}:{}}}catch(e){return{ok:!1,report:Z,snapshot:null,error:e instanceof Error?e.message:String(e)}}let n;try{n=await fetch(`/api/agent-integrations/apply`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({intents:e})})}catch(e){return Q(e instanceof Error?e.message:String(e))}if(!n.ok)return Q(`HTTP ${n.status} ${n.statusText}`.trimEnd());let r;try{r=await n.json()}catch(e){return Q(e instanceof Error?e.message:String(e))}let i=ee.safeParse(r);if(!i.success){let e=i.error.issues.map(e=>e.path.join(`.`));return console.warn(`[agent-connections] response schema drift`,{issues:e}),Q(`Unexpected response shape at ${e.join(`, `)}`)}let a={actions:i.data.actions,conflicts:i.data.conflicts,withheld:i.data.withheld};return{ok:le(a),report:a,snapshot:i.data.snapshot}}var de=new Set;function fe(e){return de.add(e),()=>{de.delete(e)}}async function pe(e){let t=await ue(e);if(e.length>0){let e=[...de];for(let n of e)try{n(t)}catch(e){console.warn(`[agent-connections] change listener failed:`,e)}}return t}var me=e(n(),1),he=a();function ge(e){if(e===void 0)return null;let t=B(e);if(t===null)return null;if(t.kind===`central-skill-store`)return`~/${F}/`;switch(t.kind){case`editor-project-config`:return j[t.editor];case`editor-project-skill-root`:{let e=P[t.editor];return e===null?null:`${e}/${N}/`}case`editor-user-skill-root`:{let e=H[t.editor];return e===null?null:`~/${e}/`}case`editor-user-config`:return null}}function _e(e,t){if(e===void 0||t.length===0)return[];let n=B(e);return n===null||n.kind===`central-skill-store`?[]:t.map(e=>ge(`${n.kind}:${e}`)).filter(e=>e!==null)}function ve(e){return typeof e==`string`?R[e]??e:null}function ye(e){if(e===void 0)return null;let t=ve(e.params?.agent);if(t===null)return null;switch(e.id){case`guidance.mcp.user-config`:return G._({id:`guidance.mcp.user-config`,values:{agent:t}});case`guidance.mcp.project-config`:return G._({id:`guidance.mcp.project-config`,values:{agent:t}});case`guidance.mcp.session-injection`:return G._({id:`guidance.mcp.session-injection`,values:{agent:t}});case`guidance.mcp.managed-file`:return G._({id:`guidance.mcp.managed-file`,values:{agent:t}});case`guidance.skill.project`:return G._({id:`guidance.skill.project`,values:{agent:t}});case`guidance.skill.user`:return G._({id:`guidance.skill.user`,values:{agent:t}});case`guidance.skill.central-store`:return G._({id:`guidance.skill.central-store`,values:{agent:t}});default:return null}}function be(e){if(e===void 0)return null;let t=ve(e.params?.agent);if(t===null)return null;switch(e.id){case`troubleshooting.claude.project-entry-not-approved`:return G._({id:`troubleshooting.claude.project-entry-not-approved`,values:{agent:t}});case`troubleshooting.claude-desktop.per-tool-approval`:return G._({id:`troubleshooting.claude-desktop.per-tool-approval`,values:{agent:t}});case`troubleshooting.cursor.project-entry-not-loaded`:return G._({id:`troubleshooting.cursor.project-entry-not-loaded`,values:{agent:t}});case`troubleshooting.codex.folder-trust`:return G._({id:`troubleshooting.codex.folder-trust`,values:{agent:t}});case`troubleshooting.codex.desktop-project-config`:return e.params?.honoredByDesktop===!0?null:G._({id:`troubleshooting.codex.desktop-project-config`,values:{agent:t}});case`troubleshooting.copilot.shared-workspace-config`:{let n=ve(e.params?.sourceAgent)??``;return G._({id:`troubleshooting.copilot.shared-workspace-config`,values:{agent:t,sourceAgent:n}})}case`troubleshooting.openclaw.central-store-missing`:return G._({id:`troubleshooting.openclaw.central-store-missing`,values:{agent:t}});case`troubleshooting.pi.folder-trust`:return G._({id:`troubleshooting.pi.folder-trust`,values:{agent:t}});case`troubleshooting.lm-studio.config-path-mismatch`:return G._({id:`troubleshooting.lm-studio.config-path-mismatch`,values:{agent:t}});default:return null}}function xe(e){return e?.closest(`section`)?.querySelector(`h4`)??null}var $=t(),Se={projectMcp:!1,projectSkill:!1,globalMcp:!1,discoverySkill:!1},Ce=[`projectMcp`,`projectSkill`,`globalMcp`,`discoverySkill`],we={projectMcp:`project`,projectSkill:`project`,globalMcp:`machine`,discoverySkill:`machine`};function Te(e,t){return Ce.flatMap(n=>{if(we[n]!==t)return[];let r=e.cells[n];return r===void 0?[]:[[n,r]]})}function Ee(e){return e.disabledReason!==null}function De(e){let t=new Set,n=new Map;for(let[r,i]of e){let e=[];if(i.checked&&!Ee(i))for(let n of i.troubleshooting){if(t.has(n.id))continue;let r=be(n);r!==null&&(t.add(n.id),e.push({id:n.id,text:r}))}n.set(r,e)}return n}function Oe(e){return e.scope===`project`&&e.piece===`mcp`?`projectMcp`:e.scope===`project`&&e.piece===`skill`?`projectSkill`:e.scope===`user`&&e.piece===`mcp`?`globalMcp`:e.scope===`user`&&e.piece===`skill`?`discoverySkill`:null}function ke(e){if(!V.includes(e.agentId))return null;let t=e.agentId,n={};for(let t of e.scopes)for(let e of t.cells){let t=Oe(e);t!==null&&(n[t]=e)}return{id:t,label:Ae(t),row:e,cells:n}}function Ae(e){return R[e]}function je(e){let t=(0,he.c)(5),{agentId:n,className:r}=e;if(n===`lm-studio`){let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(q,{"aria-hidden":!0,className:r,strokeWidth:1.5}),t[0]=r,t[1]=e),e}let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(o,{host:n,"aria-hidden":!0,className:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}function Me(e,{forceDetected:t=[]}={}){return z({agentIds:V,probes:e.probes,detection:{...e.detection,detected:[...e.detection.detected,...t]}}).rows.flatMap(e=>{let t=ke(e);return t===null?[]:[t]})}function Ne(e){return W.some(t=>U(t)===e)&&I.some(t=>A(t.id)===e)}function Pe(e){return{projectMcp:e.cells.projectMcp?.checked===!0,projectSkill:e.cells.projectSkill?.checked===!0,globalMcp:e.cells.globalMcp?.checked===!0,discoverySkill:e.cells.discoverySkill?.checked===!0}}function Fe(e){let t=Pe(e);return Ie(t)>0?t:Object.fromEntries(Ce.map(t=>{let n=e.cells[t];return[t,n!==void 0&&!Ee(n)&&!M(n.state)]}))}function Ie(e){return Object.values(e).filter(Boolean).length}function Le(e){return Object.values(e.cells).some(e=>!Ee(e))}function Re(e){let t=Object.values(e.cells);return t.length>0&&t.every(e=>e.checked)}function ze(e){let t=(0,he.c)(10),{children:n}=e,{_:r}=i(),a;t[0]===r?a=t[1]:(a=r({id:`kjrq_8`}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(K,{"aria-hidden":!0}),t[2]=o):o=t[2];let d;t[3]===a?d=t[4]:(d=(0,$.jsx)(c,{asChild:!0,children:(0,$.jsx)(s,{variant:`ghost`,size:`icon-sm`,"aria-label":a,children:o})}),t[3]=a,t[4]=d);let f;t[5]===n?f=t[6]:(f=(0,$.jsx)(l,{className:`max-w-72`,children:n}),t[5]=n,t[6]=f);let p;return t[7]!==d||t[8]!==f?(p=(0,$.jsxs)(u,{children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9],p}function Be(e){let t=(0,he.c)(16),{message:n,path:r,info:a}=e,{_:o}=i(),d;t[0]===o?d=t[1]:(d=o({id:`bn_MDX`}),t[0]=o,t[1]=d);let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(re,{"aria-hidden":!0}),t[2]=f):f=t[2];let p;t[3]===d?p=t[4]:(p=(0,$.jsx)(c,{asChild:!0,children:(0,$.jsx)(s,{variant:`ghost`,size:`icon-sm`,className:`text-amber-700 hover:text-amber-700 dark:text-amber-400 dark:hover:text-amber-400`,"aria-label":d,children:f})}),t[3]=d,t[4]=p);let m;t[5]===n?m=t[6]:(m=(0,$.jsx)(`span`,{className:`font-medium`,children:n}),t[5]=n,t[6]=m);let h;t[7]===r?h=t[8]:(h=r===null?null:(0,$.jsx)(`code`,{className:`wrap-break-word font-mono opacity-80`,children:r}),t[7]=r,t[8]=h);let g;t[9]!==a||t[10]!==m||t[11]!==h?(g=(0,$.jsx)(l,{className:`max-w-72`,children:(0,$.jsxs)(`span`,{className:`flex flex-col gap-1.5`,children:[m,a,h]})}),t[9]=a,t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;return t[13]!==p||t[14]!==g?(_=(0,$.jsxs)(u,{children:[p,g]}),t[13]=p,t[14]=g,t[15]=_):_=t[15],_}function Ve(e){let t=(0,he.c)(51),{id:n,checked:r,disabled:a,exception:o,state:s,title:c,description:l,info:u,path:d,sharedPaths:f,alsoAffects:p,notes:m,onCheckedChange:h}=e,{_:g}=i(),_=o===`warning`||o===`error`,v;t[0]!==g||t[1]!==_||t[2]!==s?(v=_?g(s===`foreign`?{id:`tCE-ZH`}:s===`foreign-replaceable`?{id:`KTxoDA`}:{id:`8wwkVu`}):null,t[0]=g,t[1]=_,t[2]=s,t[3]=v):v=t[3];let y=v,b=y===null?void 0:`${n}-warning`,x=p===null?void 0:`${n}-shared`,S;t[4]!==x||t[5]!==b?(S=[b,x].filter(Boolean).join(` `)||void 0,t[4]=x,t[5]=b,t[6]=S):S=t[6];let C=S,w=a||void 0,T;t[7]===h?T=t[8]:(T=e=>h(e===!0),t[7]=h,t[8]=T);let E;t[9]!==r||t[10]!==C||t[11]!==a||t[12]!==n||t[13]!==T?(E=(0,$.jsx)(`div`,{className:`flex h-7 items-center`,children:(0,$.jsx)(D,{id:n,checked:r,disabled:a,"aria-describedby":C,onCheckedChange:T})}),t[9]=r,t[10]=C,t[11]=a,t[12]=n,t[13]=T,t[14]=E):E=t[14];let k;t[15]===c?k=t[16]:(k=(0,$.jsx)(X,{children:c}),t[15]=c,t[16]=k);let A;t[17]!==n||t[18]!==k?(A=(0,$.jsx)(O,{htmlFor:n,className:`cursor-pointer`,children:k}),t[17]=n,t[18]=k,t[19]=A):A=t[19];let j;t[20]!==a||t[21]!==u||t[22]!==d||t[23]!==f||t[24]!==y?(j=y===null?(0,$.jsx)(ze,{children:(0,$.jsxs)(`span`,{className:`flex flex-col gap-1.5`,children:[u,d===null?null:(0,$.jsx)(`code`,{className:`wrap-break-word font-mono opacity-80`,children:d}),f.map(Ue)]})}):(0,$.jsx)(Be,{message:y,path:d,info:a?null:u}),t[20]=a,t[21]=u,t[22]=d,t[23]=f,t[24]=y,t[25]=j):j=t[25];let M;t[26]!==A||t[27]!==j?(M=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[A,j]}),t[26]=A,t[27]=j,t[28]=M):M=t[28];let N;t[29]===l?N=t[30]:(N=(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:l}),t[29]=l,t[30]=N);let P;t[31]!==n||t[32]!==m?(P=m.length===0?null:(0,$.jsx)(`div`,{className:`flex flex-col gap-1.5`,"data-testid":`${n}-troubleshooting`,children:m.map(He)}),t[31]=n,t[32]=m,t[33]=P):P=t[33];let F;t[34]!==g||t[35]!==p||t[36]!==x?(F=p===null?null:(0,$.jsx)(`p`,{id:x,className:`text-sm leading-relaxed text-amber-700 dark:text-amber-400`,children:g({id:`qze9od`,values:{alsoAffects:p}})}),t[34]=g,t[35]=p,t[36]=x,t[37]=F):F=t[37];let I;t[38]!==y||t[39]!==b?(I=b===void 0?null:(0,$.jsx)(`span`,{id:b,className:`sr-only`,children:y}),t[38]=y,t[39]=b,t[40]=I):I=t[40];let L;t[41]!==N||t[42]!==P||t[43]!==F||t[44]!==I||t[45]!==M?(L=(0,$.jsxs)(oe,{children:[M,N,P,F,I]}),t[41]=N,t[42]=P,t[43]=F,t[44]=I,t[45]=M,t[46]=L):L=t[46];let R;return t[47]!==L||t[48]!==w||t[49]!==E?(R=(0,$.jsxs)(ce,{orientation:`horizontal`,className:`items-start gap-3`,"data-disabled":w,children:[E,L]}),t[47]=L,t[48]=w,t[49]=E,t[50]=R):R=t[50],R}function He(e){return(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:e.text},e.id)}function Ue(e){return(0,$.jsx)(`code`,{className:`wrap-break-word font-mono opacity-80`,children:e},e)}function We(e,t){let n=e.cells[t];return n===void 0?!1:!Ee(n)}function Ge(e){let t=(0,he.c)(81),{part:n,cell:a,notes:o,draft:s,setPart:c}=e,{i18n:l,_:u}=i(),d;t[0]===a?d=t[1]:(d=Ee(a),t[0]=a,t[1]=d);let f=d,p;t[2]===u?p=t[3]:(p=u({id:`ggMMa7`}),t[2]=u,t[3]=p);let m;t[4]===u?m=t[5]:(m=u({id:`LtiJ5c`}),t[4]=u,t[5]=m);let h;t[6]===u?h=t[7]:(h=u({id:`2gXnCO`}),t[6]=u,t[7]=h);let g;t[8]===u?g=t[9]:(g=u({id:`ejiJeW`}),t[8]=u,t[9]=g);let _;t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==g?(_={projectMcp:p,projectSkill:m,globalMcp:h,discoverySkill:g},t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_):_=t[14];let v=_,y;if(t[15]!==u||t[16]!==a.agentId||t[17]!==a.disabledReason||t[18]!==a.exception||t[19]!==a.guidance||t[20]!==a.pathId||t[21]!==a.piece||t[22]!==a.resolvedPath||t[23]!==a.sharedFolderWith||t[24]!==a.state||t[25]!==f||t[26]!==s||t[27]!==l||t[28]!==o||t[29]!==n||t[30]!==c||t[31]!==v){y=Symbol.for(`react.early_return_sentinel`);bb0:{let e={foreign:u({id:`tCE-ZH`}),"structural-na":u({id:`3n7lnE`}),"not-installable":u({id:`BMoSQy`}),"agent-undetected":u({id:`mdWhUY`})},i=function(){let t=a.disabledReason;return t==null?u({id:`RXYvxn`}):e[t]},d;t[33]!==u||t[34]!==a.state?(d=a.state===`foreign-replaceable`?u({id:`S6SbxA`}):null,t[33]=u,t[34]=a.state,t[35]=d):d=t[35];let p=d,m;t[36]!==a.piece||t[37]!==a.sharedFolderWith||t[38]!==l?(m=a.piece===`skill`&&a.sharedFolderWith.length>0?Y(a.sharedFolderWith.map(at),l.locale):null,t[36]=a.piece,t[37]=a.sharedFolderWith,t[38]=l,t[39]=m):m=t[39];let h=m,g=a.exception,_=g===`warning`||g===`error`,b;t[40]!==a.pathId||t[41]!==a.sharedFolderWith?(b=_e(a.pathId,a.sharedFolderWith),t[40]=a.pathId,t[41]=a.sharedFolderWith,t[42]=b):b=t[42];let x=b,S;t[43]===a.guidance?S=t[44]:(S=ye(a.guidance),t[43]=a.guidance,t[44]=S);let C=S,w=`${a.agentId}-${n}`,T=s[n],E;t[45]!==a.pathId||t[46]!==a.resolvedPath||t[47]!==f||t[48]!==_?(E=f&&!_?null:a.resolvedPath??ge(a.pathId),t[45]=a.pathId,t[46]=a.resolvedPath,t[47]=f,t[48]=_,t[49]=E):E=t[49];let D;t[50]!==f||t[51]!==_||t[52]!==x?(D=f&&!_?[]:x,t[50]=f,t[51]=_,t[52]=x,t[53]=D):D=t[53];let O=f?null:h,k;t[54]!==n||t[55]!==c?(k=e=>c(n,e),t[54]=n,t[55]=c,t[56]=k):k=t[56];let A;t[57]!==a.state||t[58]!==f||t[59]!==g||t[60]!==o||t[61]!==w||t[62]!==T||t[63]!==E||t[64]!==D||t[65]!==O||t[66]!==k?(A={id:w,checked:T,disabled:f,exception:g,state:a.state,notes:o,path:E,sharedPaths:D,alsoAffects:O,onCheckedChange:k},t[57]=a.state,t[58]=f,t[59]=g,t[60]=o,t[61]=w,t[62]=T,t[63]=E,t[64]=D,t[65]=O,t[66]=k,t[67]=A):A=t[67];let j=A;switch(n){case`projectMcp`:{let e;t[68]===C?e=t[69]:(e=C??(0,$.jsx)(r,{id:`oxj8er`}),t[68]=C,t[69]=e),y=(0,$.jsx)(Ve,{...j,title:v[n],description:e,info:f?i():p??(0,$.jsx)(r,{id:`EBP_hA`})});break bb0}case`projectSkill`:{let e;t[70]===C?e=t[71]:(e=C??(0,$.jsx)(r,{id:`nta97o`}),t[70]=C,t[71]=e),y=(0,$.jsx)(Ve,{...j,title:v[n],description:e,info:f?i():(0,$.jsx)(r,{id:`n11Jj7`})});break bb0}case`globalMcp`:{let e;t[72]===C?e=t[73]:(e=C??(0,$.jsx)(r,{id:`itchkf`}),t[72]=C,t[73]=e),y=(0,$.jsx)(Ve,{...j,title:v[n],description:e,info:f?i():p??(0,$.jsx)(r,{id:`wgj--j`})});break bb0}case`discoverySkill`:{let e=v[n],a;t[74]===C?a=t[75]:(a=C??(0,$.jsx)(r,{id:`6ur2Mk`}),t[74]=C,t[75]=a);let o=f?i():(0,$.jsx)(r,{id:`uVhq9B`}),s;t[76]!==j||t[77]!==e||t[78]!==a||t[79]!==o?(s=(0,$.jsx)(Ve,{...j,title:e,description:a,info:o}),t[76]=j,t[77]=e,t[78]=a,t[79]=o,t[80]=s):s=t[80],y=s;break bb0}}}t[15]=u,t[16]=a.agentId,t[17]=a.disabledReason,t[18]=a.exception,t[19]=a.guidance,t[20]=a.pathId,t[21]=a.piece,t[22]=a.resolvedPath,t[23]=a.sharedFolderWith,t[24]=a.state,t[25]=f,t[26]=s,t[27]=l,t[28]=o,t[29]=n,t[30]=c,t[31]=v,t[32]=y}else y=t[32];if(y!==Symbol.for(`react.early_return_sentinel`))return y}function Ke(e){return e.piece===`mcp`&&e.scope===`project`?(0,$.jsx)(r,{id:`ggMMa7`}):e.piece===`skill`&&e.scope===`project`?(0,$.jsx)(r,{id:`LtiJ5c`}):e.piece===`mcp`&&e.scope===`user`?(0,$.jsx)(r,{id:`2gXnCO`}):e.piece===`skill`&&e.scope===`user`?(0,$.jsx)(r,{id:`ejiJeW`}):null}function qe(e,t,n,r){let i=e.report.conflicts.find(e=>e.kind===r);if(i===void 0)return null;let a=e=>Ce.find(n=>t.cells[n]?.satisfierId===e),[o,s]=i.satisfierIds,c=o===void 0?void 0:a(o),l=s===void 0?void 0:a(s);return c===void 0||l===void 0?null:{dependent:n[l],prerequisite:n[c],blockedReason:i.blockedReason}}function Je(e){let t=(0,he.c)(28),{result:n,connection:a}=e,{_:o}=i(),s;if(t[0]!==o||t[1]!==a||t[2]!==n){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e={projectMcp:o({id:`ggMMa7`}),projectSkill:o({id:`LtiJ5c`}),globalMcp:o({id:`2gXnCO`}),discoverySkill:o({id:`ejiJeW`})},t=qe(n,a,e,`prerequisite-unavailable`);if(t!==null){let{dependent:e,prerequisite:n}=t;s=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:(()=>{switch(t.blockedReason){case`foreign`:return o({id:`XrPvMT`,values:{dependent:e,prerequisite:n}});case`structural-na`:return o({id:`XNdXMR`,values:{dependent:e,prerequisite:n}});case`not-installable`:return o({id:`GTvYzA`,values:{dependent:e,prerequisite:n}});case`agent-undetected`:return o({id:`7Ny8bV`,values:{dependent:e,prerequisite:n}});default:return o({id:`h2QPvj`,values:{dependent:e,prerequisite:n}})}})()});break bb0}let r=qe(n,a,e,`prerequisite-removed`);if(r!==null){s=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:o({id:`5CHuXn`,values:{0:r.dependent,1:r.prerequisite}})});break bb0}}t[0]=o,t[1]=a,t[2]=n,t[3]=s}else s=t[3];if(s!==Symbol.for(`react.early_return_sentinel`))return s;if(n.unavailable===!0){let e;t[4]===o?e=t[5]:(e=o({id:`RD8cCw`}),t[4]=o,t[5]=e);let n;return t[6]===e?n=t[7]:(n=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:e}),t[6]=e,t[7]=n),n}let c;t[8]===o?c=t[9]:(c=e=>{switch(e.errorId){case`surface-missing`:return o({id:`3n7lnE`});case`foreign-artifact`:return o({id:`tCE-ZH`});case`no-writer`:case`not-installable`:return o({id:`BMoSQy`});case`dependency-failed`:return o({id:`1FXL-O`});case`write-declined`:return o({id:`_fZSIY`});case`write-failed`:case`executor-threw`:case`unrecognized-outcome`:return o({id:`dCforW`});default:return null}},t[8]=o,t[9]=c);let l=c,u=n.report.actions,d,f,p,m;if(t[10]!==l||t[11]!==n.error||t[12]!==n.report.actions){m=Symbol.for(`react.early_return_sentinel`);bb1:{let e;t[17]===l?e=t[18]:(e=e=>({key:e.satisfierId,title:Ke(e),managedInSkillsStudio:e.errorId===`no-writer`&&e.piece===`skill`&&e.scope===`user`,detail:l(e)}),t[17]=l,t[18]=e);let i=u.filter(Ze).map(e).filter(Xe);if(i.length===0){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{children:(0,$.jsx)(r,{id:`fWsBTs`})}),t[19]=e):e=t[19];let i;t[20]===n.error?i=t[21]:(i=n.error===void 0?null:(0,$.jsx)(`code`,{className:`block wrap-break-word font-mono text-xs opacity-80`,children:n.error}),t[20]=n.error,t[21]=i);let a;t[22]===i?a=t[23]:(a=(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-1 text-sm text-destructive`,children:[e,i]}),t[22]=i,t[23]=a),m=a;break bb1}d=`alert`,f=`space-y-2 text-sm text-destructive`,p=i.map(Ye)}t[10]=l,t[11]=n.error,t[12]=n.report.actions,t[13]=d,t[14]=f,t[15]=p,t[16]=m}else d=t[13],f=t[14],p=t[15],m=t[16];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;return t[24]!==d||t[25]!==f||t[26]!==p?(h=(0,$.jsx)(`div`,{role:d,className:f,children:p}),t[24]=d,t[25]=f,t[26]=p,t[27]=h):h=t[27],h}function Ye(e){return(0,$.jsxs)(`div`,{className:`space-y-1`,children:[e.title===null?null:(0,$.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,$.jsx)(`p`,{children:e.managedInSkillsStudio?(0,$.jsx)(r,{id:`5RiC8D`}):e.detail})]},e.key)}function Xe(e){return e.managedInSkillsStudio||e.detail!==null}function Ze(e){return e.errorId!==void 0}function Qe(){let e=(0,he.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(r,{id:`s8difl`})}),e[0]=t):t=e[0],t}function $e(e){let t=(0,he.c)(5),{label:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=r({id:`74Mikl`,values:{label:n}}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]===a?o=t[4]:(o=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),t[3]=a,t[4]=o),o}function et(e){let t=(0,he.c)(5),{label:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=r({id:`2lJAvH`,values:{label:n}}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]===a?o=t[4]:(o=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),t[3]=a,t[4]=o),o}function tt(e){let t=(0,he.c)(133),{connection:n,open:a,onOpenChange:o,onSave:c,paired:l,onCloseAutoFocus:u}=e,v=l===void 0?!1:l,{i18n:y,_:b}=i(),x;t[0]===n?x=t[1]:(x=()=>n===null?Se:Fe(n),t[0]=n,t[1]=x);let[S,C]=(0,me.useState)(x),[w,T]=(0,me.useState)(!1),[E,D]=(0,me.useState)(null),[O,k]=(0,me.useState)(null),A;t[2]!==n||t[3]!==S?(A=n!==null&&Ce.some(e=>{let t=n.cells[e];return S[e]&&t!==void 0&&M(t.state)}),t[2]=n,t[3]=S,t[4]=A):A=t[4];let j=A,N;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e,t){C(n=>({...n,[e]:t})),k(null)},t[5]=N):N=t[5];let P=N,F;t[6]!==n||t[7]!==S?(F=n!==null&&!S.projectSkill&&We(n,`projectSkill`),t[6]=n,t[7]=S,t[8]=F):F=t[8];let I=F,L,R,ee,z,B,V,H,U,W,K,q,re,J,Y,X,oe,ce,Z;if(t[9]!==b||t[10]!==n||t[11]!==S||t[12]!==u||t[13]!==o||t[14]!==a||t[15]!==v||t[16]!==w||t[17]!==O||t[18]!==I){let e=n===null?[]:Te(n,`project`),i=n===null?[]:Te(n,`machine`),s=n!==null&&e.length===0,c=n?.label,l=De(e),h=De(i),y;t[37]!==n?.cells||t[38]!==S?(y=Ce.filter(e=>n?.cells[e]?.checked===!0&&!S[e]),t[37]=n?.cells,t[38]=S,t[39]=y):y=t[39],V=y.length;let x;t[40]!==n||t[41]!==S?(x=Ce.filter(e=>n?.cells[e]!==void 0&&S[e]&&!n.cells[e]?.checked),t[40]=n,t[41]=S,t[42]=x):x=t[42],z=x.length;let C;t[43]!==b||t[44]!==z||t[45]!==V?(C=z>0&&V>0?b({id:`6tQC_t`,values:{addingCount:z,removingCount:V}}):z>0?G._({id:`xKcXG6`,values:{addingCount:z}}):V>0?G._({id:`0niWj3`,values:{removingCount:V}}):null,t[43]=b,t[44]=z,t[45]=V,t[46]=C):C=t[46];let T=C;H=V>0&&z===0;let E;t[47]!==S||t[48]!==H?(E=H&&Ce.every(e=>!S[e]),t[47]=S,t[48]=H,t[49]=E):E=t[49];let D=E;Z=O!==null&&O.peerSatisfierIds.length>0;let k;t[50]!==b||t[51]!==z||t[52]!==n||t[53]!==D||t[54]!==V||t[55]!==O||t[56]!==T||t[57]!==Z?(k=n===null?null:O===null?D?b({id:`CCngW8`,values:{0:n.label}}):T:Z?b(z>0?{id:`0hAvVd`,values:{0:n.label,1:O.peers,addingCount:z,removingCount:V}}:{id:`yqr502`,values:{0:n.label,1:O.peers,removingCount:V}}):T,t[50]=b,t[51]=z,t[52]=n,t[53]=D,t[54]=V,t[55]=O,t[56]=T,t[57]=Z,t[58]=k):k=t[58],B=k,ee=_,re=a,t[59]!==o||t[60]!==w?(J=e=>!w&&o(e),t[59]=o,t[60]=w,t[61]=J):J=t[61],R=p,U=`sm:max-w-lg`,W=!1,K=u;let A;t[62]===n?A=t[63]:(A=n?(0,$.jsx)(je,{agentId:n.id,className:`size-5 text-muted-foreground`}):null,t[62]=n,t[63]=A);let j=n?.label,M;t[64]!==A||t[65]!==j?(M=(0,$.jsxs)(f,{className:`flex items-center gap-2 text-lg`,children:[A,j]}),t[64]=A,t[65]=j,t[66]=M):M=t[66];let N;t[67]!==b||t[68]!==c||t[69]!==n||t[70]!==s?(N=b(n?s?{id:`bm1oV9`,values:{agentLabel:c}}:{id:`qr2gAH`,values:{0:n.label}}:{id:`CxnZP4`}),t[67]=b,t[68]=c,t[69]=n,t[70]=s,t[71]=N):N=t[71];let F;t[72]===N?F=t[73]:(F=(0,$.jsx)(d,{children:N}),t[72]=N,t[73]=F),t[74]!==M||t[75]!==F?(q=(0,$.jsxs)(g,{className:`gap-2`,children:[M,F]}),t[74]=M,t[75]=F,t[76]=q):q=t[76],L=m,Y=`flex flex-col gap-6`,t[77]!==n||t[78]!==v?(X=v&&n?(0,$.jsx)($e,{label:n.label}):null,t[77]=n,t[78]=v,t[79]=X):X=t[79],oe=e.length>0?(0,$.jsxs)(ae,{className:`gap-5`,children:[(0,$.jsxs)(se,{className:`flex items-center gap-2 font-mono data-[variant=legend]:text-xs uppercase tracking-wide text-muted-foreground`,children:[(0,$.jsx)(te,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(r,{id:`ZWyHmq`}),(0,$.jsx)(ie,{variant:`secondary`,className:`font-mono text-[10px] uppercase`,children:(0,$.jsx)(r,{id:`WEYdDv`})})]}),e.map(e=>{let[t,n]=e;return(0,$.jsx)(Ge,{part:t,cell:n,notes:l.get(t)??[],draft:S,setPart:P},t)}),I?(0,$.jsx)(Qe,{}):null]}):null,ce=i.length>0?(0,$.jsxs)(ae,{className:`gap-5`,children:[(0,$.jsxs)(se,{className:`flex items-center gap-2 font-mono data-[variant=legend]:text-xs uppercase tracking-wide text-muted-foreground`,children:[(0,$.jsx)(ne,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(r,{id:`ImTzPZ`})]}),i.map(e=>{let[t,n]=e;return(0,$.jsx)(Ge,{part:t,cell:n,notes:h.get(t)??[],draft:S,setPart:P},t)})]}):null,t[9]=b,t[10]=n,t[11]=S,t[12]=u,t[13]=o,t[14]=a,t[15]=v,t[16]=w,t[17]=O,t[18]=I,t[19]=L,t[20]=R,t[21]=ee,t[22]=z,t[23]=B,t[24]=V,t[25]=H,t[26]=U,t[27]=W,t[28]=K,t[29]=q,t[30]=re,t[31]=J,t[32]=Y,t[33]=X,t[34]=oe,t[35]=ce,t[36]=Z}else L=t[19],R=t[20],ee=t[21],z=t[22],B=t[23],V=t[24],H=t[25],U=t[26],W=t[27],K=t[28],q=t[29],re=t[30],J=t[31],Y=t[32],X=t[33],oe=t[34],ce=t[35],Z=t[36];let Q;t[80]!==n||t[81]!==E||t[82]!==O?(Q=O===null?E!==null&&n!==null?(0,$.jsx)(Je,{result:E,connection:n}):null:(0,$.jsx)(st,{choice:O}),t[80]=n,t[81]=E,t[82]=O,t[83]=Q):Q=t[83];let le;t[84]!==L||t[85]!==Q||t[86]!==Y||t[87]!==X||t[88]!==oe||t[89]!==ce?(le=(0,$.jsxs)(L,{className:Y,children:[X,oe,ce,Q]}),t[84]=L,t[85]=Q,t[86]=Y,t[87]=X,t[88]=oe,t[89]=ce,t[90]=le):le=t[90];let ue;t[91]===B?ue=t[92]:(ue=(0,$.jsx)(`p`,{role:`status`,className:`me-auto text-xs text-muted-foreground`,"aria-live":`polite`,"aria-atomic":`true`,children:B}),t[91]=B,t[92]=ue);let de;t[93]===o?de=t[94]:(de=()=>o(!1),t[93]=o,t[94]=de);let fe;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsx)(r,{id:`dEgA5A`}),t[95]=fe):fe=t[95];let pe;t[96]!==w||t[97]!==de?(pe=(0,$.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,disabled:w,onClick:de,children:fe}),t[96]=w,t[97]=de,t[98]=pe):pe=t[98];let ge=j||V>0?`destructive`:`default`,_e=w||(O===null?z+V===0:!Z),ve;t[99]!==n||t[100]!==S||t[101]!==y||t[102]!==o||t[103]!==c||t[104]!==O?.peerSatisfierIds?(ve=()=>{T(!0),D(null);let e=O?.peerSatisfierIds;k(null),c(S,e).then(e=>{if(e.ok){o(!1);return}let t=n===null?null:ot(e,n,y.locale);t===null?D(e):k(t)}).catch(()=>D({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null})).finally(()=>T(!1))},t[99]=n,t[100]=S,t[101]=y,t[102]=o,t[103]=c,t[104]=O?.peerSatisfierIds,t[105]=ve):ve=t[105];let ye;t[106]!==j||t[107]!==H||t[108]!==w||t[109]!==Z?(ye=w?(0,$.jsx)(r,{id:`uF9ruK`}):Z?(0,$.jsx)(r,{id:`dGcsnU`}):j?(0,$.jsx)(r,{id:`inJhKB`}):H?(0,$.jsx)(r,{id:`t_YqKh`}):(0,$.jsx)(r,{id:`y3aU20`}),t[106]=j,t[107]=H,t[108]=w,t[109]=Z,t[110]=ye):ye=t[110];let be;t[111]!==ge||t[112]!==_e||t[113]!==ve||t[114]!==ye?(be=(0,$.jsx)(s,{variant:ge,className:`font-mono uppercase`,disabled:_e,onClick:ve,children:ye}),t[111]=ge,t[112]=_e,t[113]=ve,t[114]=ye,t[115]=be):be=t[115];let xe;t[116]!==ue||t[117]!==pe||t[118]!==be?(xe=(0,$.jsxs)(h,{className:`items-center`,children:[ue,pe,be]}),t[116]=ue,t[117]=pe,t[118]=be,t[119]=xe):xe=t[119];let we;t[120]!==R||t[121]!==U||t[122]!==W||t[123]!==K||t[124]!==q||t[125]!==le||t[126]!==xe?(we=(0,$.jsxs)(R,{className:U,showCloseButton:W,onCloseAutoFocus:K,children:[q,le,xe]}),t[120]=R,t[121]=U,t[122]=W,t[123]=K,t[124]=q,t[125]=le,t[126]=xe,t[127]=we):we=t[127];let Ee;return t[128]!==ee||t[129]!==re||t[130]!==J||t[131]!==we?(Ee=(0,$.jsx)(ee,{open:re,onOpenChange:J,children:we}),t[128]=ee,t[129]=re,t[130]=J,t[131]=we,t[132]=Ee):Ee=t[132],Ee}function nt(e){switch(e){case`projectMcp`:return(0,$.jsx)(r,{id:`ggMMa7`});case`projectSkill`:return(0,$.jsx)(r,{id:`LtiJ5c`});case`globalMcp`:return(0,$.jsx)(r,{id:`2gXnCO`});case`discoverySkill`:return(0,$.jsx)(r,{id:`ejiJeW`})}}function rt(e,t){return Ce.flatMap(n=>{let r=e.cells[n];return r?.checked===!0?[{cell:r,part:n,label:nt(n),path:r.resolvedPath??ge(r.pathId),scope:r.scope===`project`?`project`:`machine`,alsoAffects:r.piece===`skill`&&r.sharedFolderWith.length>0?Y(r.sharedFolderWith.map(at),t):null}]:[]})}function it(e){let t=(0,he.c)(12),{scope:n,rows:a}=e,{_:o}=i();if(a.length===0)return null;let s;t[0]===n?s=t[1]:(s=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 border-b bg-muted/60 px-3 py-2 font-mono text-xs uppercase tracking-wide text-muted-foreground`,children:[n===`project`?(0,$.jsx)(te,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(ne,{"aria-hidden":!0,className:`size-3.5`}),n===`project`?(0,$.jsx)(r,{id:`ZWyHmq`}):(0,$.jsx)(r,{id:`ImTzPZ`})]}),t[0]=n,t[1]=s);let c;if(t[2]!==o||t[3]!==a){let e;t[5]===o?e=t[6]:(e=e=>{let t=e.alsoAffects;return(0,$.jsxs)(`li`,{className:`flex items-start gap-3 px-3 py-3`,children:[(0,$.jsx)(J,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),e.path===null?null:(0,$.jsx)(`code`,{className:`block truncate text-xs text-muted-foreground`,children:e.path}),t===null?null:(0,$.jsx)(`p`,{className:`text-xs text-amber-700 dark:text-amber-400`,children:o({id:`qze9od`,values:{alsoAffects:t}})})]})]},e.cell.satisfierId)},t[5]=o,t[6]=e),c=a.map(e),t[2]=o,t[3]=a,t[4]=c}else c=t[4];let l;t[7]===c?l=t[8]:(l=(0,$.jsx)(`ul`,{className:`divide-y divide-border`,children:c}),t[7]=c,t[8]=l);let u;return t[9]!==s||t[10]!==l?(u=(0,$.jsxs)(`div`,{children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11],u}function at(e){return R[e]??e}function ot(e,t,n){let r=e.report.conflicts.filter(e=>e.kind===`unresolved-shared-copy`),i=new Set(Object.values(t.cells).map(e=>e.satisfierId)),a=[...new Set(r.flatMap(e=>e.satisfierIds))].filter(e=>!i.has(e)),o=[...new Set(r.flatMap(e=>e.agentIds))].filter(e=>e!==t.id);if(a.length===0&&o.length===0)return null;let s=[...new Set(r.map(e=>ge(e.pathId)).filter(e=>e!==null))];return{peers:Y(o.map(at),n),path:s.length===1?s[0]:null,peerSatisfierIds:a}}function st(e){let t=(0,he.c)(5),{choice:n}=e,{peers:i,path:a}=n;if(n.peerSatisfierIds.length===0){let e;return t[0]===i?e=t[1]:(e=(0,$.jsx)(`div`,{role:`status`,className:`rounded-md border bg-muted/50 p-3 text-sm`,children:(0,$.jsx)(r,{id:`H8tj8y`,values:{peers:i}})}),t[0]=i,t[1]=e),e}let o;return t[2]!==a||t[3]!==i?(o=(0,$.jsx)(`div`,{role:`status`,className:`rounded-md border bg-muted/50 p-3 text-sm`,children:a===null?(0,$.jsx)(r,{id:`4C2RCg`,values:{peers:i}}):(0,$.jsx)(r,{id:`fybwfg`,values:{peers:i,path:a},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[2]=a,t[3]=i,t[4]=o):o=t[4],o}function ct(e){let t=(0,he.c)(96),{connection:n,open:a,onOpenChange:o,onRemove:s,paired:c}=e,l=c===void 0?!1:c,{i18n:u,_:d}=i(),f=(0,me.useRef)(null),p=(0,me.useRef)(null),m,h;t[0]===a?(m=t[1],h=t[2]):(m=()=>{if(!a)return;let e=document.activeElement;f.current=e,p.current=e?.closest(`section`)??null},h=[a],t[0]=a,t[1]=m,t[2]=h),(0,me.useEffect)(m,h);let[g,_]=(0,me.useState)(!1),[D,O]=(0,me.useState)(null),[k,A]=(0,me.useState)(null),j,M,N,P,F,I,L,R,ee,z,B,V,H,U,W,G;if(t[3]!==d||t[4]!==n||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==a||t[9]!==g){F=n?rt(n,u.locale):[];let e;t[26]!==n||t[27]!==u||t[28]!==o||t[29]!==s?(e=function(e){n!==null&&(_(!0),O(null),A(null),s(e).then(e=>{if(e.ok){o(!1);return}let t=ot(e,n,u.locale);t===null?O(e):A(t)}).catch(e=>O({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null,error:e instanceof Error?e.message:String(e)})).finally(()=>_(!1)))},t[26]=n,t[27]=u,t[28]=o,t[29]=s,t[30]=e):e=t[30],I=e,P=E,ee=a,t[31]!==o||t[32]!==g?(z=e=>!g&&o(e),t[31]=o,t[32]=g,t[33]=z):z=t[33],N=v,G=`sm:max-w-lg`,t[34]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{let t=f.current,n=t?.isConnected?t:xe(p.current);n?.isConnected&&(e.preventDefault(),n.focus())},t[34]=L):L=t[34];let i;t[35]===n?i=t[36]:(i=n?(0,$.jsx)(je,{agentId:n.id,className:`size-5 text-muted-foreground`}):null,t[35]=n,t[36]=i);let c;t[37]!==d||t[38]!==n?(c=d(n?{id:`ApNWRQ`,values:{0:n.label}}:{id:`Y1wa2r`}),t[37]=d,t[38]=n,t[39]=c):c=t[39];let l;t[40]!==i||t[41]!==c?(l=(0,$.jsxs)(x,{className:`flex items-center gap-2 text-lg`,children:[i,c]}),t[40]=i,t[41]=c,t[42]=l):l=t[42];let m;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(C,{children:(0,$.jsx)(r,{id:`da7Yfw`})}),t[43]=m):m=t[43],t[44]===l?R=t[45]:(R=(0,$.jsxs)(y,{className:`gap-2`,children:[l,m]}),t[44]=l,t[45]=R),M=w,W=`flex flex-col gap-4`,H=`overflow-hidden rounded-lg border`,U=(0,$.jsx)(it,{scope:`project`,rows:F.filter(ut)}),j=it,B=`machine`,V=F.filter(lt),t[3]=d,t[4]=n,t[5]=u,t[6]=o,t[7]=s,t[8]=a,t[9]=g,t[10]=j,t[11]=M,t[12]=N,t[13]=P,t[14]=F,t[15]=I,t[16]=L,t[17]=R,t[18]=ee,t[19]=z,t[20]=B,t[21]=V,t[22]=H,t[23]=U,t[24]=W,t[25]=G}else j=t[10],M=t[11],N=t[12],P=t[13],F=t[14],I=t[15],L=t[16],R=t[17],ee=t[18],z=t[19],B=t[20],V=t[21],H=t[22],U=t[23],W=t[24],G=t[25];let te;t[46]!==j||t[47]!==B||t[48]!==V?(te=(0,$.jsx)(j,{scope:B,rows:V}),t[46]=j,t[47]=B,t[48]=V,t[49]=te):te=t[49];let K;t[50]!==te||t[51]!==H||t[52]!==U?(K=(0,$.jsxs)(`div`,{className:H,children:[U,te]}),t[50]=te,t[51]=H,t[52]=U,t[53]=K):K=t[53];let ne;t[54]!==n||t[55]!==l?(ne=l&&n?(0,$.jsx)(et,{label:n.label}):null,t[54]=n,t[55]=l,t[56]=ne):ne=t[56];let q;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(r,{id:`Evsh6U`})}),t[57]=q):q=t[57];let re;t[58]!==n||t[59]!==D||t[60]!==k?(re=k===null?D!==null&&n!==null?(0,$.jsx)(Je,{result:D,connection:n}):null:(0,$.jsx)(st,{choice:k}),t[58]=n,t[59]=D,t[60]=k,t[61]=re):re=t[61];let J;t[62]!==M||t[63]!==K||t[64]!==ne||t[65]!==re||t[66]!==W?(J=(0,$.jsxs)(M,{className:W,children:[K,ne,q,re]}),t[62]=M,t[63]=K,t[64]=ne,t[65]=re,t[66]=W,t[67]=J):J=t[67];let ie;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(r,{id:`dEgA5A`}),t[68]=ie):ie=t[68];let Y;t[69]===g?Y=t[70]:(Y=(0,$.jsx)(b,{disabled:g,children:ie}),t[69]=g,t[70]=Y);let ae=g||F.length===0||k!==null&&k.peerSatisfierIds.length===0,X;t[71]!==k?.peerSatisfierIds||t[72]!==I?(X=e=>{e.preventDefault(),I(k?.peerSatisfierIds)},t[71]=k?.peerSatisfierIds,t[72]=I,t[73]=X):X=t[73];let oe;t[74]!==g||t[75]!==k?(oe=g?(0,$.jsx)(r,{id:`uF9ruK`}):k!==null&&k.peerSatisfierIds.length>0?(0,$.jsx)(r,{id:`dGcsnU`}):(0,$.jsx)(r,{id:`t_YqKh`}),t[74]=g,t[75]=k,t[76]=oe):oe=t[76];let se;t[77]!==ae||t[78]!==X||t[79]!==oe?(se=(0,$.jsx)(S,{variant:`destructive`,className:`font-mono uppercase`,disabled:ae,onClick:X,children:oe}),t[77]=ae,t[78]=X,t[79]=oe,t[80]=se):se=t[80];let ce;t[81]!==Y||t[82]!==se?(ce=(0,$.jsxs)(T,{children:[Y,se]}),t[81]=Y,t[82]=se,t[83]=ce):ce=t[83];let Z;t[84]!==N||t[85]!==L||t[86]!==R||t[87]!==J||t[88]!==ce||t[89]!==G?(Z=(0,$.jsxs)(N,{className:G,onCloseAutoFocus:L,children:[R,J,ce]}),t[84]=N,t[85]=L,t[86]=R,t[87]=J,t[88]=ce,t[89]=G,t[90]=Z):Z=t[90];let Q;return t[91]!==P||t[92]!==ee||t[93]!==z||t[94]!==Z?(Q=(0,$.jsx)(P,{open:ee,onOpenChange:z,children:Z}),t[91]=P,t[92]=ee,t[93]=z,t[94]=Z,t[95]=Q):Q=t[95],Q}function lt(e){return e.scope===`machine`}function ut(e){return e.scope===`project`}function dt(e,t,n=[]){let r=Pe(e);return[...n.map(e=>({satisfierId:e,desired:`absent`})),...Ce.flatMap(n=>{let i=e.cells[n];return i===void 0||t[n]===r[n]?[]:[{satisfierId:i.satisfierId,desired:t[n]?`present`:`absent`}]})]}function ft(e,t=[]){let n=Pe(e),r=Object.fromEntries(Ce.map(t=>[t,e.cells[t]?!1:n[t]])),i=t.map(e=>({satisfierId:e,desired:`absent`}));return[...dt(e,r),...i]}function pt(e){if(e.status===`nothing-required`)return`met`;let t=!1;for(let n of e.options){if(n.confidence===`unverified`){t=!0;continue}if(n.counts)return`met`}return t?`unprobed`:`unmet`}function mt(e,t,n){return n===!1?`absent`:n===!0?`present`:t===null||!t.detection.probed?`unknown`:k(t.detection,e)?`present`:`absent`}function ht(e){let{agentId:t,mode:n,snapshot:r,detected:i}=e;if(mt(t,r,i)===`absent`)return`not-installed`;if(r===null)return`no-status`;let a=L({agentId:t,mode:n,probes:r.probes}).requirements.filter(e=>e.level===`required`);if(a.length===0)return`no-status`;let o=a.map(pt);return o.includes(`unprobed`)?`no-status`:o.includes(`unmet`)?`not-connected`:`connected`}function gt(e){return e===`enable-manually`?`external`:`terminal`}function _t(e){let{agentId:t,mode:n,snapshot:r,projectMcp:i}=e;if(r===null||i?.followup===void 0||ht(e)!==`connected`)return;let a=L({agentId:t,mode:n,probes:r.probes}).requirements.find(e=>e.level===`required`&&e.piece===`mcp`);if(a===void 0||a.status!==`met`)return;let o=a.options.filter(e=>e.counts);if(!(o.length!==1||o[0]?.id!==i.satisfierId))return i.followup}export{xe as _,tt as a,Re as c,Le as d,Ne as f,ft as g,Pe as h,mt as i,Ae as l,dt as m,_t as n,je as o,Ie as p,gt as r,ct as s,ht as t,Me as u,pe as v,fe as y};
|
|
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{t as o}from"./AgentIconCluster-BjhMMJvg.js";import{t as s}from"./button-Cym3gapE.js";import{i as c,n as l,t as u}from"./tooltip-BnyyQDRs.js";import{a as d,c as f,i as p,n as m,o as h,s as g,t as _}from"./dialog-DgIQr9zS.js";import{a as v,c as y,i as b,l as x,n as S,o as C,r as w,s as T,t as E}from"./alert-dialog-CrZSZ5Zj.js";import{t as D}from"./checkbox-Crs_F_Np.js";import{t as O}from"./label-D-K3fWtj.js";import{$r as k,Cc as A,Gc as j,Gi as M,Jc as N,Kc as P,Os as F,Sc as I,Tn as L,Wc as R,a as ee,jn as z,kc as B,mc as V,qc as H,wc as U,xc as W}from"./dist-868Gd8gd.js";import{t as G}from"./dist-Cr4-nBVI.js";import{t as te}from"./folder-C4F4ia-z.js";import{t as K}from"./info-CilGMBpP.js";import{t as ne}from"./monitor-BZlB-tXl.js";import{t as q}from"./sparkles-CKoBZZKl.js";import{t as re}from"./triangle-alert-CCeXtPLU.js";import{t as J}from"./x-DIayTyoR.js";import{t as ie}from"./badge-Ct5y0ScC.js";import{t as Y}from"./tool-list-format-CAqZbZya.js";import{c as ae,l as X,n as oe,s as se,t as ce}from"./field-CuGdn_wl.js";var Z={actions:[],conflicts:[],withheld:[]};function Q(e){return{ok:!1,report:Z,snapshot:null,error:e}}function le(e){return e.conflicts.length===0&&e.actions.every(e=>e.errorId===void 0)}async function ue(e){let t=globalThis.window?.okDesktop;if(t!==void 0)try{let n=await t.agentIntegrations.apply({intents:e});return n.ok?{ok:!0,report:n.report,snapshot:n.snapshot}:{ok:!1,report:n.report,snapshot:n.snapshot,error:n.error,...n.unavailable===!0?{unavailable:!0}:{}}}catch(e){return{ok:!1,report:Z,snapshot:null,error:e instanceof Error?e.message:String(e)}}let n;try{n=await fetch(`/api/agent-integrations/apply`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({intents:e})})}catch(e){return Q(e instanceof Error?e.message:String(e))}if(!n.ok)return Q(`HTTP ${n.status} ${n.statusText}`.trimEnd());let r;try{r=await n.json()}catch(e){return Q(e instanceof Error?e.message:String(e))}let i=ee.safeParse(r);if(!i.success){let e=i.error.issues.map(e=>e.path.join(`.`));return console.warn(`[agent-connections] response schema drift`,{issues:e}),Q(`Unexpected response shape at ${e.join(`, `)}`)}let a={actions:i.data.actions,conflicts:i.data.conflicts,withheld:i.data.withheld};return{ok:le(a),report:a,snapshot:i.data.snapshot}}var de=new Set;function fe(e){return de.add(e),()=>{de.delete(e)}}async function pe(e){let t=await ue(e);if(e.length>0){let e=[...de];for(let n of e)try{n(t)}catch(e){console.warn(`[agent-connections] change listener failed:`,e)}}return t}var me=e(n(),1),he=a();function ge(e){if(e===void 0)return null;let t=B(e);if(t===null)return null;if(t.kind===`central-skill-store`)return`~/${F}/`;switch(t.kind){case`editor-project-config`:return j[t.editor];case`editor-project-skill-root`:{let e=P[t.editor];return e===null?null:`${e}/${N}/`}case`editor-user-skill-root`:{let e=H[t.editor];return e===null?null:`~/${e}/`}case`editor-user-config`:return null}}function _e(e,t){if(e===void 0||t.length===0)return[];let n=B(e);return n===null||n.kind===`central-skill-store`?[]:t.map(e=>ge(`${n.kind}:${e}`)).filter(e=>e!==null)}function ve(e){return typeof e==`string`?R[e]??e:null}function ye(e){if(e===void 0)return null;let t=ve(e.params?.agent);if(t===null)return null;switch(e.id){case`guidance.mcp.user-config`:return G._({id:`guidance.mcp.user-config`,values:{agent:t}});case`guidance.mcp.project-config`:return G._({id:`guidance.mcp.project-config`,values:{agent:t}});case`guidance.mcp.session-injection`:return G._({id:`guidance.mcp.session-injection`,values:{agent:t}});case`guidance.mcp.managed-file`:return G._({id:`guidance.mcp.managed-file`,values:{agent:t}});case`guidance.skill.project`:return G._({id:`guidance.skill.project`,values:{agent:t}});case`guidance.skill.user`:return G._({id:`guidance.skill.user`,values:{agent:t}});case`guidance.skill.central-store`:return G._({id:`guidance.skill.central-store`,values:{agent:t}});default:return null}}function be(e){if(e===void 0)return null;let t=ve(e.params?.agent);if(t===null)return null;switch(e.id){case`troubleshooting.claude.project-entry-not-approved`:return G._({id:`troubleshooting.claude.project-entry-not-approved`,values:{agent:t}});case`troubleshooting.claude-desktop.per-tool-approval`:return G._({id:`troubleshooting.claude-desktop.per-tool-approval`,values:{agent:t}});case`troubleshooting.cursor.project-entry-not-loaded`:return G._({id:`troubleshooting.cursor.project-entry-not-loaded`,values:{agent:t}});case`troubleshooting.codex.folder-trust`:return G._({id:`troubleshooting.codex.folder-trust`,values:{agent:t}});case`troubleshooting.codex.desktop-project-config`:return e.params?.honoredByDesktop===!0?null:G._({id:`troubleshooting.codex.desktop-project-config`,values:{agent:t}});case`troubleshooting.copilot.shared-workspace-config`:{let n=ve(e.params?.sourceAgent)??``;return G._({id:`troubleshooting.copilot.shared-workspace-config`,values:{agent:t,sourceAgent:n}})}case`troubleshooting.openclaw.central-store-missing`:return G._({id:`troubleshooting.openclaw.central-store-missing`,values:{agent:t}});case`troubleshooting.pi.folder-trust`:return G._({id:`troubleshooting.pi.folder-trust`,values:{agent:t}});case`troubleshooting.lm-studio.config-path-mismatch`:return G._({id:`troubleshooting.lm-studio.config-path-mismatch`,values:{agent:t}});default:return null}}function xe(e){return e?.closest(`section`)?.querySelector(`h4`)??null}var $=t(),Se={projectMcp:!1,projectSkill:!1,globalMcp:!1,discoverySkill:!1},Ce=[`projectMcp`,`projectSkill`,`globalMcp`,`discoverySkill`],we={projectMcp:`project`,projectSkill:`project`,globalMcp:`machine`,discoverySkill:`machine`};function Te(e,t){return Ce.flatMap(n=>{if(we[n]!==t)return[];let r=e.cells[n];return r===void 0?[]:[[n,r]]})}function Ee(e){return e.disabledReason!==null}function De(e){let t=new Set,n=new Map;for(let[r,i]of e){let e=[];if(i.checked&&!Ee(i))for(let n of i.troubleshooting){if(t.has(n.id))continue;let r=be(n);r!==null&&(t.add(n.id),e.push({id:n.id,text:r}))}n.set(r,e)}return n}function Oe(e){return e.scope===`project`&&e.piece===`mcp`?`projectMcp`:e.scope===`project`&&e.piece===`skill`?`projectSkill`:e.scope===`user`&&e.piece===`mcp`?`globalMcp`:e.scope===`user`&&e.piece===`skill`?`discoverySkill`:null}function ke(e){if(!V.includes(e.agentId))return null;let t=e.agentId,n={};for(let t of e.scopes)for(let e of t.cells){let t=Oe(e);t!==null&&(n[t]=e)}return{id:t,label:Ae(t),row:e,cells:n}}function Ae(e){return R[e]}function je(e){let t=(0,he.c)(5),{agentId:n,className:r}=e;if(n===`lm-studio`){let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(q,{"aria-hidden":!0,className:r,strokeWidth:1.5}),t[0]=r,t[1]=e),e}let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(o,{host:n,"aria-hidden":!0,className:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}function Me(e,{forceDetected:t=[]}={}){return z({agentIds:V,probes:e.probes,detection:{...e.detection,detected:[...e.detection.detected,...t]}}).rows.flatMap(e=>{let t=ke(e);return t===null?[]:[t]})}function Ne(e){return W.some(t=>U(t)===e)&&I.some(t=>A(t.id)===e)}function Pe(e){return{projectMcp:e.cells.projectMcp?.checked===!0,projectSkill:e.cells.projectSkill?.checked===!0,globalMcp:e.cells.globalMcp?.checked===!0,discoverySkill:e.cells.discoverySkill?.checked===!0}}function Fe(e){let t=Pe(e);return Ie(t)>0?t:Object.fromEntries(Ce.map(t=>{let n=e.cells[t];return[t,n!==void 0&&!Ee(n)&&!M(n.state)]}))}function Ie(e){return Object.values(e).filter(Boolean).length}function Le(e){return Object.values(e.cells).some(e=>!Ee(e))}function Re(e){let t=Object.values(e.cells);return t.length>0&&t.every(e=>e.checked)}function ze(e){let t=(0,he.c)(10),{children:n}=e,{_:r}=i(),a;t[0]===r?a=t[1]:(a=r({id:`kjrq_8`}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(K,{"aria-hidden":!0}),t[2]=o):o=t[2];let d;t[3]===a?d=t[4]:(d=(0,$.jsx)(c,{asChild:!0,children:(0,$.jsx)(s,{variant:`ghost`,size:`icon-sm`,"aria-label":a,children:o})}),t[3]=a,t[4]=d);let f;t[5]===n?f=t[6]:(f=(0,$.jsx)(l,{className:`max-w-72`,children:n}),t[5]=n,t[6]=f);let p;return t[7]!==d||t[8]!==f?(p=(0,$.jsxs)(u,{children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9],p}function Be(e){let t=(0,he.c)(16),{message:n,path:r,info:a}=e,{_:o}=i(),d;t[0]===o?d=t[1]:(d=o({id:`bn_MDX`}),t[0]=o,t[1]=d);let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(re,{"aria-hidden":!0}),t[2]=f):f=t[2];let p;t[3]===d?p=t[4]:(p=(0,$.jsx)(c,{asChild:!0,children:(0,$.jsx)(s,{variant:`ghost`,size:`icon-sm`,className:`text-amber-700 hover:text-amber-700 dark:text-amber-400 dark:hover:text-amber-400`,"aria-label":d,children:f})}),t[3]=d,t[4]=p);let m;t[5]===n?m=t[6]:(m=(0,$.jsx)(`span`,{className:`font-medium`,children:n}),t[5]=n,t[6]=m);let h;t[7]===r?h=t[8]:(h=r===null?null:(0,$.jsx)(`code`,{className:`wrap-break-word font-mono opacity-80`,children:r}),t[7]=r,t[8]=h);let g;t[9]!==a||t[10]!==m||t[11]!==h?(g=(0,$.jsx)(l,{className:`max-w-72`,children:(0,$.jsxs)(`span`,{className:`flex flex-col gap-1.5`,children:[m,a,h]})}),t[9]=a,t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;return t[13]!==p||t[14]!==g?(_=(0,$.jsxs)(u,{children:[p,g]}),t[13]=p,t[14]=g,t[15]=_):_=t[15],_}function Ve(e){let t=(0,he.c)(51),{id:n,checked:r,disabled:a,exception:o,state:s,title:c,description:l,info:u,path:d,sharedPaths:f,alsoAffects:p,notes:m,onCheckedChange:h}=e,{_:g}=i(),_=o===`warning`||o===`error`,v;t[0]!==g||t[1]!==_||t[2]!==s?(v=_?g(s===`foreign`?{id:`tCE-ZH`}:s===`foreign-replaceable`?{id:`KTxoDA`}:{id:`8wwkVu`}):null,t[0]=g,t[1]=_,t[2]=s,t[3]=v):v=t[3];let y=v,b=y===null?void 0:`${n}-warning`,x=p===null?void 0:`${n}-shared`,S;t[4]!==x||t[5]!==b?(S=[b,x].filter(Boolean).join(` `)||void 0,t[4]=x,t[5]=b,t[6]=S):S=t[6];let C=S,w=a||void 0,T;t[7]===h?T=t[8]:(T=e=>h(e===!0),t[7]=h,t[8]=T);let E;t[9]!==r||t[10]!==C||t[11]!==a||t[12]!==n||t[13]!==T?(E=(0,$.jsx)(`div`,{className:`flex h-7 items-center`,children:(0,$.jsx)(D,{id:n,checked:r,disabled:a,"aria-describedby":C,onCheckedChange:T})}),t[9]=r,t[10]=C,t[11]=a,t[12]=n,t[13]=T,t[14]=E):E=t[14];let k;t[15]===c?k=t[16]:(k=(0,$.jsx)(X,{children:c}),t[15]=c,t[16]=k);let A;t[17]!==n||t[18]!==k?(A=(0,$.jsx)(O,{htmlFor:n,className:`cursor-pointer`,children:k}),t[17]=n,t[18]=k,t[19]=A):A=t[19];let j;t[20]!==a||t[21]!==u||t[22]!==d||t[23]!==f||t[24]!==y?(j=y===null?(0,$.jsx)(ze,{children:(0,$.jsxs)(`span`,{className:`flex flex-col gap-1.5`,children:[u,d===null?null:(0,$.jsx)(`code`,{className:`wrap-break-word font-mono opacity-80`,children:d}),f.map(Ue)]})}):(0,$.jsx)(Be,{message:y,path:d,info:a?null:u}),t[20]=a,t[21]=u,t[22]=d,t[23]=f,t[24]=y,t[25]=j):j=t[25];let M;t[26]!==A||t[27]!==j?(M=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[A,j]}),t[26]=A,t[27]=j,t[28]=M):M=t[28];let N;t[29]===l?N=t[30]:(N=(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:l}),t[29]=l,t[30]=N);let P;t[31]!==n||t[32]!==m?(P=m.length===0?null:(0,$.jsx)(`div`,{className:`flex flex-col gap-1.5`,"data-testid":`${n}-troubleshooting`,children:m.map(He)}),t[31]=n,t[32]=m,t[33]=P):P=t[33];let F;t[34]!==g||t[35]!==p||t[36]!==x?(F=p===null?null:(0,$.jsx)(`p`,{id:x,className:`text-sm leading-relaxed text-amber-700 dark:text-amber-400`,children:g({id:`qze9od`,values:{alsoAffects:p}})}),t[34]=g,t[35]=p,t[36]=x,t[37]=F):F=t[37];let I;t[38]!==y||t[39]!==b?(I=b===void 0?null:(0,$.jsx)(`span`,{id:b,className:`sr-only`,children:y}),t[38]=y,t[39]=b,t[40]=I):I=t[40];let L;t[41]!==N||t[42]!==P||t[43]!==F||t[44]!==I||t[45]!==M?(L=(0,$.jsxs)(oe,{children:[M,N,P,F,I]}),t[41]=N,t[42]=P,t[43]=F,t[44]=I,t[45]=M,t[46]=L):L=t[46];let R;return t[47]!==L||t[48]!==w||t[49]!==E?(R=(0,$.jsxs)(ce,{orientation:`horizontal`,className:`items-start gap-3`,"data-disabled":w,children:[E,L]}),t[47]=L,t[48]=w,t[49]=E,t[50]=R):R=t[50],R}function He(e){return(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:e.text},e.id)}function Ue(e){return(0,$.jsx)(`code`,{className:`wrap-break-word font-mono opacity-80`,children:e},e)}function We(e,t){let n=e.cells[t];return n===void 0?!1:!Ee(n)}function Ge(e){let t=(0,he.c)(81),{part:n,cell:a,notes:o,draft:s,setPart:c}=e,{i18n:l,_:u}=i(),d;t[0]===a?d=t[1]:(d=Ee(a),t[0]=a,t[1]=d);let f=d,p;t[2]===u?p=t[3]:(p=u({id:`ggMMa7`}),t[2]=u,t[3]=p);let m;t[4]===u?m=t[5]:(m=u({id:`LtiJ5c`}),t[4]=u,t[5]=m);let h;t[6]===u?h=t[7]:(h=u({id:`2gXnCO`}),t[6]=u,t[7]=h);let g;t[8]===u?g=t[9]:(g=u({id:`ejiJeW`}),t[8]=u,t[9]=g);let _;t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==g?(_={projectMcp:p,projectSkill:m,globalMcp:h,discoverySkill:g},t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_):_=t[14];let v=_,y;if(t[15]!==u||t[16]!==a.agentId||t[17]!==a.disabledReason||t[18]!==a.exception||t[19]!==a.guidance||t[20]!==a.pathId||t[21]!==a.piece||t[22]!==a.resolvedPath||t[23]!==a.sharedFolderWith||t[24]!==a.state||t[25]!==f||t[26]!==s||t[27]!==l||t[28]!==o||t[29]!==n||t[30]!==c||t[31]!==v){y=Symbol.for(`react.early_return_sentinel`);bb0:{let e={foreign:u({id:`tCE-ZH`}),"structural-na":u({id:`3n7lnE`}),"not-installable":u({id:`BMoSQy`}),"agent-undetected":u({id:`mdWhUY`})},i=function(){let t=a.disabledReason;return t==null?u({id:`RXYvxn`}):e[t]},d;t[33]!==u||t[34]!==a.state?(d=a.state===`foreign-replaceable`?u({id:`S6SbxA`}):null,t[33]=u,t[34]=a.state,t[35]=d):d=t[35];let p=d,m;t[36]!==a.piece||t[37]!==a.sharedFolderWith||t[38]!==l?(m=a.piece===`skill`&&a.sharedFolderWith.length>0?Y(a.sharedFolderWith.map(at),l.locale):null,t[36]=a.piece,t[37]=a.sharedFolderWith,t[38]=l,t[39]=m):m=t[39];let h=m,g=a.exception,_=g===`warning`||g===`error`,b;t[40]!==a.pathId||t[41]!==a.sharedFolderWith?(b=_e(a.pathId,a.sharedFolderWith),t[40]=a.pathId,t[41]=a.sharedFolderWith,t[42]=b):b=t[42];let x=b,S;t[43]===a.guidance?S=t[44]:(S=ye(a.guidance),t[43]=a.guidance,t[44]=S);let C=S,w=`${a.agentId}-${n}`,T=s[n],E;t[45]!==a.pathId||t[46]!==a.resolvedPath||t[47]!==f||t[48]!==_?(E=f&&!_?null:a.resolvedPath??ge(a.pathId),t[45]=a.pathId,t[46]=a.resolvedPath,t[47]=f,t[48]=_,t[49]=E):E=t[49];let D;t[50]!==f||t[51]!==_||t[52]!==x?(D=f&&!_?[]:x,t[50]=f,t[51]=_,t[52]=x,t[53]=D):D=t[53];let O=f?null:h,k;t[54]!==n||t[55]!==c?(k=e=>c(n,e),t[54]=n,t[55]=c,t[56]=k):k=t[56];let A;t[57]!==a.state||t[58]!==f||t[59]!==g||t[60]!==o||t[61]!==w||t[62]!==T||t[63]!==E||t[64]!==D||t[65]!==O||t[66]!==k?(A={id:w,checked:T,disabled:f,exception:g,state:a.state,notes:o,path:E,sharedPaths:D,alsoAffects:O,onCheckedChange:k},t[57]=a.state,t[58]=f,t[59]=g,t[60]=o,t[61]=w,t[62]=T,t[63]=E,t[64]=D,t[65]=O,t[66]=k,t[67]=A):A=t[67];let j=A;switch(n){case`projectMcp`:{let e;t[68]===C?e=t[69]:(e=C??(0,$.jsx)(r,{id:`oxj8er`}),t[68]=C,t[69]=e),y=(0,$.jsx)(Ve,{...j,title:v[n],description:e,info:f?i():p??(0,$.jsx)(r,{id:`EBP_hA`})});break bb0}case`projectSkill`:{let e;t[70]===C?e=t[71]:(e=C??(0,$.jsx)(r,{id:`nta97o`}),t[70]=C,t[71]=e),y=(0,$.jsx)(Ve,{...j,title:v[n],description:e,info:f?i():(0,$.jsx)(r,{id:`n11Jj7`})});break bb0}case`globalMcp`:{let e;t[72]===C?e=t[73]:(e=C??(0,$.jsx)(r,{id:`itchkf`}),t[72]=C,t[73]=e),y=(0,$.jsx)(Ve,{...j,title:v[n],description:e,info:f?i():p??(0,$.jsx)(r,{id:`wgj--j`})});break bb0}case`discoverySkill`:{let e=v[n],a;t[74]===C?a=t[75]:(a=C??(0,$.jsx)(r,{id:`6ur2Mk`}),t[74]=C,t[75]=a);let o=f?i():(0,$.jsx)(r,{id:`uVhq9B`}),s;t[76]!==j||t[77]!==e||t[78]!==a||t[79]!==o?(s=(0,$.jsx)(Ve,{...j,title:e,description:a,info:o}),t[76]=j,t[77]=e,t[78]=a,t[79]=o,t[80]=s):s=t[80],y=s;break bb0}}}t[15]=u,t[16]=a.agentId,t[17]=a.disabledReason,t[18]=a.exception,t[19]=a.guidance,t[20]=a.pathId,t[21]=a.piece,t[22]=a.resolvedPath,t[23]=a.sharedFolderWith,t[24]=a.state,t[25]=f,t[26]=s,t[27]=l,t[28]=o,t[29]=n,t[30]=c,t[31]=v,t[32]=y}else y=t[32];if(y!==Symbol.for(`react.early_return_sentinel`))return y}function Ke(e){return e.piece===`mcp`&&e.scope===`project`?(0,$.jsx)(r,{id:`ggMMa7`}):e.piece===`skill`&&e.scope===`project`?(0,$.jsx)(r,{id:`LtiJ5c`}):e.piece===`mcp`&&e.scope===`user`?(0,$.jsx)(r,{id:`2gXnCO`}):e.piece===`skill`&&e.scope===`user`?(0,$.jsx)(r,{id:`ejiJeW`}):null}function qe(e,t,n,r){let i=e.report.conflicts.find(e=>e.kind===r);if(i===void 0)return null;let a=e=>Ce.find(n=>t.cells[n]?.satisfierId===e),[o,s]=i.satisfierIds,c=o===void 0?void 0:a(o),l=s===void 0?void 0:a(s);return c===void 0||l===void 0?null:{dependent:n[l],prerequisite:n[c],blockedReason:i.blockedReason}}function Je(e){let t=(0,he.c)(28),{result:n,connection:a}=e,{_:o}=i(),s;if(t[0]!==o||t[1]!==a||t[2]!==n){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e={projectMcp:o({id:`ggMMa7`}),projectSkill:o({id:`LtiJ5c`}),globalMcp:o({id:`2gXnCO`}),discoverySkill:o({id:`ejiJeW`})},t=qe(n,a,e,`prerequisite-unavailable`);if(t!==null){let{dependent:e,prerequisite:n}=t;s=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:(()=>{switch(t.blockedReason){case`foreign`:return o({id:`XrPvMT`,values:{dependent:e,prerequisite:n}});case`structural-na`:return o({id:`XNdXMR`,values:{dependent:e,prerequisite:n}});case`not-installable`:return o({id:`GTvYzA`,values:{dependent:e,prerequisite:n}});case`agent-undetected`:return o({id:`7Ny8bV`,values:{dependent:e,prerequisite:n}});default:return o({id:`h2QPvj`,values:{dependent:e,prerequisite:n}})}})()});break bb0}let r=qe(n,a,e,`prerequisite-removed`);if(r!==null){s=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:o({id:`5CHuXn`,values:{0:r.dependent,1:r.prerequisite}})});break bb0}}t[0]=o,t[1]=a,t[2]=n,t[3]=s}else s=t[3];if(s!==Symbol.for(`react.early_return_sentinel`))return s;if(n.unavailable===!0){let e;t[4]===o?e=t[5]:(e=o({id:`RD8cCw`}),t[4]=o,t[5]=e);let n;return t[6]===e?n=t[7]:(n=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:e}),t[6]=e,t[7]=n),n}let c;t[8]===o?c=t[9]:(c=e=>{switch(e.errorId){case`surface-missing`:return o({id:`3n7lnE`});case`foreign-artifact`:return o({id:`tCE-ZH`});case`no-writer`:case`not-installable`:return o({id:`BMoSQy`});case`dependency-failed`:return o({id:`1FXL-O`});case`write-declined`:return o({id:`_fZSIY`});case`write-failed`:case`executor-threw`:case`unrecognized-outcome`:return o({id:`dCforW`});default:return null}},t[8]=o,t[9]=c);let l=c,u=n.report.actions,d,f,p,m;if(t[10]!==l||t[11]!==n.error||t[12]!==n.report.actions){m=Symbol.for(`react.early_return_sentinel`);bb1:{let e;t[17]===l?e=t[18]:(e=e=>({key:e.satisfierId,title:Ke(e),managedInSkillsStudio:e.errorId===`no-writer`&&e.piece===`skill`&&e.scope===`user`,detail:l(e)}),t[17]=l,t[18]=e);let i=u.filter(Ze).map(e).filter(Xe);if(i.length===0){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{children:(0,$.jsx)(r,{id:`fWsBTs`})}),t[19]=e):e=t[19];let i;t[20]===n.error?i=t[21]:(i=n.error===void 0?null:(0,$.jsx)(`code`,{className:`block wrap-break-word font-mono text-xs opacity-80`,children:n.error}),t[20]=n.error,t[21]=i);let a;t[22]===i?a=t[23]:(a=(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-1 text-sm text-destructive`,children:[e,i]}),t[22]=i,t[23]=a),m=a;break bb1}d=`alert`,f=`space-y-2 text-sm text-destructive`,p=i.map(Ye)}t[10]=l,t[11]=n.error,t[12]=n.report.actions,t[13]=d,t[14]=f,t[15]=p,t[16]=m}else d=t[13],f=t[14],p=t[15],m=t[16];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;return t[24]!==d||t[25]!==f||t[26]!==p?(h=(0,$.jsx)(`div`,{role:d,className:f,children:p}),t[24]=d,t[25]=f,t[26]=p,t[27]=h):h=t[27],h}function Ye(e){return(0,$.jsxs)(`div`,{className:`space-y-1`,children:[e.title===null?null:(0,$.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,$.jsx)(`p`,{children:e.managedInSkillsStudio?(0,$.jsx)(r,{id:`5RiC8D`}):e.detail})]},e.key)}function Xe(e){return e.managedInSkillsStudio||e.detail!==null}function Ze(e){return e.errorId!==void 0}function Qe(){let e=(0,he.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(r,{id:`s8difl`})}),e[0]=t):t=e[0],t}function $e(e){let t=(0,he.c)(5),{label:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=r({id:`74Mikl`,values:{label:n}}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]===a?o=t[4]:(o=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),t[3]=a,t[4]=o),o}function et(e){let t=(0,he.c)(5),{label:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=r({id:`2lJAvH`,values:{label:n}}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]===a?o=t[4]:(o=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),t[3]=a,t[4]=o),o}function tt(e){let t=(0,he.c)(133),{connection:n,open:a,onOpenChange:o,onSave:c,paired:l,onCloseAutoFocus:u}=e,v=l===void 0?!1:l,{i18n:y,_:b}=i(),x;t[0]===n?x=t[1]:(x=()=>n===null?Se:Fe(n),t[0]=n,t[1]=x);let[S,C]=(0,me.useState)(x),[w,T]=(0,me.useState)(!1),[E,D]=(0,me.useState)(null),[O,k]=(0,me.useState)(null),A;t[2]!==n||t[3]!==S?(A=n!==null&&Ce.some(e=>{let t=n.cells[e];return S[e]&&t!==void 0&&M(t.state)}),t[2]=n,t[3]=S,t[4]=A):A=t[4];let j=A,N;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e,t){C(n=>({...n,[e]:t})),k(null)},t[5]=N):N=t[5];let P=N,F;t[6]!==n||t[7]!==S?(F=n!==null&&!S.projectSkill&&We(n,`projectSkill`),t[6]=n,t[7]=S,t[8]=F):F=t[8];let I=F,L,R,ee,z,B,V,H,U,W,K,q,re,J,Y,X,oe,ce,Z;if(t[9]!==b||t[10]!==n||t[11]!==S||t[12]!==u||t[13]!==o||t[14]!==a||t[15]!==v||t[16]!==w||t[17]!==O||t[18]!==I){let e=n===null?[]:Te(n,`project`),i=n===null?[]:Te(n,`machine`),s=n!==null&&e.length===0,c=n?.label,l=De(e),h=De(i),y;t[37]!==n?.cells||t[38]!==S?(y=Ce.filter(e=>n?.cells[e]?.checked===!0&&!S[e]),t[37]=n?.cells,t[38]=S,t[39]=y):y=t[39],V=y.length;let x;t[40]!==n||t[41]!==S?(x=Ce.filter(e=>n?.cells[e]!==void 0&&S[e]&&!n.cells[e]?.checked),t[40]=n,t[41]=S,t[42]=x):x=t[42],z=x.length;let C;t[43]!==b||t[44]!==z||t[45]!==V?(C=z>0&&V>0?b({id:`6tQC_t`,values:{addingCount:z,removingCount:V}}):z>0?G._({id:`xKcXG6`,values:{addingCount:z}}):V>0?G._({id:`0niWj3`,values:{removingCount:V}}):null,t[43]=b,t[44]=z,t[45]=V,t[46]=C):C=t[46];let T=C;H=V>0&&z===0;let E;t[47]!==S||t[48]!==H?(E=H&&Ce.every(e=>!S[e]),t[47]=S,t[48]=H,t[49]=E):E=t[49];let D=E;Z=O!==null&&O.peerSatisfierIds.length>0;let k;t[50]!==b||t[51]!==z||t[52]!==n||t[53]!==D||t[54]!==V||t[55]!==O||t[56]!==T||t[57]!==Z?(k=n===null?null:O===null?D?b({id:`CCngW8`,values:{0:n.label}}):T:Z?b(z>0?{id:`0hAvVd`,values:{0:n.label,1:O.peers,addingCount:z,removingCount:V}}:{id:`yqr502`,values:{0:n.label,1:O.peers,removingCount:V}}):T,t[50]=b,t[51]=z,t[52]=n,t[53]=D,t[54]=V,t[55]=O,t[56]=T,t[57]=Z,t[58]=k):k=t[58],B=k,ee=_,re=a,t[59]!==o||t[60]!==w?(J=e=>!w&&o(e),t[59]=o,t[60]=w,t[61]=J):J=t[61],R=p,U=`sm:max-w-lg`,W=!1,K=u;let A;t[62]===n?A=t[63]:(A=n?(0,$.jsx)(je,{agentId:n.id,className:`size-5 text-muted-foreground`}):null,t[62]=n,t[63]=A);let j=n?.label,M;t[64]!==A||t[65]!==j?(M=(0,$.jsxs)(f,{className:`flex items-center gap-2 text-lg`,children:[A,j]}),t[64]=A,t[65]=j,t[66]=M):M=t[66];let N;t[67]!==b||t[68]!==c||t[69]!==n||t[70]!==s?(N=b(n?s?{id:`bm1oV9`,values:{agentLabel:c}}:{id:`qr2gAH`,values:{0:n.label}}:{id:`CxnZP4`}),t[67]=b,t[68]=c,t[69]=n,t[70]=s,t[71]=N):N=t[71];let F;t[72]===N?F=t[73]:(F=(0,$.jsx)(d,{children:N}),t[72]=N,t[73]=F),t[74]!==M||t[75]!==F?(q=(0,$.jsxs)(g,{className:`gap-2`,children:[M,F]}),t[74]=M,t[75]=F,t[76]=q):q=t[76],L=m,Y=`flex flex-col gap-6`,t[77]!==n||t[78]!==v?(X=v&&n?(0,$.jsx)($e,{label:n.label}):null,t[77]=n,t[78]=v,t[79]=X):X=t[79],oe=e.length>0?(0,$.jsxs)(ae,{className:`gap-5`,children:[(0,$.jsxs)(se,{className:`flex items-center gap-2 font-mono data-[variant=legend]:text-xs uppercase tracking-wide text-muted-foreground`,children:[(0,$.jsx)(te,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(r,{id:`ZWyHmq`}),(0,$.jsx)(ie,{variant:`secondary`,className:`font-mono text-[10px] uppercase`,children:(0,$.jsx)(r,{id:`WEYdDv`})})]}),e.map(e=>{let[t,n]=e;return(0,$.jsx)(Ge,{part:t,cell:n,notes:l.get(t)??[],draft:S,setPart:P},t)}),I?(0,$.jsx)(Qe,{}):null]}):null,ce=i.length>0?(0,$.jsxs)(ae,{className:`gap-5`,children:[(0,$.jsxs)(se,{className:`flex items-center gap-2 font-mono data-[variant=legend]:text-xs uppercase tracking-wide text-muted-foreground`,children:[(0,$.jsx)(ne,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(r,{id:`ImTzPZ`})]}),i.map(e=>{let[t,n]=e;return(0,$.jsx)(Ge,{part:t,cell:n,notes:h.get(t)??[],draft:S,setPart:P},t)})]}):null,t[9]=b,t[10]=n,t[11]=S,t[12]=u,t[13]=o,t[14]=a,t[15]=v,t[16]=w,t[17]=O,t[18]=I,t[19]=L,t[20]=R,t[21]=ee,t[22]=z,t[23]=B,t[24]=V,t[25]=H,t[26]=U,t[27]=W,t[28]=K,t[29]=q,t[30]=re,t[31]=J,t[32]=Y,t[33]=X,t[34]=oe,t[35]=ce,t[36]=Z}else L=t[19],R=t[20],ee=t[21],z=t[22],B=t[23],V=t[24],H=t[25],U=t[26],W=t[27],K=t[28],q=t[29],re=t[30],J=t[31],Y=t[32],X=t[33],oe=t[34],ce=t[35],Z=t[36];let Q;t[80]!==n||t[81]!==E||t[82]!==O?(Q=O===null?E!==null&&n!==null?(0,$.jsx)(Je,{result:E,connection:n}):null:(0,$.jsx)(st,{choice:O}),t[80]=n,t[81]=E,t[82]=O,t[83]=Q):Q=t[83];let le;t[84]!==L||t[85]!==Q||t[86]!==Y||t[87]!==X||t[88]!==oe||t[89]!==ce?(le=(0,$.jsxs)(L,{className:Y,children:[X,oe,ce,Q]}),t[84]=L,t[85]=Q,t[86]=Y,t[87]=X,t[88]=oe,t[89]=ce,t[90]=le):le=t[90];let ue;t[91]===B?ue=t[92]:(ue=(0,$.jsx)(`p`,{role:`status`,className:`me-auto text-xs text-muted-foreground`,"aria-live":`polite`,"aria-atomic":`true`,children:B}),t[91]=B,t[92]=ue);let de;t[93]===o?de=t[94]:(de=()=>o(!1),t[93]=o,t[94]=de);let fe;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsx)(r,{id:`dEgA5A`}),t[95]=fe):fe=t[95];let pe;t[96]!==w||t[97]!==de?(pe=(0,$.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,disabled:w,onClick:de,children:fe}),t[96]=w,t[97]=de,t[98]=pe):pe=t[98];let ge=j||V>0?`destructive`:`default`,_e=w||(O===null?z+V===0:!Z),ve;t[99]!==n||t[100]!==S||t[101]!==y||t[102]!==o||t[103]!==c||t[104]!==O?.peerSatisfierIds?(ve=()=>{T(!0),D(null);let e=O?.peerSatisfierIds;k(null),c(S,e).then(e=>{if(e.ok){o(!1);return}let t=n===null?null:ot(e,n,y.locale);t===null?D(e):k(t)}).catch(()=>D({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null})).finally(()=>T(!1))},t[99]=n,t[100]=S,t[101]=y,t[102]=o,t[103]=c,t[104]=O?.peerSatisfierIds,t[105]=ve):ve=t[105];let ye;t[106]!==j||t[107]!==H||t[108]!==w||t[109]!==Z?(ye=w?(0,$.jsx)(r,{id:`uF9ruK`}):Z?(0,$.jsx)(r,{id:`dGcsnU`}):j?(0,$.jsx)(r,{id:`inJhKB`}):H?(0,$.jsx)(r,{id:`t_YqKh`}):(0,$.jsx)(r,{id:`y3aU20`}),t[106]=j,t[107]=H,t[108]=w,t[109]=Z,t[110]=ye):ye=t[110];let be;t[111]!==ge||t[112]!==_e||t[113]!==ve||t[114]!==ye?(be=(0,$.jsx)(s,{variant:ge,className:`font-mono uppercase`,disabled:_e,onClick:ve,children:ye}),t[111]=ge,t[112]=_e,t[113]=ve,t[114]=ye,t[115]=be):be=t[115];let xe;t[116]!==ue||t[117]!==pe||t[118]!==be?(xe=(0,$.jsxs)(h,{className:`items-center`,children:[ue,pe,be]}),t[116]=ue,t[117]=pe,t[118]=be,t[119]=xe):xe=t[119];let we;t[120]!==R||t[121]!==U||t[122]!==W||t[123]!==K||t[124]!==q||t[125]!==le||t[126]!==xe?(we=(0,$.jsxs)(R,{className:U,showCloseButton:W,onCloseAutoFocus:K,children:[q,le,xe]}),t[120]=R,t[121]=U,t[122]=W,t[123]=K,t[124]=q,t[125]=le,t[126]=xe,t[127]=we):we=t[127];let Ee;return t[128]!==ee||t[129]!==re||t[130]!==J||t[131]!==we?(Ee=(0,$.jsx)(ee,{open:re,onOpenChange:J,children:we}),t[128]=ee,t[129]=re,t[130]=J,t[131]=we,t[132]=Ee):Ee=t[132],Ee}function nt(e){switch(e){case`projectMcp`:return(0,$.jsx)(r,{id:`ggMMa7`});case`projectSkill`:return(0,$.jsx)(r,{id:`LtiJ5c`});case`globalMcp`:return(0,$.jsx)(r,{id:`2gXnCO`});case`discoverySkill`:return(0,$.jsx)(r,{id:`ejiJeW`})}}function rt(e,t){return Ce.flatMap(n=>{let r=e.cells[n];return r?.checked===!0?[{cell:r,part:n,label:nt(n),path:r.resolvedPath??ge(r.pathId),scope:r.scope===`project`?`project`:`machine`,alsoAffects:r.piece===`skill`&&r.sharedFolderWith.length>0?Y(r.sharedFolderWith.map(at),t):null}]:[]})}function it(e){let t=(0,he.c)(12),{scope:n,rows:a}=e,{_:o}=i();if(a.length===0)return null;let s;t[0]===n?s=t[1]:(s=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 border-b bg-muted/60 px-3 py-2 font-mono text-xs uppercase tracking-wide text-muted-foreground`,children:[n===`project`?(0,$.jsx)(te,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(ne,{"aria-hidden":!0,className:`size-3.5`}),n===`project`?(0,$.jsx)(r,{id:`ZWyHmq`}):(0,$.jsx)(r,{id:`ImTzPZ`})]}),t[0]=n,t[1]=s);let c;if(t[2]!==o||t[3]!==a){let e;t[5]===o?e=t[6]:(e=e=>{let t=e.alsoAffects;return(0,$.jsxs)(`li`,{className:`flex items-start gap-3 px-3 py-3`,children:[(0,$.jsx)(J,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),e.path===null?null:(0,$.jsx)(`code`,{className:`block truncate text-xs text-muted-foreground`,children:e.path}),t===null?null:(0,$.jsx)(`p`,{className:`text-xs text-amber-700 dark:text-amber-400`,children:o({id:`qze9od`,values:{alsoAffects:t}})})]})]},e.cell.satisfierId)},t[5]=o,t[6]=e),c=a.map(e),t[2]=o,t[3]=a,t[4]=c}else c=t[4];let l;t[7]===c?l=t[8]:(l=(0,$.jsx)(`ul`,{className:`divide-y divide-border`,children:c}),t[7]=c,t[8]=l);let u;return t[9]!==s||t[10]!==l?(u=(0,$.jsxs)(`div`,{children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11],u}function at(e){return R[e]??e}function ot(e,t,n){let r=e.report.conflicts.filter(e=>e.kind===`unresolved-shared-copy`),i=new Set(Object.values(t.cells).map(e=>e.satisfierId)),a=[...new Set(r.flatMap(e=>e.satisfierIds))].filter(e=>!i.has(e)),o=[...new Set(r.flatMap(e=>e.agentIds))].filter(e=>e!==t.id);if(a.length===0&&o.length===0)return null;let s=[...new Set(r.map(e=>ge(e.pathId)).filter(e=>e!==null))];return{peers:Y(o.map(at),n),path:s.length===1?s[0]:null,peerSatisfierIds:a}}function st(e){let t=(0,he.c)(5),{choice:n}=e,{peers:i,path:a}=n;if(n.peerSatisfierIds.length===0){let e;return t[0]===i?e=t[1]:(e=(0,$.jsx)(`div`,{role:`status`,className:`rounded-md border bg-muted/50 p-3 text-sm`,children:(0,$.jsx)(r,{id:`H8tj8y`,values:{peers:i}})}),t[0]=i,t[1]=e),e}let o;return t[2]!==a||t[3]!==i?(o=(0,$.jsx)(`div`,{role:`status`,className:`rounded-md border bg-muted/50 p-3 text-sm`,children:a===null?(0,$.jsx)(r,{id:`4C2RCg`,values:{peers:i}}):(0,$.jsx)(r,{id:`fybwfg`,values:{peers:i,path:a},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[2]=a,t[3]=i,t[4]=o):o=t[4],o}function ct(e){let t=(0,he.c)(96),{connection:n,open:a,onOpenChange:o,onRemove:s,paired:c}=e,l=c===void 0?!1:c,{i18n:u,_:d}=i(),f=(0,me.useRef)(null),p=(0,me.useRef)(null),m,h;t[0]===a?(m=t[1],h=t[2]):(m=()=>{if(!a)return;let e=document.activeElement;f.current=e,p.current=e?.closest(`section`)??null},h=[a],t[0]=a,t[1]=m,t[2]=h),(0,me.useEffect)(m,h);let[g,_]=(0,me.useState)(!1),[D,O]=(0,me.useState)(null),[k,A]=(0,me.useState)(null),j,M,N,P,F,I,L,R,ee,z,B,V,H,U,W,G;if(t[3]!==d||t[4]!==n||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==a||t[9]!==g){F=n?rt(n,u.locale):[];let e;t[26]!==n||t[27]!==u||t[28]!==o||t[29]!==s?(e=function(e){n!==null&&(_(!0),O(null),A(null),s(e).then(e=>{if(e.ok){o(!1);return}let t=ot(e,n,u.locale);t===null?O(e):A(t)}).catch(e=>O({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null,error:e instanceof Error?e.message:String(e)})).finally(()=>_(!1)))},t[26]=n,t[27]=u,t[28]=o,t[29]=s,t[30]=e):e=t[30],I=e,P=E,ee=a,t[31]!==o||t[32]!==g?(z=e=>!g&&o(e),t[31]=o,t[32]=g,t[33]=z):z=t[33],N=v,G=`sm:max-w-lg`,t[34]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{let t=f.current,n=t?.isConnected?t:xe(p.current);n?.isConnected&&(e.preventDefault(),n.focus())},t[34]=L):L=t[34];let i;t[35]===n?i=t[36]:(i=n?(0,$.jsx)(je,{agentId:n.id,className:`size-5 text-muted-foreground`}):null,t[35]=n,t[36]=i);let c;t[37]!==d||t[38]!==n?(c=d(n?{id:`ApNWRQ`,values:{0:n.label}}:{id:`Y1wa2r`}),t[37]=d,t[38]=n,t[39]=c):c=t[39];let l;t[40]!==i||t[41]!==c?(l=(0,$.jsxs)(x,{className:`flex items-center gap-2 text-lg`,children:[i,c]}),t[40]=i,t[41]=c,t[42]=l):l=t[42];let m;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(C,{children:(0,$.jsx)(r,{id:`da7Yfw`})}),t[43]=m):m=t[43],t[44]===l?R=t[45]:(R=(0,$.jsxs)(y,{className:`gap-2`,children:[l,m]}),t[44]=l,t[45]=R),M=w,W=`flex flex-col gap-4`,H=`overflow-hidden rounded-lg border`,U=(0,$.jsx)(it,{scope:`project`,rows:F.filter(ut)}),j=it,B=`machine`,V=F.filter(lt),t[3]=d,t[4]=n,t[5]=u,t[6]=o,t[7]=s,t[8]=a,t[9]=g,t[10]=j,t[11]=M,t[12]=N,t[13]=P,t[14]=F,t[15]=I,t[16]=L,t[17]=R,t[18]=ee,t[19]=z,t[20]=B,t[21]=V,t[22]=H,t[23]=U,t[24]=W,t[25]=G}else j=t[10],M=t[11],N=t[12],P=t[13],F=t[14],I=t[15],L=t[16],R=t[17],ee=t[18],z=t[19],B=t[20],V=t[21],H=t[22],U=t[23],W=t[24],G=t[25];let te;t[46]!==j||t[47]!==B||t[48]!==V?(te=(0,$.jsx)(j,{scope:B,rows:V}),t[46]=j,t[47]=B,t[48]=V,t[49]=te):te=t[49];let K;t[50]!==te||t[51]!==H||t[52]!==U?(K=(0,$.jsxs)(`div`,{className:H,children:[U,te]}),t[50]=te,t[51]=H,t[52]=U,t[53]=K):K=t[53];let ne;t[54]!==n||t[55]!==l?(ne=l&&n?(0,$.jsx)(et,{label:n.label}):null,t[54]=n,t[55]=l,t[56]=ne):ne=t[56];let q;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(r,{id:`Evsh6U`})}),t[57]=q):q=t[57];let re;t[58]!==n||t[59]!==D||t[60]!==k?(re=k===null?D!==null&&n!==null?(0,$.jsx)(Je,{result:D,connection:n}):null:(0,$.jsx)(st,{choice:k}),t[58]=n,t[59]=D,t[60]=k,t[61]=re):re=t[61];let J;t[62]!==M||t[63]!==K||t[64]!==ne||t[65]!==re||t[66]!==W?(J=(0,$.jsxs)(M,{className:W,children:[K,ne,q,re]}),t[62]=M,t[63]=K,t[64]=ne,t[65]=re,t[66]=W,t[67]=J):J=t[67];let ie;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(r,{id:`dEgA5A`}),t[68]=ie):ie=t[68];let Y;t[69]===g?Y=t[70]:(Y=(0,$.jsx)(b,{disabled:g,children:ie}),t[69]=g,t[70]=Y);let ae=g||F.length===0||k!==null&&k.peerSatisfierIds.length===0,X;t[71]!==k?.peerSatisfierIds||t[72]!==I?(X=e=>{e.preventDefault(),I(k?.peerSatisfierIds)},t[71]=k?.peerSatisfierIds,t[72]=I,t[73]=X):X=t[73];let oe;t[74]!==g||t[75]!==k?(oe=g?(0,$.jsx)(r,{id:`uF9ruK`}):k!==null&&k.peerSatisfierIds.length>0?(0,$.jsx)(r,{id:`dGcsnU`}):(0,$.jsx)(r,{id:`t_YqKh`}),t[74]=g,t[75]=k,t[76]=oe):oe=t[76];let se;t[77]!==ae||t[78]!==X||t[79]!==oe?(se=(0,$.jsx)(S,{variant:`destructive`,className:`font-mono uppercase`,disabled:ae,onClick:X,children:oe}),t[77]=ae,t[78]=X,t[79]=oe,t[80]=se):se=t[80];let ce;t[81]!==Y||t[82]!==se?(ce=(0,$.jsxs)(T,{children:[Y,se]}),t[81]=Y,t[82]=se,t[83]=ce):ce=t[83];let Z;t[84]!==N||t[85]!==L||t[86]!==R||t[87]!==J||t[88]!==ce||t[89]!==G?(Z=(0,$.jsxs)(N,{className:G,onCloseAutoFocus:L,children:[R,J,ce]}),t[84]=N,t[85]=L,t[86]=R,t[87]=J,t[88]=ce,t[89]=G,t[90]=Z):Z=t[90];let Q;return t[91]!==P||t[92]!==ee||t[93]!==z||t[94]!==Z?(Q=(0,$.jsx)(P,{open:ee,onOpenChange:z,children:Z}),t[91]=P,t[92]=ee,t[93]=z,t[94]=Z,t[95]=Q):Q=t[95],Q}function lt(e){return e.scope===`machine`}function ut(e){return e.scope===`project`}function dt(e,t,n=[]){let r=Pe(e);return[...n.map(e=>({satisfierId:e,desired:`absent`})),...Ce.flatMap(n=>{let i=e.cells[n];return i===void 0||t[n]===r[n]?[]:[{satisfierId:i.satisfierId,desired:t[n]?`present`:`absent`}]})]}function ft(e,t=[]){let n=Pe(e),r=Object.fromEntries(Ce.map(t=>[t,e.cells[t]?!1:n[t]])),i=t.map(e=>({satisfierId:e,desired:`absent`}));return[...dt(e,r),...i]}function pt(e){if(e.status===`nothing-required`)return`met`;let t=!1;for(let n of e.options){if(n.confidence===`unverified`){t=!0;continue}if(n.counts)return`met`}return t?`unprobed`:`unmet`}function mt(e,t,n){return n===!1?`absent`:n===!0?`present`:t===null||!t.detection.probed?`unknown`:k(t.detection,e)?`present`:`absent`}function ht(e){let{agentId:t,mode:n,snapshot:r,detected:i}=e;if(mt(t,r,i)===`absent`)return`not-installed`;if(r===null)return`no-status`;let a=L({agentId:t,mode:n,probes:r.probes}).requirements.filter(e=>e.level===`required`);if(a.length===0)return`no-status`;let o=a.map(pt);return o.includes(`unprobed`)?`no-status`:o.includes(`unmet`)?`not-connected`:`connected`}function gt(e){return e===`enable-manually`?`external`:`terminal`}function _t(e){let{agentId:t,mode:n,snapshot:r,projectMcp:i}=e;if(r===null||i?.followup===void 0||ht(e)!==`connected`)return;let a=L({agentId:t,mode:n,probes:r.probes}).requirements.find(e=>e.level===`required`&&e.piece===`mcp`);if(a===void 0||a.status!==`met`)return;let o=a.options.filter(e=>e.counts);if(!(o.length!==1||o[0]?.id!==i.satisfierId))return i.followup}export{xe as _,tt as a,Re as c,Le as d,Ne as f,ft as g,Pe as h,mt as i,Ae as l,dt as m,_t as n,je as o,Ie as p,gt as r,ct as s,ht as t,Me as u,pe as v,fe as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Sr as n,Tr as r,br as i,i as a,or as o,xr as s}from"./DocumentContext-VTBMqEb0.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{t as f}from"./utils-CPqDy6Hr.js";import{n as p}from"./AgentIconCluster-CfR3DGT6.js";import{t as m}from"./button-Cym3gapE.js";import{t as h}from"./dist-BHv-mziD.js";import{i as g,n as _,t as v}from"./tooltip-BnyyQDRs.js";import{n as y,r as b,t as x}from"./collapsible-DYySK8La.js";import{a as S,c as C,i as w,n as T,o as E,s as D,t as O}from"./dialog-DgIQr9zS.js";import{t as k}from"./alert-dialog-CrZSZ5Zj.js";import{t as A}from"./checkbox-Crs_F_Np.js";import{t as j}from"./label-D-K3fWtj.js";import{i as M,n as N,o as P,s as F,t as I}from"./select-ByJwKu6h.js";import{n as L,t as R}from"./radio-group-npdxiS6E.js";import{Dt as z,Jt as B,Kt as V,Wc as ee,Xt as H,Yt as U,Zt as W,cn as G,ds as K,en as te,sc as ne,uc as re}from"./dist-C7TUqndm.js";import{n as ie}from"./dist-CJhtNlOm2.js";import{c as q}from"./use-settings-route-1U5FeWiG.js";import{t as J}from"./dist-Cr4-nBVI.js";import{c as Y,v as ae,x as oe}from"./documents-events-Bns9VJKK.js";import{a as se}from"./local-menu-action-bus-BQUa_HQ5.js";import{i as ce}from"./use-apply-config-theme-B5w38X1P.js";import{t as le}from"./parse-api-error-BtEdpaFC.js";import{n as ue}from"./use-workspace-Bs75Zv0f.js";import{t as X}from"./createLucideIcon-B6ULg5PN.js";import{h as de,n as fe,r as pe,t as me}from"./EnableSyncConfirmDialog-rknOqm6H.js";import{f as he,h as ge,p as _e}from"./Mermaid-C8EPNkJP.js";import{t as ve}from"./arrow-up-right-B3B9a7te.js";import{t as ye}from"./check-BzfGb3KU.js";import{t as be}from"./chevron-right-C-g4JuT4.js";import{s as xe}from"./prop-types-Dftq6RlG.js";import{a as Se,m as Ce,r as we,t as Te}from"./dropdown-menu-DjQ8GtwR.js";import{a as Ee,b as De,m as Oe,y as ke}from"./SkillInstallMenu-BGASnDM4.js";import{a as Ae,r as je,t as Me}from"./folder-config-api-BfxvdHun.js";import{t as Ne}from"./spinner-Bp2_BYkl.js";import{t as Pe}from"./refresh-cw-DisV0kHO.js";import{t as Fe}from"./terminal-DGmaW797.js";import{t as Ie}from"./trash-2-B9Flu-41.js";import{t as Le}from"./triangle-alert-CCeXtPLU.js";import{t as Re}from"./x-DIayTyoR.js";import{d as ze,f as Be,n as Ve,v as He}from"./doc-paths-DVIJKJSX.js";import"./config-provider-C_s4gZBL.js";import{p as Ue,r as We,t as Ge}from"./skill-scope-CkRSHwP9.js";import{S as Ke,h as qe,i as Je,p as Ye,x as Xe}from"./skills-api-GG_S3DLj.js";import{t as Ze}from"./input-BJqFvbJL.js";import{a as Qe,i as $e,r as et,t as tt}from"./popover-CfUn4Hx9.js";import{t as nt}from"./external-link-B7FVOsOS.js";import{t as rt}from"./badge-Ct5y0ScC.js";import{a as it,i as at,l as ot,n as st,o as ct,r as lt,t as ut}from"./field-CuGdn_wl.js";import{t as dt}from"./use-skills-BBxerxq6.js";import{n as ft,t as pt}from"./clipboard-adapter-BXo3nuDA.js";import{t as mt}from"./textarea-CGEv5cav.js";import{n as ht}from"./use-conflicts-DA5fcbwd.js";import{t as gt}from"./terminal-command-events-D8Y8z7dv.js";var _t=X(`cloud-alert`,[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]),vt=X(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),yt=X(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),bt=X(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),xt=X(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),St=X(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);function Ct(e){return e===`eperm`?J._({id:`XuQzrk`}):J._({id:`BUyQnq`})}async function wt(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:Ct(t.reason)}}var Z=e(c(),1),Q=d(),Tt=3e3;function Et(e){let{query:t,firedQuery:n,status:r,resultCount:i}=e,a=i>0,o=t!==``&&t!==n,s=a&&(r===`loading`||t!==n),c=null;(r===`error`||r===`provider_error`)&&t!==``?c={kind:`retry`,query:t}:o&&r!==`loading`&&r!==`restart_required`&&r!==`incapable`&&(c={kind:`search`,query:t});let l=null;return r===`loading`?l=`searching`:r===`provider_error`&&t===``?l=`provider-error`:r===`restart_required`?l=`restart-required`:r===`incapable`?l=`incapable`:r===`query_too_short`&&!o?l=`query-too-short`:t===``&&!a?l=`empty`:r===`success`&&!o&&!a&&(l=`no-results`),{submit:c,results:{show:a,dimmed:s,forQuery:a?n:null},notice:l}}function Dt(e){let t=(0,Q.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Z.useState)(n),[a,o]=(0,Z.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return oe(()=>{o(jt)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,Z.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(kt).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:J._({id:`_ci9Bj`})});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null,warnings:e.warnings??[],warningCodes:e.warningCodes??[]}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,Z.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(Ot),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function Ot(e){return e+1}async function kt(e){if(!e.ok){let t=await e.json().catch(At);throw Error(le(t)??`HTTP ${e.status}`)}return e.json()}function At(){return null}function jt(e){return e+1}function Mt(){let e=(0,Q.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Z.useState)(t),[i,a]=(0,Z.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>oe(()=>{a(Ft)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,Z.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then(Nt).then(t=>{if(e)return;let n=G.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:J._({id:`RLNIgv`})});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,Z.useEffect)(c,l),n}async function Nt(e){if(!e.ok){let t=await e.json().catch(Pt);throw Error(le(t)??`HTTP ${e.status}`)}return e.json()}function Pt(){return null}function Ft(e){return e+1}var It=2500,Lt=3e4;async function Rt(e={}){let t=e.warnOnFailure??!0;try{let e=await fetch(`/api/semantic-status`,{signal:AbortSignal.timeout(Tt)});if(!e.ok)return t&&console.warn(`[semantic-status] probe returned`,e.status),{kind:`unavailable`};let n=V.safeParse(await e.json());return n.success?{kind:`success`,status:n.data}:(console.warn(`[semantic-status] probe returned an invalid payload`),{kind:`invalid`})}catch(e){return t&&console.warn(`[semantic-status] probe failed`,e),{kind:`unavailable`}}}function zt(e,t){return t.kind===`success`?{status:t.status,stale:!1}:t.kind===`invalid`?{status:null,stale:!1}:e.stale?e:{...e,stale:!0}}function Bt(e){let t=(0,Q.c)(23),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=r.enabled??!0,a=r.retryUnavailable??!0,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={status:null,stale:!1},t[2]=o):o=t[2];let[s,c]=(0,Z.useReducer)(zt,o),l=(0,Z.useRef)(0),u;t[3]===i?u=t[4]:(u=function(){if(!i)return;let e=l.current+=1;Rt().then(t=>{e===l.current&&c(t)})},t[3]=i,t[4]=u);let d=u,f;t[5]===d?f=t[6]:(f=()=>(d(),()=>{l.current+=1}),t[5]=d,t[6]=f);let p;t[7]===i?p=t[8]:(p=[i],t[7]=i,t[8]=p),(0,Z.useEffect)(f,p);let m;t[9]!==i||t[10]!==d?(m=()=>{if(i)return ae(e=>{e.includes(`files`)&&d()})},t[9]=i,t[10]=d,t[11]=m):m=t[11];let h;t[12]===i?h=t[13]:(h=[i],t[12]=i,t[13]=h),(0,Z.useEffect)(m,h);let g,_;t[14]!==i||t[15]!==a||t[16]!==s.stale?(g=()=>{if(!i||!a||!s.stale)return;let e=!1,t=null,n=0,r=()=>{let i=Math.min(It*2**n,Lt);t=window.setTimeout(()=>{let t=l.current+=1;Rt({warnOnFailure:!1}).then(i=>{if(!e){if(t!==l.current){r();return}c(i),i.kind===`unavailable`&&(n+=1,r())}})},i)};return r(),()=>{e=!0,t!==null&&window.clearTimeout(t)}},_=[i,a,s.stale],t[14]=i,t[15]=a,t[16]=s.stale,t[17]=g,t[18]=_):(g=t[17],_=t[18]),(0,Z.useEffect)(g,_);let v;return t[19]!==d||t[20]!==s.stale||t[21]!==s.status?(v={status:s.status,stale:s.stale,refresh:d},t[19]=d,t[20]=s.stale,t[21]=s.status,t[22]=v):v=t[22],v}var $=t(),Vt=`github.com`,Ht=new Map;async function Ut(e){try{let t=await e.json(),n=z.safeParse(t);if(n.success)return n.data.title}catch{}}async function Wt(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function Gt(e){let t=e?.host??Vt,n=await Wt(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Ut(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function Kt(e){let t=e?.host??Vt,n=Ht.get(t);if(n)return n;let r=Gt(e).finally(()=>{Ht.delete(t)});return Ht.set(t,r),r}function qt(e){let t=e.split(`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Sr as n,Tr as r,br as i,i as a,or as o,xr as s}from"./DocumentContext-CmobwhDV.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{t as f}from"./utils-CPqDy6Hr.js";import{n as p}from"./AgentIconCluster-BjhMMJvg.js";import{t as m}from"./button-Cym3gapE.js";import{t as h}from"./dist-BHv-mziD.js";import{i as g,n as _,t as v}from"./tooltip-BnyyQDRs.js";import{n as y,r as b,t as x}from"./collapsible-DYySK8La.js";import{a as S,c as C,i as w,n as T,o as E,s as D,t as O}from"./dialog-DgIQr9zS.js";import{t as k}from"./alert-dialog-CrZSZ5Zj.js";import{t as A}from"./checkbox-Crs_F_Np.js";import{t as j}from"./label-D-K3fWtj.js";import{i as M,n as N,o as P,s as F,t as I}from"./select-ByJwKu6h.js";import{n as L,t as R}from"./radio-group-npdxiS6E.js";import{Dt as z,Jt as B,Kt as V,Wc as ee,Xt as H,Yt as U,Zt as W,cn as G,ds as K,en as te,sc as ne,uc as re}from"./dist-868Gd8gd.js";import{n as ie}from"./dist-CJhtNlOm2.js";import{c as q}from"./use-settings-route-Dmjvvjxd.js";import{t as J}from"./dist-Cr4-nBVI.js";import{c as Y,v as ae,x as oe}from"./documents-events-DyVmV0Qo.js";import{a as se}from"./local-menu-action-bus-BQUa_HQ5.js";import{i as ce}from"./use-apply-config-theme-B5w38X1P.js";import{t as le}from"./parse-api-error-BtEdpaFC.js";import{n as ue}from"./use-workspace-uVXshHxD.js";import{t as X}from"./createLucideIcon-B6ULg5PN.js";import{h as de,n as fe,r as pe,t as me}from"./EnableSyncConfirmDialog-3Y8YTBbR.js";import{f as he,h as ge,p as _e}from"./Mermaid-C8EPNkJP.js";import{t as ve}from"./arrow-up-right-B3B9a7te.js";import{t as ye}from"./check-BzfGb3KU.js";import{t as be}from"./chevron-right-C-g4JuT4.js";import{s as xe}from"./prop-types-xcUPxUpJ.js";import{a as Se,m as Ce,r as we,t as Te}from"./dropdown-menu-DjQ8GtwR.js";import{a as Ee,b as De,m as Oe,y as ke}from"./SkillInstallMenu-B6dyzecr.js";import{a as Ae,r as je,t as Me}from"./folder-config-api-CL7I86xK.js";import{t as Ne}from"./spinner-Bp2_BYkl.js";import{t as Pe}from"./refresh-cw-DisV0kHO.js";import{t as Fe}from"./terminal-DGmaW797.js";import{t as Ie}from"./trash-2-B9Flu-41.js";import{t as Le}from"./triangle-alert-CCeXtPLU.js";import{t as Re}from"./x-DIayTyoR.js";import{d as ze,f as Be,n as Ve,v as He}from"./doc-paths-ZgPMU9hv.js";import"./config-provider-CMsrN7B5.js";import{p as Ue,r as We,t as Ge}from"./skill-scope-BUi8busH.js";import{S as Ke,h as qe,i as Je,p as Ye,x as Xe}from"./skills-api-Cx2rJHH9.js";import{t as Ze}from"./input-BJqFvbJL.js";import{a as Qe,i as $e,r as et,t as tt}from"./popover-CfUn4Hx9.js";import{t as nt}from"./external-link-B7FVOsOS.js";import{t as rt}from"./badge-Ct5y0ScC.js";import{a as it,i as at,l as ot,n as st,o as ct,r as lt,t as ut}from"./field-CuGdn_wl.js";import{t as dt}from"./use-skills-CpkfrpBl.js";import{n as ft,t as pt}from"./clipboard-adapter-BXo3nuDA.js";import{t as mt}from"./textarea-CGEv5cav.js";import{n as ht}from"./use-conflicts-D-6loWer.js";import{t as gt}from"./terminal-command-events-DQbD5--h.js";var _t=X(`cloud-alert`,[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]),vt=X(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),yt=X(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),bt=X(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),xt=X(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),St=X(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);function Ct(e){return e===`eperm`?J._({id:`XuQzrk`}):J._({id:`BUyQnq`})}async function wt(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:Ct(t.reason)}}var Z=e(c(),1),Q=d(),Tt=3e3;function Et(e){let{query:t,firedQuery:n,status:r,resultCount:i}=e,a=i>0,o=t!==``&&t!==n,s=a&&(r===`loading`||t!==n),c=null;(r===`error`||r===`provider_error`)&&t!==``?c={kind:`retry`,query:t}:o&&r!==`loading`&&r!==`restart_required`&&r!==`incapable`&&(c={kind:`search`,query:t});let l=null;return r===`loading`?l=`searching`:r===`provider_error`&&t===``?l=`provider-error`:r===`restart_required`?l=`restart-required`:r===`incapable`?l=`incapable`:r===`query_too_short`&&!o?l=`query-too-short`:t===``&&!a?l=`empty`:r===`success`&&!o&&!a&&(l=`no-results`),{submit:c,results:{show:a,dimmed:s,forQuery:a?n:null},notice:l}}function Dt(e){let t=(0,Q.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Z.useState)(n),[a,o]=(0,Z.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return oe(()=>{o(jt)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,Z.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(kt).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:J._({id:`_ci9Bj`})});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null,warnings:e.warnings??[],warningCodes:e.warningCodes??[]}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,Z.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(Ot),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function Ot(e){return e+1}async function kt(e){if(!e.ok){let t=await e.json().catch(At);throw Error(le(t)??`HTTP ${e.status}`)}return e.json()}function At(){return null}function jt(e){return e+1}function Mt(){let e=(0,Q.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Z.useState)(t),[i,a]=(0,Z.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>oe(()=>{a(Ft)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,Z.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then(Nt).then(t=>{if(e)return;let n=G.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:J._({id:`RLNIgv`})});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,Z.useEffect)(c,l),n}async function Nt(e){if(!e.ok){let t=await e.json().catch(Pt);throw Error(le(t)??`HTTP ${e.status}`)}return e.json()}function Pt(){return null}function Ft(e){return e+1}var It=2500,Lt=3e4;async function Rt(e={}){let t=e.warnOnFailure??!0;try{let e=await fetch(`/api/semantic-status`,{signal:AbortSignal.timeout(Tt)});if(!e.ok)return t&&console.warn(`[semantic-status] probe returned`,e.status),{kind:`unavailable`};let n=V.safeParse(await e.json());return n.success?{kind:`success`,status:n.data}:(console.warn(`[semantic-status] probe returned an invalid payload`),{kind:`invalid`})}catch(e){return t&&console.warn(`[semantic-status] probe failed`,e),{kind:`unavailable`}}}function zt(e,t){return t.kind===`success`?{status:t.status,stale:!1}:t.kind===`invalid`?{status:null,stale:!1}:e.stale?e:{...e,stale:!0}}function Bt(e){let t=(0,Q.c)(23),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=r.enabled??!0,a=r.retryUnavailable??!0,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={status:null,stale:!1},t[2]=o):o=t[2];let[s,c]=(0,Z.useReducer)(zt,o),l=(0,Z.useRef)(0),u;t[3]===i?u=t[4]:(u=function(){if(!i)return;let e=l.current+=1;Rt().then(t=>{e===l.current&&c(t)})},t[3]=i,t[4]=u);let d=u,f;t[5]===d?f=t[6]:(f=()=>(d(),()=>{l.current+=1}),t[5]=d,t[6]=f);let p;t[7]===i?p=t[8]:(p=[i],t[7]=i,t[8]=p),(0,Z.useEffect)(f,p);let m;t[9]!==i||t[10]!==d?(m=()=>{if(i)return ae(e=>{e.includes(`files`)&&d()})},t[9]=i,t[10]=d,t[11]=m):m=t[11];let h;t[12]===i?h=t[13]:(h=[i],t[12]=i,t[13]=h),(0,Z.useEffect)(m,h);let g,_;t[14]!==i||t[15]!==a||t[16]!==s.stale?(g=()=>{if(!i||!a||!s.stale)return;let e=!1,t=null,n=0,r=()=>{let i=Math.min(It*2**n,Lt);t=window.setTimeout(()=>{let t=l.current+=1;Rt({warnOnFailure:!1}).then(i=>{if(!e){if(t!==l.current){r();return}c(i),i.kind===`unavailable`&&(n+=1,r())}})},i)};return r(),()=>{e=!0,t!==null&&window.clearTimeout(t)}},_=[i,a,s.stale],t[14]=i,t[15]=a,t[16]=s.stale,t[17]=g,t[18]=_):(g=t[17],_=t[18]),(0,Z.useEffect)(g,_);let v;return t[19]!==d||t[20]!==s.stale||t[21]!==s.status?(v={status:s.status,stale:s.stale,refresh:d},t[19]=d,t[20]=s.stale,t[21]=s.status,t[22]=v):v=t[22],v}var $=t(),Vt=`github.com`,Ht=new Map;async function Ut(e){try{let t=await e.json(),n=z.safeParse(t);if(n.success)return n.data.title}catch{}}async function Wt(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function Gt(e){let t=e?.host??Vt,n=await Wt(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Ut(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function Kt(e){let t=e?.host??Vt,n=Ht.get(t);if(n)return n;let r=Gt(e).finally(()=>{Ht.delete(t)});return Ht.set(t,r),r}function qt(e){let t=e.split(`
|
|
2
2
|
`);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function Jt(){return{status:Kt,async repos(e){let t=e?.host??`github.com`,n=await Wt(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await Ut(n)??J._({id:`sGZLfB`})};let r=qt(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||J._({id:`sGZLfB`})}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:J._({id:`sGZLfB`})};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}},async signout(e){let t=await Wt(`/api/local-op/auth/signout`,e);return t.ok?{ok:!0}:{ok:!1,error:await Ut(t)}}}}function Yt(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function Xt(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
|
|
3
3
|
`);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Zt(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}var Qt=2e3,$t=1e4;function en(e,t){return new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t.addEventListener(`abort`,i,{once:!0})})}function tn(e){fetch(`/api/local-op/auth/cancel`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({channel:e})}).catch(e=>{console.warn(`[auth-transport] Cancel request failed (best-effort):`,e instanceof Error?e.message:e)})}async function nn(e,t,n,r){let i=Jt(),a=Qt;for(;!t.aborted&&Date.now()<n;){try{let n=await i.status(r?{host:r}:void 0);if(t.aborted)return;if(n.authenticated){e({type:`complete`,host:n.host,login:n.login,name:n.name,email:n.email});return}}catch(e){console.warn(`[auth-transport] Recovery probe failed:`,e instanceof Error?e.message:e)}await en(a,t),a=Math.min(a*1.5,$t)}t.aborted||e({type:`error`,message:J._({id:`ve8vEM`})})}function rn(e,t,n){let r=!1,i=Zt((n,i)=>{let a=e=>{(e.type===`complete`||e.type===`error`)&&(r=!0),n(e)};(async()=>{let n=null;try{let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:i});if(!r.ok){let e=J._({id:`LnVIW4`});try{let t=z.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}a({type:`error`,message:e});return}if(!r.body){a({type:`error`,message:J._({id:`LnVIW4`})});return}if(await Xt(r.body,e=>{let t;try{t=JSON.parse(e)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,e.slice(0,100)),`continue`}if(t&&typeof t==`object`&&t.type===`error`&&`problem`in t){let e=t.problem;return a({type:`error`,message:e?.detail||e?.title||J._({id:`29VNqC`})}),`terminal`}if(t.type===`ping`)return`continue`;let r=t;return r.type===`verification`&&(n=Date.now()+r.expires_in*1e3),a(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})||i.aborted)return;if(n===null){a({type:`error`,message:J._({id:`DskIkK`})});return}await nn(a,i,n,t.host)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;if(n!==null){await nn(a,i,n,t.host);return}a({type:`error`,message:J._({id:`Q5fqMz`})})}})()});return{events:i.events,cancel:()=>{r||tn(n),i.cancel()}}}function an(){return{start(){return rn(`/api/local-op/auth/login`,{json:!0},`login`)},ghLogin(e){return rn(`/api/local-op/auth/gh-login`,{host:e,json:!0},`gh-login`)},async pat(e,t){try{let n=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({host:e,token:t})});if(n.ok){let e=await n.json();return{ok:!0,login:typeof e.login==`string`?e.login:``}}let r=J._({id:`sNeKjP`});try{let e=z.safeParse(await n.json());e.success&&(r=e.data.detail||e.data.title)}catch{}return{ok:!1,error:r}}catch{return{ok:!1,error:J._({id:`Q5fqMz`})}}}}}function on(e){return{start(){return e.localOp.auth.start()}}}async function sn(e){try{await navigator.clipboard.writeText(e)}catch{}}function cn(e){let t=(0,Q.c)(25),{onSuccess:r,startFlow:i}=e,{_:a}=u(),[o,s]=(0,Z.useState)(null),[c,d]=(0,Z.useState)(`https://github.com/login/device`),[f,p]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null),[y,b]=(0,Z.useState)(0),x=(0,Z.useRef)(null),S=(0,Z.useRef)(null),C;t[0]!==a||t[1]!==r||t[2]!==i?(C=async function(){g(null);try{let e=i();x.current=e.cancel;let t=e.events[Symbol.asyncIterator](),n=!1,o=await t.next();for(;!o.done;){let e=o.value;if(e.type===`verification`)s(e.user_code),d(e.verification_uri),v(Date.now()+e.expires_in*1e3),b(e.expires_in*1e3),sn(e.user_code).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)});else if(e.type===`complete`){n=!0,r({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){n=!0,g(e.message);break}o=await t.next()}n||g(a({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&g(a({id:`Q5fqMz`}))}},t[0]=a,t[1]=r,t[2]=i,t[3]=C):C=t[3];let w=C,T;t[4]===w?T=t[5]:(T=()=>{let e=!1;return queueMicrotask(()=>{e||w()}),()=>{e=!0,x.current?.(),x.current=null,S.current&&clearInterval(S.current)}},t[4]=w,t[5]=T);let E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[6]=E):E=t[6],(0,Z.useEffect)(T,E);let D,O;t[7]!==a||t[8]!==_?(D=()=>{if(_!==null)return S.current=setInterval(()=>{let e=_-Date.now();e<=0?(b(0),S.current&&clearInterval(S.current),g(a({id:`ve8vEM`}))):b(e)},1e3),()=>{S.current&&clearInterval(S.current)}},O=[_,a],t[7]=a,t[8]=_,t[9]=D,t[10]=O):(D=t[9],O=t[10]),(0,Z.useEffect)(D,O);let k=Math.floor(y/6e4),A=Math.floor(y%6e4/1e3),j;t[11]===A?j=t[12]:(j=A.toString().padStart(2,`0`),t[11]=A,t[12]=j);let M=`${k}:${j}`,N;t[13]!==a||t[14]!==f||t[15]!==h||t[16]!==M||t[17]!==o||t[18]!==c?(N=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`eVPynQ`,values:{verificationUri:c},components:{0:(0,$.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>nt(e,c),onAuxClick:e=>nt(e,c),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,$.jsx)(`span`,{}),2:(0,$.jsx)(ve,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,$.jsxs)(m,{type:`button`,variant:`outline`,"aria-label":a({id:`nCzR-G`,values:{userCode:o}}),onClick:()=>void sn(o).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}),className:`relative h-auto w-full justify-center rounded-md bg-muted px-12 py-3 hover:bg-muted/80`,children:[(0,$.jsx)(`code`,{className:`font-mono text-2xl font-bold tracking-widest`,children:o}),(0,$.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:f?(0,$.jsx)(ye,{className:`size-4`}):(0,$.jsx)(n,{className:`size-4`})})]}),(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:f?(0,$.jsx)(l,{id:`80c4-P`}):null}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,$.jsx)(l,{id:`5y_9lO`})]}),(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`gYz2ep`,values:{timeLabel:M}})})]})]}):(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:h?null:(0,$.jsx)(l,{id:`aWlJai`})}),t[13]=a,t[14]=f,t[15]=h,t[16]=M,t[17]=o,t[18]=c,t[19]=N):N=t[19];let P;t[20]===h?P=t[21]:(P=h&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:h}),t[20]=h,t[21]=P);let F;return t[22]!==N||t[23]!==P?(F=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[N,P]}),t[22]=N,t[23]=P,t[24]=F):F=t[24],F}function ln(e){let t=(0,Q.c)(30),{login:n,name:r,onNameChange:i,email:a,onEmailChange:o}=e,{_:s}=u(),c;t[0]===n?c=t[1]:(c=(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:(0,$.jsx)(l,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=c);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`gp3I7-`})}),t[2]=d):d=t[2];let f;t[3]===s?f=t[4]:(f=s({id:`6YtxFj`}),t[3]=s,t[4]=f);let p;t[5]!==s||t[6]!==n?(p=s({id:`J2Mv98`,values:{login:n}}),t[5]=s,t[6]=n,t[7]=p):p=t[7];let m;t[8]===i?m=t[9]:(m=e=>i(e.target.value),t[8]=i,t[9]=m);let h;t[10]!==r||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(Ze,{"aria-label":f,placeholder:p,value:r,onChange:m}),t[10]=r,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===s?g=t[16]:(g=s({id:`O3oNi5`}),t[15]=s,t[16]=g);let _;t[17]===s?_=t[18]:(_=s({id:`O3oNi5`}),t[17]=s,t[18]=_);let v;t[19]===o?v=t[20]:(v=e=>o(e.target.value),t[19]=o,t[20]=v);let y;t[21]!==a||t[22]!==g||t[23]!==_||t[24]!==v?(y=(0,$.jsx)(Ze,{type:`email`,"aria-label":g,placeholder:_,value:a,onChange:v}),t[21]=a,t[22]=g,t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==c||t[27]!==y||t[28]!==h?(b=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[c,d,h,y]}),t[26]=c,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}function un(e){let t=(0,Q.c)(37),{host:n,token:r,onTokenChange:i,error:a,onSubmit:o,showGhOption:s,onGhSignIn:c}=e,{_:d}=u(),f=`https://${n}/settings/tokens/new?scopes=repo,read:user&description=OpenKnowledge`,p;t[0]!==n||t[1]!==c||t[2]!==s?(p=s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m,{type:`button`,onClick:c,children:(0,$.jsx)(l,{id:`_SDGzH`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,$.jsx)(l,{id:`8L0EPw`}),(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})]}):(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`8k6INX`,values:{host:n},components:{0:(0,$.jsx)(`span`,{className:`font-medium text-foreground`})}})}),t[0]=n,t[1]=c,t[2]=s,t[3]=p):p=t[3];let h,g;t[4]===f?(h=t[5],g=t[6]):(h=e=>nt(e,f),g=e=>nt(e,f),t[4]=f,t[5]=h,t[6]=g);let _;t[7]===n?_=t[8]:(_=(0,$.jsx)(l,{id:`6hYjww`,values:{host:n}}),t[7]=n,t[8]=_);let v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(ve,{className:`inline size-3.5`,"aria-hidden":!0}),t[9]=v):v=t[9];let y;t[10]!==f||t[11]!==h||t[12]!==g||t[13]!==_?(y=(0,$.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:h,onAuxClick:g,className:`inline-flex w-fit items-center gap-0.5 text-sm text-foreground hover:text-primary hover:underline`,children:[_,v]}),t[10]=f,t[11]=h,t[12]=g,t[13]=_,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`Xg-Ntj`})}),t[15]=b):b=t[15];let x;t[16]===d?x=t[17]:(x=d({id:`p2LEhJ`}),t[16]=d,t[17]=x);let S;t[18]===i?S=t[19]:(S=e=>i(e.target.value),t[18]=i,t[19]=S);let C;t[20]===o?C=t[21]:(C=e=>{e.key===`Enter`&&o()},t[20]=o,t[21]=C);let w;t[22]!==C||t[23]!==x||t[24]!==S||t[25]!==r?(w=(0,$.jsx)(Ze,{type:`password`,"aria-label":x,placeholder:`ghp_`,value:r,onChange:S,onKeyDown:C}),t[22]=C,t[23]=x,t[24]=S,t[25]=r,t[26]=w):w=t[26];let T;t[27]===a?T=t[28]:(T=a&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:a}),t[27]=a,t[28]=T);let E;t[29]===s?E=t[30]:(E=!s&&(0,$.jsxs)(`div`,{className:`mt-1 rounded-md border border-border/60 bg-muted/40 p-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(`p`,{children:(0,$.jsx)(l,{id:`qX-ABr`})}),(0,$.jsxs)(`ol`,{className:`mt-1.5 list-decimal space-y-0.5 pl-5`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{id:`jxtXZI`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{id:`9Vh9Jf`})})]})]}),t[29]=s,t[30]=E);let D;return t[31]!==p||t[32]!==w||t[33]!==T||t[34]!==E||t[35]!==y?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p,y,b,w,T,E]}),t[31]=p,t[32]=w,t[33]=T,t[34]=E,t[35]=y,t[36]=D):D=t[36],D}var dn=1e4;function fn(e){let t=(0,Q.c)(92),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s,queryTransport:c,host:d,ghAvailable:f}=e,{_:p}=u(),h;t[0]===s?h=t[1]:(h=s??an(),t[0]=s,t[1]=h);let g=h,_;t[2]===c?_=t[3]:(_=c??Jt(),t[2]=c,t[3]=_);let v=_,[y,b]=(0,Z.useState)(`auth`),[x,S]=(0,Z.useState)(null),[k,A]=(0,Z.useState)(``),[j,M]=(0,Z.useState)(``),[N,P]=(0,Z.useState)(``),[F,I]=(0,Z.useState)(null),[L,R]=(0,Z.useState)(!1),[z,B]=(0,Z.useState)(void 0),[V,ee]=(0,Z.useState)(void 0),H=d??z,U=!!H&&H!==`github.com`&&!!(f??V)&&typeof g.ghLogin==`function`,W=!a&&d===void 0,G,K;t[4]!==d||t[5]!==a||t[6]!==W||t[7]!==n?(G=()=>{n&&(S(null),A(``),M(``),P(``),I(null),R(!1),B(void 0),ee(void 0),b(a||W?`checking`:d&&d!==`github.com`?`pat`:`auth`))},K=[n,a,d,W],t[4]=d,t[5]=a,t[6]=W,t[7]=n,t[8]=G,t[9]=K):(G=t[8],K=t[9]),(0,Z.useLayoutEffect)(G,K);let te;t[10]!==a||t[11]!==n||t[12]!==v?(te=()=>{if(!n||!a)return;let e=!1,t=t=>{e||(e=!0,b(t))},r=setTimeout(()=>t(`auth`),dn);return v.status().then(n=>{e||(n.authenticated?(S({login:n.login,name:n.name,email:n.email}),A(n.name??``),M(n.email??``),t(`identity`)):t(`auth`))}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[10]=a,t[11]=n,t[12]=v,t[13]=te):te=t[13];let ne;t[14]!==a||t[15]!==n?(ne=[n,a],t[14]=a,t[15]=n,t[16]=ne):ne=t[16],(0,Z.useEffect)(te,ne);let re;t[17]!==W||t[18]!==n||t[19]!==v?(re=()=>{if(!n||!W)return;let e=!1,t=t=>{e||(e=!0,b(t))},r=setTimeout(()=>t(`auth`),dn);return v.status().then(n=>{if(e)return;let r=!!n.host&&n.host!==`github.com`;B(n.host),ee(n.ghAvailable),t(r?`pat`:`auth`)}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[17]=W,t[18]=n,t[19]=v,t[20]=re):re=t[20];let q;t[21]!==W||t[22]!==n?(q=[n,W],t[21]=W,t[22]=n,t[23]=q):q=t[23],(0,Z.useEffect)(re,q);let J;t[24]!==p||t[25]!==a||t[26]!==r||t[27]!==i?(J=function(e){if(S(e),a)A(e.name??``),M(e.email??``),b(`identity`);else{b(`done`),i?.(e),r(!1);let t=e.login;ie.success(p(t?{id:`E_tNGD`,values:{login:t}}:{id:`cgl-gn`}))}},t[24]=p,t[25]=a,t[26]=r,t[27]=i,t[28]=J):J=t[28];let Y=J,ae;t[29]!==p||t[30]!==H||t[31]!==Y||t[32]!==L||t[33]!==N||t[34]!==g?(ae=async function(){let e=N.trim();if(!e||!H||L)return;if(!g.pat){I(p({id:`iMYFJM`}));return}R(!0),I(null);let t=await g.pat(H,e);R(!1),t.ok?Y({login:t.login??``}):I(t.error??p({id:`sNeKjP`}))},t[29]=p,t[30]=H,t[31]=Y,t[32]=L,t[33]=N,t[34]=g,t[35]=ae):ae=t[35];let oe=ae,se;t[36]!==p||t[37]!==x||t[38]!==r||t[39]!==i?(se=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(pn);let n={...x??{login:``},name:e,email:t};b(`done`),i?.(n),r(!1);let a=n.login;ie.success(p(a?{id:`E_tNGD`,values:{login:a}}:{id:`cgl-gn`}))},t[36]=p,t[37]=x,t[38]=r,t[39]=i,t[40]=se):se=t[40];let ce=se,le;t[41]!==p||t[42]!==x||t[43]!==r||t[44]!==i?(le=function(){if(!x)return;b(`done`),i?.(x),r(!1);let e=x.login;ie.success(p(e?{id:`E_tNGD`,values:{login:e}}:{id:`cgl-gn`}))},t[41]=p,t[42]=x,t[43]=r,t[44]=i,t[45]=le):le=t[45];let ue=le,X;t[46]===r?X=t[47]:(X=function(){r(!1)},t[46]=r,t[47]=X);let de=X,fe;t[48]!==a||t[49]!==o||t[50]!==y?(fe=(0,$.jsx)(D,{children:(0,$.jsx)(C,{children:o&&(y===`pat`||y===`gh-device`)?(0,$.jsx)(l,{id:`DUWgfT`}):o?(0,$.jsx)(l,{id:`X8kjQX`}):y===`pat`||y===`gh-device`?(0,$.jsx)(l,{id:`tzZ6ha`}):a&&y!==`auth`?(0,$.jsx)(l,{id:`29XZXN`}):(0,$.jsx)(l,{id:`3jod3l`})})}),t[48]=a,t[49]=o,t[50]=y,t[51]=fe):fe=t[51];let pe;t[52]===y?pe=t[53]:(pe=y===`checking`&&(0,$.jsx)(T,{children:(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`gBbxn_`})})}),t[52]=y,t[53]=pe);let me;t[54]!==Y||t[55]!==de||t[56]!==g||t[57]!==y?(me=y===`auth`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{children:(0,$.jsx)(cn,{onSuccess:Y,startFlow:()=>g.start()})}),(0,$.jsx)(E,{children:(0,$.jsx)(m,{variant:`outline`,onClick:de,children:(0,$.jsx)(l,{id:`dEgA5A`})})})]}),t[54]=Y,t[55]=de,t[56]=g,t[57]=y,t[58]=me):me=t[58];let he;t[59]!==U||t[60]!==H||t[61]!==de||t[62]!==oe||t[63]!==F||t[64]!==L||t[65]!==N||t[66]!==y?(he=y===`pat`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{children:(0,$.jsx)(un,{host:H??``,token:N,onTokenChange:P,error:F,onSubmit:oe,showGhOption:U,onGhSignIn:()=>b(`gh-device`)})}),(0,$.jsxs)(E,{children:[(0,$.jsx)(m,{variant:`outline`,onClick:de,children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsx)(m,{onClick:oe,disabled:!N.trim()||L,children:L?(0,$.jsx)(l,{id:`9zb2WA`}):(0,$.jsx)(l,{id:`iSLIjg`})})]})]}),t[59]=U,t[60]=H,t[61]=de,t[62]=oe,t[63]=F,t[64]=L,t[65]=N,t[66]=y,t[67]=he):he=t[67];let ge;t[68]!==H||t[69]!==Y||t[70]!==de||t[71]!==g||t[72]!==y?(ge=y===`gh-device`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{children:(0,$.jsx)(cn,{onSuccess:Y,startFlow:()=>g.ghLogin?.(H??``)??g.start()})}),(0,$.jsxs)(E,{children:[(0,$.jsx)(m,{variant:`ghost`,onClick:()=>b(`pat`),children:(0,$.jsx)(l,{id:`hLKfZe`})}),(0,$.jsx)(m,{variant:`outline`,onClick:de,children:(0,$.jsx)(l,{id:`dEgA5A`})})]})]}),t[68]=H,t[69]=Y,t[70]=de,t[71]=g,t[72]=y,t[73]=ge):ge=t[73];let _e;t[74]!==x||t[75]!==ce||t[76]!==ue||t[77]!==j||t[78]!==k||t[79]!==y?(_e=y===`identity`&&x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{children:(0,$.jsx)(ln,{login:x.login,name:k,onNameChange:A,email:j,onEmailChange:M})}),(0,$.jsxs)(E,{children:[(0,$.jsx)(m,{variant:`ghost`,onClick:ue,children:(0,$.jsx)(l,{id:`6Uau97`})}),(0,$.jsx)(m,{onClick:()=>ce(k.trim(),j.trim()),disabled:!k.trim()||!j.trim(),children:(0,$.jsx)(l,{id:`tfDRzk`})})]})]}),t[74]=x,t[75]=ce,t[76]=ue,t[77]=j,t[78]=k,t[79]=y,t[80]=_e):_e=t[80];let ve;t[81]!==fe||t[82]!==pe||t[83]!==me||t[84]!==he||t[85]!==ge||t[86]!==_e?(ve=(0,$.jsxs)(w,{className:`sm:max-w-md`,children:[fe,pe,me,he,ge,_e]}),t[81]=fe,t[82]=pe,t[83]=me,t[84]=he,t[85]=ge,t[86]=_e,t[87]=ve):ve=t[87];let ye;return t[88]!==r||t[89]!==n||t[90]!==ve?(ye=(0,$.jsx)(O,{open:n,onOpenChange:r,children:ve}),t[88]=r,t[89]=n,t[90]=ve,t[91]=ye):ye=t[91],ye}function pn(){}function mn(e){let t=(0,Q.c)(16),{value:n,onChange:r,disabled:i,placeholder:a,rows:o}=e,s=i===void 0?!1:i,c=o===void 0?12:o,u=(0,Z.useId)(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(l,{id:`3o3tur`}),t[0]=d):d=t[0];let f;t[1]===u?f=t[2]:(f=(0,$.jsx)(ct,{htmlFor:u,children:d}),t[1]=u,t[2]=f);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(lt,{children:(0,$.jsx)(l,{id:`5gr_ev`,values:{dateToken:`{{date}}`,userToken:`{{user}}`},components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[3]=p):p=t[3];let m;t[4]===r?m=t[5]:(m=e=>r(e.target.value),t[4]=r,t[5]=m);let h;t[6]!==s||t[7]!==u||t[8]!==a||t[9]!==c||t[10]!==m||t[11]!==n?(h=(0,$.jsx)(mt,{id:u,value:n,onChange:m,disabled:s,rows:c,spellCheck:!1,placeholder:a,className:`font-mono text-xs leading-relaxed min-h-72`}),t[6]=s,t[7]=u,t[8]=a,t[9]=c,t[10]=m,t[11]=n,t[12]=h):h=t[12];let g;return t[13]!==f||t[14]!==h?(g=(0,$.jsxs)(ut,{children:[f,p,h]}),t[13]=f,t[14]=h,t[15]=g):g=t[15],g}var hn=/^[A-Za-z0-9_-]+$/;function gn(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function _n(e){let t={},n=e.title.trim();n&&(t.title=n);let r=e.description.trim();return r&&(t.description=r),t}var vn=0;function yn(){return vn+=1,`prop-${vn}`}function bn(e){let{frontmatter:t,body:n}=ne(e);if(t===``)return{type:``,properties:[],markdown:e};let r=[];for(let e of re(t).split(`
|
|
4
4
|
`)){if(e.trim()===``)continue;let t=e.indexOf(`:`);if((/^\s/.test(e)||t===-1)&&r.length>0){let t=r[r.length-1];t&&(t.value+=`\n${e}`);continue}t!==-1&&r.push({key:e.slice(0,t).trim(),value:e.slice(t+1).replace(/^ /,``)})}let i=``,a=[];for(let e of r){if(e.key===`type`&&i===``){i=e.value.trim();continue}a.push({id:yn(),key:e.key,value:e.value})}return{type:i,properties:a,markdown:n}}function xn(e){let t=[],n=e.type.trim();n&&t.push(`type: ${n}`);for(let n of e.properties){let e=n.key.trim();e===``||e===`type`||t.push(n.value===``?`${e}:`:`${e}: ${n.value}`)}if(t.length===0)return e.markdown.replace(/^\n+/,``);let r=e.markdown.startsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rn as e,Si as t,ca as n}from"./dist-
|
|
1
|
+
import{Rn as e,Si as t,ca as n}from"./dist-868Gd8gd.js";import{c as r,t as i}from"./trace-api-BP9dN1Hz.js";import{t as a}from"./propagation-api-DC5404fy.js";import{t as o}from"./createLucideIcon-B6ULg5PN.js";import{n as s}from"./contact-email-store-jffNheni.js";var c=o(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),l=`support@inkeep.com`;function u(e){return`mailto:${l}?subject=${encodeURIComponent(e)}`}function d(e){return e.split(/[\\/]/).pop()??e}function f(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}var p=200,m=/^(?:#{1,6}|>)(?:[ \t]+|$)/;function h(r){if(typeof r==`string`)for(let i of r.split(/\r\n|\r|\n/)){let r=t(i);for(r=n(r).replace(/\s+/g,` `).trim();m.test(r);)r=r.replace(m,``).trim();if(r!==``)return e(r,p).trimEnd()}}var g=`open-knowledge-app`,_=`ok.bug-report.send.attempt`,v={traceparent:()=>void 0,end:()=>{}},y=v;function b(e={}){try{let t=i.getTracer(g).startSpan(_,{attributes:e});return t.isRecording()?x(t,i.setSpan(r,t)):(t.end(),y)}catch(e){return console.warn(`[bug-report-send-otel] span start failed:`,e instanceof Error?e:String(e)),y}}function x(e,t){let n=!1;return{traceparent(){try{let e={};return a.inject(t,e),e.traceparent}catch{return}},end(t,r){if(!n){n=!0;try{r&&e.setAttributes(r),e.setAttribute(`ok.bug_report.renderer_outcome`,t),e.end()}catch{}}}}}var S=200,C=3,w=.9;function T(e,t=s){if(e.kind===`history-row`){let{row:n}=e,r=t.getSnapshot().email;return{zipPath:n.zipPath,zipSizeBytes:n.zipBytes,metadata:{level:n.bundleLevel===`unknown`?`standard`:n.bundleLevel,systemWide:n.systemWide,projectSlug:n.projectSlug,...n.note===void 0?{}:{note:n.note},...r===null?{}:{email:r}}}}let{report:n,note:r,includeScreenshot:i,includeAttachments:a,email:o}=e;return{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,metadata:{level:n.summary.level,systemWide:n.summary.systemWide,projectSlug:n.summary.projectSlug,note:r,...o===void 0?{}:{email:o}},includeScreenshot:i,...a===void 0?{}:{includeAttachments:a}}}function E(e,t=s){let n=new Map,r=new Set,i=null;function a(){for(let e of r)try{e()}catch(e){console.warn(`[bug-report-send] subscriber threw:`,e)}}function o(e,t){e.state=t,i=null,a()}function c(e){return{operationId:e.operationId,zipPath:e.zipPath,zipSizeBytes:e.zipSizeBytes,requestSeq:e.requestSeq}}function l(e){e.fillTimer!==null&&(clearInterval(e.fillTimer),e.fillTimer=null)}function u(e){l(e);let t=Date.now();e.fillTimer=setInterval(()=>{if(e.state.status!==`sending`){l(e);return}let n=(Date.now()-t)/1e3,r=Math.min(w,1-Math.exp(-n/C)),i=Math.round(r*100);i!==e.state.fillPercent&&o(e,{...c(e),status:`sending`,fillPercent:i})},S)}function f(e,t){l(e),e.span.end(t.status===`email-draft`?`email-drafted`:t.status===`already-sending`?`joined`:t.status,{"ok.bug_report.request_seq":e.requestSeq}),o(e,{...c(e),...t})}function p(e,t){if(t.ok){f(e,{status:`sent`,reference:t.reference});return}if(t.reason===`email-draft`){f(e,{status:`email-draft`,mailtoUrl:t.fallback.mailtoUrl});return}if(t.reason===`send-in-flight`){f(e,{status:`already-sending`});return}f(e,{status:`failed`,mailtoUrl:t.fallback.mailtoUrl})}function m(e){e.span=b({"ok.bug_report.zip_bytes":e.input.zipSizeBytes,"ok.bug_report.include_screenshot":e.input.includeScreenshot===!0,"ok.bug_report.attempt":e.requestSeq}),o(e,{...c(e),status:`sending`,fillPercent:0}),u(e),g(e,e.input)}function h(e){return e.requestSeq+=1,e.state.status===`sending`?(o(e,{...c(e),status:`sending`,fillPercent:e.state.fillPercent}),e.state):(m(e),e.state)}async function g(t,n){try{let r=e();if(r===void 0){console.warn(`[bug-report-send] no desktop bridge; send cannot be dispatched`),f(t,{status:`failed`});return}let i=t.span.traceparent();p(t,await r.send({zipPath:n.zipPath,metadata:n.metadata,...n.includeScreenshot===void 0?{}:{includeScreenshot:n.includeScreenshot},...n.includeAttachments===void 0?{}:{includeAttachments:n.includeAttachments},...i===void 0?{}:{traceparent:i}}))}catch(e){console.warn(`[bug-report-send] IPC dispatch threw:`,e),f(t,{status:`failed`})}}return{startBugReportSend(e){let r=T(e,t),i=d(r.zipPath),a=n.get(i);if(a!==void 0)return a.input=r,h(a);let o={operationId:i,zipPath:r.zipPath,zipSizeBytes:r.zipSizeBytes,requestSeq:1},s={...o,input:r,fillTimer:null,state:{...o,status:`sending`,fillPercent:0},span:v};return n.set(i,s),m(s),s.state},retryBugReportSend(e){let t=n.get(e);t!==void 0&&h(t)},get(e){return n.get(e)?.state},getSnapshot(){return i??=[...n.values()].map(e=>e.state),i},subscribe(e){return r.add(e),()=>{r.delete(e)}}}}var D=E(()=>window.okDesktop?.bugReport);export{d as a,u as i,h as n,c as o,f as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Hn as e,Un as t}from"./dist-868Gd8gd.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.75.1`}?.VITE_APP_VERSION??`0.0.0-unknown`;function r(){return e({kind:`web`,runtimeVersion:n})}function i(){return t({kind:`web`,runtimeVersion:n})}export{r as n,i as r,n as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Fr as t,Hr as n,In as r,Ir as i,Qn as a,Xn as o,ai as s,ci as c,fi as l}from"./DocumentContext-VTBMqEb0.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-Cym3gapE.js";import{i as h,n as g,t as _}from"./tooltip-BnyyQDRs.js";import{Er as v,Kn as y,Zi as b,cr as x,lr as S,qn as C}from"./dist-C7TUqndm.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{i as ee}from"./local-menu-action-bus-BQUa_HQ5.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{Mt as D}from"./CodeMirrorPropInput-s4NvdTOo.js";import{t as te}from"./x-DIayTyoR.js";import{f as ne}from"./doc-paths-DVIJKJSX.js";var O=E(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),k=f(),re=`var(--ok-comment-hue, rgb(37 99 235))`,ie={fill:.22,line:.7},ae={fill:.45,line:1},oe=.45;function A(e){return`color-mix(in srgb,${re} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?ae:ie;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${A(n)}`,`box-shadow:inset 0 -2px 0 ${A(r)}`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function M(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function N(e,t){return e.id===null||e.id===t}function ce(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>N(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:M(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var P=`data-comment-reveal`;function F(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function I(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${F(e)}"]`)}function le(e){let t=I(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){I(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function L(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${F(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=R(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),de(n),!0}return!1}function R(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function de(e){e.style.setProperty(`--comment-reveal-fill`,A(oe)),e.setAttribute(P,`true`);let t=()=>{e.removeAttribute(P),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function z(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=y(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function fe(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:v(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:v(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=b(t.length);return c-s>l?null:{start:s,end:c}}function V(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function H(e,t,n){if(t.length===0)return null;let r=fe(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=v(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||v(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||S(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=S(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function pe(e,t,n){return{prefix:C(e,Math.max(0,t-U),t),suffix:C(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=z(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=z(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var me=220,he=24;function ge(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-me;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+he)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,n,i){let a=D(e);if(!a)return!1;let o=K(a.dom);if(!o)return r(n,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=ge({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return r(n,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var _e=1e4,Y=80,ve=1500,X=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let n=!1,r=null,s=null,c=-1,u=()=>{let a=o(e.docName);if(!a||a.isDestroyed)return!1;if(n||(n=!0,t(e.threadId)),e.quote===``)return r===null&&(r=Date.now(),i(e.threadId)),!0;let l=a.state.doc.content.size;return(s===null||l!==c)&&(s=W(a.state.doc,e.quote,e.context),c=l),!s||!J(a,s,e.docName,{instant:!0})?!1:(r===null&&(r=Date.now(),i(e.threadId)),!0)};l(`comments`),u(),o(e.docName)===null&&window.location.assign(ne(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of X)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&r!==null&&Date.now()-r>=ve&&f()},h=a(m),g=window.setInterval(m,Y),_=window.setTimeout(()=>{r===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},_e);for(let e of X)window.addEventListener(e,p,!0);m()}var Z=e();function be(){return s().length}function xe(){let e=(0,k.c)(4),t=s(),r;if(e[0]!==t){r=new Map;for(let e of t){let t=n(e)?.docName;t!==void 0&&r.set(t,(r.get(t)??0)+1)}e[0]=t,e[1]=r}else r=e[1];let i;return e[2]===r?i=e[3]:(i=[...r].map(Se),e[2]=r,e[3]=i),i}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,k.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=d();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=p(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,Z.jsx)(ee,{className:`size-3`}),i=(0,Z.jsx)(u,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=p(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[10]=f):f=t[10];let v;t[11]===l?v=t[12]:(v=l({id:`2zvUIK`}),t[11]=l,t[12]=v);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(O,{className:`size-3`}),t[13]=y):y=t[13];let b;t[14]!==n||t[15]!==c.length?(b=c.length>1?(0,Z.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,Z.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=b):b=t[16];let x;t[17]!==v||t[18]!==b?(x=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":v,onClick:Te,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[y,b]})}),t[17]=v,t[18]=b,t[19]=x):x=t[19];let S;t[20]===c?S=t[21]:(S=(0,Z.jsx)(g,{className:`max-w-64`,children:c.length>1?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(we)}):(0,Z.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=S);let C;t[22]!==x||t[23]!==S?(C=(0,Z.jsxs)(_,{children:[x,S]}),t[22]=x,t[23]=S,t[24]=C):C=t[24];let w;t[25]===l?w=t[26]:(w=l({id:`pFRz_E`}),t[25]=l,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(te,{className:`size-3`}),t[27]=T):T=t[27];let E;t[28]!==o||t[29]!==w?(E=(0,Z.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":w,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:T}),t[28]=o,t[29]=w,t[30]=E):E=t[30];let D;return t[31]!==E||t[32]!==C?(D=(0,Z.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[C,E]}),t[31]=E,t[32]=C,t[33]=D):D=t[33],D}function we(e){return(0,Z.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Z.jsx)(`span`,{className:`truncate`,children:Q(e.docName)})]},e.docName)}function Te(){return c()}function Q(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ee(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function De(e){ye({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{L({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Oe)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Oe=30;function ke(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function Ae(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function je(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Me(e){if(!e.repeats)return null;let t=Ae(e.prefix),n=je(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Ne(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Fr as t,Hr as n,In as r,Ir as i,Qn as a,Xn as o,ai as s,ci as c,fi as l}from"./DocumentContext-CmobwhDV.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-Cym3gapE.js";import{i as h,n as g,t as _}from"./tooltip-BnyyQDRs.js";import{Er as v,Kn as y,Zi as b,cr as x,lr as S,qn as C}from"./dist-868Gd8gd.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{i as ee}from"./local-menu-action-bus-BQUa_HQ5.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{Mt as D}from"./CodeMirrorPropInput-BfFHUIPT.js";import{t as te}from"./x-DIayTyoR.js";import{f as ne}from"./doc-paths-ZgPMU9hv.js";var O=E(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),k=f(),re=`var(--ok-comment-hue, rgb(37 99 235))`,ie={fill:.22,line:.7},ae={fill:.45,line:1},oe=.45;function A(e){return`color-mix(in srgb,${re} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?ae:ie;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${A(n)}`,`box-shadow:inset 0 -2px 0 ${A(r)}`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function M(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function N(e,t){return e.id===null||e.id===t}function ce(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>N(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:M(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var P=`data-comment-reveal`;function F(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function I(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${F(e)}"]`)}function le(e){let t=I(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){I(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function L(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${F(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=R(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),de(n),!0}return!1}function R(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function de(e){e.style.setProperty(`--comment-reveal-fill`,A(oe)),e.setAttribute(P,`true`);let t=()=>{e.removeAttribute(P),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function z(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=y(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function fe(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:v(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:v(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=b(t.length);return c-s>l?null:{start:s,end:c}}function V(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function H(e,t,n){if(t.length===0)return null;let r=fe(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=v(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||v(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||S(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=S(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function pe(e,t,n){return{prefix:C(e,Math.max(0,t-U),t),suffix:C(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=z(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=z(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var me=220,he=24;function ge(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-me;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+he)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,n,i){let a=D(e);if(!a)return!1;let o=K(a.dom);if(!o)return r(n,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=ge({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return r(n,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var _e=1e4,Y=80,ve=1500,X=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let n=!1,r=null,s=null,c=-1,u=()=>{let a=o(e.docName);if(!a||a.isDestroyed)return!1;if(n||(n=!0,t(e.threadId)),e.quote===``)return r===null&&(r=Date.now(),i(e.threadId)),!0;let l=a.state.doc.content.size;return(s===null||l!==c)&&(s=W(a.state.doc,e.quote,e.context),c=l),!s||!J(a,s,e.docName,{instant:!0})?!1:(r===null&&(r=Date.now(),i(e.threadId)),!0)};l(`comments`),u(),o(e.docName)===null&&window.location.assign(ne(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of X)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&r!==null&&Date.now()-r>=ve&&f()},h=a(m),g=window.setInterval(m,Y),_=window.setTimeout(()=>{r===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},_e);for(let e of X)window.addEventListener(e,p,!0);m()}var Z=e();function be(){return s().length}function xe(){let e=(0,k.c)(4),t=s(),r;if(e[0]!==t){r=new Map;for(let e of t){let t=n(e)?.docName;t!==void 0&&r.set(t,(r.get(t)??0)+1)}e[0]=t,e[1]=r}else r=e[1];let i;return e[2]===r?i=e[3]:(i=[...r].map(Se),e[2]=r,e[3]=i),i}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,k.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=d();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=p(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,Z.jsx)(ee,{className:`size-3`}),i=(0,Z.jsx)(u,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=p(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[10]=f):f=t[10];let v;t[11]===l?v=t[12]:(v=l({id:`2zvUIK`}),t[11]=l,t[12]=v);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(O,{className:`size-3`}),t[13]=y):y=t[13];let b;t[14]!==n||t[15]!==c.length?(b=c.length>1?(0,Z.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,Z.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=b):b=t[16];let x;t[17]!==v||t[18]!==b?(x=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":v,onClick:Te,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[y,b]})}),t[17]=v,t[18]=b,t[19]=x):x=t[19];let S;t[20]===c?S=t[21]:(S=(0,Z.jsx)(g,{className:`max-w-64`,children:c.length>1?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(we)}):(0,Z.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=S);let C;t[22]!==x||t[23]!==S?(C=(0,Z.jsxs)(_,{children:[x,S]}),t[22]=x,t[23]=S,t[24]=C):C=t[24];let w;t[25]===l?w=t[26]:(w=l({id:`pFRz_E`}),t[25]=l,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(te,{className:`size-3`}),t[27]=T):T=t[27];let E;t[28]!==o||t[29]!==w?(E=(0,Z.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":w,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:T}),t[28]=o,t[29]=w,t[30]=E):E=t[30];let D;return t[31]!==E||t[32]!==C?(D=(0,Z.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[C,E]}),t[31]=E,t[32]=C,t[33]=D):D=t[33],D}function we(e){return(0,Z.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Z.jsx)(`span`,{className:`truncate`,children:Q(e.docName)})]},e.docName)}function Te(){return c()}function Q(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ee(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function De(e){ye({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{L({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Oe)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Oe=30;function ke(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function Ae(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function je(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Me(e){if(!e.repeats)return null;let t=Ae(e.prefix),n=je(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Ne(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|
|
2
2
|
`))i.push(` > ${e}`);i.push(``),i.push(` ${e.body.trim()}`)}e.anchorLost&&(i.push(``),i.push(n===``?` (Note: \`${e.propertyKey}\` is no longer in this document's frontmatter — it was renamed or removed since the comment was written. Do not apply this to a different property; if you cannot tell what it now refers to, say so instead of guessing.)`:` (Note: that text is no longer in \`${e.propertyKey}\` — the value was edited, reshaped, or removed since the comment was written. Do not apply this to a different property or a different part of the value; if you cannot tell what it now refers to, say so instead of guessing.)`));return}i.push(`${t+1}. In \`${e.docName}\`, on this passage:`),i.push(``);for(let t of e.quote.split(`
|
|
3
3
|
`))i.push(` > ${t}`);i.push(``),i.push(` ${e.body.trim()}`);let n=Me(e);n!==null&&(i.push(``),i.push(` ${n}`)),e.anchorLost&&(i.push(``),i.push(` (Note: this passage is no longer in the document — it was edited or removed since the comment was written. Do not apply this to a different passage; if you cannot tell what it now refers to, say so instead of guessing.)`))}),n&&n.markdown.trim().length>0){i.push(``),i.push(`Also in scope, selected in \`${n.docName}\` (not a comment):`),i.push(``);for(let e of n.markdown.trim().split(`
|
|
4
4
|
`))i.push(`> ${e}`)}return i.join(`
|