@pi-chamber/web 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lib/cli-startup.js +53 -10
- package/bin/lib/cli-startup.test.js +42 -0
- package/dist/assets/{CommitSection-BpbMC0et.js → CommitSection-DLIvjYbM.js} +1 -1
- package/dist/assets/{DiagramEditor-dFTMKHuO.js → DiagramEditor-Tw3ZWHML.js} +1 -1
- package/dist/assets/{DiagramView-DVw_8Px1.js → DiagramView-CK6R7taL.js} +1 -1
- package/dist/assets/{DiffView-CkoY1oAM.js → DiffView-vrxi5oWp.js} +2 -2
- package/dist/assets/{FilesView-C0hyg2pa.js → FilesView-BD_h3EVr.js} +6 -6
- package/dist/assets/{GitView-D36hpDsb.js → GitView-BwNKqK0K.js} +4 -4
- package/dist/assets/{JsonTreeView-BF8S-bPN.js → JsonTreeView-CmY7QgEX.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-BVNChdig.js → MarkdownRendererImpl-CpI-25Xk.js} +1 -1
- package/dist/assets/{PatchDiff-B--OaNB1.js → PatchDiff-CrIWbYj7.js} +1 -1
- package/dist/assets/{PierreDiffViewer-0Qkp9ICt.js → PierreDiffViewer-B410mdbq.js} +2 -2
- package/dist/assets/{SessionSwitcherDropdown-cFWgy1td.js → SessionSwitcherDropdown-DROjbyIu.js} +100 -100
- package/dist/assets/SettingsView-CsJItYZh.js +4 -0
- package/dist/assets/{SettingsWindow-BuJCvYoR.js → SettingsWindow-C9s4AX72.js} +1 -1
- package/dist/assets/{ToolOutputDialog-Bi9BoEe7.js → ToolOutputDialog-b_R4tAZu.js} +5 -5
- package/dist/assets/{ToolPartDiffPreview-DGX7N4zr.js → ToolPartDiffPreview-CfnliaE9.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-CxraYoDZ.js → VirtualizedFileDiff-CQz2fSZI.js} +4 -4
- package/dist/assets/{collapsible-d4-HChej.js → collapsible-CR4U9tjw.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-BuD14qFL.js → computeVirtualFileMetrics-C7vXPUYT.js} +2 -2
- package/dist/assets/{contextFileOpenGuard-DirV-hCs.js → contextFileOpenGuard-DtTHRnq1.js} +1 -1
- package/dist/assets/{index-DEYblXCW.js → index-BAqpUCjs.js} +5 -5
- package/dist/assets/{index-BWmmf5yJ.js → index-DZG82DE1.js} +1 -1
- package/dist/assets/{index-DLKBsLKY.css → index-riABQmQ_.css} +1 -1
- package/dist/assets/{isDiffPlainText-LoMmNzmX.js → isDiffPlainText-zTq-4A04.js} +1 -1
- package/dist/assets/{isFilePlainText-3Hj9i02t.js → isFilePlainText-CLgIdzE5.js} +1 -1
- package/dist/assets/{main-BsszlAdQ.js → main-BVWtJYSk.js} +2 -2
- package/dist/assets/main-DXYHsqzA.js +133 -0
- package/dist/assets/{markdownCore-sGxk8jrc.js → markdownCore-CN0pApQE.js} +2 -2
- package/dist/assets/{miniChat-C6SDQL4G.js → miniChat-BrbRq5NQ.js} +2 -2
- package/dist/assets/{mobile-DBW3XDmZ.js → mobile-DTPtCn5N.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-B1_fTdN-.js → renderElectronMiniChatApp-CM8qBaye.js} +1 -1
- package/dist/assets/{renderMobileApp-CFxZc_1a.js → renderMobileApp-KS_pt-qc.js} +4 -4
- package/dist/assets/{runtimeSurface-9aJdtQbh.js → runtimeSurface-CkHYYg0E.js} +1 -1
- package/dist/assets/{useInlineCommentController-Cl--s6vE.js → useInlineCommentController-CwNNjgc7.js} +2 -2
- package/dist/assets/usePanelSlide-DkorgQJ5.js +56 -0
- package/dist/assets/{useWindowTitle-C-AZD713.js → useWindowTitle-B9wt_3ZQ.js} +3 -3
- package/dist/assets/{vendor-codemirror-language-data-HC9JT4I3.js → vendor-codemirror-language-data-x89A7Wy0.js} +2 -2
- package/dist/assets/{vendor-sonner-dWA7qvjr.js → vendor-sonner-CW8w438f.js} +1 -1
- package/dist/assets/{web-components-skJ_VpnT.js → web-components-BEPfE4kU.js} +2 -2
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +1 -1
- package/server/index.js +33 -0
- package/server/lib/pi/routes.js +24 -2
- package/server/lib/pi/routes.test.js +14 -6
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +4 -3
- package/server/lib/pi/session-daemon/message-entry-aliases.js +100 -0
- package/server/lib/pi/session-daemon/session-daemon.js +176 -46
- package/server/lib/pi/session-daemon/session-daemon.test.js +364 -6
- package/server/lib/pi/session-daemon/supervisor.js +20 -1
- package/server/lib/pi/session-daemon/supervisor.test.js +43 -0
- package/server/lib/pi/settings-store.js +17 -0
- package/server/lib/pi/settings-store.test.js +33 -0
- package/server/lib/server/core-routes.js +36 -4
- package/server/lib/server/tunnel-service.DOCUMENTATION.md +74 -0
- package/server/lib/server/tunnel-service.js +228 -0
- package/server/lib/server/tunnel-service.test.js +61 -0
- package/server/lib/ui-auth/DOCUMENTATION.md +2 -0
- package/server/lib/ui-auth/ui-auth.js +5 -1
- package/server/lib/ui-auth/ui-auth.test.js +17 -0
- package/dist/assets/SettingsView-D3ZZyjU3.js +0 -4
- package/dist/assets/main-CUvZIN16.js +0 -133
- package/dist/assets/usePanelSlide-D5ffPTGM.js +0 -56
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-
|
|
2
|
-
import{_ as t}from"./vendor-vite-runtime-DD1OZmLC.js";import{c as i}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-KS_pt-qc.js","assets/vendor-react-DYyjh7Q0.js","assets/vendor-scheduler-7OC5HNn7.js","assets/vendor-katex-CHD9BdDO.js","assets/vendor-katex-Cp579UoJ.css","assets/index-BAqpUCjs.js","assets/vendor-zustand-CnsBKjP5.js","assets/index-riABQmQ_.css","assets/useWindowTitle-B9wt_3ZQ.js","assets/SessionSwitcherDropdown-DROjbyIu.js","assets/vendor-simplewebauthn-browser-VDA66rT_.js","assets/vendor-vite-runtime-DD1OZmLC.js","assets/vendor-base-ui-DL8r2fgQ.js","assets/vendor-floating-ui-utils-BzXdqYpP.js","assets/vendor-floating-ui-react-dom-sVFnuruh.js","assets/vendor-floating-ui-dom-Bkw82kL9.js","assets/vendor-floating-ui-core-CXmKXOXc.js","assets/vendor-use-sync-external-store-B7OScDIw.js","assets/runtimeSurface-CkHYYg0E.js","assets/vendor-dnd-kit-core-GipZW2tY.js","assets/vendor-dnd-kit-utilities-CrOcp0Bp.js","assets/vendor-dnd-kit-accessibility-Cv52zwWT.js","assets/vendor-dnd-kit-sortable-Ct2QxIHb.js","assets/vendor-cmdk-BCEUzcHE.js","assets/vendor-radix-ui-react-dialog-jX3Dld8c.js","assets/vendor-radix-ui-primitive-Dc_FVRD7.js","assets/vendor-radix-ui-react-compose-refs-D1GnwnP9.js","assets/vendor-radix-ui-react-context-CM4yFQ2I.js","assets/vendor-radix-ui-react-id-BcxRjnbX.js","assets/vendor-radix-ui-react-use-layout-effect-0fyGwS2_.js","assets/vendor-radix-ui-react-use-controllable-state-C_ecoh35.js","assets/vendor-radix-ui-react-dismissable-layer-M7LsH3yL.js","assets/vendor-radix-ui-react-primitive-CfpW6_IT.js","assets/vendor-radix-ui-react-slot-BxUc3Pvz.js","assets/vendor-radix-ui-react-use-callback-ref-UKEWHtoP.js","assets/vendor-radix-ui-react-use-escape-keydown-Co13lHGj.js","assets/vendor-radix-ui-react-focus-scope-C2K7lNPv.js","assets/vendor-radix-ui-react-portal-xlJWBfDg.js","assets/vendor-radix-ui-react-presence-Btn-Dp7L.js","assets/vendor-radix-ui-react-focus-guards-D5MZ0nQs.js","assets/vendor-react-remove-scroll-CfeMe0DL.js","assets/vendor-tslib-De9GV7Vy.js","assets/vendor-react-remove-scroll-bar-C9YRs2nU.js","assets/vendor-react-style-singleton-B1H4bWSG.js","assets/vendor-get-nonce-C-Z93AgS.js","assets/vendor-use-sidecar-C-AuTczP.js","assets/vendor-use-callback-ref-CJB0R85I.js","assets/vendor-aria-hidden-DvXkyWUv.js","assets/vendor-codemirror-language-E2vgV9K3.js","assets/vendor-lezer-common-B3-cUCR_.js","assets/vendor-codemirror-state-CNWM3Q8V.js","assets/vendor-marijn-find-cluster-break-DXwl3gUT.js","assets/vendor-codemirror-view-DSzLbZiS.js","assets/vendor-style-mod-NZ5MEPvj.js","assets/vendor-w3c-keyname-Vcq4gwWv.js","assets/vendor-crelt-C8TCjufn.js","assets/vendor-lezer-highlight-CDMHUZ74.js","assets/vendor-codemirror-lang-javascript-BUlYhQ3o.js","assets/vendor-lezer-javascript-D7Tj24ot.js","assets/vendor-lezer-lr-bhwg1HMg.js","assets/vendor-codemirror-autocomplete-BS2SpSAZ.js","assets/vendor-codemirror-lang-json-CqayksDf.js","assets/vendor-lezer-json-Iaex0UN-.js","assets/vendor-codemirror-lang-css-Ba8JZ6fp.js","assets/vendor-lezer-css-C5xB6jxd.js","assets/vendor-codemirror-lang-html-DK27qQri.js","assets/vendor-lezer-html-C0I1p52t.js","assets/vendor-codemirror-lang-markdown-CvO36Y1p.js","assets/vendor-lezer-markdown-C6g-d6P3.js","assets/vendor-codemirror-language-data-x89A7Wy0.js","assets/vendor-codemirror-lang-python-_2bIYTiJ.js","assets/vendor-lezer-python-CvuFxeZl.js","assets/vendor-codemirror-commands-RrgJ8H_6.js","assets/vendor-class-variance-authority-5VPnzWs2.js","assets/vendor-clsx-B-dksMZM.js","assets/vendor-tanstack-react-virtual-IrbCBGJ4.js","assets/vendor-tanstack-virtual-core-Dubg10g5.js","assets/vendor-framer-motion-DJASDzNt.js","assets/vendor-motion-dom-DJLgZh4Q.js","assets/vendor-motion-utils-BGh8QBgx.js","assets/vendor-sonner-CW8w438f.js","assets/vendor-tailwind-merge-CPcsbTWB.js","assets/vendor-fuse.js-Dw8P0qyA.js","assets/usePanelSlide-DkorgQJ5.js","assets/permissionStore-BRcQ9Jgt.js","assets/usePanelSlide-BV3KOtdA.css","assets/SettingsView-CsJItYZh.js","assets/vendor-qrcode-COsmt6jn.js","assets/vendor-dijkstrajs-COg3n3zL.js","assets/collapsible-CR4U9tjw.js","assets/vendor-aparajita-capacitor-secure-storage-5IShChL0.js","assets/vendor-capacitor-core-B4EWRrHz.js","assets/CommitSection-DLIvjYbM.js","assets/PierreDiffViewer-B410mdbq.js","assets/web-components-BEPfE4kU.js","assets/computeVirtualFileMetrics-C7vXPUYT.js","assets/vendor-shiki-Bbf2GEcE.js","assets/vendor-shikijs-core-CGM_jqPK.js","assets/vendor-shikijs-types-CPSbSeK6.js","assets/vendor-shikijs-vscode-textmate-BgLrS_2D.js","assets/vendor-hast-util-to-html-BKBhbTDb.js","assets/vendor-html-void-elements-CkdplsNl.js","assets/vendor-property-information-rJCbAzvX.js","assets/vendor-zwitch-C2o2j-tx.js","assets/vendor-stringify-entities-CsH1VEn9.js","assets/vendor-character-entities-legacy-BpoLgcEt.js","assets/vendor-character-entities-html4-D7taRCQ7.js","assets/vendor-ccount-c2V3InAJ.js","assets/vendor-comma-separated-tokens-D8TqSuIK.js","assets/vendor-space-separated-tokens-DD3iYX1K.js","assets/vendor-hast-util-whitespace-D4Wp6AEg.js","assets/vendor-shikijs-engine-oniguruma-DPWuIF1G.js","assets/themeResolver-BmJyTmjJ.js","assets/vendor-pierre-theming-C6Z4M5_u.js","assets/vendor-shikijs-engine-javascript-Cme4830A.js","assets/vendor-oniguruma-to-es-DLBnFDCE.js","assets/vendor-oniguruma-parser-C0D4_9rT.js","assets/vendor-regex-BBWcyTkg.js","assets/vendor-regex-utilities-2BQyy0xI.js","assets/vendor-regex-recursion-JU4mF-dD.js","assets/vendor-shikijs-transformers-CZWsLLKm.js","assets/VirtualizedFileDiff-CQz2fSZI.js","assets/isDiffPlainText-zTq-4A04.js","assets/vendor-diff-C3JhlQdm.js","assets/useInlineCommentController-CwNNjgc7.js","assets/appThemeRegistry-BK0dHKa6.js","assets/registerCustomTheme-BBXUCRnG.js","assets/vendor-remixicon-react-CzPq62YO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t}from"./vendor-vite-runtime-DD1OZmLC.js";import{c as i}from"./index-BAqpUCjs.js";import"./vendor-katex-CHD9BdDO.js";import"./vendor-zustand-CnsBKjP5.js";import"./vendor-react-DYyjh7Q0.js";import"./vendor-scheduler-7OC5HNn7.js";window.__PICHAMBER_RUNTIME_APIS__=i();t(async()=>{const{renderMobileApp:r}=await import("./renderMobileApp-KS_pt-qc.js").then(o=>o.r);return{renderMobileApp:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127])).then(({renderMobileApp:r})=>{r()});
|
package/dist/assets/{renderElectronMiniChatApp-B1_fTdN-.js → renderElectronMiniChatApp-CM8qBaye.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,R as c,e as ge,r as we}from"./vendor-react-DYyjh7Q0.js";import"./vendor-katex-CHD9BdDO.js";import{m as q,S as ve,E as J,u as oe,L as je,v as de,q as be,y as Se,x as Ie}from"./index-DEYblXCW.js";import{u as Ce,a as De,b as Ne,s as Pe,c as Me,d as ke}from"./useWindowTitle-C-AZD713.js";import{c$ as Ee,I as Y,f as K,bZ as _e,T as Le,q as Te,s as Oe,d0 as Ae,d1 as Re,h as S,br as Be,b as ie,a5 as w,aB as ae,d2 as Fe,C as ze,K as Ue,cP as $e,cm as We,cY as le,cX as He,B as ue,cW as z,d3 as me,d4 as Ge,aX as Ke,t as qe,b7 as Ve,aa as Xe,ab as Je,X as Ye,ad as Ze,ae as Qe,af as et,ah as tt,ai as rt,d5 as st,cn as nt,ap as ot,aq as it,ar as at}from"./SessionSwitcherDropdown-cFWgy1td.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-zustand-CnsBKjP5.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-base-ui-DL8r2fgQ.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-react-dom-sVFnuruh.js";import"./vendor-floating-ui-dom-Bkw82kL9.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-use-sync-external-store-B7OScDIw.js";import"./runtimeSurface-9aJdtQbh.js";import"./vendor-dnd-kit-core-GipZW2tY.js";import"./vendor-dnd-kit-utilities-CrOcp0Bp.js";import"./vendor-dnd-kit-accessibility-Cv52zwWT.js";import"./vendor-dnd-kit-sortable-Ct2QxIHb.js";import"./vendor-cmdk-BCEUzcHE.js";import"./vendor-radix-ui-react-dialog-jX3Dld8c.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D1GnwnP9.js";import"./vendor-radix-ui-react-context-CM4yFQ2I.js";import"./vendor-radix-ui-react-id-BcxRjnbX.js";import"./vendor-radix-ui-react-use-layout-effect-0fyGwS2_.js";import"./vendor-radix-ui-react-use-controllable-state-C_ecoh35.js";import"./vendor-radix-ui-react-dismissable-layer-M7LsH3yL.js";import"./vendor-radix-ui-react-primitive-CfpW6_IT.js";import"./vendor-radix-ui-react-slot-BxUc3Pvz.js";import"./vendor-radix-ui-react-use-callback-ref-UKEWHtoP.js";import"./vendor-radix-ui-react-use-escape-keydown-Co13lHGj.js";import"./vendor-radix-ui-react-focus-scope-C2K7lNPv.js";import"./vendor-radix-ui-react-portal-xlJWBfDg.js";import"./vendor-radix-ui-react-presence-Btn-Dp7L.js";import"./vendor-radix-ui-react-focus-guards-D5MZ0nQs.js";import"./vendor-react-remove-scroll-CfeMe0DL.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-C9YRs2nU.js";import"./vendor-react-style-singleton-B1H4bWSG.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-C-AuTczP.js";import"./vendor-use-callback-ref-CJB0R85I.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-codemirror-language-E2vgV9K3.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-codemirror-state-CNWM3Q8V.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-DSzLbZiS.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-codemirror-lang-javascript-BUlYhQ3o.js";import"./vendor-lezer-javascript-D7Tj24ot.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-BS2SpSAZ.js";import"./vendor-codemirror-lang-json-CqayksDf.js";import"./vendor-lezer-json-Iaex0UN-.js";import"./vendor-codemirror-lang-css-Ba8JZ6fp.js";import"./vendor-lezer-css-C5xB6jxd.js";import"./vendor-codemirror-lang-html-DK27qQri.js";import"./vendor-lezer-html-C0I1p52t.js";import"./vendor-codemirror-lang-markdown-CvO36Y1p.js";import"./vendor-lezer-markdown-C6g-d6P3.js";import"./vendor-codemirror-language-data-HC9JT4I3.js";import"./vendor-codemirror-lang-python-_2bIYTiJ.js";import"./vendor-lezer-python-CvuFxeZl.js";import"./vendor-codemirror-commands-RrgJ8H_6.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tanstack-react-virtual-IrbCBGJ4.js";import"./vendor-tanstack-virtual-core-Dubg10g5.js";import"./vendor-framer-motion-DJASDzNt.js";import"./vendor-motion-dom-DJLgZh4Q.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-sonner-dWA7qvjr.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";const ct=({mode:t,children:s})=>e.jsx(Ee.Provider,{value:t,children:s}),dt=Ae,lt=Re,ut=({totalTokens:t,percentage:s,colorPercentage:n,contextLimit:d,outputLimit:i,size:m="default",isMobile:a=!1,hideIcon:M=!1,showPercentIcon:L=!1,className:h,valueClassName:p,percentIconClassName:k,onClick:D,pressed:E=!1,cacheRead:x,cacheWrite:I,cacheHitPercent:v})=>{const[N,j]=c.useState(!1),_=typeof n=="number"?n:s,o=dt(s)??0,y=lt(_),g=y==="critical"?"var(--status-error)":y==="warn"?"var(--status-warning)":"var(--status-success)",l=b=>b>=1e6?`${(b/1e6).toFixed(1)}M`:b>=1e3?`${(b/1e3).toFixed(1)}K`:b.toFixed(1).replace(/\.0$/,""),U=b=>b>=90?"text-status-error":b>=75?"text-status-warning":"text-status-success",f=20,$=3,W=(f-$)/2,Z=2*Math.PI*W,ce=Z*(1-o/100),H=typeof i=="number"?Math.max(i,0):0,A=typeof x=="number"&&typeof I=="number",V=A?Math.max(0,x):0,Q=A?Math.max(0,I):0,R=typeof v=="number"&&Number.isFinite(v),O=[`Used tokens: ${l(t)}`,`Context limit: ${l(d)}`,`Output limit: ${l(H)}`,...A?[`Cache read: ${l(V)}`,`Cache write: ${l(Q)}`]:[],...R?[`Cache hit: ${v.toFixed(1)}%`]:[],`${Math.min(s,999).toFixed(1)}% used`],T=!a&&typeof D=="function",B=e.jsxs(e.Fragment,{children:[!a&&!M&&e.jsx(Y,{name:"donut-chart",className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:K("font-medium inline-flex items-center gap-1.5",p),children:L?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${f}`,className:K("h-3.5 w-3.5 -rotate-90",k),role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("circle",{cx:f/2,cy:f/2,r:W,fill:"none",stroke:"var(--interactive-border)",strokeWidth:$}),e.jsx("circle",{cx:f/2,cy:f/2,r:W,fill:"none",stroke:g,strokeWidth:$,strokeLinecap:"round",strokeDasharray:Z,strokeDashoffset:ce,className:"transition-[stroke-dashoffset,stroke] duration-300"})]}),e.jsxs("span",{className:"text-foreground",children:[Math.min(s,999).toFixed(1),"%"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:U(_),children:Math.min(s,999).toFixed(1)}),"%"]})})]}),C=K("app-region-no-drag flex items-center gap-1.5 select-none",m==="compact"?"typography-micro":"typography-meta",T?K("rounded-md px-2 py-1.5 text-foreground transition-colors","hover:bg-interactive-hover","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"):"text-muted-foreground/60",h),P=T?e.jsx("button",{type:"button",className:C,"aria-label":"Context usage","aria-pressed":E,onClick:D,children:B}):e.jsx("div",{className:C,"aria-label":"Context usage",onClick:a?()=>j(!0):void 0,children:B});return a?e.jsxs(e.Fragment,{children:[P,e.jsx(_e,{open:N,onClose:()=>j(!1),title:"Context Usage",children:e.jsx("div",{className:"flex flex-col gap-1.5",children:e.jsxs("div",{className:"rounded-xl border border-border/40 bg-sidebar/30 px-3 py-2 space-y-1",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Used tokens"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:l(t)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Context limit"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:l(d)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Output limit"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:l(H)})]}),A?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Cache read"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:l(V)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Cache write"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:l(Q)})]})]}):null,R?e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Cache hit"}),e.jsxs("span",{className:"typography-meta text-foreground font-medium",children:[v.toFixed(1),"%"]})]}):null,e.jsxs("div",{className:"flex justify-between items-center pt-1 border-t border-border/40",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Usage"}),e.jsxs("span",{className:K("typography-meta font-semibold",U(_)),children:[Math.min(s,999).toFixed(1),"%"]})]})]})})})]}):e.jsxs(Le,{children:[e.jsx(Te,{asChild:!0,children:P}),e.jsx(Oe,{children:e.jsx("div",{className:"space-y-0.5",children:O.map(b=>e.jsx("p",{className:"typography-micro leading-tight",children:b},b))})})]})},mt=t=>{const s=typeof t=="string"?t.trim():"";if(!s)return"";const n=typeof window<"u"?window.__PICHAMBER_HOME__:"";if(n&&s===n)return"~";if(n&&s.startsWith(`${n}/`))return`~/${s.slice(n.length+1)}`;const d=s.split("/").filter(Boolean);return d.length<=3?s:`.../${d.slice(-3).join("/")}`},te=t=>{const s=typeof t=="string"?t.trim():"";if(!s)return"";const n=s.replace(/\\/g,"/");return n==="/"?"/":n.replace(/\/+$/,"")},pt=({mode:t})=>{const s=S(r=>r.currentSessionId),n=S(r=>!!r.newSessionDraft?.open),d=S(r=>r.newSessionDraft?.selectedProjectId??null),i=q(r=>r.currentDirectory),m=ie(r=>r.projects),a=ie(r=>r.getActiveProject()),M=w(r=>r.getCurrentModel),L=w(r=>r.providers),h=ae(),p=Fe(s??""),k=ze(),D=Ue(r=>r.ensureStatus),E=S(r=>r.newSessionDraft?.open?te(r.newSessionDraft.directoryOverride??""):""),[x,I]=c.useState(!1),v=typeof window<"u"?window.__PICHAMBER_MACOS_MAJOR__??0:0,N=Number.isFinite(v)&&v>0,{usesFramelessChrome:j,side:_}=$e(),o=N?v>=26?"h-12":v<=15?"h-14":"":"",y=c.useMemo(()=>s?h.find(r=>r.id===s)??null:null,[s,h]);c.useEffect(()=>{ve()&&J("desktop_get_window_pinned").then(r=>{typeof r?.pinned=="boolean"&&I(r.pinned)})},[]);const g=y?.title?.trim()||(n||t==="draft"?"New session":"Session"),l=te(y?.directory??null),U=te(i),f=l||E||U,$=mt(f);c.useEffect(()=>{f&&D(f,k.git).catch(()=>{})},[D,f,k.git]);const W=c.useMemo(()=>{const r=f;return r?m.map(u=>({...u,normalizedPath:te(u.path)})).filter(u=>u.normalizedPath&&(u.normalizedPath===r||r.startsWith(`${u.normalizedPath}/`))).sort((u,G)=>G.path.length-u.path.length)[0]??null:null},[f,m]),Z=c.useMemo(()=>{const r=W??a;if(!r)return $||"PiChamber";const u=r.label?.trim();return u||(r.path.split(/[\\/]/).filter(Boolean).at(-1)??r.path)},[a,$,W]),H=We(f||null),A=H&&H!=="HEAD"?H:null,V=M(),Q=c.useMemo(()=>{for(let r=p.length-1;r>=0;r-=1){const u=p[r];if(u.role!=="assistant"||typeof u.providerID!="string"||typeof u.modelID!="string")continue;const ee=L.find(X=>X.id===u.providerID)?.models.find(X=>X.id===u.modelID);if(ee)return ee}},[p,L]),R=V?.limit?V:Q,O=R&&typeof R.limit=="object"&&R.limit!==null?R.limit:null,T=O&&typeof O.context=="number"?O.context:0,B=O&&typeof O.output=="number"?O.output:0,C=c.useMemo(()=>{if(!s||p.length===0)return null;let r,u;for(let se=p.length-1;se>=0;se-=1){const ne=p[se];if(ne.role!=="assistant")continue;const F=ne.tokens;if(!F)continue;if(F.input+F.output+F.reasoning+(F.cache?.read??0)+(F.cache?.write??0)>0){r=F,u=ne.id;break}}if(!r)return null;const G=r.input+r.output+r.reasoning+(r.cache?.read??0)+(r.cache?.write??0),ee=T>0?T:2e5,X=T>0?Math.round(G/T*100):0,ye=B>0?Math.round(r.output/B*100):void 0;return{totalTokens:G,percentage:X,contextLimit:T||0,outputLimit:B||void 0,normalizedOutput:ye,thresholdLimit:ee,lastMessageId:u}},[T,s,p,B]),[P,b]=c.useState(null),pe={WebkitAppRegion:"drag"},re={WebkitAppRegion:"no-drag"};c.useEffect(()=>{if(!s){b(r=>r===null?r:null);return}if(C&&C.totalTokens>0){b(r=>r&&r.totalTokens===C.totalTokens&&r.percentage===C.percentage&&r.contextLimit===C.contextLimit&&(r.outputLimit??0)===(C.outputLimit??0)&&(r.normalizedOutput??0)===(C.normalizedOutput??0)&&r.thresholdLimit===C.thresholdLimit&&r.lastMessageId===C.lastMessageId?r:C);return}b(r=>r===null?r:null)},[C,s]);const fe=P&&P.contextLimit>0?Math.min(999,P.totalTokens/P.contextLimit*100):0,he=c.useCallback(()=>{const r=!x;I(r),J("desktop_set_window_pinned",{pinned:r}).catch(()=>{I(!r)})},[x]),xe=c.useCallback(()=>{const r=s?{sessionId:s,directory:y?.directory??i??""}:{mode:"draft",directory:f||i||"",projectId:d};J("desktop_focus_main_window",r).then(u=>u?.focused===!0?J("desktop_close_current_window"):null)},[i,s,d,f,y]);return e.jsxs("header",{className:K("flex items-center gap-3 bg-background pr-3",N?"pl-[5.5rem]":"pl-3",j?"h-12":o||"min-h-14"),style:pe,children:[j&&_==="left"?e.jsx(le,{visible:!0,position:"left"}):null,e.jsx(He,{children:e.jsxs("button",{type:"button","aria-label":"Open session switcher",style:re,className:"flex min-w-0 max-w-full flex-col items-start rounded-md px-1 py-0.5 text-left transition-colors hover:bg-interactive-hover/60 focus-visible:outline-none focus-visible:bg-interactive-hover/60",children:[e.jsx("span",{className:"truncate typography-ui-label text-[14px] font-normal leading-tight text-foreground max-w-full",children:g}),e.jsxs("span",{className:"flex min-w-0 max-w-full items-center gap-1.5 truncate typography-micro text-[10.5px] font-normal leading-tight text-muted-foreground/75",children:[e.jsx("span",{className:"truncate",children:Z}),A?e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[e.jsx(Y,{name:"git-branch",className:"h-3 w-3 flex-shrink-0 text-muted-foreground/70"}),e.jsx("span",{className:"truncate",children:A})]}):null]})]})}),e.jsx("div",{className:"min-w-0 flex-1"}),P&&P.totalTokens>0?e.jsx(ut,{totalTokens:P.totalTokens,percentage:fe,colorPercentage:P.percentage,contextLimit:P.contextLimit,outputLimit:P.outputLimit??0,className:"h-9 shrink-0 pl-1 pr-1 typography-ui-label",valueClassName:"font-semibold leading-none",hideIcon:!0,showPercentIcon:!0,percentIconClassName:"h-4.5 w-4.5"}):null,e.jsx(ue,{type:"button",variant:"ghost",size:"icon",onClick:he,"aria-label":x?"Unpin Mini Chat window":"Pin Mini Chat window",title:x?"Unpin window":"Pin above other windows",style:re,children:x?e.jsx(Y,{name:"pushpin-2-fill",className:"h-4 w-4"}):e.jsx(Y,{name:"pushpin-2",className:"h-4 w-4"})}),e.jsx(ue,{type:"button",variant:"ghost",size:"icon",onClick:xe,"aria-label":"Open session in main window",title:"Open in main window",style:re,children:e.jsx(Y,{name:"external-link",className:"h-4 w-4"})}),e.jsx(le,{visible:j&&_==="right",position:"right"})]})},ft=({mode:t,autoOpenDraft:s=!1,unavailable:n=!1})=>{const d=S(i=>i.currentSessionId);return e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-background text-foreground",children:[e.jsx(pt,{mode:t}),e.jsx("main",{className:"min-h-0 flex-1",children:n?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center typography-ui-label text-muted-foreground",children:e.jsxs("div",{className:"max-w-sm rounded-lg border border-[var(--interactive-border)] bg-[var(--surface-elevated)] px-4 py-3",children:[e.jsx("div",{className:"font-medium text-foreground",children:"Session unavailable"}),e.jsx("div",{className:"mt-1 typography-small text-muted-foreground",children:"This session could not be loaded. It may have been deleted, archived, or opened from a different project context."})]})}):e.jsx(ct,{mode:"mini-chat",children:e.jsx(Be,{autoOpenDraft:s},d??"no-session")})})]})},ht=()=>{const t=oe(i=>i.shortcutOverrides),s=q(i=>i.currentDirectory),n=ie(i=>i.getActiveProject()),d=S(i=>i.openNewSessionDraft);c.useEffect(()=>{const i=a=>Ve(a,t),m=a=>{if(z(a,i("focus_input"))){a.preventDefault(),me();return}if(je()&&z(a,i("new_mini_chat"))){a.preventDefault(),J("desktop_open_draft_mini_chat_window",{directory:s||n?.path||"",projectId:n?.id??null})?.catch(h=>{console.warn("[mini-chat-shortcuts] failed to open draft mini chat window",h)});return}if(z(a,i("new_chat"))){a.preventDefault(),d({selectedProjectId:n?.id??null,directoryOverride:s||n?.path||null,preserveDirectoryOverride:!!(s||n?.path)}),me();return}if(z(a,i("open_model_selector"))){a.preventDefault();const{isModelSelectorOpen:h,setModelSelectorOpen:p}=oe.getState();p(!h);return}if(z(a,i("cycle_thinking_variant"))){if(w.getState().getCurrentModelVariants().length===0)return;a.preventDefault(),Ge(1).then(k=>{const D=S.getState().currentSessionId,E=w.getState().currentAgentName,x=w.getState().currentProviderId,I=w.getState().currentModelId;D&&E&&x&&I&&Ke.getState().saveAgentModelVariantForSession(D,E,x,I,k)}).catch(()=>{qe.error("Couldn't update thinking")});return}const M=z(a,i("cycle_favorite_model_forward")),L=z(a,i("cycle_favorite_model_backward"));if(M||L){const{favoriteModels:h,addRecentModel:p}=oe.getState();if(h.length===0)return;a.preventDefault();const{currentProviderId:k,currentModelId:D,setProvider:E,setModel:x}=w.getState(),I=h.findIndex(j=>j.providerID===k&&j.modelID===D),N=h[(I+(M?1:-1)+h.length)%h.length];E(N.providerID),x(N.modelID),p(N.providerID,N.modelID)}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[n?.id,n?.path,s,d,t])},xt="pichamber:mini-chat-presence",yt=()=>{const t=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,s=t.get("mode")==="session"?"session":"draft",n=t.get("sessionId")?.trim()||null,d=t.get("directory")?.trim()||null,i=t.get("projectId")?.trim()||null;return{mode:s,sessionId:n,directory:d,projectId:i}},gt=({config:t})=>{const s=ae(),n=q(o=>o.currentDirectory),d=q(o=>o.setDirectory),i=S(o=>o.currentSessionId),m=S(o=>!!o.newSessionDraft?.open),a=S(o=>o.newSessionDraft?.open?o.newSessionDraft.bootstrapPendingDirectory??o.newSessionDraft.directoryOverride??"":""),M=S(o=>o.setCurrentSession),L=S(o=>o.openNewSessionDraft),h=w(o=>o.initializeApp),p=w(o=>o.isInitialized),k=w(o=>o.isConnected),D=w(o=>o.loadProviders),E=w(o=>o.loadAgents),x=w(o=>o.providers.length),I=w(o=>o.agents.length),v=nt();c.useEffect(()=>{h()},[h]),c.useEffect(()=>{if(p)return;let o=!0,y=0;const g=window.setInterval(()=>{if(o){if(y+=1,y>10){window.clearInterval(g);return}w.getState().isInitialized||w.getState().initializeApp()}},1e3);return()=>{o=!1,window.clearInterval(g)}},[p]);const N=c.useRef(!1);c.useEffect(()=>{if(!N.current&&t.mode==="session"&&t.directory){if(n===t.directory){N.current=!0;return}d(t.directory,{showOverlay:!1}),N.current=!0}},[t.directory,t.mode,n,d]),c.useEffect(()=>{t.mode!=="draft"||!m||i||!a||n===a||d(a,{showOverlay:!1})},[t.mode,n,i,a,m,d]),c.useEffect(()=>{k&&(x===0&&D({source:"electronMiniChat:recovery"}),I===0&&E({source:"electronMiniChat:recovery"}))},[I,k,E,D,x]);const j=c.useRef(!1);c.useEffect(()=>{if(j.current||t.mode!=="session"||!t.sessionId)return;if(i===t.sessionId){j.current=!0;return}if(i){j.current=!0;return}const o=s.find(g=>g.id===t.sessionId);if(!o){v.ensureSessionRenderable(t.sessionId);return}const y=o.directory??t.directory;M(t.sessionId,y),j.current=!0},[t,i,s,M,v]),c.useEffect(()=>{const o=y=>{const g=y.detail,l=typeof g?.sessionId=="string"?g.sessionId.trim():"";if(!l||S.getState().currentSessionId===l)return;const U=typeof g?.directory=="string"&&g.directory.trim().length>0?g.directory.trim():s.find(f=>f.id===l)?.directory??null;v.ensureSessionRenderable(l),M(l,U),j.current=!0};return window.addEventListener("pichamber:open-session",o),()=>window.removeEventListener("pichamber:open-session",o)},[s,M,v]),c.useEffect(()=>{t.mode!=="draft"||m||i||L({selectedProjectId:t.projectId,directoryOverride:t.directory,preserveDirectoryOverride:!!t.directory})},[t,i,m,L]);const _=c.useRef(!1);return c.useEffect(()=>{if(_.current||!p)return;const o=()=>{if(_.current)return;_.current=!0;const l=typeof document<"u"?document.getElementById("initial-loading"):null;l&&(l.classList.add("fade-out"),window.setTimeout(()=>l.remove(),300))},y=t.mode==="session"?i===t.sessionId:m,g=window.setTimeout(o,y?100:1500);return()=>window.clearTimeout(g)},[p,t.mode,t.sessionId,i,m]),null},wt=()=>{const t=S(n=>n.currentSessionId),s=q(n=>n.currentDirectory);return c.useEffect(()=>{if(!t||!s||typeof BroadcastChannel>"u")return;const n=new BroadcastChannel(xt),d=a=>{n.postMessage({type:"mini-chat-session-presence",sessionId:t,directory:s,viewed:a})};d(!0);const i=window.setInterval(()=>d(!0),5e3),m=()=>d(!1);return window.addEventListener("beforeunload",m),()=>{window.clearInterval(i),window.removeEventListener("beforeunload",m),d(!1),n.close()}},[s,t]),null},vt=t=>{const s=ae(),n=S(m=>m.currentSessionId),[d,i]=c.useState(!1);return c.useEffect(()=>{if(t.mode!=="session"||!t.sessionId||n===t.sessionId){i(!1);return}if(s.some(a=>a.id===t.sessionId)){i(!1);return}const m=window.setTimeout(()=>i(!0),5e3);return()=>window.clearTimeout(m)},[t.mode,t.sessionId,n,s]),d};function jt({apis:t}){const s=c.useMemo(()=>yt(),[]),n=q(d=>d.currentDirectory);return c.useEffect(()=>{Xe.setDirectory(n||s.directory||void 0)},[s.directory,n]),c.useEffect(()=>(de(t),()=>de(null)),[t]),Je(),ht(),Ce({enabled:!0}),De(),e.jsx(Ye,{children:e.jsx(Ze,{directory:n||s.directory,children:e.jsx(Qe,{apis:t,children:e.jsx(et,{delayDuration:300,skipDelayDuration:150,children:e.jsxs("div",{className:"h-full text-foreground bg-background",children:[e.jsx(bt,{config:s}),e.jsx(tt,{}),e.jsx(rt,{})]})})})})})}const bt=({config:t})=>{const s=vt(t);return e.jsxs(e.Fragment,{children:[e.jsx(gt,{config:t}),e.jsx(wt,{}),e.jsx(st,{embeddedBackgroundWorkEnabled:!0}),e.jsx(ft,{mode:t.mode,autoOpenDraft:t.mode==="draft",unavailable:s})]})},St=()=>{Se().then(()=>{Promise.all([Ie(),Ne()]).catch(t=>{console.error("[mini-chat-main] settings init failed:",t)}),Pe(),Me(),ke()}).catch(t=>{console.error("[mini-chat-main] appearance init failed:",t)})};function Yr(t){const s=t??be();if(!s)throw new Error("Runtime APIs not registered");St();const n=document.getElementById("root");if(!n)throw new Error("Root element not found");ge.createRoot(n).render(e.jsx(we.StrictMode,{children:e.jsx(ot,{children:e.jsx(it,{children:e.jsx(at,{children:e.jsx(jt,{apis:s})})})})}))}export{Yr as renderElectronMiniChatApp};
|
|
1
|
+
import{j as e,R as c,e as ge,r as we}from"./vendor-react-DYyjh7Q0.js";import"./vendor-katex-CHD9BdDO.js";import{m as q,P as ve,E as J,u as oe,I as je,v as le,q as be,y as Se,x as Ie}from"./index-BAqpUCjs.js";import{u as Ce,a as De,b as Ne,s as Pe,c as Me,d as ke}from"./useWindowTitle-B9wt_3ZQ.js";import{cW as Ee,I as Y,f as G,bT as _e,T as Te,q as Le,s as Oe,cX as Ae,cY as Re,h as S,bl as Be,b as ie,a5 as w,aB as ae,cZ as Fe,C as ze,K as Ue,cK as $e,cg as We,cT as de,cS as He,B as ue,cR as z,c_ as me,c$ as Ke,aS as Ge,t as qe,b2 as Ve,aa as Xe,ab as Je,X as Ye,ad as Ze,ae as Qe,af as et,ah as tt,ai as rt,d0 as st,ch as nt,ap as ot,aq as it,ar as at}from"./SessionSwitcherDropdown-DROjbyIu.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-zustand-CnsBKjP5.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-base-ui-DL8r2fgQ.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-react-dom-sVFnuruh.js";import"./vendor-floating-ui-dom-Bkw82kL9.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-use-sync-external-store-B7OScDIw.js";import"./runtimeSurface-CkHYYg0E.js";import"./vendor-dnd-kit-core-GipZW2tY.js";import"./vendor-dnd-kit-utilities-CrOcp0Bp.js";import"./vendor-dnd-kit-accessibility-Cv52zwWT.js";import"./vendor-dnd-kit-sortable-Ct2QxIHb.js";import"./vendor-cmdk-BCEUzcHE.js";import"./vendor-radix-ui-react-dialog-jX3Dld8c.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D1GnwnP9.js";import"./vendor-radix-ui-react-context-CM4yFQ2I.js";import"./vendor-radix-ui-react-id-BcxRjnbX.js";import"./vendor-radix-ui-react-use-layout-effect-0fyGwS2_.js";import"./vendor-radix-ui-react-use-controllable-state-C_ecoh35.js";import"./vendor-radix-ui-react-dismissable-layer-M7LsH3yL.js";import"./vendor-radix-ui-react-primitive-CfpW6_IT.js";import"./vendor-radix-ui-react-slot-BxUc3Pvz.js";import"./vendor-radix-ui-react-use-callback-ref-UKEWHtoP.js";import"./vendor-radix-ui-react-use-escape-keydown-Co13lHGj.js";import"./vendor-radix-ui-react-focus-scope-C2K7lNPv.js";import"./vendor-radix-ui-react-portal-xlJWBfDg.js";import"./vendor-radix-ui-react-presence-Btn-Dp7L.js";import"./vendor-radix-ui-react-focus-guards-D5MZ0nQs.js";import"./vendor-react-remove-scroll-CfeMe0DL.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-C9YRs2nU.js";import"./vendor-react-style-singleton-B1H4bWSG.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-C-AuTczP.js";import"./vendor-use-callback-ref-CJB0R85I.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-codemirror-language-E2vgV9K3.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-codemirror-state-CNWM3Q8V.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-DSzLbZiS.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-codemirror-lang-javascript-BUlYhQ3o.js";import"./vendor-lezer-javascript-D7Tj24ot.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-BS2SpSAZ.js";import"./vendor-codemirror-lang-json-CqayksDf.js";import"./vendor-lezer-json-Iaex0UN-.js";import"./vendor-codemirror-lang-css-Ba8JZ6fp.js";import"./vendor-lezer-css-C5xB6jxd.js";import"./vendor-codemirror-lang-html-DK27qQri.js";import"./vendor-lezer-html-C0I1p52t.js";import"./vendor-codemirror-lang-markdown-CvO36Y1p.js";import"./vendor-lezer-markdown-C6g-d6P3.js";import"./vendor-codemirror-language-data-x89A7Wy0.js";import"./vendor-codemirror-lang-python-_2bIYTiJ.js";import"./vendor-lezer-python-CvuFxeZl.js";import"./vendor-codemirror-commands-RrgJ8H_6.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tanstack-react-virtual-IrbCBGJ4.js";import"./vendor-tanstack-virtual-core-Dubg10g5.js";import"./vendor-framer-motion-DJASDzNt.js";import"./vendor-motion-dom-DJLgZh4Q.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-sonner-CW8w438f.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";const ct=({mode:t,children:s})=>e.jsx(Ee.Provider,{value:t,children:s}),lt=Ae,dt=Re,ut=({totalTokens:t,percentage:s,colorPercentage:n,contextLimit:l,outputLimit:i,size:m="default",isMobile:a=!1,hideIcon:M=!1,showPercentIcon:T=!1,className:h,valueClassName:p,percentIconClassName:k,onClick:D,pressed:E=!1,cacheRead:x,cacheWrite:I,cacheHitPercent:v})=>{const[N,j]=c.useState(!1),_=typeof n=="number"?n:s,o=lt(s)??0,y=dt(_),g=y==="critical"?"var(--status-error)":y==="warn"?"var(--status-warning)":"var(--status-success)",d=b=>b>=1e6?`${(b/1e6).toFixed(1)}M`:b>=1e3?`${(b/1e3).toFixed(1)}K`:b.toFixed(1).replace(/\.0$/,""),U=b=>b>=90?"text-status-error":b>=75?"text-status-warning":"text-status-success",f=20,$=3,W=(f-$)/2,Z=2*Math.PI*W,ce=Z*(1-o/100),H=typeof i=="number"?Math.max(i,0):0,A=typeof x=="number"&&typeof I=="number",V=A?Math.max(0,x):0,Q=A?Math.max(0,I):0,R=typeof v=="number"&&Number.isFinite(v),O=[`Used tokens: ${d(t)}`,`Context limit: ${d(l)}`,`Output limit: ${d(H)}`,...A?[`Cache read: ${d(V)}`,`Cache write: ${d(Q)}`]:[],...R?[`Cache hit: ${v.toFixed(1)}%`]:[],`${Math.min(s,999).toFixed(1)}% used`],L=!a&&typeof D=="function",B=e.jsxs(e.Fragment,{children:[!a&&!M&&e.jsx(Y,{name:"donut-chart",className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:G("font-medium inline-flex items-center gap-1.5",p),children:T?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${f}`,className:G("h-3.5 w-3.5 -rotate-90",k),role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("circle",{cx:f/2,cy:f/2,r:W,fill:"none",stroke:"var(--interactive-border)",strokeWidth:$}),e.jsx("circle",{cx:f/2,cy:f/2,r:W,fill:"none",stroke:g,strokeWidth:$,strokeLinecap:"round",strokeDasharray:Z,strokeDashoffset:ce,className:"transition-[stroke-dashoffset,stroke] duration-300"})]}),e.jsxs("span",{className:"text-foreground",children:[Math.min(s,999).toFixed(1),"%"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:U(_),children:Math.min(s,999).toFixed(1)}),"%"]})})]}),C=G("app-region-no-drag flex items-center gap-1.5 select-none",m==="compact"?"typography-micro":"typography-meta",L?G("rounded-md px-2 py-1.5 text-foreground transition-colors","hover:bg-interactive-hover","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"):"text-muted-foreground/60",h),P=L?e.jsx("button",{type:"button",className:C,"aria-label":"Context usage","aria-pressed":E,onClick:D,children:B}):e.jsx("div",{className:C,"aria-label":"Context usage",onClick:a?()=>j(!0):void 0,children:B});return a?e.jsxs(e.Fragment,{children:[P,e.jsx(_e,{open:N,onClose:()=>j(!1),title:"Context Usage",children:e.jsx("div",{className:"flex flex-col gap-1.5",children:e.jsxs("div",{className:"rounded-xl border border-border/40 bg-sidebar/30 px-3 py-2 space-y-1",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Used tokens"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:d(t)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Context limit"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:d(l)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Output limit"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:d(H)})]}),A?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Cache read"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:d(V)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Cache write"}),e.jsx("span",{className:"typography-meta text-foreground font-medium",children:d(Q)})]})]}):null,R?e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Cache hit"}),e.jsxs("span",{className:"typography-meta text-foreground font-medium",children:[v.toFixed(1),"%"]})]}):null,e.jsxs("div",{className:"flex justify-between items-center pt-1 border-t border-border/40",children:[e.jsx("span",{className:"typography-meta text-muted-foreground",children:"Usage"}),e.jsxs("span",{className:G("typography-meta font-semibold",U(_)),children:[Math.min(s,999).toFixed(1),"%"]})]})]})})})]}):e.jsxs(Te,{children:[e.jsx(Le,{asChild:!0,children:P}),e.jsx(Oe,{children:e.jsx("div",{className:"space-y-0.5",children:O.map(b=>e.jsx("p",{className:"typography-micro leading-tight",children:b},b))})})]})},mt=t=>{const s=typeof t=="string"?t.trim():"";if(!s)return"";const n=typeof window<"u"?window.__PICHAMBER_HOME__:"";if(n&&s===n)return"~";if(n&&s.startsWith(`${n}/`))return`~/${s.slice(n.length+1)}`;const l=s.split("/").filter(Boolean);return l.length<=3?s:`.../${l.slice(-3).join("/")}`},te=t=>{const s=typeof t=="string"?t.trim():"";if(!s)return"";const n=s.replace(/\\/g,"/");return n==="/"?"/":n.replace(/\/+$/,"")},pt=({mode:t})=>{const s=S(r=>r.currentSessionId),n=S(r=>!!r.newSessionDraft?.open),l=S(r=>r.newSessionDraft?.selectedProjectId??null),i=q(r=>r.currentDirectory),m=ie(r=>r.projects),a=ie(r=>r.getActiveProject()),M=w(r=>r.getCurrentModel),T=w(r=>r.providers),h=ae(),p=Fe(s??""),k=ze(),D=Ue(r=>r.ensureStatus),E=S(r=>r.newSessionDraft?.open?te(r.newSessionDraft.directoryOverride??""):""),[x,I]=c.useState(!1),v=typeof window<"u"?window.__PICHAMBER_MACOS_MAJOR__??0:0,N=Number.isFinite(v)&&v>0,{usesFramelessChrome:j,side:_}=$e(),o=N?v>=26?"h-12":v<=15?"h-14":"":"",y=c.useMemo(()=>s?h.find(r=>r.id===s)??null:null,[s,h]);c.useEffect(()=>{ve()&&J("desktop_get_window_pinned").then(r=>{typeof r?.pinned=="boolean"&&I(r.pinned)})},[]);const g=y?.title?.trim()||(n||t==="draft"?"New session":"Session"),d=te(y?.directory??null),U=te(i),f=d||E||U,$=mt(f);c.useEffect(()=>{f&&D(f,k.git).catch(()=>{})},[D,f,k.git]);const W=c.useMemo(()=>{const r=f;return r?m.map(u=>({...u,normalizedPath:te(u.path)})).filter(u=>u.normalizedPath&&(u.normalizedPath===r||r.startsWith(`${u.normalizedPath}/`))).sort((u,K)=>K.path.length-u.path.length)[0]??null:null},[f,m]),Z=c.useMemo(()=>{const r=W??a;if(!r)return $||"PiChamber";const u=r.label?.trim();return u||(r.path.split(/[\\/]/).filter(Boolean).at(-1)??r.path)},[a,$,W]),H=We(f||null),A=H&&H!=="HEAD"?H:null,V=M(),Q=c.useMemo(()=>{for(let r=p.length-1;r>=0;r-=1){const u=p[r];if(u.role!=="assistant"||typeof u.providerID!="string"||typeof u.modelID!="string")continue;const ee=T.find(X=>X.id===u.providerID)?.models.find(X=>X.id===u.modelID);if(ee)return ee}},[p,T]),R=V?.limit?V:Q,O=R&&typeof R.limit=="object"&&R.limit!==null?R.limit:null,L=O&&typeof O.context=="number"?O.context:0,B=O&&typeof O.output=="number"?O.output:0,C=c.useMemo(()=>{if(!s||p.length===0)return null;let r,u;for(let se=p.length-1;se>=0;se-=1){const ne=p[se];if(ne.role!=="assistant")continue;const F=ne.tokens;if(!F)continue;if(F.input+F.output+F.reasoning+(F.cache?.read??0)+(F.cache?.write??0)>0){r=F,u=ne.id;break}}if(!r)return null;const K=r.input+r.output+r.reasoning+(r.cache?.read??0)+(r.cache?.write??0),ee=L>0?L:2e5,X=L>0?Math.round(K/L*100):0,ye=B>0?Math.round(r.output/B*100):void 0;return{totalTokens:K,percentage:X,contextLimit:L||0,outputLimit:B||void 0,normalizedOutput:ye,thresholdLimit:ee,lastMessageId:u}},[L,s,p,B]),[P,b]=c.useState(null),pe={WebkitAppRegion:"drag"},re={WebkitAppRegion:"no-drag"};c.useEffect(()=>{if(!s){b(r=>r===null?r:null);return}if(C&&C.totalTokens>0){b(r=>r&&r.totalTokens===C.totalTokens&&r.percentage===C.percentage&&r.contextLimit===C.contextLimit&&(r.outputLimit??0)===(C.outputLimit??0)&&(r.normalizedOutput??0)===(C.normalizedOutput??0)&&r.thresholdLimit===C.thresholdLimit&&r.lastMessageId===C.lastMessageId?r:C);return}b(r=>r===null?r:null)},[C,s]);const fe=P&&P.contextLimit>0?Math.min(999,P.totalTokens/P.contextLimit*100):0,he=c.useCallback(()=>{const r=!x;I(r),J("desktop_set_window_pinned",{pinned:r}).catch(()=>{I(!r)})},[x]),xe=c.useCallback(()=>{const r=s?{sessionId:s,directory:y?.directory??i??""}:{mode:"draft",directory:f||i||"",projectId:l};J("desktop_focus_main_window",r).then(u=>u?.focused===!0?J("desktop_close_current_window"):null)},[i,s,l,f,y]);return e.jsxs("header",{className:G("flex items-center gap-3 bg-background pr-3",N?"pl-[5.5rem]":"pl-3",j?"h-12":o||"min-h-14"),style:pe,children:[j&&_==="left"?e.jsx(de,{visible:!0,position:"left"}):null,e.jsx(He,{children:e.jsxs("button",{type:"button","aria-label":"Open session switcher",style:re,className:"flex min-w-0 max-w-full flex-col items-start rounded-md px-1 py-0.5 text-left transition-colors hover:bg-interactive-hover/60 focus-visible:outline-none focus-visible:bg-interactive-hover/60",children:[e.jsx("span",{className:"truncate typography-ui-label text-[14px] font-normal leading-tight text-foreground max-w-full",children:g}),e.jsxs("span",{className:"flex min-w-0 max-w-full items-center gap-1.5 truncate typography-micro text-[10.5px] font-normal leading-tight text-muted-foreground/75",children:[e.jsx("span",{className:"truncate",children:Z}),A?e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[e.jsx(Y,{name:"git-branch",className:"h-3 w-3 flex-shrink-0 text-muted-foreground/70"}),e.jsx("span",{className:"truncate",children:A})]}):null]})]})}),e.jsx("div",{className:"min-w-0 flex-1"}),P&&P.totalTokens>0?e.jsx(ut,{totalTokens:P.totalTokens,percentage:fe,colorPercentage:P.percentage,contextLimit:P.contextLimit,outputLimit:P.outputLimit??0,className:"h-9 shrink-0 pl-1 pr-1 typography-ui-label",valueClassName:"font-semibold leading-none",hideIcon:!0,showPercentIcon:!0,percentIconClassName:"h-4.5 w-4.5"}):null,e.jsx(ue,{type:"button",variant:"ghost",size:"icon",onClick:he,"aria-label":x?"Unpin Mini Chat window":"Pin Mini Chat window",title:x?"Unpin window":"Pin above other windows",style:re,children:x?e.jsx(Y,{name:"pushpin-2-fill",className:"h-4 w-4"}):e.jsx(Y,{name:"pushpin-2",className:"h-4 w-4"})}),e.jsx(ue,{type:"button",variant:"ghost",size:"icon",onClick:xe,"aria-label":"Open session in main window",title:"Open in main window",style:re,children:e.jsx(Y,{name:"external-link",className:"h-4 w-4"})}),e.jsx(de,{visible:j&&_==="right",position:"right"})]})},ft=({mode:t,autoOpenDraft:s=!1,unavailable:n=!1})=>{const l=S(i=>i.currentSessionId);return e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-background text-foreground",children:[e.jsx(pt,{mode:t}),e.jsx("main",{className:"min-h-0 flex-1",children:n?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center typography-ui-label text-muted-foreground",children:e.jsxs("div",{className:"max-w-sm rounded-lg border border-[var(--interactive-border)] bg-[var(--surface-elevated)] px-4 py-3",children:[e.jsx("div",{className:"font-medium text-foreground",children:"Session unavailable"}),e.jsx("div",{className:"mt-1 typography-small text-muted-foreground",children:"This session could not be loaded. It may have been deleted, archived, or opened from a different project context."})]})}):e.jsx(ct,{mode:"mini-chat",children:e.jsx(Be,{autoOpenDraft:s},l??"no-session")})})]})},ht=()=>{const t=oe(i=>i.shortcutOverrides),s=q(i=>i.currentDirectory),n=ie(i=>i.getActiveProject()),l=S(i=>i.openNewSessionDraft);c.useEffect(()=>{const i=a=>Ve(a,t),m=a=>{if(z(a,i("focus_input"))){a.preventDefault(),me();return}if(je()&&z(a,i("new_mini_chat"))){a.preventDefault(),J("desktop_open_draft_mini_chat_window",{directory:s||n?.path||"",projectId:n?.id??null})?.catch(h=>{console.warn("[mini-chat-shortcuts] failed to open draft mini chat window",h)});return}if(z(a,i("new_chat"))){a.preventDefault(),l({selectedProjectId:n?.id??null,directoryOverride:s||n?.path||null,preserveDirectoryOverride:!!(s||n?.path)}),me();return}if(z(a,i("open_model_selector"))){a.preventDefault();const{isModelSelectorOpen:h,setModelSelectorOpen:p}=oe.getState();p(!h);return}if(z(a,i("cycle_thinking_variant"))){if(w.getState().getCurrentModelVariants().length===0)return;a.preventDefault(),Ke(1).then(k=>{const D=S.getState().currentSessionId,E=w.getState().currentAgentName,x=w.getState().currentProviderId,I=w.getState().currentModelId;D&&E&&x&&I&&Ge.getState().saveAgentModelVariantForSession(D,E,x,I,k)}).catch(()=>{qe.error("Couldn't update thinking")});return}const M=z(a,i("cycle_favorite_model_forward")),T=z(a,i("cycle_favorite_model_backward"));if(M||T){const{favoriteModels:h,addRecentModel:p}=oe.getState();if(h.length===0)return;a.preventDefault();const{currentProviderId:k,currentModelId:D,setProvider:E,setModel:x}=w.getState(),I=h.findIndex(j=>j.providerID===k&&j.modelID===D),N=h[(I+(M?1:-1)+h.length)%h.length];E(N.providerID),x(N.modelID),p(N.providerID,N.modelID)}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[n?.id,n?.path,s,l,t])},xt="pichamber:mini-chat-presence",yt=()=>{const t=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,s=t.get("mode")==="session"?"session":"draft",n=t.get("sessionId")?.trim()||null,l=t.get("directory")?.trim()||null,i=t.get("projectId")?.trim()||null;return{mode:s,sessionId:n,directory:l,projectId:i}},gt=({config:t})=>{const s=ae(),n=q(o=>o.currentDirectory),l=q(o=>o.setDirectory),i=S(o=>o.currentSessionId),m=S(o=>!!o.newSessionDraft?.open),a=S(o=>o.newSessionDraft?.open?o.newSessionDraft.bootstrapPendingDirectory??o.newSessionDraft.directoryOverride??"":""),M=S(o=>o.setCurrentSession),T=S(o=>o.openNewSessionDraft),h=w(o=>o.initializeApp),p=w(o=>o.isInitialized),k=w(o=>o.isConnected),D=w(o=>o.loadProviders),E=w(o=>o.loadAgents),x=w(o=>o.providers.length),I=w(o=>o.agents.length),v=nt();c.useEffect(()=>{h()},[h]),c.useEffect(()=>{if(p)return;let o=!0,y=0;const g=window.setInterval(()=>{if(o){if(y+=1,y>10){window.clearInterval(g);return}w.getState().isInitialized||w.getState().initializeApp()}},1e3);return()=>{o=!1,window.clearInterval(g)}},[p]);const N=c.useRef(!1);c.useEffect(()=>{if(!N.current&&t.mode==="session"&&t.directory){if(n===t.directory){N.current=!0;return}l(t.directory,{showOverlay:!1}),N.current=!0}},[t.directory,t.mode,n,l]),c.useEffect(()=>{t.mode!=="draft"||!m||i||!a||n===a||l(a,{showOverlay:!1})},[t.mode,n,i,a,m,l]),c.useEffect(()=>{k&&(x===0&&D({source:"electronMiniChat:recovery"}),I===0&&E({source:"electronMiniChat:recovery"}))},[I,k,E,D,x]);const j=c.useRef(!1);c.useEffect(()=>{if(j.current||t.mode!=="session"||!t.sessionId)return;if(i===t.sessionId){j.current=!0;return}if(i){j.current=!0;return}const o=s.find(g=>g.id===t.sessionId);if(!o){v.ensureSessionRenderable(t.sessionId);return}const y=o.directory??t.directory;M(t.sessionId,y),j.current=!0},[t,i,s,M,v]),c.useEffect(()=>{const o=y=>{const g=y.detail,d=typeof g?.sessionId=="string"?g.sessionId.trim():"";if(!d||S.getState().currentSessionId===d)return;const U=typeof g?.directory=="string"&&g.directory.trim().length>0?g.directory.trim():s.find(f=>f.id===d)?.directory??null;v.ensureSessionRenderable(d),M(d,U),j.current=!0};return window.addEventListener("pichamber:open-session",o),()=>window.removeEventListener("pichamber:open-session",o)},[s,M,v]),c.useEffect(()=>{t.mode!=="draft"||m||i||T({selectedProjectId:t.projectId,directoryOverride:t.directory,preserveDirectoryOverride:!!t.directory})},[t,i,m,T]);const _=c.useRef(!1);return c.useEffect(()=>{if(_.current||!p)return;const o=()=>{if(_.current)return;_.current=!0;const d=typeof document<"u"?document.getElementById("initial-loading"):null;d&&(d.classList.add("fade-out"),window.setTimeout(()=>d.remove(),300))},y=t.mode==="session"?i===t.sessionId:m,g=window.setTimeout(o,y?100:1500);return()=>window.clearTimeout(g)},[p,t.mode,t.sessionId,i,m]),null},wt=()=>{const t=S(n=>n.currentSessionId),s=q(n=>n.currentDirectory);return c.useEffect(()=>{if(!t||!s||typeof BroadcastChannel>"u")return;const n=new BroadcastChannel(xt),l=a=>{n.postMessage({type:"mini-chat-session-presence",sessionId:t,directory:s,viewed:a})};l(!0);const i=window.setInterval(()=>l(!0),5e3),m=()=>l(!1);return window.addEventListener("beforeunload",m),()=>{window.clearInterval(i),window.removeEventListener("beforeunload",m),l(!1),n.close()}},[s,t]),null},vt=t=>{const s=ae(),n=S(m=>m.currentSessionId),[l,i]=c.useState(!1);return c.useEffect(()=>{if(t.mode!=="session"||!t.sessionId||n===t.sessionId){i(!1);return}if(s.some(a=>a.id===t.sessionId)){i(!1);return}const m=window.setTimeout(()=>i(!0),5e3);return()=>window.clearTimeout(m)},[t.mode,t.sessionId,n,s]),l};function jt({apis:t}){const s=c.useMemo(()=>yt(),[]),n=q(l=>l.currentDirectory);return c.useEffect(()=>{Xe.setDirectory(n||s.directory||void 0)},[s.directory,n]),c.useEffect(()=>(le(t),()=>le(null)),[t]),Je(),ht(),Ce({enabled:!0}),De(),e.jsx(Ye,{children:e.jsx(Ze,{directory:n||s.directory,children:e.jsx(Qe,{apis:t,children:e.jsx(et,{delayDuration:300,skipDelayDuration:150,children:e.jsxs("div",{className:"h-full text-foreground bg-background",children:[e.jsx(bt,{config:s}),e.jsx(tt,{}),e.jsx(rt,{})]})})})})})}const bt=({config:t})=>{const s=vt(t);return e.jsxs(e.Fragment,{children:[e.jsx(gt,{config:t}),e.jsx(wt,{}),e.jsx(st,{embeddedBackgroundWorkEnabled:!0}),e.jsx(ft,{mode:t.mode,autoOpenDraft:t.mode==="draft",unavailable:s})]})},St=()=>{Se().then(()=>{Promise.all([Ie(),Ne()]).catch(t=>{console.error("[mini-chat-main] settings init failed:",t)}),Pe(),Me(),ke()}).catch(t=>{console.error("[mini-chat-main] appearance init failed:",t)})};function Yr(t){const s=t??be();if(!s)throw new Error("Runtime APIs not registered");St();const n=document.getElementById("root");if(!n)throw new Error("Root element not found");ge.createRoot(n).render(e.jsx(we.StrictMode,{children:e.jsx(ot,{children:e.jsx(it,{children:e.jsx(at,{children:e.jsx(jt,{apis:s})})})})}))}export{Yr as renderElectronMiniChatApp};
|