@openchambery/web 1.18.2-beta.2 → 1.18.2-beta.21
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/{AgentAvatar-B2kZjgaf.js → AgentAvatar-B4fj9PIe.js} +1 -1
- package/dist/assets/{AssistantView-DvoyOGkx.js → AssistantView-C00aiEHK.js} +1 -1
- package/dist/assets/{ChatContainer-D6yfuigV.js → ChatContainer-BDFeDKu-.js} +39 -39
- package/dist/assets/{DiagramView-MGGo9iME.js → DiagramView-CUfSFI3e.js} +1 -1
- package/dist/assets/{FadeInOnReveal-aeWlaqVB.js → FadeInOnReveal-CKKU6fKI.js} +1 -1
- package/dist/assets/{Icon-AXqa-fYB.js → Icon-DiIuWOuC.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-jVOkZkyX.js → MarkdownRendererImpl-Cen6E9Lj.js} +2 -2
- package/dist/assets/{MobileDetailNavigation-Q2IzHqGA.js → MobileDetailNavigation-DILi0tN7.js} +1 -1
- package/dist/assets/{MobileShareBridge-apXM34Lb.js → MobileShareBridge-PZMRiieI.js} +1 -1
- package/dist/assets/MobileSurface-BLYcR0tO.js +2 -0
- package/dist/assets/{MultiRunWindow-B-l_O-bd.js → MultiRunWindow-D_2mWZyv.js} +1 -1
- package/dist/assets/{OnboardingScreen-CUsgwt4y.js → OnboardingScreen-CYeRZznl.js} +1 -1
- package/dist/assets/{OverlayScrollbar-D6NySAxi.js → OverlayScrollbar-BgMLtMIq.js} +1 -1
- package/dist/assets/SettingsView-CbDBfQp1.js +25 -0
- package/dist/assets/{SettingsWindow-DfVgTQ4I.js → SettingsWindow-Br7XLcSd.js} +1 -1
- package/dist/assets/{TerminalView-DNyjfkvT.js → TerminalView-CM5jRKlj.js} +1 -1
- package/dist/assets/{ToolOutputDialog-DLG1iThm.js → ToolOutputDialog-D3U6aTZ4.js} +1 -1
- package/dist/assets/appThemeRegistry-CDxBJNNB.js +2 -0
- package/dist/assets/assistant-guide-hero-BeUHQcxE.jpg +0 -0
- package/dist/assets/{button-CDvMVaiO.js → button-DaAoVF4X.js} +1 -1
- package/dist/assets/{clipboard-BW7nk_Cx.js → clipboard-BnElHSnO.js} +1 -1
- package/dist/assets/{collapsible-C2aamDvD.js → collapsible-BmuQu0dq.js} +1 -1
- package/dist/assets/{context-menu-BaxmodD8.js → context-menu-DBOMervd.js} +1 -1
- package/dist/assets/{desktopHosts-CBoBpJ1Z.js → desktopHosts-ZK_vkdzL.js} +1 -1
- package/dist/assets/{desktopRelayRestore-l2R9muux.js → desktopRelayRestore-CewM6-g5.js} +1 -1
- package/dist/assets/{diagram-CEon0BQs.js → diagram-DAE4CZy2.js} +1 -1
- package/dist/assets/{dialog-DjYfj1Sn.js → dialog-COrLBm9O.js} +1 -1
- package/dist/assets/{es-5Lhudh0n.js → es-DIVYdoxi.js} +1 -1
- package/dist/assets/{fileQueries-CE_DaZWQ.js → fileQueries-CmWYnRVz.js} +1 -1
- package/dist/assets/{fr-Q_UhFmKT.js → fr-CNTlVypq.js} +2 -2
- package/dist/assets/{gitApi-BYxg_qGJ.js → gitApi-BQT3QXD2.js} +1 -1
- package/dist/assets/gitApiHttp-BxGAFLTf.js +2 -0
- package/dist/assets/{input-k9DGGyZ6.js → input-XiL2-2gG.js} +1 -1
- package/dist/assets/insertionBoundaries-9a0RuIDc.js +1 -0
- package/dist/assets/{ja-CzMPz7bT.js → ja-C_eW5ZM8.js} +1 -1
- package/dist/assets/{ko-B-EslUsR.js → ko-CE3cOv7v.js} +1 -1
- package/dist/assets/{main-LDphyc-v.js → main-BGfX81Y9.js} +20 -20
- package/dist/assets/{main-CO6z5yRB.js → main-CEqSDnE2.js} +2 -2
- package/dist/assets/{markdown-worker-DkeWiER6.js → markdown-worker-BDyY0vt6.js} +1 -1
- package/dist/assets/{markdownTheme-DNT93i5L.js → markdownTheme-D-aLQZaM.js} +1 -1
- package/dist/assets/{miniChat-BZQwTZpx.js → miniChat-CKucSAhg.js} +2 -2
- package/dist/assets/mobile-C4bTWKry.js +2 -0
- package/dist/assets/{multirun-ZlwlkIy5.js → multirun-DeNtSkgb.js} +1 -1
- package/dist/assets/{persistence-DPNMIbF5.js → persistence-D1lIuyqO.js} +1 -1
- package/dist/assets/{pl-Dnea6Ppc.js → pl-BZKZOE99.js} +1 -1
- package/dist/assets/projectMeta-BunN9pH5.js +3 -0
- package/dist/assets/{pt-BR-Ca6QTem7.js → pt-BR-DHDgp8S3.js} +1 -1
- package/dist/assets/{radio-CJuhbQ5a.js → radio-Bziafaje.js} +1 -1
- package/dist/assets/renderElectronMiniChatApp-D8-FDgWE.js +2 -0
- package/dist/assets/renderMobileApp-CdU0aJ-e.js +23 -0
- package/dist/assets/{runtimeConfig-BtWi74Pm.js → runtimeConfig-BXCt7ZsQ.js} +1 -1
- package/dist/assets/runtimeEndpointReset-CK1GhIsm.js +145 -0
- package/dist/assets/{sortable-tabs-strip-D8JHUI0z.js → sortable-tabs-strip-pWlBorwQ.js} +1 -1
- package/dist/assets/src-8kQFmtjw.css +2 -0
- package/dist/assets/{store-wa1ersRf.js → store-CUWqzRt7.js} +2 -2
- package/dist/assets/{terminalApi-tB3qLcfa.js → terminalApi-DpiAJlil.js} +1 -1
- package/dist/assets/{tooltip-DMNR5rN0.js → tooltip-BLugzWq-.js} +1 -1
- package/dist/assets/{uk-xGc9Pzge.js → uk-CfQK6cz1.js} +1 -1
- package/dist/assets/{url-7MqoLs9X.js → url-DMs_PgIC.js} +1 -1
- package/dist/assets/useAppFontEffects-IEUQDvE8.js +7 -0
- package/dist/assets/useDesktopWindowControlsLayout-MlqJX89k.js +1 -0
- package/dist/assets/{useEffectiveDirectory-aUC3zzl_.js → useEffectiveDirectory-GbhkdO6m.js} +1 -1
- package/dist/assets/{useFontPreferences-CIurCeNv.js → useFontPreferences-92Qg-98H.js} +1 -1
- package/dist/assets/useMobileNavigationStore-DQHF_ETu.js +476 -0
- package/dist/assets/useSessionAutoCleanup-BuU_S_Sh.js +1 -0
- package/dist/assets/{useWorkerHighlightedLines-CiYQjBe6.js → useWorkerHighlightedLines-Ca6OgNHF.js} +1 -1
- package/dist/assets/{utils-Co19EJEL.js → utils-BxJEIWv5.js} +1 -1
- package/dist/assets/{zh-CN-sL4ktGB3.js → zh-CN-DvY2fKWp.js} +1 -1
- package/dist/assets/{zh-TW-Cfxps4gq.js → zh-TW-eWe0lm3-.js} +1 -1
- package/dist/index.html +8 -8
- package/dist/mini-chat.html +8 -8
- package/dist/mobile.html +8 -8
- package/package.json +1 -1
- package/server/index.d.ts +6 -0
- package/server/index.js +13 -0
- package/server/lib/config-sync/DOCUMENTATION.md +70 -0
- package/server/lib/config-sync/config-sync.test.js +197 -0
- package/server/lib/config-sync/constants.js +39 -0
- package/server/lib/config-sync/contract.js +130 -0
- package/server/lib/config-sync/credential-auth.js +39 -0
- package/server/lib/config-sync/engine.js +108 -0
- package/server/lib/config-sync/index.js +67 -0
- package/server/lib/config-sync/local-backup.js +171 -0
- package/server/lib/config-sync/plan.js +318 -0
- package/server/lib/config-sync/receiver.js +330 -0
- package/server/lib/config-sync/routes.js +141 -0
- package/server/lib/config-sync/routes.test.js +154 -0
- package/server/lib/config-sync/scripts.js +264 -0
- package/server/lib/config-sync/selections.js +112 -0
- package/server/lib/config-sync/tar.js +35 -0
- package/server/lib/config-sync/target-id.js +24 -0
- package/server/lib/event-stream/DOCUMENTATION.md +2 -2
- package/server/lib/event-stream/diff-summary.js +39 -11
- package/server/lib/event-stream/diff-summary.test.js +73 -6
- package/server/lib/event-stream/protocol.test.js +70 -7
- package/server/lib/notifications/DOCUMENTATION.md +2 -2
- package/server/lib/notifications/runtime.js +68 -27
- package/server/lib/notifications/runtime.test.js +176 -0
- package/server/lib/opencode/DOCUMENTATION.md +4 -1
- package/server/lib/opencode/bootstrap-runtime.js +2 -0
- package/server/lib/opencode/core-routes.js +1 -0
- package/server/lib/opencode/feature-routes-runtime.test.js +10 -1
- package/server/lib/opencode/openchamber-routes.js +7 -0
- package/server/lib/opencode/settings-runtime.js +82 -51
- package/server/lib/opencode/settings-runtime.test.js +42 -0
- package/server/lib/relay/DOCUMENTATION.md +1 -1
- package/server/lib/session-index/DOCUMENTATION.md +12 -6
- package/server/lib/session-index/routes.js +34 -0
- package/server/lib/session-index/routes.test.js +76 -0
- package/server/lib/session-index/service.js +53 -4
- package/server/lib/session-index/service.test.js +72 -2
- package/server/lib/session-title/DOCUMENTATION.md +19 -14
- package/server/lib/session-title/runtime.js +8 -8
- package/server/lib/session-title/runtime.test.js +231 -0
- package/server/lib/session-turn-pages/DOCUMENTATION.md +26 -6
- package/server/lib/session-turn-pages/changes.service.js +156 -0
- package/server/lib/session-turn-pages/changes.service.test.js +188 -0
- package/server/lib/session-turn-pages/reconcile.routes.test.js +52 -0
- package/server/lib/session-turn-pages/reconcile.service.js +3 -1
- package/server/lib/session-turn-pages/reconcile.service.test.js +44 -0
- package/server/lib/session-turn-pages/routes.js +273 -12
- package/server/lib/session-turn-pages/routes.test.js +387 -0
- package/server/lib/session-turn-pages/service.js +31 -7
- package/server/lib/session-turn-pages/service.test.js +40 -0
- package/server/lib/small-model/DOCUMENTATION.md +93 -38
- package/server/lib/small-model/catalog.js +10 -2
- package/server/lib/small-model/catalog.test.js +3 -1
- package/server/lib/small-model/index.js +52 -28
- package/server/lib/small-model/opencode-session.js +339 -0
- package/server/lib/small-model/opencode-session.test.js +177 -0
- package/server/lib/small-model/resolve.js +116 -5
- package/server/lib/small-model/resolve.test.js +76 -10
- package/server/lib/small-model/summary-settings.test.js +60 -3
- package/dist/assets/MobileSurface-htGkf7Ua.js +0 -2
- package/dist/assets/SettingsView-DxMpVLlt.js +0 -25
- package/dist/assets/appThemeRegistry-CgfOR_0L.js +0 -2
- package/dist/assets/gitApiHttp-D8j1qRH4.js +0 -2
- package/dist/assets/insertionBoundaries-DzXMTleb.js +0 -1
- package/dist/assets/mobile-BktO3_4R.js +0 -2
- package/dist/assets/projectMeta-v-LP2mzz.js +0 -3
- package/dist/assets/renderElectronMiniChatApp-Db8uO-6q.js +0 -2
- package/dist/assets/renderMobileApp-BCV81Ryl.js +0 -23
- package/dist/assets/runtimeEndpointReset-Dg3DMy9v.js +0 -145
- package/dist/assets/src-oHrYIqHF.css +0 -2
- package/dist/assets/useAppFontEffects-CM0VKsdo.js +0 -7
- package/dist/assets/useDesktopWindowControlsLayout-Cq-r4Hcb.js +0 -1
- package/dist/assets/useMobileNavigationStore-DnzT4jO2.js +0 -475
- package/dist/assets/useSessionAutoCleanup-DxZeceKO.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderElectronMiniChatApp-
|
|
2
|
-
import{t as e}from"./runtimeConfig-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderElectronMiniChatApp-D8-FDgWE.js","assets/rolldown-runtime-C0FnF6B9.js","assets/useUIStore-5agS8bsW.js","assets/vendor-zustand-B4dlGEM2.js","assets/vendor-base-ui-CnHfUmDN.js","assets/persistence-D1lIuyqO.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/gitApiHttp-BxGAFLTf.js","assets/vendor-opencode-sdk-C07HQypa.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/vendor-reactuses-core-DDoDDyM9.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/clipboard-BnElHSnO.js","assets/store-CUWqzRt7.js","assets/useMobileNavigationStore-DQHF_ETu.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/vendor-sonner-DVzioF3d.js","assets/useAssistantUIStore-Bq3cPj2x.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/utils-BxJEIWv5.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/Icon-DiIuWOuC.js","assets/button-DaAoVF4X.js","assets/useAppFontEffects-IEUQDvE8.js","assets/desktopHosts-ZK_vkdzL.js","assets/desktopRelayRestore-CewM6-g5.js","assets/dialog-COrLBm9O.js","assets/gitApi-BQT3QXD2.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/projectMeta-BunN9pH5.js","assets/input-XiL2-2gG.js","assets/tooltip-BLugzWq-.js","assets/OverlayScrollbar-BgMLtMIq.js","assets/vendor-dnd-kit-core-CvWxUPdb.js","assets/vendor-dnd-kit-accessibility-BY5LhhUB.js","assets/vendor-dnd-kit-sortable-hHdP9lLb.js","assets/useSessionAutoCleanup-BuU_S_Sh.js","assets/radio-Bziafaje.js","assets/vendor-codemirror-autocomplete-DHomsvW7.js","assets/vendor-codemirror-lang-angular-DShkBD6m.js","assets/vendor-codemirror-lang-json-CYJRHck9.js","assets/vendor-codemirror-lang-markdown-WORgx6ZD.js","assets/vendor-codemirror-lang-python-Du6XQ8Zw.js","assets/vendor-codemirror-legacy-modes-DuRAjNvB.js","assets/AgentAvatar-B4fj9PIe.js","assets/useThemeSystem-DMzWVJaW.js","assets/vendor-codemirror-language-data-BfYFhIH1.js","assets/markdownTheme-D-aLQZaM.js","assets/vendor-pierre-diffs-BenIz2TM.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/ChatContainer-BDFeDKu-.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/appThemeRegistry-CDxBJNNB.js","assets/markdown-worker-BDyY0vt6.js","assets/url-DMs_PgIC.js","assets/useEffectiveDirectory-GbhkdO6m.js","assets/FadeInOnReveal-CKKU6fKI.js","assets/insertionBoundaries-9a0RuIDc.js","assets/useWorkerHighlightedLines-Ca6OgNHF.js","assets/vendor-tanstack-react-virtual-tlDgH6PG.js","assets/vendor-cmdk-CeAGfrLo.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-pWlBorwQ.js","assets/vendor-framer-motion-DFy_BSVd.js","assets/useFontPreferences-92Qg-98H.js","assets/terminalApi-DpiAJlil.js","assets/useDesktopWindowControlsLayout-MlqJX89k.js","assets/src-8kQFmtjw.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./runtimeConfig-BXCt7ZsQ.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";/* empty css */window.__OPENCHAMBER_RUNTIME_APIS__=e(),t(async()=>{let{renderElectronMiniChatApp:e}=await import(`./renderElectronMiniChatApp-D8-FDgWE.js`);return{renderElectronMiniChatApp:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,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])).then(({renderElectronMiniChatApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??e())});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-CdU0aJ-e.js","assets/rolldown-runtime-C0FnF6B9.js","assets/useUIStore-5agS8bsW.js","assets/vendor-zustand-B4dlGEM2.js","assets/vendor-base-ui-CnHfUmDN.js","assets/persistence-D1lIuyqO.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/gitApiHttp-BxGAFLTf.js","assets/vendor-opencode-sdk-C07HQypa.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/vendor-sonner-DVzioF3d.js","assets/vendor-reactuses-core-DDoDDyM9.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/clipboard-BnElHSnO.js","assets/store-CUWqzRt7.js","assets/useMobileNavigationStore-DQHF_ETu.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/useAssistantUIStore-Bq3cPj2x.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/MobileShareBridge-PZMRiieI.js","assets/desktopHosts-ZK_vkdzL.js","assets/desktopRelayRestore-CewM6-g5.js","assets/MobileDetailNavigation-DILi0tN7.js","assets/utils-BxJEIWv5.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/Icon-DiIuWOuC.js","assets/button-DaAoVF4X.js","assets/AgentAvatar-B4fj9PIe.js","assets/dialog-COrLBm9O.js","assets/gitApi-BQT3QXD2.js","assets/useAppFontEffects-IEUQDvE8.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/projectMeta-BunN9pH5.js","assets/input-XiL2-2gG.js","assets/tooltip-BLugzWq-.js","assets/OverlayScrollbar-BgMLtMIq.js","assets/vendor-dnd-kit-core-CvWxUPdb.js","assets/vendor-dnd-kit-accessibility-BY5LhhUB.js","assets/vendor-dnd-kit-sortable-hHdP9lLb.js","assets/useSessionAutoCleanup-BuU_S_Sh.js","assets/radio-Bziafaje.js","assets/vendor-codemirror-autocomplete-DHomsvW7.js","assets/vendor-codemirror-lang-angular-DShkBD6m.js","assets/vendor-codemirror-lang-json-CYJRHck9.js","assets/vendor-codemirror-lang-markdown-WORgx6ZD.js","assets/vendor-codemirror-lang-python-Du6XQ8Zw.js","assets/vendor-codemirror-legacy-modes-DuRAjNvB.js","assets/useThemeSystem-DMzWVJaW.js","assets/vendor-codemirror-language-data-BfYFhIH1.js","assets/markdownTheme-D-aLQZaM.js","assets/vendor-pierre-diffs-BenIz2TM.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/ChatContainer-BDFeDKu-.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/appThemeRegistry-CDxBJNNB.js","assets/markdown-worker-BDyY0vt6.js","assets/url-DMs_PgIC.js","assets/useEffectiveDirectory-GbhkdO6m.js","assets/FadeInOnReveal-CKKU6fKI.js","assets/insertionBoundaries-9a0RuIDc.js","assets/useWorkerHighlightedLines-Ca6OgNHF.js","assets/vendor-tanstack-react-virtual-tlDgH6PG.js","assets/vendor-cmdk-CeAGfrLo.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-pWlBorwQ.js","assets/vendor-framer-motion-DFy_BSVd.js","assets/useFontPreferences-92Qg-98H.js","assets/terminalApi-DpiAJlil.js","assets/MobileSurface-BLYcR0tO.js","assets/collapsible-BmuQu0dq.js","assets/vendor-codemirror-commands-C9DCaJ0C.js","assets/vendor-codemirror-search-D2SOgzph.js","assets/vendor-replit-codemirror-vim-CEibx3EP.js","assets/projectActions-CWvNGKfA.js","assets/runtimeEndpointReset-CK1GhIsm.js","assets/context-menu-DBOMervd.js","assets/vendor-cron-parser-CCD11YFT.js","assets/SettingsView-CbDBfQp1.js","assets/vendor-yaml-DIcAK3EC.js","assets/vendor-qrcode-DAuVxiQR.js","assets/vendor-dijkstrajs-DztKuCwY.js","assets/AssistantView-C00aiEHK.js","assets/fileQueries-CmWYnRVz.js","assets/src-8kQFmtjw.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./runtimeConfig-BXCt7ZsQ.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";/* empty css */window.__OPENCHAMBER_RUNTIME_APIS__=e(),t(async()=>{let{renderMobileApp:e}=await import(`./renderMobileApp-CdU0aJ-e.js`);return{renderMobileApp:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,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])).then(({renderMobileApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??e())});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./useUIStore-5agS8bsW.js";import{Xt as n}from"./persistence-DPNMIbF5.js";import{a as r,r as i}from"./vendor-zustand-B4dlGEM2.js";import{nt as a,rt as o}from"./vendor-base-ui-CnHfUmDN.js";import{kt as s,yt as c}from"./gitApiHttp-D8j1qRH4.js";import{n as l}from"./vendor-react-DLPElpoQ.js";import{n as u}from"./vendor-reactuses-core-DDoDDyM9.js";import{l as d,n as f}from"./clipboard-BW7nk_Cx.js";import{Ba as p,In as m,Ji as h,Ln as g,Ra as _,Wn as v,Zi as y,c as b,er as x,l as S,mo as C,ta as w,tr as T,wr as E}from"./useMobileNavigationStore-DnzT4jO2.js";import{n as D,t as ee}from"./utils-Co19EJEL.js";import{n as O}from"./Icon-AXqa-fYB.js";import{t as te}from"./button-CDvMVaiO.js";import{n as ne}from"./gitApi-BYxg_qGJ.js";import{C as re,M as ie,N as k,O as ae,S as A,_ as j,a as oe,b as se,g as ce,h as le,i as M,j as ue,k as de,n as N,o as P,p as F,v as fe,x as pe,y as I}from"./projectMeta-v-LP2mzz.js";import{t as L}from"./input-k9DGGyZ6.js";import{i as R,n as me,t as z}from"./tooltip-DMNR5rN0.js";import{o as he}from"./OverlayScrollbar-D6NySAxi.js";import{n as B}from"./useRuntimeAPIs-DSLXJybW.js";import{E as ge,T as _e,a as V,b as H,c as ve,g as U,k as ye,l as W,m as G,o as K,p as q,r as be,x as J}from"./insertionBoundaries-DzXMTleb.js";import{n as Y,r as xe,t as Se}from"./collapsible-C2aamDvD.js";var X=e(o(),1),Ce=l(),Z=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Q=/^g[1-9]\d*$/,we=(e,t,n,r,i)=>{if(!Z.test(e)||t!==void 0&&!Q.test(t)||!n?.trim()||!r?.trim()||n!==n.trim()||r!==r.trim())return null;if(i===void 0)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!1};if(i===`fusion`)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!0};if(!/^\d+$/.test(i))return null;let a=Number.parseInt(i,10);return!Number.isSafeInteger(a)||a<=0?null:{groupSlug:e,runGroup:t,providerID:n,modelID:r,index:a,fusion:!1}},Te=e=>{if(!e)return null;let t=e.split(`/`);if(t.length<3||t.length>5)return null;let[n]=t;if(t.length===3)return we(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Q.test(e)?we(n,e,r,i,void 0):we(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?we(n,void 0,i,a,o):we(n,r,i,a,o)},Ee=e=>{let t=[e.groupSlug];return e.runGroup&&t.push(e.runGroup),t.push(e.providerID,e.modelID),e.index!==void 0&&t.push(String(e.index)),t.join(`/`)},De=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Oe=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),ke=(e,t)=>`${Oe(e)}-${Oe(t)}`.substring(0,60),Ae=(e,t)=>`${e}/${t}`,je=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Me=(e,t)=>{let n=je(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};w(e.id,n),S.getState().markSessionAsOpenChamberCreated(e.id),E.getState().upsertSession(i);try{y().ensureChild(n,{bootstrap:!1}).setState(t=>{let n=t.session.findIndex(t=>t.id===e.id);if(n>=0&&t.session[n]===i)return t;let r=n>=0?t.session.map((e,t)=>t===n?i:e):[...t.session,i].sort((e,t)=>e.id.localeCompare(t.id));return{session:r,sessionTotal:Math.max(t.sessionTotal,r.length),limit:Math.max(t.limit,r.length)}})}catch{}return i},Ne=()=>{let e=C.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=c.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Pe=r()(i(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let c=Ne();if(!c)return e({error:`Select a project`,isLoading:!1}),null;let l=c.path,u=await ne(l)&&t.isolateRuns!==!1,d=Oe(n),f=u?await F(l):void 0,p=u?await W(l):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let _ of n.models){let n=`${_.providerID}:${_.modelID}`,v=a.get(n)||1,y=(o.get(n)||0)+1;o.set(n,y);let b=ke(_.providerID,_.modelID),C=r.length>1?`g${e+1}`:void 0,w=v>1?Ae(d,`${b}/${y}`):Ae(d,b),T=C?`${C}/${w}`:w,E=Ee({groupSlug:d,runGroup:C,providerID:_.providerID,modelID:_.modelID,index:v>1?y:void 0});try{if(!u){let e=await s.withDirectory(l,()=>s.createSession({title:E}));Me(e,l),m.push({sessionId:e.id,worktreePath:l,providerID:_.providerID,modelID:_.modelID,variant:_.variant,prompt:i});continue}let e=await ve(c,{preferredName:T,mode:`new`,branchName:T,worktreeName:T,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await g(c)&&await x(e.path);let r=await s.withDirectory(e.path,()=>s.createSession({title:E}));Me(r,e.path),S.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:_.providerID,modelID:_.modelID,variant:_.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let _=o?.filter(e=>e.trim().length>0)??[];_.length>0&&v(c,_).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let y=m.map(e=>e.sessionId),C=m[0]?.sessionId??null;if(y.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let w=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{let e=ie.getState().expandText;await Promise.allSettled(m.map(async t=>{try{let n=await e(t.prompt).catch(()=>t.prompt);await b({sessionId:t.sessionId,directory:t.worktreePath,content:n,providerID:t.providerID,modelID:t.modelID,variant:t.variant,agent:i,files:w})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:y,firstSessionId:C}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),$=a(),Fe=`h-7`,Ie=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Le=e=>{let t=(0,Ce.c)(13),{model:n,instanceIndex:r,totalSameModel:i,onRemove:a}=e,o=n.displayName||`${n.providerID}/${n.modelID}`,s=i>1?`${o} (${r})`:o,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=ee(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Fe),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(de,{modelId:n.modelID,providerId:n.providerID,className:`h-3.5 w-3.5`}),t[1]=n.modelID,t[2]=n.providerID,t[3]=l):l=t[3];let u;t[4]===s?u=t[5]:(u=(0,$.jsx)(`span`,{className:`typography-meta font-medium truncate max-w-[140px]`,children:s}),t[4]=s,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`}),t[6]=d):d=t[6];let f;t[7]===a?f=t[8]:(f=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,children:d}),t[7]=a,t[8]=f);let p;return t[9]!==l||t[10]!==u||t[11]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},Re=e=>{let n=(0,Ce.c)(131),{selectedModels:r,onAdd:i,onRemove:a,onUpdate:o,minModels:s,addButtonLabel:c,showChips:l,maxModels:u,addButtonClassName:d,dropdownSide:m,dropdownClassName:g,containerClassName:_,triggerIcon:v}=e,y=l===void 0||l,b=m===void 0?`top`:m,{t:x}=f(),S=h(ze),C=h(Be),w=t(Ve),T=t(He),{favoriteModelsList:E,recentModelsList:D}=ae(),ne=t(Ue),ie=t(We),[k,j]=X.useState(!1),[oe,se]=X.useState(``),[M,ue]=X.useState(null),de=X.useRef(null),N=X.useRef(null),P=u===1,F=u===void 0||r.length<u||P,I;if(n[0]!==r){I=new Map;for(let e of r){let t=`${e.providerID}:${e.modelID}`;I.set(t,(I.get(t)||0)+1)}n[0]=r,n[1]=I}else I=n[1];let L=I,R;n[2]===r?R=n[3]:(R=e=>r.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,n[2]=r,n[3]=R);let me=R,z,he;n[4]!==b||n[5]!==k?(z=()=>{if(!k||!N.current)return;let e=N.current.getBoundingClientRect();if(b===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ue(Math.max(160,Math.min(320,t)));return}let t=N.current.parentElement;for(;t&&!(t.getAttribute(`role`)===`dialog`||t.hasAttribute(`data-scroll-shadow`));){let e=getComputedStyle(t);if(e.overflow===`auto`||e.overflow===`hidden`||e.overflowY===`auto`||e.overflowY===`hidden`)break;t=t.parentElement}let n=t?t.getBoundingClientRect().top:0,r=e.top-n-16;ue(Math.max(150,Math.min(300,r)))},he=[b,k],n[4]=b,n[5]=k,n[6]=z,n[7]=he):(z=n[6],he=n[7]),X.useEffect(z,he);let B,ge;n[8]!==F||n[9]!==k?(B=()=>{!F&&k&&(j(!1),se(``))},ge=[F,k],n[8]=F,n[9]=k,n[10]=B,n[11]=ge):(B=n[10],ge=n[11]),X.useEffect(B,ge);let _e,V;n[12]===k?(_e=n[13],V=n[14]):(_e=()=>{if(!k)return;let e=e=>{de.current&&!de.current.contains(e.target)&&(j(!1),se(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[k],n[12]=k,n[13]=_e,n[14]=V),X.useEffect(_e,V);let H;n[15]!==P||n[16]!==i||n[17]!==o||n[18]!==r.length?(H=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:p(e.model,e.modelID)||e.modelID,instanceId:Ie()};P&&r.length>0&&o?o(0,t):i(t),P&&(j(!1),se(``))},n[15]=P,n[16]=i,n[17]=o,n[18]=r.length,n[19]=H):H=n[19];let ve=H,U;n[20]===x?U=n[21]:(U=x(`multirun.modelMultiSelect.search.placeholder`),n[20]=x,n[21]=U);let ye;n[22]===x?ye=n[23]:(ye=x(`multirun.modelMultiSelect.search.noResults`),n[22]=x,n[23]=ye);let W;n[24]===x?W=n[25]:(W=x(`multirun.modelMultiSelect.sections.favorites`),n[24]=x,n[25]=W);let G;n[26]===x?G=n[27]:(G=x(`multirun.modelMultiSelect.sections.recent`),n[26]=x,n[27]=G);let K;n[28]===x?K=n[29]:(K=x(`multirun.modelMultiSelect.keyboard.hint`),n[28]=x,n[29]=K);let q;n[30]===x?q=n[31]:(q=x(`settings.agents.modelSelector.actions.favorite`),n[30]=x,n[31]=q);let be;n[32]===x?be=n[33]:(be=x(`settings.agents.modelSelector.actions.unfavorite`),n[32]=x,n[33]=be);let J;n[34]===x?J=n[35]:(J=x(`chat.modelControls.provider`),n[34]=x,n[35]=J);let Y;n[36]===x?Y=n[37]:(Y=x(`chat.modelControls.capabilities`),n[36]=x,n[37]=Y);let xe;n[38]===x?xe=n[39]:(xe=x(`chat.modelControls.capability.toolCalling`),n[38]=x,n[39]=xe);let Se;n[40]===x?Se=n[41]:(Se=x(`chat.modelControls.capability.reasoning`),n[40]=x,n[41]=Se);let Z;n[42]===x?Z=n[43]:(Z=x(`chat.modelControls.modality.image`),n[42]=x,n[43]=Z);let Q;n[44]===x?Q=n[45]:(Q=x(`chat.modelControls.modality.video`),n[44]=x,n[45]=Q);let we;n[46]===x?we=n[47]:(we=x(`chat.modelControls.modality.audio`),n[46]=x,n[47]=we);let Te;n[48]===x?Te=n[49]:(Te=x(`chat.modelControls.costPerMillion`),n[48]=x,n[49]=Te);let Ee;n[50]===x?Ee=n[51]:(Ee=x(`chat.modelControls.costInput`),n[50]=x,n[51]=Ee);let De;n[52]===x?De=n[53]:(De=x(`chat.modelControls.costOutput`),n[52]=x,n[53]=De);let Oe;n[54]!==U||n[55]!==ye||n[56]!==W||n[57]!==G||n[58]!==K||n[59]!==q||n[60]!==be||n[61]!==J||n[62]!==Y||n[63]!==xe||n[64]!==Se||n[65]!==Z||n[66]!==Q||n[67]!==we||n[68]!==Te||n[69]!==Ee||n[70]!==De?(Oe={searchPlaceholder:U,noResults:ye,favorites:W,recent:G,keyboardHint:K,favorite:q,unfavorite:be,provider:J,capabilities:Y,capabilityToolCalling:xe,capabilityReasoning:Se,modalityImage:Z,modalityVideo:Q,modalityAudio:we,costPerMillion:Te,costInput:Ee,costOutput:De},n[54]=U,n[55]=ye,n[56]=W,n[57]=G,n[58]=K,n[59]=q,n[60]=be,n[61]=J,n[62]=Y,n[63]=xe,n[64]=Se,n[65]=Z,n[66]=Q,n[67]=we,n[68]=Te,n[69]=Ee,n[70]=De,n[71]=Oe):Oe=n[71];let ke=Oe,Ae;n[72]===_?Ae=n[73]:(Ae=ee(`relative`,_),n[72]=_,n[73]=Ae);let je;n[74]===d?je=n[75]:(je=ee(Fe,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,d),n[74]=d,n[75]=je);let Me=!F,Ne;n[76]===k?Ne=n[77]:(Ne=()=>{j(!k)},n[76]=k,n[77]=Ne);let Pe;n[78]===v?Pe=n[79]:(Pe=v??(0,$.jsx)(O,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),n[78]=v,n[79]=Pe);let Re;n[80]!==c||n[81]!==x?(Re=c??x(`multirun.modelMultiSelect.actions.addModel`),n[80]=c,n[81]=x,n[82]=Re):Re=n[82];let Ke;n[83]!==je||n[84]!==Me||n[85]!==Ne||n[86]!==Pe||n[87]!==Re?(Ke=(0,$.jsxs)(te,{ref:N,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ne,children:[Pe,Re]}),n[83]=je,n[84]=Me,n[85]=Ne,n[86]=Pe,n[87]=Re,n[88]=Ke):Ke=n[88];let qe;n[89]!==M||n[90]!==F||n[91]!==g||n[92]!==b||n[93]!==E||n[94]!==C||n[95]!==ve||n[96]!==ne||n[97]!==T||n[98]!==k||n[99]!==ke||n[100]!==L||n[101]!==ie||n[102]!==S||n[103]!==D||n[104]!==oe||n[105]!==w?(qe=k?(0,$.jsx)(`div`,{className:ee(`absolute left-0 z-50 w-[min(420px,calc(100vw-2rem))] max-w-[calc(100vw-2rem)] flex flex-col overflow-hidden rounded-xl border border-border/50 shadow-lg`,b===`top`?`bottom-full mb-1`:`top-full mt-1`,g),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(re,{providers:S,providerOrder:ie,favoriteModels:E,recentModels:D,getMetadata:C,hiddenModels:ne,searchQuery:oe,onSearchQueryChange:se,onSelect:ve,labels:ke,selectionCount:e=>L.get(`${e.providerID}:${e.modelID}`)||0,disabled:!F,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:M?`${M}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:k,isFavorite:e=>T(e.providerID,e.modelID),onToggleFavorite:e=>w(e.providerID,e.modelID),onEscape:()=>{j(!1),se(``)}})}):null,n[89]=M,n[90]=F,n[91]=g,n[92]=b,n[93]=E,n[94]=C,n[95]=ve,n[96]=ne,n[97]=T,n[98]=k,n[99]=ke,n[100]=L,n[101]=ie,n[102]=S,n[103]=D,n[104]=oe,n[105]=w,n[106]=qe):qe=n[106];let Je;n[107]!==Ae||n[108]!==Ke||n[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:de,children:[Ke,qe]}),n[107]=Ae,n[108]=Ke,n[109]=qe,n[110]=Je):Je=n[110];let Ye;n[111]!==me||n[112]!==L||n[113]!==a||n[114]!==o||n[115]!==S||n[116]!==r||n[117]!==y||n[118]!==x?(Ye=y&&r.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:r.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=L.get(n)||1,i=me(e),s=S.find(t=>t.id===e.providerID)?.models?.find(t=>t.id===e.modelID),c=s?.variants?Object.keys(s.variants):[],l=c.length>0,u=e.variant??`__default__`;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Le,{model:e,instanceIndex:i,totalSameModel:r,onRemove:()=>a(t)}),l&&(0,$.jsxs)(le,{value:u,onValueChange:n=>{if(!o)return;let r=n===`__default__`?void 0:n;o(t,{...e,variant:r})},children:[(0,$.jsxs)(pe,{size:`chip`,className:`px-2 gap-1.5 rounded-md !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 typography-meta font-medium text-foreground`,children:[(0,$.jsx)(O,{name:`brain-ai-3`,className:ee(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(A,{placeholder:x(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?x(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(ce,{fitContent:!0,children:[(0,$.jsx)(fe,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:x(`multirun.modelMultiSelect.variant.default`)}),c.map(Ge)]})]})]},e.instanceId)})}),n[111]=me,n[112]=L,n[113]=a,n[114]=o,n[115]=S,n[116]=r,n[117]=y,n[118]=x,n[119]=Ye):Ye=n[119];let Xe;n[120]!==Je||n[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),n[120]=Je,n[121]=Ye,n[122]=Xe):Xe=n[122];let Ze;n[123]!==u||n[124]!==s||n[125]!==r.length||n[126]!==x?(Ze=s!==void 0&&r.length<s&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:u===void 0?x(`multirun.modelMultiSelect.validation.minOnly`,{min:s}):x(`multirun.modelMultiSelect.validation.minToMax`,{min:s,max:u})}),n[123]=u,n[124]=s,n[125]=r.length,n[126]=x,n[127]=Ze):Ze=n[127];let Qe;return n[128]!==Xe||n[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),n[128]=Xe,n[129]=Ze,n[130]=Qe):Qe=n[130],Qe};function ze(e){return e.providers}function Be(e){return e.getModelMetadata}function Ve(e){return e.toggleFavoriteModel}function He(e){return e.isFavoriteModel}function Ue(e){return e.hiddenModels}function We(e){return e.providerOrder}function Ge(e){return(0,$.jsx)(fe,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function Ke(e){let t=(0,Ce.c)(30),{git:n}=B(),r=q(e),i=J(e),a=U(e),o=G(e),s=H(Ze),c=H(Xe),l,u;t[0]!==e||t[1]!==c||t[2]!==n||t[3]!==i||t[4]!==a?(l=()=>{!e||!n||i!==null||a||c(e,n,{silent:!0})},u=[e,n,c,i,a],t[0]=e,t[1]=c,t[2]=n,t[3]=i,t[4]=a,t[5]=l,t[6]=u):(l=t[5],u=t[6]),X.useEffect(l,u);let d;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(d=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=d):d=t[12];let f=r?.all,p;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==f?(p=[e,n,i,f,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=f,t[18]=p):p=t[18],X.useEffect(d,p);let m=a||i===!0&&o,h;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],h=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(Ye).sort(),t[20]=r.all,t[21]=e),h=e}let g=h,_;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],_=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Je).map(qe).sort(),t[23]=r.all,t[24]=e),_=e}let v=_,y;bb2:{if(!e){y=null;break bb2}if(i!==null){y=i;break bb2}if(m){y=null;break bb2}y=r?.all?!0:null}let b=y,x;return t[25]!==b||t[26]!==m||t[27]!==g||t[28]!==v?(x={localBranches:g,remoteBranches:v,isLoading:m,isGitRepository:b},t[25]=b,t[26]=m,t[27]=g,t[28]=v,t[29]=x):x=t[29],x}function qe(e){return e.replace(/^remotes\//,``)}function Je(e){return e.startsWith(`remotes/`)}function Ye(e){return!e.startsWith(`remotes/`)}function Xe(e){return e.fetchStatus}function Ze(e){return e.fetchBranches}var Qe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=f(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=Ke(e),d=X.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return X.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await F(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(V),{sourceBranch:o,shouldClearSavedSourceBranch:s}=K({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(V),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(le,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(pe,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(A,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(ce,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.loadingBranches`)}):s.length===0&&c.length===0?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,$.jsxs)($.Fragment,{children:[s.length>0&&(0,$.jsxs)(j,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(fe,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(se,{}),c.length>0&&(0,$.jsxs)(j,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(fe,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},$e=e=>{let t=(0,Ce.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=f(),l=h(et),u=h(tt),d=h(nt),p;t[0]===l?p=t[1]:(p=l(),t[0]=l,t[1]=p);let m=p,g;t[2]===m?g=t[3]:(g=m.filter(rt),t[2]=m,t[3]=g);let _=g,v,y;t[4]!==m.length||t[5]!==u?(v=()=>{m.length===0&&u()},y=[m.length,u],t[4]=m.length,t[5]=u,t[6]=v,t[7]=y):(v=t[6],y=t[7]),X.useEffect(v,y);let b,x;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==_||t[12]!==n?(b=()=>{if(a)return;let e=n.trim();if(e.length>0&&_.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&_.some(e=>e.name===t)){r(t);return}let i=_[0]?.name;i&&r(i)},x=[d,a,r,_,n],t[8]=d,t[9]=a,t[10]=r,t[11]=_,t[12]=n,t[13]=b,t[14]=x):(b=t[13],x=t[14]),X.useEffect(b,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=ee(`max-w-full typography-meta text-foreground !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 data-[popup-open]:!bg-[var(--interactive-active)]/70`,i),t[15]=i,t[16]=C);let w;t[17]===c?w=t[18]:(w=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=w);let T;t[19]===w?T=t[20]:(T=(0,$.jsx)(A,{placeholder:w}),t[19]=w,t[20]=T);let E;t[21]!==o||t[22]!==C||t[23]!==T?(E=(0,$.jsx)(pe,{id:o,size:`lg`,className:C,children:T}),t[21]=o,t[22]=C,t[23]=T,t[24]=E):E=t[24];let D;t[25]===_?D=t[26]:(D=_.length>0&&(0,$.jsx)(j,{children:_.map(it)}),t[25]=_,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(ce,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let te;return t[30]!==a||t[31]!==r||t[32]!==S||t[33]!==E||t[34]!==O?(te=(0,$.jsxs)(le,{value:S,onValueChange:r,disabled:a,children:[E,O]}),t[30]=a,t[31]=r,t[32]=S,t[33]=E,t[34]=O,t[35]=te):te=t[35],te};function et(e){return e.getVisibleAgents}function tt(e){return e.loadAgents}function nt(e){return e.currentAgentName}function rt(e){return _(e.mode)}function it(e){return(0,$.jsx)(fe,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var at=10485760,ot=5,st=e=>{let t=(0,Ce.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground transition-colors`,children:(0,$.jsx)(O,{name:`information`,className:`h-3.5 w-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(z,{children:[r,(0,$.jsx)(me,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ct=e=>{let t=(0,Ce.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,$.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`}),t[0]=r,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==o?(s=(0,$.jsxs)(`label`,{htmlFor:n,className:`typography-meta font-medium text-foreground`,children:[i,o]}),t[2]=i,t[3]=n,t[4]=o,t[5]=s):s=t[5];let c=a&&a,l;return t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l},lt=e=>{let t=D(e.path),n=e.icon?M[e.icon]:null,r=e.color?N[e.color]:void 0,i=(0,$.jsx)(O,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(oe,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ut=({initialPrompt:e,onCreated:t,onCancel:r,isWindowed:i=!1})=>{let{t:a}=f(),[o,s]=X.useState(``),[l,p]=X.useState(()=>[{id:Ie(),prompt:``,models:[]}]),[h,g]=X.useState(``),[_,v]=X.useState([]),[y,b]=X.useState(!1),[x,w]=X.useState([]),[E,D]=X.useState(!1),[ne,re]=X.useState(!1),[ie,ae]=X.useState(!0),j=X.useRef(null),oe=c(e=>e.currentDirectory??null),se=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__VSCODE_CONFIG__?.workspaceFolder;return typeof e==`string`&&e.trim().length>0?e.trim():null},[]),M=C(e=>e.activeProjectId),de=C(e=>e.setActiveProjectIdOnly),N=C(e=>e.projects),[P,F]=X.useState(()=>M??null);X.useEffect(()=>{if(M){F(M);return}!P&&N.length>0&&F(N[0].id)},[M,N,P]);let I=X.useMemo(()=>P?N.find(e=>e.id===P)??null:null,[N,P]),B=I?.path??oe,ge=u(e=>{F(e),e!==M&&de(e)}),_e=X.useMemo(()=>{if(I?.path)return{id:I.id,path:I.path};let e=oe??se;return e?{id:`path:${e}`,path:e}:null},[I,oe,se]),[V]=X.useState(()=>typeof window<`u`&&n()),H=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),ve=he(),U=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__OPENCHAMBER_MACOS_MAJOR__;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;if(typeof navigator>`u`)return null;let t=(navigator.userAgent||``).match(/Mac OS X (\d+)[._](\d+)/);if(!t)return null;let n=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);return Number.isNaN(n)?null:n===10?r:n},[]),ye=X.useMemo(()=>V&&H||ve?`pl-[5.5rem]`:`pl-3`,[V,H,ve]),W=X.useMemo(()=>!V||!H||U===null?``:U>=26?`h-12`:U<=15?`h-14`:``,[V,H,U]),G=u(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&V&&await d()}),K=u(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),q=!!r;X.useEffect(()=>{if(q)return window.addEventListener(`keydown`,K,!0),()=>window.removeEventListener(`keydown`,K,!0)},[q]);let[be,J]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=Ke(B),Q=X.useRef(!1),we=Z===!0,Te=we&&ie;X.useEffect(()=>{if(Z===!1){Q.current=!0,ae(!1);return}Z===!0&&Q.current&&(Q.current=!1,ae(!0))},[Z]);let Ee=Pe(e=>e.createMultiRun),De=Pe(e=>e.error),Oe=Pe(e=>e.clearError);X.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&p(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),X.useEffect(()=>{if(!_e)return;let e=!1;return re(!0),(async()=>{try{let t=await m(_e);e||w(t)}catch{}finally{e||re(!1)}})(),()=>{e=!0}},[_e]);let ke=u((e,t)=>{p(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=u(e=>{p(t=>t.filter(t=>t.id!==e))}),je=u(()=>{p(e=>[...e,{id:Ie(),prompt:``,models:[]}])}),Me=async e=>{let t=e.target.files;if(!t)return;let n=0;for(let e=0;e<t.length;e++){let r=t[e];if(r.size>at){T.error(a(`multirun.launcher.toast.fileTooLarge`,{fileName:r.name}));continue}try{let e=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)});v(t=>[...t,{id:Ie(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),T.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&T.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),j.current&&(j.current.value=``)},Ne=e=>{v(t=>t.filter(t=>t.id!==e))},Fe=X.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let n=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(n.length!==0&&!(Fe<1)){b(!0),Oe();try{P&&P!==M&&de(P);let e=_.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=x.filter(e=>e.trim().length>0),i=n.map(e=>({prompt:e.prompt.trim(),models:e.models.map(e=>({providerID:e.providerID,modelID:e.modelID,displayName:e.displayName,variant:e.variant}))})),a={name:o.trim(),groups:i,agent:h||void 0,worktreeBaseBranch:Te?be:void 0,isolateRuns:Te,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},s=await Ee(a);s&&(s.firstSessionId&&S.getState().setCurrentSession(s.firstSessionId),t?.())}finally{b(!1)}}},Re=!!(o.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Fe>=1&&B&&!Ce&&(Z===!1||!Te||be)),ze=x.filter(e=>e.trim()).length;return(0,$.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,$.jsxs)(`header`,{onMouseDown:G,className:ee(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,ye,W),style:{borderColor:`var(--interactive-border)`},children:[(0,$.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,$.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,$.jsxs)(z,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`multirun.launcher.actions.closeEsc`),className:`inline-flex h-9 w-9 items-center justify-center p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary app-region-no-drag`,children:(0,$.jsx)(O,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(me,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(ue,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),N.length>0?(0,$.jsxs)(le,{value:P??void 0,onValueChange:ge,children:[(0,$.jsx)(pe,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:I?(0,$.jsx)(A,{children:lt(I)}):(0,$.jsx)(A,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(ce,{fitContent:!0,children:N.map(e=>(0,$.jsx)(fe,{value:e.id,className:`max-w-[24rem]`,children:lt(e)},e.id))})]}):(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(st,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(L,{id:`group-name`,value:o,onChange:e=>s(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(st,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Qe,{directory:B,value:be,onChange:J,disabled:!Te,id:`multirun-worktree-base-branch`}),(0,$.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(k,{checked:ie,onChange:ae,disabled:!we,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,$.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-agent`,info:(0,$.jsx)(st,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)($e,{value:h,onChange:g,id:`multirun-agent`})]})]}),(0,$.jsxs)(Se,{open:E,onOpenChange:D,children:[(0,$.jsxs)(xe,{className:`w-full flex items-center gap-2 py-1.5 px-2 -mx-2 rounded-lg hover:bg-[var(--interactive-hover)]/50 transition-colors group`,children:[(0,$.jsx)(O,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,$.jsx)(`span`,{className:`typography-meta font-medium text-muted-foreground group-hover:text-foreground transition-colors`,children:a(`multirun.launcher.setupCommands.label`)}),ze>0&&(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center h-4 min-w-4 px-1 rounded-full typography-micro font-medium`,style:{backgroundColor:`var(--primary-base)`,color:`var(--primary-foreground)`,fontSize:`0.625rem`,lineHeight:1},children:ze}),(0,$.jsx)(O,{name:`arrow-down-s`,className:ee(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,E&&`rotate-180`)})]}),(0,$.jsx)(Y,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:ne?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[x.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(L,{value:e,onChange:e=>{let n=[...x];n[t]=e.target.value,w(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>w(x.filter((e,n)=>n!==t)),className:`flex-shrink-0 flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,"aria-label":a(`multirun.launcher.setupCommands.removeCommandAria`),children:(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>w([...x,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(O,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(ct,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`input`,{ref:j,type:`file`,multiple:!0,className:`hidden`,onChange:Me,accept:`*/*`}),(0,$.jsxs)(z,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>j.current?.click(),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md typography-micro text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(O,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(me,{children:a(`multirun.launcher.attachments.tooltip`)})]}),_.map(e=>(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md typography-micro border`,style:{backgroundColor:`var(--surface-elevated)`,borderColor:`var(--interactive-border)`},children:[e.mimeType.startsWith(`image/`)?(0,$.jsx)(O,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(O,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Ne(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(O,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(dt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:ke,onRemove:Ae},e.id)),(0,$.jsxs)(`button`,{type:`button`,onClick:je,className:`flex items-center gap-1.5 py-2 px-3 -mx-3 rounded-lg typography-meta font-medium text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(O,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),De&&(0,$.jsx)(`div`,{className:`px-3 py-2 rounded-lg typography-meta`,style:{backgroundColor:`var(--status-error-background)`,color:`var(--status-error)`,borderWidth:1,borderColor:`var(--status-error-border)`},children:De})]})})}),(0,$.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Te&&Z!==null?(0,$.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(O,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,$.jsx)(te,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(te,{type:`submit`,size:`sm`,disabled:!Re||y,children:y?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Fe})})})]})})]})},dt=e=>{let t=(0,Ce.c)(104),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=f(),[c,l]=X.useState(!1),[d,p]=X.useState(``),[m,h]=X.useState(!1),[g,_]=X.useState(``),[v,y]=X.useState(!1),[b,x]=X.useState(``),S=X.useRef(null),C=X.useRef(null),w=X.useRef(null),T=X.useRef(null),E;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(E=e=>{n.models.length>=ot||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=E):E=t[3];let D=u(E),ee;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(ee=e=>{a(n.id,{models:n.models.filter((t,n)=>n!==e)})},t[4]=n.id,t[5]=n.models,t[6]=a,t[7]=ee):ee=t[7];let te=u(ee),ne;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(ne=(e,t)=>{a(n.id,{models:n.models.map((n,r)=>r===e?t:n)})},t[8]=n.id,t[9]=n.models,t[10]=a,t[11]=ne):ne=t[11];let re=u(ne),ie;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./useUIStore-5agS8bsW.js";import{Xt as n}from"./persistence-D1lIuyqO.js";import{a as r,r as i}from"./vendor-zustand-B4dlGEM2.js";import{nt as a,rt as o}from"./vendor-base-ui-CnHfUmDN.js";import{kt as s,yt as c}from"./gitApiHttp-BxGAFLTf.js";import{n as l}from"./vendor-react-DLPElpoQ.js";import{n as u}from"./vendor-reactuses-core-DDoDDyM9.js";import{l as d,n as f}from"./clipboard-BnElHSnO.js";import{$i as p,Ba as m,Ha as h,In as g,Ln as _,Wn as v,Xi as y,c as b,er as x,go as S,hr as C,l as w,ra as T,vr as E}from"./useMobileNavigationStore-DQHF_ETu.js";import{n as D,t as ee}from"./utils-BxJEIWv5.js";import{n as O}from"./Icon-DiIuWOuC.js";import{t as te}from"./button-DaAoVF4X.js";import{n as ne}from"./gitApi-BQT3QXD2.js";import{C as re,M as ie,N as k,O as ae,S as A,_ as j,a as oe,b as se,g as ce,h as le,i as M,j as ue,k as de,n as N,o as P,p as F,v as fe,x as pe,y as I}from"./projectMeta-BunN9pH5.js";import{t as L}from"./input-XiL2-2gG.js";import{i as R,n as me,t as z}from"./tooltip-BLugzWq-.js";import{o as he}from"./OverlayScrollbar-BgMLtMIq.js";import{n as B}from"./useRuntimeAPIs-DSLXJybW.js";import{E as ge,T as _e,a as V,b as H,c as ve,g as U,k as ye,l as W,m as G,o as K,p as q,r as be,x as J}from"./insertionBoundaries-9a0RuIDc.js";import{n as Y,r as xe,t as Se}from"./collapsible-BmuQu0dq.js";var X=e(o(),1),Ce=l(),Z=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Q=/^g[1-9]\d*$/,we=(e,t,n,r,i)=>{if(!Z.test(e)||t!==void 0&&!Q.test(t)||!n?.trim()||!r?.trim()||n!==n.trim()||r!==r.trim())return null;if(i===void 0)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!1};if(i===`fusion`)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!0};if(!/^\d+$/.test(i))return null;let a=Number.parseInt(i,10);return!Number.isSafeInteger(a)||a<=0?null:{groupSlug:e,runGroup:t,providerID:n,modelID:r,index:a,fusion:!1}},Te=e=>{if(!e)return null;let t=e.split(`/`);if(t.length<3||t.length>5)return null;let[n]=t;if(t.length===3)return we(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Q.test(e)?we(n,e,r,i,void 0):we(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?we(n,void 0,i,a,o):we(n,r,i,a,o)},Ee=e=>{let t=[e.groupSlug];return e.runGroup&&t.push(e.runGroup),t.push(e.providerID,e.modelID),e.index!==void 0&&t.push(String(e.index)),t.join(`/`)},De=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Oe=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),ke=(e,t)=>`${Oe(e)}-${Oe(t)}`.substring(0,60),Ae=(e,t)=>`${e}/${t}`,je=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Me=(e,t)=>{let n=je(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};T(e.id,n),w.getState().markSessionAsOpenChamberCreated(e.id),C.getState().upsertSession(i);try{p().ensureChild(n,{bootstrap:!1}).setState(t=>{let n=t.session.findIndex(t=>t.id===e.id);if(n>=0&&t.session[n]===i)return t;let r=n>=0?t.session.map((e,t)=>t===n?i:e):[...t.session,i].sort((e,t)=>e.id.localeCompare(t.id));return{session:r,sessionTotal:Math.max(t.sessionTotal,r.length),limit:Math.max(t.limit,r.length)}})}catch{}return i},Ne=()=>{let e=S.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=c.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Pe=r()(i(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let c=Ne();if(!c)return e({error:`Select a project`,isLoading:!1}),null;let l=c.path,u=await ne(l)&&t.isolateRuns!==!1,d=Oe(n),f=u?await F(l):void 0,p=u?await W(l):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let g of n.models){let n=`${g.providerID}:${g.modelID}`,v=a.get(n)||1,y=(o.get(n)||0)+1;o.set(n,y);let b=ke(g.providerID,g.modelID),S=r.length>1?`g${e+1}`:void 0,C=v>1?Ae(d,`${b}/${y}`):Ae(d,b),T=S?`${S}/${C}`:C,E=Ee({groupSlug:d,runGroup:S,providerID:g.providerID,modelID:g.modelID,index:v>1?y:void 0});try{if(!u){let e=await s.withDirectory(l,()=>s.createSession({title:E}));Me(e,l),m.push({sessionId:e.id,worktreePath:l,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await ve(c,{preferredName:T,mode:`new`,branchName:T,worktreeName:T,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await _(c)&&await x(e.path);let r=await s.withDirectory(e.path,()=>s.createSession({title:E}));Me(r,e.path),w.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let g=o?.filter(e=>e.trim().length>0)??[];g.length>0&&v(c,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let y=m.map(e=>e.sessionId),S=m[0]?.sessionId??null;if(y.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let C=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{let e=ie.getState().expandText;await Promise.allSettled(m.map(async t=>{try{let n=await e(t.prompt).catch(()=>t.prompt);await b({sessionId:t.sessionId,directory:t.worktreePath,content:n,providerID:t.providerID,modelID:t.modelID,variant:t.variant,agent:i,files:C})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:y,firstSessionId:S}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),$=a(),Fe=`h-7`,Ie=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Le=e=>{let t=(0,Ce.c)(13),{model:n,instanceIndex:r,totalSameModel:i,onRemove:a}=e,o=n.displayName||`${n.providerID}/${n.modelID}`,s=i>1?`${o} (${r})`:o,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=ee(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Fe),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(de,{modelId:n.modelID,providerId:n.providerID,className:`h-3.5 w-3.5`}),t[1]=n.modelID,t[2]=n.providerID,t[3]=l):l=t[3];let u;t[4]===s?u=t[5]:(u=(0,$.jsx)(`span`,{className:`typography-meta font-medium truncate max-w-[140px]`,children:s}),t[4]=s,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`}),t[6]=d):d=t[6];let f;t[7]===a?f=t[8]:(f=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,children:d}),t[7]=a,t[8]=f);let p;return t[9]!==l||t[10]!==u||t[11]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},Re=e=>{let n=(0,Ce.c)(131),{selectedModels:r,onAdd:i,onRemove:a,onUpdate:o,minModels:s,addButtonLabel:c,showChips:l,maxModels:u,addButtonClassName:d,dropdownSide:p,dropdownClassName:m,containerClassName:g,triggerIcon:_}=e,v=l===void 0||l,b=p===void 0?`top`:p,{t:x}=f(),S=y(ze),C=y(Be),w=t(Ve),T=t(He),{favoriteModelsList:E,recentModelsList:D}=ae(),ne=t(Ue),ie=t(We),[k,j]=X.useState(!1),[oe,se]=X.useState(``),[M,ue]=X.useState(null),de=X.useRef(null),N=X.useRef(null),P=u===1,F=u===void 0||r.length<u||P,I;if(n[0]!==r){I=new Map;for(let e of r){let t=`${e.providerID}:${e.modelID}`;I.set(t,(I.get(t)||0)+1)}n[0]=r,n[1]=I}else I=n[1];let L=I,R;n[2]===r?R=n[3]:(R=e=>r.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,n[2]=r,n[3]=R);let me=R,z,he;n[4]!==b||n[5]!==k?(z=()=>{if(!k||!N.current)return;let e=N.current.getBoundingClientRect();if(b===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ue(Math.max(160,Math.min(320,t)));return}let t=N.current.parentElement;for(;t&&!(t.getAttribute(`role`)===`dialog`||t.hasAttribute(`data-scroll-shadow`));){let e=getComputedStyle(t);if(e.overflow===`auto`||e.overflow===`hidden`||e.overflowY===`auto`||e.overflowY===`hidden`)break;t=t.parentElement}let n=t?t.getBoundingClientRect().top:0,r=e.top-n-16;ue(Math.max(150,Math.min(300,r)))},he=[b,k],n[4]=b,n[5]=k,n[6]=z,n[7]=he):(z=n[6],he=n[7]),X.useEffect(z,he);let B,ge;n[8]!==F||n[9]!==k?(B=()=>{!F&&k&&(j(!1),se(``))},ge=[F,k],n[8]=F,n[9]=k,n[10]=B,n[11]=ge):(B=n[10],ge=n[11]),X.useEffect(B,ge);let _e,V;n[12]===k?(_e=n[13],V=n[14]):(_e=()=>{if(!k)return;let e=e=>{de.current&&!de.current.contains(e.target)&&(j(!1),se(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[k],n[12]=k,n[13]=_e,n[14]=V),X.useEffect(_e,V);let H;n[15]!==P||n[16]!==i||n[17]!==o||n[18]!==r.length?(H=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:h(e.model,e.modelID)||e.modelID,instanceId:Ie()};P&&r.length>0&&o?o(0,t):i(t),P&&(j(!1),se(``))},n[15]=P,n[16]=i,n[17]=o,n[18]=r.length,n[19]=H):H=n[19];let ve=H,U;n[20]===x?U=n[21]:(U=x(`multirun.modelMultiSelect.search.placeholder`),n[20]=x,n[21]=U);let ye;n[22]===x?ye=n[23]:(ye=x(`multirun.modelMultiSelect.search.noResults`),n[22]=x,n[23]=ye);let W;n[24]===x?W=n[25]:(W=x(`multirun.modelMultiSelect.sections.favorites`),n[24]=x,n[25]=W);let G;n[26]===x?G=n[27]:(G=x(`multirun.modelMultiSelect.sections.recent`),n[26]=x,n[27]=G);let K;n[28]===x?K=n[29]:(K=x(`multirun.modelMultiSelect.keyboard.hint`),n[28]=x,n[29]=K);let q;n[30]===x?q=n[31]:(q=x(`settings.agents.modelSelector.actions.favorite`),n[30]=x,n[31]=q);let be;n[32]===x?be=n[33]:(be=x(`settings.agents.modelSelector.actions.unfavorite`),n[32]=x,n[33]=be);let J;n[34]===x?J=n[35]:(J=x(`chat.modelControls.provider`),n[34]=x,n[35]=J);let Y;n[36]===x?Y=n[37]:(Y=x(`chat.modelControls.capabilities`),n[36]=x,n[37]=Y);let xe;n[38]===x?xe=n[39]:(xe=x(`chat.modelControls.capability.toolCalling`),n[38]=x,n[39]=xe);let Se;n[40]===x?Se=n[41]:(Se=x(`chat.modelControls.capability.reasoning`),n[40]=x,n[41]=Se);let Z;n[42]===x?Z=n[43]:(Z=x(`chat.modelControls.modality.image`),n[42]=x,n[43]=Z);let Q;n[44]===x?Q=n[45]:(Q=x(`chat.modelControls.modality.video`),n[44]=x,n[45]=Q);let we;n[46]===x?we=n[47]:(we=x(`chat.modelControls.modality.audio`),n[46]=x,n[47]=we);let Te;n[48]===x?Te=n[49]:(Te=x(`chat.modelControls.costPerMillion`),n[48]=x,n[49]=Te);let Ee;n[50]===x?Ee=n[51]:(Ee=x(`chat.modelControls.costInput`),n[50]=x,n[51]=Ee);let De;n[52]===x?De=n[53]:(De=x(`chat.modelControls.costOutput`),n[52]=x,n[53]=De);let Oe;n[54]!==U||n[55]!==ye||n[56]!==W||n[57]!==G||n[58]!==K||n[59]!==q||n[60]!==be||n[61]!==J||n[62]!==Y||n[63]!==xe||n[64]!==Se||n[65]!==Z||n[66]!==Q||n[67]!==we||n[68]!==Te||n[69]!==Ee||n[70]!==De?(Oe={searchPlaceholder:U,noResults:ye,favorites:W,recent:G,keyboardHint:K,favorite:q,unfavorite:be,provider:J,capabilities:Y,capabilityToolCalling:xe,capabilityReasoning:Se,modalityImage:Z,modalityVideo:Q,modalityAudio:we,costPerMillion:Te,costInput:Ee,costOutput:De},n[54]=U,n[55]=ye,n[56]=W,n[57]=G,n[58]=K,n[59]=q,n[60]=be,n[61]=J,n[62]=Y,n[63]=xe,n[64]=Se,n[65]=Z,n[66]=Q,n[67]=we,n[68]=Te,n[69]=Ee,n[70]=De,n[71]=Oe):Oe=n[71];let ke=Oe,Ae;n[72]===g?Ae=n[73]:(Ae=ee(`relative`,g),n[72]=g,n[73]=Ae);let je;n[74]===d?je=n[75]:(je=ee(Fe,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,d),n[74]=d,n[75]=je);let Me=!F,Ne;n[76]===k?Ne=n[77]:(Ne=()=>{j(!k)},n[76]=k,n[77]=Ne);let Pe;n[78]===_?Pe=n[79]:(Pe=_??(0,$.jsx)(O,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),n[78]=_,n[79]=Pe);let Re;n[80]!==c||n[81]!==x?(Re=c??x(`multirun.modelMultiSelect.actions.addModel`),n[80]=c,n[81]=x,n[82]=Re):Re=n[82];let Ke;n[83]!==je||n[84]!==Me||n[85]!==Ne||n[86]!==Pe||n[87]!==Re?(Ke=(0,$.jsxs)(te,{ref:N,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ne,children:[Pe,Re]}),n[83]=je,n[84]=Me,n[85]=Ne,n[86]=Pe,n[87]=Re,n[88]=Ke):Ke=n[88];let qe;n[89]!==M||n[90]!==F||n[91]!==m||n[92]!==b||n[93]!==E||n[94]!==C||n[95]!==ve||n[96]!==ne||n[97]!==T||n[98]!==k||n[99]!==ke||n[100]!==L||n[101]!==ie||n[102]!==S||n[103]!==D||n[104]!==oe||n[105]!==w?(qe=k?(0,$.jsx)(`div`,{className:ee(`absolute left-0 z-50 w-[min(420px,calc(100vw-2rem))] max-w-[calc(100vw-2rem)] flex flex-col overflow-hidden rounded-xl border border-border/50 shadow-lg`,b===`top`?`bottom-full mb-1`:`top-full mt-1`,m),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(re,{providers:S,providerOrder:ie,favoriteModels:E,recentModels:D,getMetadata:C,hiddenModels:ne,searchQuery:oe,onSearchQueryChange:se,onSelect:ve,labels:ke,selectionCount:e=>L.get(`${e.providerID}:${e.modelID}`)||0,disabled:!F,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:M?`${M}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:k,isFavorite:e=>T(e.providerID,e.modelID),onToggleFavorite:e=>w(e.providerID,e.modelID),onEscape:()=>{j(!1),se(``)}})}):null,n[89]=M,n[90]=F,n[91]=m,n[92]=b,n[93]=E,n[94]=C,n[95]=ve,n[96]=ne,n[97]=T,n[98]=k,n[99]=ke,n[100]=L,n[101]=ie,n[102]=S,n[103]=D,n[104]=oe,n[105]=w,n[106]=qe):qe=n[106];let Je;n[107]!==Ae||n[108]!==Ke||n[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:de,children:[Ke,qe]}),n[107]=Ae,n[108]=Ke,n[109]=qe,n[110]=Je):Je=n[110];let Ye;n[111]!==me||n[112]!==L||n[113]!==a||n[114]!==o||n[115]!==S||n[116]!==r||n[117]!==v||n[118]!==x?(Ye=v&&r.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:r.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=L.get(n)||1,i=me(e),s=S.find(t=>t.id===e.providerID)?.models?.find(t=>t.id===e.modelID),c=s?.variants?Object.keys(s.variants):[],l=c.length>0,u=e.variant??`__default__`;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Le,{model:e,instanceIndex:i,totalSameModel:r,onRemove:()=>a(t)}),l&&(0,$.jsxs)(le,{value:u,onValueChange:n=>{if(!o)return;let r=n===`__default__`?void 0:n;o(t,{...e,variant:r})},children:[(0,$.jsxs)(pe,{size:`chip`,className:`px-2 gap-1.5 rounded-md !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 typography-meta font-medium text-foreground`,children:[(0,$.jsx)(O,{name:`brain-ai-3`,className:ee(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(A,{placeholder:x(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?x(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(ce,{fitContent:!0,children:[(0,$.jsx)(fe,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:x(`multirun.modelMultiSelect.variant.default`)}),c.map(Ge)]})]})]},e.instanceId)})}),n[111]=me,n[112]=L,n[113]=a,n[114]=o,n[115]=S,n[116]=r,n[117]=v,n[118]=x,n[119]=Ye):Ye=n[119];let Xe;n[120]!==Je||n[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),n[120]=Je,n[121]=Ye,n[122]=Xe):Xe=n[122];let Ze;n[123]!==u||n[124]!==s||n[125]!==r.length||n[126]!==x?(Ze=s!==void 0&&r.length<s&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:u===void 0?x(`multirun.modelMultiSelect.validation.minOnly`,{min:s}):x(`multirun.modelMultiSelect.validation.minToMax`,{min:s,max:u})}),n[123]=u,n[124]=s,n[125]=r.length,n[126]=x,n[127]=Ze):Ze=n[127];let Qe;return n[128]!==Xe||n[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),n[128]=Xe,n[129]=Ze,n[130]=Qe):Qe=n[130],Qe};function ze(e){return e.providers}function Be(e){return e.getModelMetadata}function Ve(e){return e.toggleFavoriteModel}function He(e){return e.isFavoriteModel}function Ue(e){return e.hiddenModels}function We(e){return e.providerOrder}function Ge(e){return(0,$.jsx)(fe,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function Ke(e){let t=(0,Ce.c)(30),{git:n}=B(),r=q(e),i=J(e),a=U(e),o=G(e),s=H(Ze),c=H(Xe),l,u;t[0]!==e||t[1]!==c||t[2]!==n||t[3]!==i||t[4]!==a?(l=()=>{!e||!n||i!==null||a||c(e,n,{silent:!0})},u=[e,n,c,i,a],t[0]=e,t[1]=c,t[2]=n,t[3]=i,t[4]=a,t[5]=l,t[6]=u):(l=t[5],u=t[6]),X.useEffect(l,u);let d;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(d=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=d):d=t[12];let f=r?.all,p;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==f?(p=[e,n,i,f,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=f,t[18]=p):p=t[18],X.useEffect(d,p);let m=a||i===!0&&o,h;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],h=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(Ye).sort(),t[20]=r.all,t[21]=e),h=e}let g=h,_;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],_=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Je).map(qe).sort(),t[23]=r.all,t[24]=e),_=e}let v=_,y;bb2:{if(!e){y=null;break bb2}if(i!==null){y=i;break bb2}if(m){y=null;break bb2}y=r?.all?!0:null}let b=y,x;return t[25]!==b||t[26]!==m||t[27]!==g||t[28]!==v?(x={localBranches:g,remoteBranches:v,isLoading:m,isGitRepository:b},t[25]=b,t[26]=m,t[27]=g,t[28]=v,t[29]=x):x=t[29],x}function qe(e){return e.replace(/^remotes\//,``)}function Je(e){return e.startsWith(`remotes/`)}function Ye(e){return!e.startsWith(`remotes/`)}function Xe(e){return e.fetchStatus}function Ze(e){return e.fetchBranches}var Qe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=f(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=Ke(e),d=X.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return X.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await F(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(V),{sourceBranch:o,shouldClearSavedSourceBranch:s}=K({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(V),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(le,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(pe,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(A,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(ce,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.loadingBranches`)}):s.length===0&&c.length===0?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,$.jsxs)($.Fragment,{children:[s.length>0&&(0,$.jsxs)(j,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(fe,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(se,{}),c.length>0&&(0,$.jsxs)(j,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(fe,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},$e=e=>{let t=(0,Ce.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=f(),l=y(et),u=y(tt),d=y(nt),p;t[0]===l?p=t[1]:(p=l(),t[0]=l,t[1]=p);let m=p,h;t[2]===m?h=t[3]:(h=m.filter(rt),t[2]=m,t[3]=h);let g=h,_,v;t[4]!==m.length||t[5]!==u?(_=()=>{m.length===0&&u()},v=[m.length,u],t[4]=m.length,t[5]=u,t[6]=_,t[7]=v):(_=t[6],v=t[7]),X.useEffect(_,v);let b,x;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==g||t[12]!==n?(b=()=>{if(a)return;let e=n.trim();if(e.length>0&&g.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&g.some(e=>e.name===t)){r(t);return}let i=g[0]?.name;i&&r(i)},x=[d,a,r,g,n],t[8]=d,t[9]=a,t[10]=r,t[11]=g,t[12]=n,t[13]=b,t[14]=x):(b=t[13],x=t[14]),X.useEffect(b,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=ee(`max-w-full typography-meta text-foreground !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 data-[popup-open]:!bg-[var(--interactive-active)]/70`,i),t[15]=i,t[16]=C);let w;t[17]===c?w=t[18]:(w=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=w);let T;t[19]===w?T=t[20]:(T=(0,$.jsx)(A,{placeholder:w}),t[19]=w,t[20]=T);let E;t[21]!==o||t[22]!==C||t[23]!==T?(E=(0,$.jsx)(pe,{id:o,size:`lg`,className:C,children:T}),t[21]=o,t[22]=C,t[23]=T,t[24]=E):E=t[24];let D;t[25]===g?D=t[26]:(D=g.length>0&&(0,$.jsx)(j,{children:g.map(it)}),t[25]=g,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(ce,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let te;return t[30]!==a||t[31]!==r||t[32]!==S||t[33]!==E||t[34]!==O?(te=(0,$.jsxs)(le,{value:S,onValueChange:r,disabled:a,children:[E,O]}),t[30]=a,t[31]=r,t[32]=S,t[33]=E,t[34]=O,t[35]=te):te=t[35],te};function et(e){return e.getVisibleAgents}function tt(e){return e.loadAgents}function nt(e){return e.currentAgentName}function rt(e){return m(e.mode)}function it(e){return(0,$.jsx)(fe,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var at=10485760,ot=5,st=e=>{let t=(0,Ce.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground transition-colors`,children:(0,$.jsx)(O,{name:`information`,className:`h-3.5 w-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(z,{children:[r,(0,$.jsx)(me,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ct=e=>{let t=(0,Ce.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,$.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`}),t[0]=r,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==o?(s=(0,$.jsxs)(`label`,{htmlFor:n,className:`typography-meta font-medium text-foreground`,children:[i,o]}),t[2]=i,t[3]=n,t[4]=o,t[5]=s):s=t[5];let c=a&&a,l;return t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l},lt=e=>{let t=D(e.path),n=e.icon?M[e.icon]:null,r=e.color?N[e.color]:void 0,i=(0,$.jsx)(O,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(oe,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ut=({initialPrompt:e,onCreated:t,onCancel:r,isWindowed:i=!1})=>{let{t:a}=f(),[o,s]=X.useState(``),[l,p]=X.useState(()=>[{id:Ie(),prompt:``,models:[]}]),[m,h]=X.useState(``),[_,v]=X.useState([]),[y,b]=X.useState(!1),[x,C]=X.useState([]),[T,D]=X.useState(!1),[ne,re]=X.useState(!1),[ie,ae]=X.useState(!0),j=X.useRef(null),oe=c(e=>e.currentDirectory??null),se=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__VSCODE_CONFIG__?.workspaceFolder;return typeof e==`string`&&e.trim().length>0?e.trim():null},[]),M=S(e=>e.activeProjectId),de=S(e=>e.setActiveProjectIdOnly),N=S(e=>e.projects),[P,F]=X.useState(()=>M??null);X.useEffect(()=>{if(M){F(M);return}!P&&N.length>0&&F(N[0].id)},[M,N,P]);let I=X.useMemo(()=>P?N.find(e=>e.id===P)??null:null,[N,P]),B=I?.path??oe,ge=u(e=>{F(e),e!==M&&de(e)}),_e=X.useMemo(()=>{if(I?.path)return{id:I.id,path:I.path};let e=oe??se;return e?{id:`path:${e}`,path:e}:null},[I,oe,se]),[V]=X.useState(()=>typeof window<`u`&&n()),H=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),ve=he(),U=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__OPENCHAMBER_MACOS_MAJOR__;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;if(typeof navigator>`u`)return null;let t=(navigator.userAgent||``).match(/Mac OS X (\d+)[._](\d+)/);if(!t)return null;let n=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);return Number.isNaN(n)?null:n===10?r:n},[]),ye=X.useMemo(()=>V&&H||ve?`pl-[5.5rem]`:`pl-3`,[V,H,ve]),W=X.useMemo(()=>!V||!H||U===null?``:U>=26?`h-12`:U<=15?`h-14`:``,[V,H,U]),G=u(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&V&&await d()}),K=u(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),q=!!r;X.useEffect(()=>{if(q)return window.addEventListener(`keydown`,K,!0),()=>window.removeEventListener(`keydown`,K,!0)},[q]);let[be,J]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=Ke(B),Q=X.useRef(!1),we=Z===!0,Te=we&&ie;X.useEffect(()=>{if(Z===!1){Q.current=!0,ae(!1);return}Z===!0&&Q.current&&(Q.current=!1,ae(!0))},[Z]);let Ee=Pe(e=>e.createMultiRun),De=Pe(e=>e.error),Oe=Pe(e=>e.clearError);X.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&p(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),X.useEffect(()=>{if(!_e)return;let e=!1;return re(!0),(async()=>{try{let t=await g(_e);e||C(t)}catch{}finally{e||re(!1)}})(),()=>{e=!0}},[_e]);let ke=u((e,t)=>{p(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=u(e=>{p(t=>t.filter(t=>t.id!==e))}),je=u(()=>{p(e=>[...e,{id:Ie(),prompt:``,models:[]}])}),Me=async e=>{let t=e.target.files;if(!t)return;let n=0;for(let e=0;e<t.length;e++){let r=t[e];if(r.size>at){E.error(a(`multirun.launcher.toast.fileTooLarge`,{fileName:r.name}));continue}try{let e=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)});v(t=>[...t,{id:Ie(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),E.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&E.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),j.current&&(j.current.value=``)},Ne=e=>{v(t=>t.filter(t=>t.id!==e))},Fe=X.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let n=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(n.length!==0&&!(Fe<1)){b(!0),Oe();try{P&&P!==M&&de(P);let e=_.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=x.filter(e=>e.trim().length>0),i=n.map(e=>({prompt:e.prompt.trim(),models:e.models.map(e=>({providerID:e.providerID,modelID:e.modelID,displayName:e.displayName,variant:e.variant}))})),a={name:o.trim(),groups:i,agent:m||void 0,worktreeBaseBranch:Te?be:void 0,isolateRuns:Te,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},s=await Ee(a);s&&(s.firstSessionId&&w.getState().setCurrentSession(s.firstSessionId),t?.())}finally{b(!1)}}},Re=!!(o.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Fe>=1&&B&&!Ce&&(Z===!1||!Te||be)),ze=x.filter(e=>e.trim()).length;return(0,$.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,$.jsxs)(`header`,{onMouseDown:G,className:ee(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,ye,W),style:{borderColor:`var(--interactive-border)`},children:[(0,$.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,$.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,$.jsxs)(z,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`multirun.launcher.actions.closeEsc`),className:`inline-flex h-9 w-9 items-center justify-center p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary app-region-no-drag`,children:(0,$.jsx)(O,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(me,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(ue,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),N.length>0?(0,$.jsxs)(le,{value:P??void 0,onValueChange:ge,children:[(0,$.jsx)(pe,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:I?(0,$.jsx)(A,{children:lt(I)}):(0,$.jsx)(A,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(ce,{fitContent:!0,children:N.map(e=>(0,$.jsx)(fe,{value:e.id,className:`max-w-[24rem]`,children:lt(e)},e.id))})]}):(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(st,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(L,{id:`group-name`,value:o,onChange:e=>s(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(st,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Qe,{directory:B,value:be,onChange:J,disabled:!Te,id:`multirun-worktree-base-branch`}),(0,$.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(k,{checked:ie,onChange:ae,disabled:!we,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,$.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-agent`,info:(0,$.jsx)(st,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)($e,{value:m,onChange:h,id:`multirun-agent`})]})]}),(0,$.jsxs)(Se,{open:T,onOpenChange:D,children:[(0,$.jsxs)(xe,{className:`w-full flex items-center gap-2 py-1.5 px-2 -mx-2 rounded-lg hover:bg-[var(--interactive-hover)]/50 transition-colors group`,children:[(0,$.jsx)(O,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,$.jsx)(`span`,{className:`typography-meta font-medium text-muted-foreground group-hover:text-foreground transition-colors`,children:a(`multirun.launcher.setupCommands.label`)}),ze>0&&(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center h-4 min-w-4 px-1 rounded-full typography-micro font-medium`,style:{backgroundColor:`var(--primary-base)`,color:`var(--primary-foreground)`,fontSize:`0.625rem`,lineHeight:1},children:ze}),(0,$.jsx)(O,{name:`arrow-down-s`,className:ee(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,T&&`rotate-180`)})]}),(0,$.jsx)(Y,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:ne?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[x.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(L,{value:e,onChange:e=>{let n=[...x];n[t]=e.target.value,C(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>C(x.filter((e,n)=>n!==t)),className:`flex-shrink-0 flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,"aria-label":a(`multirun.launcher.setupCommands.removeCommandAria`),children:(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>C([...x,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(O,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(ct,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`input`,{ref:j,type:`file`,multiple:!0,className:`hidden`,onChange:Me,accept:`*/*`}),(0,$.jsxs)(z,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>j.current?.click(),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md typography-micro text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(O,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(me,{children:a(`multirun.launcher.attachments.tooltip`)})]}),_.map(e=>(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md typography-micro border`,style:{backgroundColor:`var(--surface-elevated)`,borderColor:`var(--interactive-border)`},children:[e.mimeType.startsWith(`image/`)?(0,$.jsx)(O,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(O,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Ne(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(O,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(dt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:ke,onRemove:Ae},e.id)),(0,$.jsxs)(`button`,{type:`button`,onClick:je,className:`flex items-center gap-1.5 py-2 px-3 -mx-3 rounded-lg typography-meta font-medium text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(O,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),De&&(0,$.jsx)(`div`,{className:`px-3 py-2 rounded-lg typography-meta`,style:{backgroundColor:`var(--status-error-background)`,color:`var(--status-error)`,borderWidth:1,borderColor:`var(--status-error-border)`},children:De})]})})}),(0,$.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Te&&Z!==null?(0,$.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(O,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,$.jsx)(te,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(te,{type:`submit`,size:`sm`,disabled:!Re||y,children:y?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Fe})})})]})})]})},dt=e=>{let t=(0,Ce.c)(104),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=f(),[c,l]=X.useState(!1),[d,p]=X.useState(``),[m,h]=X.useState(!1),[g,_]=X.useState(``),[v,y]=X.useState(!1),[b,x]=X.useState(``),S=X.useRef(null),C=X.useRef(null),w=X.useRef(null),T=X.useRef(null),E;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(E=e=>{n.models.length>=ot||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=E):E=t[3];let D=u(E),ee;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(ee=e=>{a(n.id,{models:n.models.filter((t,n)=>n!==e)})},t[4]=n.id,t[5]=n.models,t[6]=a,t[7]=ee):ee=t[7];let te=u(ee),ne;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(ne=(e,t)=>{a(n.id,{models:n.models.map((n,r)=>r===e?t:n)})},t[8]=n.id,t[9]=n.models,t[10]=a,t[11]=ne):ne=t[11];let re=u(ne),ie;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
|
|
2
2
|
`),i=Math.min(n===-1?e.length:n,r===-1?e.length:r);if(t<=i&&n===-1){_(e.substring(1,i)),h(!0),l(!1),y(!1);return}}h(!1);let n=e.substring(0,t),r=n.lastIndexOf(`#`);if(r!==-1){let e=r>0?n[r-1]:null,t=n.substring(r+1);if((!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
|
|
3
3
|
`)){x(t),y(!0),l(!1);return}}y(!1);let i=n.lastIndexOf(`@`);if(i!==-1){let e=i>0?n[i-1]:null,t=n.substring(i+1);(!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
|
|
4
4
|
`)?(p(t),l(!0)):l(!1);return}l(!1)},t[12]=ie):ie=t[12];let k=u(ie),ae;t[13]!==n.id||t[14]!==a?(ae=e=>{a(n.id,{prompt:e})},t[13]=n.id,t[14]=a,t[15]=ae):ae=t[15];let A=u(ae),j;t[16]!==n.prompt||t[17]!==A||t[18]!==k?(j=e=>{let t=n.prompt,r=S.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=e.relativePath&&e.relativePath.trim().length>0?e.relativePath.trim():e.path||e.name,o=be(t,i===-1?r:i,r,`@${a}`);A(o.text),l(!1),p(``),requestAnimationFrame(()=>{let e=S.current;e&&(e.selectionStart=o.caret,e.selectionEnd=o.caret,e.focus()),k(o.text,o.caret)})},t[16]=n.prompt,t[17]=A,t[18]=k,t[19]=j):j=t[19];let oe=u(j),se;t[20]!==n.prompt||t[21]!==A||t[22]!==k?(se=e=>{let t=n.prompt,r=S.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=be(t,i===-1?r:i,r,`@${e}`);A(a.text),l(!1),p(``),requestAnimationFrame(()=>{let e=S.current;e&&(e.selectionStart=a.caret,e.selectionEnd=a.caret,e.focus()),k(a.text,a.caret)})},t[20]=n.prompt,t[21]=A,t[22]=k,t[23]=se):se=t[23];let ce=u(se),le;t[24]!==A||t[25]!==k?(le=e=>{let t=`/${e.name} `;A(t),h(!1),_(``),y(!1),requestAnimationFrame(()=>{let e=S.current;e&&(e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length),k(t,t.length)})},t[24]=A,t[25]=k,t[26]=le):le=t[26];let M=u(le),ue;t[27]!==n.prompt||t[28]!==A||t[29]!==k?(ue=(e,t)=>{let r=n.prompt,i=S.current?.selectionStart??r.length,a=r.substring(0,i).lastIndexOf(`#`),o=a===-1?i:a,s=`${r.substring(0,o)}#${t} ${r.substring(i)}`,c=o+t.length+2;A(s),y(!1),x(``),requestAnimationFrame(()=>{let e=S.current;e&&(e.selectionStart=c,e.selectionEnd=c,e.focus()),k(s,c)})},t[27]=n.prompt,t[28]=A,t[29]=k,t[30]=ue):ue=t[30];let de=u(ue),N;t[31]!==m||t[32]!==c||t[33]!==v?(N=e=>{if(m&&w.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)){e.preventDefault(),w.current.handleKeyDown(e.key);return}c&&C.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),C.current.handleKeyDown(e.key)),v&&T.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),T.current.handleKeyDown(e.key))},t[31]=m,t[32]=c,t[33]=v,t[34]=N):N=t[34];let F=u(N),fe=r+1,pe;t[35]!==s||t[36]!==fe?(pe=s(`multirun.launcher.groups.groupLabel`,{index:fe}),t[35]=s,t[36]=fe,t[37]=pe):pe=t[37];let I;t[38]===pe?I=t[39]:(I=(0,$.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:pe}),t[38]=pe,t[39]=I);let L;t[40]!==i||t[41]!==n.id||t[42]!==o||t[43]!==s?(L=i&&(0,$.jsx)(`button`,{type:`button`,onClick:()=>o(n.id),className:`inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10`,"aria-label":s(`multirun.launcher.groups.removeGroup`),children:(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`})}),t[40]=i,t[41]=n.id,t[42]=o,t[43]=s,t[44]=L):L=t[44];let R;t[45]!==I||t[46]!==L?(R=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[I,L]}),t[45]=I,t[46]=L,t[47]=R):R=t[47];let me;t[48]===s?me=t[49]:(me=s(`multirun.launcher.groups.prompt.label`),t[48]=s,t[49]=me);let z;t[50]===me?z=t[51]:(z=(0,$.jsx)(ct,{required:!0,children:me}),t[50]=me,t[51]=z);let he=n.prompt,B;t[52]!==A||t[53]!==k?(B=e=>{let t=e.target.value;A(t);let n=e.target.selectionStart??t.length;k(t,n)},t[52]=A,t[53]=k,t[54]=B):B=t[54];let V;t[55]===s?V=t[56]:(V=s(`multirun.launcher.groups.prompt.placeholder`),t[55]=s,t[56]=V);let H;t[57]!==n.prompt||t[58]!==F||t[59]!==B||t[60]!==V?(H=(0,$.jsx)(P,{ref:S,value:he,onChange:B,onKeyDown:F,placeholder:V,className:`typography-meta min-h-[80px] max-h-[200px] resize-none overflow-y-auto field-sizing-content`,required:!0}),t[57]=n.prompt,t[58]=F,t[59]=B,t[60]=V,t[61]=H):H=t[61];let ve;t[62]!==g||t[63]!==M||t[64]!==m?(ve=m?(0,$.jsx)(ge,{ref:w,searchQuery:g,onCommandSelect:M,onClose:()=>h(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[62]=g,t[63]=M,t[64]=m,t[65]=ve):ve=t[65];let U;t[66]!==ce||t[67]!==oe||t[68]!==d||t[69]!==c?(U=c?(0,$.jsx)(ye,{ref:C,searchQuery:d,onFileSelect:oe,onAgentSelect:ce,onClose:()=>l(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[66]=ce,t[67]=oe,t[68]=d,t[69]=c,t[70]=U):U=t[70];let W;t[71]!==de||t[72]!==v||t[73]!==b?(W=v?(0,$.jsx)(_e,{ref:T,searchQuery:b,onSnippetSelect:de,onClose:()=>y(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[71]=de,t[72]=v,t[73]=b,t[74]=W):W=t[74];let G;t[75]!==H||t[76]!==ve||t[77]!==U||t[78]!==W?(G=(0,$.jsxs)(`div`,{className:`relative`,children:[H,ve,U,W]}),t[75]=H,t[76]=ve,t[77]=U,t[78]=W,t[79]=G):G=t[79];let K;t[80]!==z||t[81]!==G?(K=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[z,G]}),t[80]=z,t[81]=G,t[82]=K):K=t[82];let q;t[83]===s?q=t[84]:(q=s(`multirun.launcher.models.info`,{max:ot}),t[83]=s,t[84]=q);let J;t[85]===q?J=t[86]:(J=(0,$.jsx)(st,{children:q}),t[85]=q,t[86]=J);let Y;t[87]===s?Y=t[88]:(Y=s(`multirun.launcher.models.label`),t[87]=s,t[88]=Y);let xe;t[89]!==J||t[90]!==Y?(xe=(0,$.jsx)(ct,{required:!0,info:J,children:Y}),t[89]=J,t[90]=Y,t[91]=xe):xe=t[91];let Se;t[92]!==n.models||t[93]!==D||t[94]!==te||t[95]!==re?(Se=(0,$.jsx)(Re,{selectedModels:n.models,onAdd:D,onRemove:te,onUpdate:re,minModels:1,maxModels:ot}),t[92]=n.models,t[93]=D,t[94]=te,t[95]=re,t[96]=Se):Se=t[96];let Z;t[97]!==xe||t[98]!==Se?(Z=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[xe,Se]}),t[97]=xe,t[98]=Se,t[99]=Z):Z=t[99];let Q;return t[100]!==R||t[101]!==K||t[102]!==Z?(Q=(0,$.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-3`,children:[R,K,Z]}),t[100]=R,t[101]=K,t[102]=Z,t[103]=Q):Q=t[103],Q};export{De as a,Ie as i,$e as n,Te as o,Re as r,ut as t};
|