@yuriai/web 0.3.6-beta.14 → 0.3.6-beta.16

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.
Files changed (206) hide show
  1. package/dist/assets/{AgentAvatar-5tMBB3OP.js → AgentAvatar-Cz7vWoUM.js} +1 -1
  2. package/dist/assets/{AgentSelector-Cb7GNCSr.js → AgentSelector-tguIbO8e.js} +1 -1
  3. package/dist/assets/{ArchivedSessionsDialog-8gBAWGWJ.js → ArchivedSessionsDialog-C0Vf38jt.js} +1 -1
  4. package/dist/assets/{AssistantConversationSurface-DBgTUUEt.js → AssistantConversationSurface-TNj9TKag.js} +3 -3
  5. package/dist/assets/{AssistantSessionCard-_yFsx4WB.js → AssistantSessionCard-BX_ck4KS.js} +2 -2
  6. package/dist/assets/{AssistantUnreadBadge-a2u_bBfi.js → AssistantUnreadBadge-DSjJfYrh.js} +1 -1
  7. package/dist/assets/{AssistantView-BxqHaArC.js → AssistantView-eAuI94K6.js} +1 -1
  8. package/dist/assets/{AssistantWorkingAvatar-DHZVN5kD.js → AssistantWorkingAvatar-OhfpjL1t.js} +1 -1
  9. package/dist/assets/{AssistantsSettingsPage-CCG2-SGj.js → AssistantsSettingsPage-X19bTIju.js} +1 -1
  10. package/dist/assets/{BinaryFileFallback-DyOwcZlP.js → BinaryFileFallback-DDWawtzt.js} +1 -1
  11. package/dist/assets/{BtwPanel-BhJA_qnp.js → BtwPanel-Dhn1iVrH.js} +2 -2
  12. package/dist/assets/BusyDots-q2aVrHbQ.js +4 -0
  13. package/dist/assets/{ChatContainer-vX0hPadC.js → ChatContainer-CYq3DRwu.js} +21 -21
  14. package/dist/assets/ChatView-CD7B735C.js +3 -0
  15. package/dist/assets/{DiagramView-XjJTNa7h.js → DiagramView-D8qMjsAQ.js} +1 -1
  16. package/dist/assets/{DiffView-B6_7v5dX.js → DiffView-BRUUP_UF.js} +1 -1
  17. package/dist/assets/{DiffViewToggle-as2OeoZV.js → DiffViewToggle-Bn4WLr8E.js} +1 -1
  18. package/dist/assets/{ErrorBoundary-6AeJc3yJ.js → ErrorBoundary-UqQdMytG.js} +1 -1
  19. package/dist/assets/{FadeInOnReveal-BKAakuxD.js → FadeInOnReveal-BV_4xYNR.js} +1 -1
  20. package/dist/assets/{GuiPluginMount-DlrUvFjg.js → GuiPluginMount-CEXVtLmV.js} +1 -1
  21. package/dist/assets/{GuiPluginPage-DsBH_Y2M.js → GuiPluginPage-BziZa4M0.js} +1 -1
  22. package/dist/assets/{GuiPluginSurface-BisC0s24.js → GuiPluginSurface-gxhtskj7.js} +1 -1
  23. package/dist/assets/{GuiPluginTitlebarItems-CraVxzKU.js → GuiPluginTitlebarItems-mIMh81nb.js} +1 -1
  24. package/dist/assets/{GuiPluginWindow-DjrDed9m.js → GuiPluginWindow-DvVG8u7w.js} +1 -1
  25. package/dist/assets/{Icon-zB0u-x9G.js → Icon-C6Duv_oe.js} +1 -1
  26. package/dist/assets/{ImageLoadingPlaceholder-COr72scf.js → ImageLoadingPlaceholder-BIQ6Y6SP.js} +1 -1
  27. package/dist/assets/{LoadingImage-DCyqFHPY.js → LoadingImage-Dk4wxhnT.js} +1 -1
  28. package/dist/assets/{MarkdownRenderer-YxMjOHQg.js → MarkdownRenderer-BY310t1T.js} +2 -2
  29. package/dist/assets/{MarkdownRendererImpl-FJ3saBi-.js → MarkdownRendererImpl-nAHoW0Z9.js} +3 -3
  30. package/dist/assets/{MarkstreamRendererImpl-69EMw8mz.js → MarkstreamRendererImpl-shwGZ7Tl.js} +1 -1
  31. package/dist/assets/{MobileAssistantSettingsPage-BoH-3iPc.js → MobileAssistantSettingsPage-DOJwDh_T.js} +1 -1
  32. package/dist/assets/{MobileAssistantTab-59nMj5dF.js → MobileAssistantTab-BAkvh3MP.js} +1 -1
  33. package/dist/assets/{MobileBtwPage-EwMOy6Vg.js → MobileBtwPage-BdPAeG7v.js} +1 -1
  34. package/dist/assets/{MobileChangesSurface-BfMWp6TX.js → MobileChangesSurface-DmlszV_t.js} +1 -1
  35. package/dist/assets/{MobileChatScreen-CZDiNi7M.js → MobileChatScreen-CEbQNMgn.js} +1 -1
  36. package/dist/assets/{MobileDetailNavigation-DKv1HfQX.js → MobileDetailNavigation-BUMzEYEL.js} +1 -1
  37. package/dist/assets/{MobileFilesSurface-BiK7LCem.js → MobileFilesSurface-DCQsIn2I.js} +2 -2
  38. package/dist/assets/{MobileHtmlNetworkBoundary-BXh_BJ93.js → MobileHtmlNetworkBoundary-DiuzUkq3.js} +2 -2
  39. package/dist/assets/{MobileOverlayPanel-Pr-vLaIF.js → MobileOverlayPanel-DhGG1USg.js} +1 -1
  40. package/dist/assets/{MobileResizableSheet-O2gv2sCB.js → MobileResizableSheet-BN5lO8_k.js} +1 -1
  41. package/dist/assets/{MobileSettingsTab-DadXop75.js → MobileSettingsTab-B4wkSo7K.js} +1 -1
  42. package/dist/assets/{MobileShareBridge-CaiscA4w.js → MobileShareBridge-DUHyEHab.js} +1 -1
  43. package/dist/assets/{MobileSurface-B_2aVFm1.js → MobileSurface-CuAPWI6D.js} +1 -1
  44. package/dist/assets/{MobileTabPageHeader-T0zUz7Wl.js → MobileTabPageHeader-Bh1ILbqr.js} +1 -1
  45. package/dist/assets/{ModelLogo-C1Vv7gz6.js → ModelLogo-R0TXf5Pt.js} +1 -1
  46. package/dist/assets/{ModelSelector-BP_s_VhY.js → ModelSelector-D5pSGqN8.js} +1 -1
  47. package/dist/assets/{MultiRunWindow--tNVFKUJ.js → MultiRunWindow-DJb6RpVw.js} +1 -1
  48. package/dist/assets/{OnboardingScreen-DMdy73Dq.js → OnboardingScreen-CdHEr54c.js} +1 -1
  49. package/dist/assets/{OverlayScrollbar-n5T49w2e.js → OverlayScrollbar-CrwDy2Pt.js} +1 -1
  50. package/dist/assets/{PierreDiffViewer-i3OsvUKm.js → PierreDiffViewer-BYO9Wbwk.js} +1 -1
  51. package/dist/assets/{ProviderLogo-D-ldwq0G.js → ProviderLogo-C8aB3qlM.js} +1 -1
  52. package/dist/assets/{RemoteAssistantSessionCard-CNpcgVmv.js → RemoteAssistantSessionCard-C_hCy6FE.js} +1 -1
  53. package/dist/assets/{RemoteDesktopPanel-hTuLKJZb.js → RemoteDesktopPanel-Cj6G6AyD.js} +1 -1
  54. package/dist/assets/ScheduledTasksDialog-z2v4fwrE.js +3 -0
  55. package/dist/assets/{ScrollableOverlay-DAMUOn67.js → ScrollableOverlay-BrA__-l0.js} +1 -1
  56. package/dist/assets/{SettingsGroup-CwMJmhq2.js → SettingsGroup-DMAcPhM4.js} +1 -1
  57. package/dist/assets/{SettingsView-bYWNjHtA.js → SettingsView-BuGjKeb9.js} +10 -10
  58. package/dist/assets/{SettingsWindow-D0ZzAXW0.js → SettingsWindow-_sonrUby.js} +1 -1
  59. package/dist/assets/{SetupTourDialog-CgM5YonA.js → SetupTourDialog-Cf1Jm1Gl.js} +1 -1
  60. package/dist/assets/{SyncActions-Ct2yZTbg.js → SyncActions-BWHWdbi_.js} +1 -1
  61. package/dist/assets/{TerminalView-BU5w40RA.js → TerminalView-DN60v7to.js} +3 -3
  62. package/dist/assets/{TextSelectionMenu-a7yyDz5R.js → TextSelectionMenu-YlWMOZkS.js} +2 -2
  63. package/dist/assets/{ToolOutputDialog-CGYnrXVV.js → ToolOutputDialog-B388thfl.js} +2 -2
  64. package/dist/assets/{YuriLogo-Cexwa29m.js → YuriLogo-CdbCjzA8.js} +1 -1
  65. package/dist/assets/{YuriWordmark-Bn5KdqMC.js → YuriWordmark-rISEHjrd.js} +1 -1
  66. package/dist/assets/{assistant-attachment-cache-Y7yhlQcv.js → assistant-attachment-cache-BsIYVOYw.js} +1 -1
  67. package/dist/assets/{assistantMessagePreview-BXNdMDW-.js → assistantMessagePreview-DJVWTOKl.js} +1 -1
  68. package/dist/assets/{assistantQueries-DkAmjFg7.js → assistantQueries-C_SpnqtF.js} +1 -1
  69. package/dist/assets/{auto-read-context-DLilPZMl.js → auto-read-context-BO5tE9k_.js} +1 -1
  70. package/dist/assets/{capgoAdapter-DaIrgBjp.js → capgoAdapter-qaeQqHpT.js} +1 -1
  71. package/dist/assets/{card-CXE0ffyH.js → card-t-tgqQ79.js} +1 -1
  72. package/dist/assets/{chatUpwardIntent-DRFjEP4t.js → chatUpwardIntent-BEntur0S.js} +1 -1
  73. package/dist/assets/{checkbox-hYuewn9u.js → checkbox-D-OIaMB8.js} +1 -1
  74. package/dist/assets/{client-QcYZg8_d.js → client-BuCd-T7s.js} +1 -1
  75. package/dist/assets/{collapsible-C4a0ndbm.js → collapsible-CCc6anWP.js} +1 -1
  76. package/dist/assets/{connection-hint-Ci6c4iij.js → connection-hint-DAQZ45pI.js} +1 -1
  77. package/dist/assets/{context-menu-D73tnkiI.js → context-menu-BhnOdTDq.js} +1 -1
  78. package/dist/assets/{desktopHosts-DFa3lf0i.js → desktopHosts-COI-czjF.js} +1 -1
  79. package/dist/assets/{desktopRelayRestore-CGq-Ylgq.js → desktopRelayRestore-BEPNc7qb.js} +1 -1
  80. package/dist/assets/device-TCHW5U2y.js +2 -0
  81. package/dist/assets/{diagram-B2X1oieg.js → diagram-sCh-Ausk.js} +1 -1
  82. package/dist/assets/{dialog-B2Po85oU.js → dialog-C9DNMP08.js} +1 -1
  83. package/dist/assets/{dropdown-menu-vW7wfT5z.js → dropdown-menu-CcQq6JDI.js} +1 -1
  84. package/dist/assets/{fileMentionTouchSelection-B73h0W0P.js → fileMentionTouchSelection-HhfJS8d1.js} +1 -1
  85. package/dist/assets/{fileReferenceActions-DEUhs_7h.js → fileReferenceActions-wN7mWY3w.js} +1 -1
  86. package/dist/assets/{gitApi-DG2Gj6gC.js → gitApi-BNkkLnOi.js} +1 -1
  87. package/dist/assets/{gitApiHttp-C8AU1uiY.js → gitApiHttp-CrPYe9Oc.js} +2 -2
  88. package/dist/assets/{githubAuthQueries-IJPWBo0B.js → githubAuthQueries-CTTiXZ9q.js} +1 -1
  89. package/dist/assets/{historyImportQueries-B3QBdaKo.js → historyImportQueries-B4DVAuxZ.js} +1 -1
  90. package/dist/assets/{host-DchPrZpw.js → host-BjnskVUP.js} +1 -1
  91. package/dist/assets/{i18n-WsU03nwB.js → i18n-CYty_Jft.js} +1 -1
  92. package/dist/assets/{icons-6sA6AOaU.js → icons-DlTcJ36Q.js} +1 -1
  93. package/dist/assets/{imageSource-B39pFDdo.js → imageSource-BquIRnWW.js} +1 -1
  94. package/dist/assets/{input-BpDiYSsP.js → input-DVzjAzTw.js} +1 -1
  95. package/dist/assets/{input-store-PqhVEhUI.js → input-store-BtvRZZcg.js} +1 -1
  96. package/dist/assets/insertionBoundaries-WYUnaIac.js +1 -0
  97. package/dist/assets/{kbd-Dd1lM8OM.js → kbd-DA0IyUcd.js} +1 -1
  98. package/dist/assets/main-BfuLSPdJ.js +169 -0
  99. package/dist/assets/{main-BtqqLSTt.js → main-BpAkYb0H.js} +2 -2
  100. package/dist/assets/{markdownHeightCache-BzWUzccz.js → markdownHeightCache-CcgRs1ER.js} +1 -1
  101. package/dist/assets/{mcpQueries-8frBxd65.js → mcpQueries-CCvxTdrj.js} +1 -1
  102. package/dist/assets/miniChat-D2l_XXQe.js +2 -0
  103. package/dist/assets/mobile-mVNRvGd5.js +2 -0
  104. package/dist/assets/{mobileBackNavigation-Ch0aK3t9.js → mobileBackNavigation-B8wJO_pZ.js} +1 -1
  105. package/dist/assets/{mobileConnections-Bay_JNn0.js → mobileConnections-Ckzqn3Y9.js} +2 -2
  106. package/dist/assets/{multirun-CQ2v1-nW.js → multirun-B34hqzTY.js} +1 -1
  107. package/dist/assets/{native-config-B8eHFnvv.js → native-config-CD8pMBkt.js} +1 -1
  108. package/dist/assets/{nativeComposerCover--wSR2Iru.js → nativeComposerCover-CEyD3731.js} +1 -1
  109. package/dist/assets/{navigation-33oih6q2.js → navigation-atykJu0I.js} +2 -2
  110. package/dist/assets/openRemoteProjectSession-B63pkBaj.js +1 -0
  111. package/dist/assets/openSessionFromDeepLink-Bz07xQfv.js +2 -0
  112. package/dist/assets/platform-B2ylz14u.js +1 -0
  113. package/dist/assets/{pluginPresentation-BqcbcLYL.js → pluginPresentation-4xMNGtKI.js} +2 -2
  114. package/dist/assets/{project-preview-CIkGbBPZ.js → project-preview-Dq--046z.js} +1 -1
  115. package/dist/assets/{projectActions-D84EVh3q.js → projectActions-B11KAI3f.js} +1 -1
  116. package/dist/assets/{prompt-attachment-upload-D1c308Ba.js → prompt-attachment-upload-m0vbcftI.js} +1 -1
  117. package/dist/assets/{pwa-JM_Ia4Qo.js → pwa-uLk3vYDP.js} +2 -2
  118. package/dist/assets/{queue-abort-optimistic-BspQeOrZ.js → queue-abort-optimistic-C_L5pmK0.js} +1 -1
  119. package/dist/assets/{quota-C7uYEfoX.js → quota-CNmk_bQD.js} +1 -1
  120. package/dist/assets/{reference-history-DuOv6xPy.js → reference-history-CN8H7cQY.js} +1 -1
  121. package/dist/assets/{remote-input-store-CquhCIoR.js → remote-input-store-CE88ZLsw.js} +1 -1
  122. package/dist/assets/{remoteProjectQueries-BunVM5PM.js → remoteProjectQueries-zO4jYbru.js} +1 -1
  123. package/dist/assets/{remoteSessionReference-brIKt6ea.js → remoteSessionReference-BvbDndSv.js} +1 -1
  124. package/dist/assets/{renderElectronMiniChatApp-1iiZ6q0N.js → renderElectronMiniChatApp-BImqnwc-.js} +2 -2
  125. package/dist/assets/renderMobileApp-DjKpQ6id.js +17 -0
  126. package/dist/assets/{runtime-file-download-wMVtKk2v.js → runtime-file-download-CzZ_VAoB.js} +1 -1
  127. package/dist/assets/{runtime-file-resource-DKJJoOOc.js → runtime-file-resource-9kLrAtnQ.js} +1 -1
  128. package/dist/assets/{runtimeConfig-qjNoqcXT.js → runtimeConfig-Cs95Hj1_.js} +1 -1
  129. package/dist/assets/runtimeEndpointReset-BeO-ZC0f.js +4 -0
  130. package/dist/assets/{scheduledTaskNavigation-DpfZSGu8.js → scheduledTaskNavigation-r3g3DfXq.js} +1 -1
  131. package/dist/assets/{select-Ojd202kE.js → select-Cb6W8KRB.js} +1 -1
  132. package/dist/assets/sessionLookup-MXum2sR5.js +1 -0
  133. package/dist/assets/{sessionOwnership-Nqb7MQgW.js → sessionOwnership-CgeZg9fN.js} +1 -1
  134. package/dist/assets/{shortcuts-BOzfBNF8.js → shortcuts-5iHGo1f3.js} +1 -1
  135. package/dist/assets/{sortable-tabs-strip-DlQjS9bw.js → sortable-tabs-strip-D5MuRWnZ.js} +1 -1
  136. package/dist/assets/{speechSettingsQueries-DzDLUBnb.js → speechSettingsQueries-D2CugjM1.js} +1 -1
  137. package/dist/assets/{switch-BN9zvb0m.js → switch-DLlbkkU5.js} +1 -1
  138. package/dist/assets/{terminalApi-D2ECmoAo.js → terminalApi-CsTh04jY.js} +1 -1
  139. package/dist/assets/{textarea-ChLN9tnA.js → textarea-Cg3Yz3Oc.js} +1 -1
  140. package/dist/assets/{timeFormat-D1hdmWbu.js → timeFormat-fIpRkrOb.js} +1 -1
  141. package/dist/assets/{tooltip-Cdsa-YWG.js → tooltip-Chqxbwjz.js} +1 -1
  142. package/dist/assets/{truncated-path-DjN9DJvh.js → truncated-path-DWUl2HQC.js} +1 -1
  143. package/dist/assets/{types-DHO20zYy.js → types-DfbaAnUB.js} +1 -1
  144. package/dist/assets/ui-lbbchWJP.js +13 -0
  145. package/dist/assets/useAppFontEffects-BDoatEWZ.js +7 -0
  146. package/dist/assets/{useAssistantUIStore-DEiMjSqf.js → useAssistantUIStore-BUWPTwNV.js} +1 -1
  147. package/dist/assets/{useDesktopWindowControlsLayout-OdYH5vsn.js → useDesktopWindowControlsLayout-C_VGQBG3.js} +1 -1
  148. package/dist/assets/{useDictation-DUR68U4T.js → useDictation-C81KyPa6.js} +1 -1
  149. package/dist/assets/{useEffectiveDirectory-DNVTRp-B.js → useEffectiveDirectory-Dqdl58J7.js} +1 -1
  150. package/dist/assets/{useFontPreferences-BY0TXvWI.js → useFontPreferences-DyMUXTQC.js} +1 -1
  151. package/dist/assets/{useGitStore-DsxzluvZ.js → useGitStore-kco1LBfw.js} +1 -1
  152. package/dist/assets/{useInlineCommentDraftStore-DU-yffqD.js → useInlineCommentDraftStore-DFr7FLv-.js} +1 -1
  153. package/dist/assets/useMcpConfigStore-C9SxNeU1.js +1 -0
  154. package/dist/assets/{useMobileSwipeActions-rPGl_HNn.js → useMobileSwipeActions-vvnhP5zs.js} +1 -1
  155. package/dist/assets/useMobileTranscriptSyncHint-DVm8zIWR.js +10 -0
  156. package/dist/assets/{useModelLists-xVEEc-e7.js → useModelLists-CU3ffp2-.js} +1 -1
  157. package/dist/assets/{useOpenCodeReadiness-C5D4297L.js → useOpenCodeReadiness-KpQk8Bm7.js} +1 -1
  158. package/dist/assets/{usePluginsStore-DEctn121.js → usePluginsStore-BJNtJkXv.js} +1 -1
  159. package/dist/assets/{useProjectGitActions-D7yZSor5.js → useProjectGitActions-DuzvQm-w.js} +1 -1
  160. package/dist/assets/{useProjectGitStore-DFz9Eb6v.js → useProjectGitStore-U9tDVHik.js} +1 -1
  161. package/dist/assets/{useProjectRuntimeAPIs-TALa4FqO.js → useProjectRuntimeAPIs-DJubGUM_.js} +1 -1
  162. package/dist/assets/{useQuotaStore-BqPJ1nzk.js → useQuotaStore-B4FEz0gR.js} +1 -1
  163. package/dist/assets/{useSessionBtwStore-DAQVlbuf.js → useSessionBtwStore-D5bVhQ1l.js} +1 -1
  164. package/dist/assets/{useStreamingTextThrottle-BpC1BNz_.js → useStreamingTextThrottle-DlgF3Cnn.js} +1 -1
  165. package/dist/assets/{useUIStore-P32bzAJc.js → useUIStore-68ZPpgYA.js} +1 -1
  166. package/dist/assets/{worktreeManager-D56glCi_.js → worktreeManager-BJCsjptu.js} +1 -1
  167. package/dist/assets/{worktreeSourceBranchPreference-CNtT0ymW.js → worktreeSourceBranchPreference-qDpG1uyC.js} +1 -1
  168. package/dist/index.html +15 -15
  169. package/dist/mini-chat.html +15 -15
  170. package/dist/mobile.html +1 -1
  171. package/package.json +1 -1
  172. package/server/index.js +1 -0
  173. package/server/lib/assistants/DOCUMENTATION.md +7 -3
  174. package/server/lib/assistants/builtin-skills.js +19 -3
  175. package/server/lib/assistants/builtin-skills.test.js +16 -0
  176. package/server/lib/assistants/harness.js +2 -1
  177. package/server/lib/assistants/routes.js +1 -0
  178. package/server/lib/assistants/service.js +6 -2
  179. package/server/lib/gui-customization/DOCUMENTATION.md +19 -7
  180. package/server/lib/gui-customization/projects-client.mjs +1 -1
  181. package/server/lib/gui-customization/projects.js +6 -6
  182. package/server/lib/gui-customization/projects.test.js +13 -2
  183. package/server/lib/gui-customization/remote-connections-client.mjs +1 -1
  184. package/server/lib/gui-customization/remote-connections.js +6 -6
  185. package/server/lib/gui-customization/session-skill.js +15 -3
  186. package/server/lib/gui-customization/skill/references/deep-links.md +6 -6
  187. package/server/lib/gui-customization/skill-caller.js +18 -0
  188. package/server/lib/opencode/feature-routes-runtime.js +20 -3
  189. package/dist/assets/BusyDots-B9Zv4OUg.js +0 -4
  190. package/dist/assets/ChatView-OJAZBsfN.js +0 -3
  191. package/dist/assets/ScheduledTasksDialog-dgU5OpBK.js +0 -3
  192. package/dist/assets/device-CtdJ8KBJ.js +0 -2
  193. package/dist/assets/insertionBoundaries-Cu6Djn8S.js +0 -1
  194. package/dist/assets/main-CdUAbE7p.js +0 -169
  195. package/dist/assets/miniChat-C7JCQrXA.js +0 -2
  196. package/dist/assets/mobile-CcIasitd.js +0 -2
  197. package/dist/assets/openRemoteProjectSession-B94TYao_.js +0 -1
  198. package/dist/assets/openSessionFromDeepLink-C9jS-EIM.js +0 -2
  199. package/dist/assets/platform-CNdx57HN.js +0 -1
  200. package/dist/assets/renderMobileApp-CdTenU5H.js +0 -17
  201. package/dist/assets/runtimeEndpointReset-DKchBECK.js +0 -4
  202. package/dist/assets/sessionLookup-D299jmfx.js +0 -1
  203. package/dist/assets/ui-CU6n15y3.js +0 -13
  204. package/dist/assets/useAppFontEffects-Bqt4cv2k.js +0 -7
  205. package/dist/assets/useMcpConfigStore-al7LZT72.js +0 -1
  206. package/dist/assets/useMobileTranscriptSyncHint-BVvgdcp4.js +0 -10
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t}from"./platform-CNdx57HN.js";import{a as n,r}from"./vendor-zustand-CTekDqaS.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{St as o}from"./gitApiHttp-C8AU1uiY.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{_t as s,ft as c,n as l}from"./client-QcYZg8_d.js";import{n as u}from"./vendor-react-BkccXcWz.js";import{R as d}from"./runtime-file-resource-DKJJoOOc.js";import{r as f}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as p}from"./useUIStore-P32bzAJc.js";import{Ba as m,Fi as h,Yi as g,Yn as _,ai as v,ca as y,d as b,f as x,mi as S,no as C,oa as w,ri as T,ro as E,t as D,ti as O}from"./ui-CU6n15y3.js";import{n as k}from"./Icon-zB0u-x9G.js";import{c as A,t as ee}from"./i18n-WsU03nwB.js";import{n as te}from"./ScrollableOverlay-DAMUOn67.js";import{i as j,n as M,t as ne}from"./tooltip-Cdsa-YWG.js";import{a as re}from"./device-CtdJ8KBJ.js";import{n as ie,r as ae,t as oe}from"./collapsible-C4a0ndbm.js";import{t as se}from"./textarea-ChLN9tnA.js";import{t as ce}from"./gitApi-DG2Gj6gC.js";import{c as N,i as P,n as F,r as I,s as L}from"./useGitStore-DsxzluvZ.js";import{t as R}from"./input-BpDiYSsP.js";import{t as le}from"./checkbox-hYuewn9u.js";import{a as ue,c as z,r as B}from"./insertionBoundaries-Cu6Djn8S.js";import{t as V}from"./ModelLogo-C1Vv7gz6.js";import{n as H,t as de}from"./useModelLists-xVEEc-e7.js";import{a as U,c as fe,i as W,n as pe,o as G,r as K,s as me,t as he}from"./select-Ojd202kE.js";import{s as q}from"./worktreeManager-D56glCi_.js";import{a as J,i as Y,n as ge,t as _e}from"./worktreeSourceBranchPreference-CNtT0ymW.js";import{a as ve,i as ye,n as be}from"./projectMeta-vIaGFaQr.js";var X=e(a(),1),xe=u(),Se=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Ce=/^g[1-9]\d*$/,Z=(e,t,n,r,i)=>{if(!Se.test(e)||t!==void 0&&!Ce.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}},we=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 Z(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Ce.test(e)?Z(n,e,r,i,void 0):Z(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?Z(n,void 0,i,a,o):Z(n,r,i,a,o)},Te=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(`/`)},Q=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Ee=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),De=(e,t)=>`${Ee(e)}-${Ee(t)}`.substring(0,60),Oe=(e,t)=>`${e}/${t}`,ke=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Ae=(e,t)=>{let n=ke(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};s(e.id,n),x.getState().markSessionAsYuriCreated(e.id),h.getState().upsertSession(i);try{c().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},je=()=>{let e=m.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=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Me=n()(r(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 s=je();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let c=s.path,u=await ce(c)&&t.isolateRuns!==!1,d=Ee(n),f=u?await q(c):void 0,p=u?await J(c):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}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=De(g.providerID,g.modelID),b=r.length>1?`g${e+1}`:void 0,C=_>1?Oe(d,`${y}/${v}`):Oe(d,y),w=b?`${b}/${C}`:C,E=Te({groupSlug:d,runGroup:b,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await l.withDirectory(c,()=>l.createSession({title:E}));Ae(e,c),m.push({sessionId:e.id,worktreePath:c,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await Y(s,{preferredName:w,mode:`new`,branchName:w,worktreeName:w,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await T(s)&&await S(e.worktreeRoot??e.path);let r=await l.withDirectory(e.path,()=>l.createSession({title:E}));Ae(r,e.path),x.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(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),y=m[0]?.sessionId??null;if(_.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{await Promise.allSettled(m.map(async e=>{try{await b({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.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:_,firstSessionId:y}}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`})),$=i(),Ne=`h-7`,Pe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Fe=e=>{let t=(0,xe.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=C(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Ne),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(V,{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)(k,{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},Ie=e=>{let t=(0,xe.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:u,dropdownSide:d,dropdownClassName:f,containerClassName:m,triggerIcon:h}=e,v=c===void 0||c,b=d===void 0?`top`:d,{t:x}=ee(),S=g(Le),w=g(Re),T=p(ze),E=p(Be),{favoriteModelsList:D,recentModelsList:O}=de(),A=p(Ve),te=p(He),[j,M]=X.useState(!1),[ne,re]=X.useState(``),[ie,ae]=X.useState(null),oe=X.useRef(null),se=X.useRef(null),ce=l===1,N=l===void 0||n.length<l||ce,P;if(t[0]!==n){P=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;P.set(t,(P.get(t)||0)+1)}t[0]=n,t[1]=P}else P=t[1];let F=P,I;t[2]===n?I=t[3]:(I=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=I);let L=I,R,le;t[4]!==b||t[5]!==j?(R=()=>{if(!j||!se.current)return;let e=se.current.getBoundingClientRect();if(b===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ae(Math.max(160,Math.min(320,t)));return}let t=se.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;ae(Math.max(150,Math.min(300,r)))},le=[b,j],t[4]=b,t[5]=j,t[6]=R,t[7]=le):(R=t[6],le=t[7]),X.useEffect(R,le);let ue,z;t[8]!==N||t[9]!==j?(ue=()=>{!N&&j&&(M(!1),re(``))},z=[N,j],t[8]=N,t[9]=j,t[10]=ue,t[11]=z):(ue=t[10],z=t[11]),X.useEffect(ue,z);let B,V;t[12]===j?(B=t[13],V=t[14]):(B=()=>{if(!j)return;let e=e=>{oe.current&&!oe.current.contains(e.target)&&(M(!1),re(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[j],t[12]=j,t[13]=B,t[14]=V),X.useEffect(B,V);let U;t[15]!==ce||t[16]!==r||t[17]!==a||t[18]!==n.length?(U=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:y(e.model,e.modelID)||e.modelID,instanceId:Pe()};ce&&n.length>0&&a?a(0,t):r(t),ce&&(M(!1),re(``))},t[15]=ce,t[16]=r,t[17]=a,t[18]=n.length,t[19]=U):U=t[19];let G=U,K;t[20]===x?K=t[21]:(K=x(`multirun.modelMultiSelect.search.placeholder`),t[20]=x,t[21]=K);let q;t[22]===x?q=t[23]:(q=x(`multirun.modelMultiSelect.search.noResults`),t[22]=x,t[23]=q);let J;t[24]===x?J=t[25]:(J=x(`multirun.modelMultiSelect.sections.favorites`),t[24]=x,t[25]=J);let Y;t[26]===x?Y=t[27]:(Y=x(`multirun.modelMultiSelect.sections.recent`),t[26]=x,t[27]=Y);let ge;t[28]===x?ge=t[29]:(ge=x(`multirun.modelMultiSelect.keyboard.hint`),t[28]=x,t[29]=ge);let _e;t[30]===x?_e=t[31]:(_e=x(`settings.agents.modelSelector.actions.favorite`),t[30]=x,t[31]=_e);let ve;t[32]===x?ve=t[33]:(ve=x(`settings.agents.modelSelector.actions.unfavorite`),t[32]=x,t[33]=ve);let ye;t[34]===x?ye=t[35]:(ye=x(`chat.modelControls.provider`),t[34]=x,t[35]=ye);let be;t[36]===x?be=t[37]:(be=x(`chat.modelControls.capabilities`),t[36]=x,t[37]=be);let Se;t[38]===x?Se=t[39]:(Se=x(`chat.modelControls.capability.toolCalling`),t[38]=x,t[39]=Se);let Ce;t[40]===x?Ce=t[41]:(Ce=x(`chat.modelControls.capability.reasoning`),t[40]=x,t[41]=Ce);let Z;t[42]===x?Z=t[43]:(Z=x(`chat.modelControls.modality.image`),t[42]=x,t[43]=Z);let we;t[44]===x?we=t[45]:(we=x(`chat.modelControls.modality.video`),t[44]=x,t[45]=we);let Te;t[46]===x?Te=t[47]:(Te=x(`chat.modelControls.modality.audio`),t[46]=x,t[47]=Te);let Q;t[48]===x?Q=t[49]:(Q=x(`chat.modelControls.costPerMillion`),t[48]=x,t[49]=Q);let Ee;t[50]===x?Ee=t[51]:(Ee=x(`chat.modelControls.costInput`),t[50]=x,t[51]=Ee);let De;t[52]===x?De=t[53]:(De=x(`chat.modelControls.costOutput`),t[52]=x,t[53]=De);let Oe;t[54]!==K||t[55]!==q||t[56]!==J||t[57]!==Y||t[58]!==ge||t[59]!==_e||t[60]!==ve||t[61]!==ye||t[62]!==be||t[63]!==Se||t[64]!==Ce||t[65]!==Z||t[66]!==we||t[67]!==Te||t[68]!==Q||t[69]!==Ee||t[70]!==De?(Oe={searchPlaceholder:K,noResults:q,favorites:J,recent:Y,keyboardHint:ge,favorite:_e,unfavorite:ve,provider:ye,capabilities:be,capabilityToolCalling:Se,capabilityReasoning:Ce,modalityImage:Z,modalityVideo:we,modalityAudio:Te,costPerMillion:Q,costInput:Ee,costOutput:De},t[54]=K,t[55]=q,t[56]=J,t[57]=Y,t[58]=ge,t[59]=_e,t[60]=ve,t[61]=ye,t[62]=be,t[63]=Se,t[64]=Ce,t[65]=Z,t[66]=we,t[67]=Te,t[68]=Q,t[69]=Ee,t[70]=De,t[71]=Oe):Oe=t[71];let ke=Oe,Ae;t[72]===m?Ae=t[73]:(Ae=C(`relative`,m),t[72]=m,t[73]=Ae);let je;t[74]===u?je=t[75]:(je=C(Ne,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,u),t[74]=u,t[75]=je);let Me=!N,Ie;t[76]===j?Ie=t[77]:(Ie=()=>{M(!j)},t[76]=j,t[77]=Ie);let We;t[78]===h?We=t[79]:(We=h??(0,$.jsx)(k,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=h,t[79]=We);let Ge;t[80]!==s||t[81]!==x?(Ge=s??x(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=x,t[82]=Ge):Ge=t[82];let Ke;t[83]!==je||t[84]!==Me||t[85]!==Ie||t[86]!==We||t[87]!==Ge?(Ke=(0,$.jsxs)(_,{ref:se,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ie,children:[We,Ge]}),t[83]=je,t[84]=Me,t[85]=Ie,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==ie||t[90]!==N||t[91]!==f||t[92]!==b||t[93]!==D||t[94]!==w||t[95]!==G||t[96]!==A||t[97]!==E||t[98]!==j||t[99]!==ke||t[100]!==F||t[101]!==te||t[102]!==S||t[103]!==O||t[104]!==ne||t[105]!==T?(qe=j?(0,$.jsx)(`div`,{className:C(`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`,f),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(H,{providers:S,providerOrder:te,favoriteModels:D,recentModels:O,getMetadata:w,hiddenModels:A,searchQuery:ne,onSearchQueryChange:re,onSelect:G,labels:ke,selectionCount:e=>F.get(`${e.providerID}:${e.modelID}`)||0,disabled:!N,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:ie?`${ie}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:j,isFavorite:e=>E(e.providerID,e.modelID),onToggleFavorite:e=>T(e.providerID,e.modelID),onEscape:()=>{M(!1),re(``)}})}):null,t[89]=ie,t[90]=N,t[91]=f,t[92]=b,t[93]=D,t[94]=w,t[95]=G,t[96]=A,t[97]=E,t[98]=j,t[99]=ke,t[100]=F,t[101]=te,t[102]=S,t[103]=O,t[104]=ne,t[105]=T,t[106]=qe):qe=t[106];let Je;t[107]!==Ae||t[108]!==Ke||t[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:oe,children:[Ke,qe]}),t[107]=Ae,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==L||t[112]!==F||t[113]!==i||t[114]!==a||t[115]!==S||t[116]!==n||t[117]!==v||t[118]!==x?(Ye=v&&n.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=F.get(n)||1,o=L(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)(Fe,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,$.jsxs)(he,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,$.jsxs)(me,{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)(k,{name:`brain-ai-3`,className:C(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(fe,{placeholder:x(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?x(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(pe,{fitContent:!0,children:[(0,$.jsx)(W,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:x(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=L,t[112]=F,t[113]=i,t[114]=a,t[115]=S,t[116]=n,t[117]=v,t[118]=x,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),t[120]=Je,t[121]=Ye,t[122]=Xe):Xe=t[122];let Ze;t[123]!==l||t[124]!==o||t[125]!==n.length||t[126]!==x?(Ze=o!==void 0&&n.length<o&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?x(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):x(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=x,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),t[128]=Xe,t[129]=Ze,t[130]=Qe):Qe=t[130],Qe};function Le(e){return e.providers}function Re(e){return e.getModelMetadata}function ze(e){return e.toggleFavoriteModel}function Be(e){return e.isFavoriteModel}function Ve(e){return e.hiddenModels}function He(e){return e.providerOrder}function Ue(e){return(0,$.jsx)(W,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,xe.c)(30),{git:n}=d(),r=F(e),i=N(e),a=P(e),o=I(e),s=L(Ye),c=L(Je),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 f;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(f=()=>{!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]=f):f=t[12];let p=r?.all,m;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==p?(m=[e,n,i,p,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=p,t[18]=m):m=t[18],X.useEffect(f,m);let h=a||i===!0&&o,g;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],g=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),g=e}let _=g,v;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],v=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),v=e}let y=v,b;bb2:{if(!e){b=null;break bb2}if(i!==null){b=i;break bb2}if(h){b=null;break bb2}b=r?.all?!0:null}let x=b,S;return t[25]!==x||t[26]!==h||t[27]!==_||t[28]!==y?(S={localBranches:_,remoteBranches:y,isLoading:h,isGitRepository:x},t[25]=x,t[26]=h,t[27]=_,t[28]=y,t[29]=S):S=t[29],S}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=ee(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(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 q(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(_e),{sourceBranch:o,shouldClearSavedSourceBranch:s}=ge({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(_e),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(he,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(me,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(fe,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(pe,{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)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(W,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(G,{}),c.length>0&&(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(W,{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`)})]})},Ze=e=>{let t=(0,xe.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=ee(),l=g(Qe),u=g($e),d=g(et),f;t[0]===l?f=t[1]:(f=l(),t[0]=l,t[1]=f);let p=f,m;t[2]===p?m=t[3]:(m=p.filter(tt),t[2]=p,t[3]=m);let h=m,_,v;t[4]!==p.length||t[5]!==u?(_=()=>{p.length===0&&u()},v=[p.length,u],t[4]=p.length,t[5]=u,t[6]=_,t[7]=v):(_=t[6],v=t[7]),X.useEffect(_,v);let y,b;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==h||t[12]!==n?(y=()=>{if(a)return;let e=n.trim();if(e.length>0&&h.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&h.some(e=>e.name===t)){r(t);return}let i=h[0]?.name;i&&r(i)},b=[d,a,r,h,n],t[8]=d,t[9]=a,t[10]=r,t[11]=h,t[12]=n,t[13]=y,t[14]=b):(y=t[13],b=t[14]),X.useEffect(y,b);let x=n.trim().length>0?n:void 0,S;t[15]===i?S=t[16]:(S=C(`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]=S);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)(fe,{placeholder:w}),t[19]=w,t[20]=T);let E;t[21]!==o||t[22]!==S||t[23]!==T?(E=(0,$.jsx)(me,{id:o,size:`lg`,className:S,children:T}),t[21]=o,t[22]=S,t[23]=T,t[24]=E):E=t[24];let D;t[25]===h?D=t[26]:(D=h.length>0&&(0,$.jsx)(K,{children:h.map(nt)}),t[25]=h,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(pe,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let k;return t[30]!==a||t[31]!==r||t[32]!==x||t[33]!==E||t[34]!==O?(k=(0,$.jsxs)(he,{value:x,onValueChange:r,disabled:a,children:[E,O]}),t[30]=a,t[31]=r,t[32]=x,t[33]=E,t[34]=O,t[35]=k):k=t[35],k};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return w(e.mode)}function nt(e){return(0,$.jsx)(W,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var rt=10485760,it=5,at=e=>{let t=(0,xe.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(j,{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)(k,{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)(ne,{children:[r,(0,$.jsx)(M,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,xe.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},st=e=>{let t=E(e.path),n=e.icon?ye[e.icon]:null,r=e.color?be[e.color]:void 0,i=(0,$.jsx)(k,{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:`relative top-px flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(ve,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=ee(),[s,c]=X.useState(``),[l,u]=X.useState(()=>[{id:Pe(),prompt:``,models:[]}]),[d,p]=X.useState(``),[h,g]=X.useState([]),[v,y]=X.useState(!1),[b,S]=X.useState([]),[w,T]=X.useState(!1),[E,se]=X.useState(!1),[ce,N]=X.useState(!0),P=X.useRef(null),F=o(e=>e.currentDirectory??null),I=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},[]),L=m(e=>e.activeProjectId),ue=m(e=>e.setActiveProjectIdOnly),z=m(e=>e.projects),[B,V]=X.useState(()=>L??null);X.useEffect(()=>{if(L){V(L);return}!B&&z.length>0&&V(z[0].id)},[L,z,B]);let H=X.useMemo(()=>B?z.find(e=>e.id===B)??null:null,[z,B]),de=H?.path??F,U=f(e=>{V(e),e!==L&&ue(e)}),G=X.useMemo(()=>{if(H?.path)return{id:H.id,path:H.path};let e=F??I;return e?{id:`path:${e}`,path:e}:null},[H,F,I]),[K]=X.useState(()=>typeof window<`u`&&t()),q=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),J=re(),Y=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__YURI_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},[]),ge=X.useMemo(()=>K&&q||J?`pl-[5.5rem]`:`pl-3`,[K,q,J]),_e=X.useMemo(()=>!K||!q||Y===null?``:Y>=26?`h-12`:Y<=15?`h-14`:``,[K,q,Y]),ve=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&K&&await A()}),ye=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),be=!!r;X.useEffect(()=>{if(be)return window.addEventListener(`keydown`,ye,!0),()=>window.removeEventListener(`keydown`,ye,!0)},[be]);let[xe,Se]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=We(de),we=X.useRef(!1),Te=Z===!0,Q=Te&&ce;X.useEffect(()=>{if(Z===!1){we.current=!0,N(!1);return}Z===!0&&we.current&&(we.current=!1,N(!0))},[Z]);let Ee=Me(e=>e.createMultiRun),De=Me(e=>e.error),Oe=Me(e=>e.clearError);X.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&u(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),X.useEffect(()=>{if(!G)return;let e=!1;return se(!0),(async()=>{try{let t=await O(G);e||S(t)}catch{}finally{e||se(!1)}})(),()=>{e=!0}},[G]);let ke=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=f(e=>{u(t=>t.filter(t=>t.id!==e))}),je=f(()=>{u(e=>[...e,{id:Pe(),prompt:``,models:[]}])}),Ne=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>rt){D.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)});g(t=>[...t,{id:Pe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),D.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&D.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),P.current&&(P.current.value=``)},Fe=e=>{g(t=>t.filter(t=>t.id!==e))},Ie=X.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let t=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(t.length!==0&&!(Ie<1)){y(!0),Oe();try{B&&B!==L&&ue(B);let e=h.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=b.filter(e=>e.trim().length>0),i=t.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:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Q?xe:void 0,isolateRuns:Q,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await Ee(a);o&&(o.firstSessionId&&x.getState().setCurrentSession(o.firstSessionId),n?.())}finally{y(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Ie>=1&&de&&!Ce&&(Z===!1||!Q||xe)),ze=b.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:ve,className:C(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,ge,_e),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)(ne,{children:[(0,$.jsx)(j,{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)(k,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(M,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(te,{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)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),z.length>0?(0,$.jsxs)(he,{value:B??void 0,onValueChange:U,children:[(0,$.jsx)(me,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:H?(0,$.jsx)(fe,{children:st(H)}):(0,$.jsx)(fe,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(pe,{fitContent:!0,children:z.map(e=>(0,$.jsx)(W,{value:e.id,className:`max-w-[24rem]`,children:st(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)(ot,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(R,{id:`group-name`,value:s,onChange:e=>c(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)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Xe,{directory:de,value:xe,onChange:Se,disabled:!Q,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)(le,{checked:ce,onChange:N,disabled:!Te,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)(ot,{htmlFor:`multirun-agent`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)(Ze,{value:d,onChange:p,id:`multirun-agent`})]})]}),(0,$.jsxs)(oe,{open:w,onOpenChange:T,children:[(0,$.jsxs)(ae,{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)(k,{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)(k,{name:`arrow-down-s`,className:C(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,w&&`rotate-180`)})]}),(0,$.jsx)(ie,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:E?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[b.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(R,{value:e,onChange:e=>{let n=[...b];n[t]=e.target.value,S(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>S(b.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)(k,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S([...b,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(k,{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)(ot,{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:P,type:`file`,multiple:!0,className:`hidden`,onChange:Ne,accept:`*/*`}),(0,$.jsxs)(ne,{children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>P.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)(k,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(M,{children:a(`multirun.launcher.attachments.tooltip`)})]}),h.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)(k,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(k,{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:()=>Fe(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(k,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(lt,{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)(k,{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:[!Q&&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)(k,{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)(_,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(_,{type:`submit`,size:`sm`,disabled:!Re||v,children:v?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Ie})})})]})})]})},lt=e=>{let t=(0,xe.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=ee(),[c,l]=X.useState(!1),[u,d]=X.useState(``),[p,m]=X.useState(!1),[h,g]=X.useState(``),_=X.useRef(null),v=X.useRef(null),y=X.useRef(null),b;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(b=e=>{n.models.length>=it||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=b):b=t[3];let x=f(b),S;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(S=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]=S):S=t[7];let C=f(S),w;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(w=(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]=w):w=t[11];let T=f(w),E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{I as t}from"./platform-B2ylz14u.js";import{a as n,r}from"./vendor-zustand-CTekDqaS.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{St as o}from"./gitApiHttp-CrPYe9Oc.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{_t as s,ft as c,n as l}from"./client-BuCd-T7s.js";import{n as u}from"./vendor-react-BkccXcWz.js";import{R as d}from"./runtime-file-resource-9kLrAtnQ.js";import{r as f}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as p}from"./useUIStore-68ZPpgYA.js";import{Fi as m,Va as h,Xi as g,Yn as _,ai as v,d as y,f as b,io as x,la as S,mi as C,ri as w,ro as T,sa as E,t as D,ti as O}from"./ui-lbbchWJP.js";import{n as k}from"./Icon-C6Duv_oe.js";import{c as A,t as ee}from"./i18n-CYty_Jft.js";import{n as te}from"./ScrollableOverlay-BrA__-l0.js";import{i as j,n as M,t as ne}from"./tooltip-Chqxbwjz.js";import{a as re}from"./device-TCHW5U2y.js";import{n as ie,r as ae,t as oe}from"./collapsible-CCc6anWP.js";import{t as se}from"./textarea-Cg3Yz3Oc.js";import{t as ce}from"./gitApi-BNkkLnOi.js";import{c as N,i as P,n as F,r as I,s as L}from"./useGitStore-kco1LBfw.js";import{t as R}from"./input-DVzjAzTw.js";import{t as le}from"./checkbox-D-OIaMB8.js";import{a as ue,c as z,r as B}from"./insertionBoundaries-WYUnaIac.js";import{t as V}from"./ModelLogo-R0TXf5Pt.js";import{n as H,t as de}from"./useModelLists-CU3ffp2-.js";import{a as U,c as fe,i as W,n as pe,o as G,r as K,s as me,t as he}from"./select-Cb6W8KRB.js";import{s as q}from"./worktreeManager-BJCsjptu.js";import{a as J,i as Y,n as ge,t as _e}from"./worktreeSourceBranchPreference-qDpG1uyC.js";import{a as ve,i as ye,n as be}from"./projectMeta-vIaGFaQr.js";var X=e(a(),1),xe=u(),Se=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Ce=/^g[1-9]\d*$/,Z=(e,t,n,r,i)=>{if(!Se.test(e)||t!==void 0&&!Ce.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}},we=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 Z(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Ce.test(e)?Z(n,e,r,i,void 0):Z(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?Z(n,void 0,i,a,o):Z(n,r,i,a,o)},Te=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(`/`)},Q=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Ee=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),De=(e,t)=>`${Ee(e)}-${Ee(t)}`.substring(0,60),Oe=(e,t)=>`${e}/${t}`,ke=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Ae=(e,t)=>{let n=ke(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};s(e.id,n),b.getState().markSessionAsYuriCreated(e.id),m.getState().upsertSession(i);try{c().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},je=()=>{let e=h.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=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Me=n()(r(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 s=je();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let c=s.path,u=await ce(c)&&t.isolateRuns!==!1,d=Ee(n),f=u?await q(c):void 0,p=u?await J(c):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}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=De(g.providerID,g.modelID),x=r.length>1?`g${e+1}`:void 0,S=_>1?Oe(d,`${y}/${v}`):Oe(d,y),T=x?`${x}/${S}`:S,E=Te({groupSlug:d,runGroup:x,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await l.withDirectory(c,()=>l.createSession({title:E}));Ae(e,c),m.push({sessionId:e.id,worktreePath:c,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await Y(s,{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 w(s)&&await C(e.worktreeRoot??e.path);let r=await l.withDirectory(e.path,()=>l.createSession({title:E}));Ae(r,e.path),b.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(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),x=m[0]?.sessionId??null;if(_.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let S=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(m.map(async e=>{try{await y({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:S})}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:_,firstSessionId:x}}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`})),$=i(),Ne=`h-7`,Pe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Fe=e=>{let t=(0,xe.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=T(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Ne),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(V,{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)(k,{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},Ie=e=>{let t=(0,xe.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:u,dropdownSide:d,dropdownClassName:f,containerClassName:m,triggerIcon:h}=e,v=c===void 0||c,y=d===void 0?`top`:d,{t:b}=ee(),x=g(Le),C=g(Re),w=p(ze),E=p(Be),{favoriteModelsList:D,recentModelsList:O}=de(),A=p(Ve),te=p(He),[j,M]=X.useState(!1),[ne,re]=X.useState(``),[ie,ae]=X.useState(null),oe=X.useRef(null),se=X.useRef(null),ce=l===1,N=l===void 0||n.length<l||ce,P;if(t[0]!==n){P=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;P.set(t,(P.get(t)||0)+1)}t[0]=n,t[1]=P}else P=t[1];let F=P,I;t[2]===n?I=t[3]:(I=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=I);let L=I,R,le;t[4]!==y||t[5]!==j?(R=()=>{if(!j||!se.current)return;let e=se.current.getBoundingClientRect();if(y===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ae(Math.max(160,Math.min(320,t)));return}let t=se.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;ae(Math.max(150,Math.min(300,r)))},le=[y,j],t[4]=y,t[5]=j,t[6]=R,t[7]=le):(R=t[6],le=t[7]),X.useEffect(R,le);let ue,z;t[8]!==N||t[9]!==j?(ue=()=>{!N&&j&&(M(!1),re(``))},z=[N,j],t[8]=N,t[9]=j,t[10]=ue,t[11]=z):(ue=t[10],z=t[11]),X.useEffect(ue,z);let B,V;t[12]===j?(B=t[13],V=t[14]):(B=()=>{if(!j)return;let e=e=>{oe.current&&!oe.current.contains(e.target)&&(M(!1),re(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[j],t[12]=j,t[13]=B,t[14]=V),X.useEffect(B,V);let U;t[15]!==ce||t[16]!==r||t[17]!==a||t[18]!==n.length?(U=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:S(e.model,e.modelID)||e.modelID,instanceId:Pe()};ce&&n.length>0&&a?a(0,t):r(t),ce&&(M(!1),re(``))},t[15]=ce,t[16]=r,t[17]=a,t[18]=n.length,t[19]=U):U=t[19];let G=U,K;t[20]===b?K=t[21]:(K=b(`multirun.modelMultiSelect.search.placeholder`),t[20]=b,t[21]=K);let q;t[22]===b?q=t[23]:(q=b(`multirun.modelMultiSelect.search.noResults`),t[22]=b,t[23]=q);let J;t[24]===b?J=t[25]:(J=b(`multirun.modelMultiSelect.sections.favorites`),t[24]=b,t[25]=J);let Y;t[26]===b?Y=t[27]:(Y=b(`multirun.modelMultiSelect.sections.recent`),t[26]=b,t[27]=Y);let ge;t[28]===b?ge=t[29]:(ge=b(`multirun.modelMultiSelect.keyboard.hint`),t[28]=b,t[29]=ge);let _e;t[30]===b?_e=t[31]:(_e=b(`settings.agents.modelSelector.actions.favorite`),t[30]=b,t[31]=_e);let ve;t[32]===b?ve=t[33]:(ve=b(`settings.agents.modelSelector.actions.unfavorite`),t[32]=b,t[33]=ve);let ye;t[34]===b?ye=t[35]:(ye=b(`chat.modelControls.provider`),t[34]=b,t[35]=ye);let be;t[36]===b?be=t[37]:(be=b(`chat.modelControls.capabilities`),t[36]=b,t[37]=be);let Se;t[38]===b?Se=t[39]:(Se=b(`chat.modelControls.capability.toolCalling`),t[38]=b,t[39]=Se);let Ce;t[40]===b?Ce=t[41]:(Ce=b(`chat.modelControls.capability.reasoning`),t[40]=b,t[41]=Ce);let Z;t[42]===b?Z=t[43]:(Z=b(`chat.modelControls.modality.image`),t[42]=b,t[43]=Z);let we;t[44]===b?we=t[45]:(we=b(`chat.modelControls.modality.video`),t[44]=b,t[45]=we);let Te;t[46]===b?Te=t[47]:(Te=b(`chat.modelControls.modality.audio`),t[46]=b,t[47]=Te);let Q;t[48]===b?Q=t[49]:(Q=b(`chat.modelControls.costPerMillion`),t[48]=b,t[49]=Q);let Ee;t[50]===b?Ee=t[51]:(Ee=b(`chat.modelControls.costInput`),t[50]=b,t[51]=Ee);let De;t[52]===b?De=t[53]:(De=b(`chat.modelControls.costOutput`),t[52]=b,t[53]=De);let Oe;t[54]!==K||t[55]!==q||t[56]!==J||t[57]!==Y||t[58]!==ge||t[59]!==_e||t[60]!==ve||t[61]!==ye||t[62]!==be||t[63]!==Se||t[64]!==Ce||t[65]!==Z||t[66]!==we||t[67]!==Te||t[68]!==Q||t[69]!==Ee||t[70]!==De?(Oe={searchPlaceholder:K,noResults:q,favorites:J,recent:Y,keyboardHint:ge,favorite:_e,unfavorite:ve,provider:ye,capabilities:be,capabilityToolCalling:Se,capabilityReasoning:Ce,modalityImage:Z,modalityVideo:we,modalityAudio:Te,costPerMillion:Q,costInput:Ee,costOutput:De},t[54]=K,t[55]=q,t[56]=J,t[57]=Y,t[58]=ge,t[59]=_e,t[60]=ve,t[61]=ye,t[62]=be,t[63]=Se,t[64]=Ce,t[65]=Z,t[66]=we,t[67]=Te,t[68]=Q,t[69]=Ee,t[70]=De,t[71]=Oe):Oe=t[71];let ke=Oe,Ae;t[72]===m?Ae=t[73]:(Ae=T(`relative`,m),t[72]=m,t[73]=Ae);let je;t[74]===u?je=t[75]:(je=T(Ne,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,u),t[74]=u,t[75]=je);let Me=!N,Ie;t[76]===j?Ie=t[77]:(Ie=()=>{M(!j)},t[76]=j,t[77]=Ie);let We;t[78]===h?We=t[79]:(We=h??(0,$.jsx)(k,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=h,t[79]=We);let Ge;t[80]!==s||t[81]!==b?(Ge=s??b(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=b,t[82]=Ge):Ge=t[82];let Ke;t[83]!==je||t[84]!==Me||t[85]!==Ie||t[86]!==We||t[87]!==Ge?(Ke=(0,$.jsxs)(_,{ref:se,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ie,children:[We,Ge]}),t[83]=je,t[84]=Me,t[85]=Ie,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==ie||t[90]!==N||t[91]!==f||t[92]!==y||t[93]!==D||t[94]!==C||t[95]!==G||t[96]!==A||t[97]!==E||t[98]!==j||t[99]!==ke||t[100]!==F||t[101]!==te||t[102]!==x||t[103]!==O||t[104]!==ne||t[105]!==w?(qe=j?(0,$.jsx)(`div`,{className:T(`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`,y===`top`?`bottom-full mb-1`:`top-full mt-1`,f),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(H,{providers:x,providerOrder:te,favoriteModels:D,recentModels:O,getMetadata:C,hiddenModels:A,searchQuery:ne,onSearchQueryChange:re,onSelect:G,labels:ke,selectionCount:e=>F.get(`${e.providerID}:${e.modelID}`)||0,disabled:!N,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:ie?`${ie}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:j,isFavorite:e=>E(e.providerID,e.modelID),onToggleFavorite:e=>w(e.providerID,e.modelID),onEscape:()=>{M(!1),re(``)}})}):null,t[89]=ie,t[90]=N,t[91]=f,t[92]=y,t[93]=D,t[94]=C,t[95]=G,t[96]=A,t[97]=E,t[98]=j,t[99]=ke,t[100]=F,t[101]=te,t[102]=x,t[103]=O,t[104]=ne,t[105]=w,t[106]=qe):qe=t[106];let Je;t[107]!==Ae||t[108]!==Ke||t[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:oe,children:[Ke,qe]}),t[107]=Ae,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==L||t[112]!==F||t[113]!==i||t[114]!==a||t[115]!==x||t[116]!==n||t[117]!==v||t[118]!==b?(Ye=v&&n.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=F.get(n)||1,o=L(e),s=x.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)(Fe,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,$.jsxs)(he,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,$.jsxs)(me,{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)(k,{name:`brain-ai-3`,className:T(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(fe,{placeholder:b(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?b(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(pe,{fitContent:!0,children:[(0,$.jsx)(W,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:b(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=L,t[112]=F,t[113]=i,t[114]=a,t[115]=x,t[116]=n,t[117]=v,t[118]=b,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),t[120]=Je,t[121]=Ye,t[122]=Xe):Xe=t[122];let Ze;t[123]!==l||t[124]!==o||t[125]!==n.length||t[126]!==b?(Ze=o!==void 0&&n.length<o&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?b(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):b(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=b,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),t[128]=Xe,t[129]=Ze,t[130]=Qe):Qe=t[130],Qe};function Le(e){return e.providers}function Re(e){return e.getModelMetadata}function ze(e){return e.toggleFavoriteModel}function Be(e){return e.isFavoriteModel}function Ve(e){return e.hiddenModels}function He(e){return e.providerOrder}function Ue(e){return(0,$.jsx)(W,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,xe.c)(30),{git:n}=d(),r=F(e),i=N(e),a=P(e),o=I(e),s=L(Ye),c=L(Je),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 f;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(f=()=>{!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]=f):f=t[12];let p=r?.all,m;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==p?(m=[e,n,i,p,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=p,t[18]=m):m=t[18],X.useEffect(f,m);let h=a||i===!0&&o,g;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],g=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),g=e}let _=g,v;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],v=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),v=e}let y=v,b;bb2:{if(!e){b=null;break bb2}if(i!==null){b=i;break bb2}if(h){b=null;break bb2}b=r?.all?!0:null}let x=b,S;return t[25]!==x||t[26]!==h||t[27]!==_||t[28]!==y?(S={localBranches:_,remoteBranches:y,isLoading:h,isGitRepository:x},t[25]=x,t[26]=h,t[27]=_,t[28]=y,t[29]=S):S=t[29],S}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=ee(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(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 q(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(_e),{sourceBranch:o,shouldClearSavedSourceBranch:s}=ge({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(_e),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(he,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(me,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(fe,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(pe,{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)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(W,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(G,{}),c.length>0&&(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(W,{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`)})]})},Ze=e=>{let t=(0,xe.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=ee(),l=g(Qe),u=g($e),d=g(et),f;t[0]===l?f=t[1]:(f=l(),t[0]=l,t[1]=f);let p=f,m;t[2]===p?m=t[3]:(m=p.filter(tt),t[2]=p,t[3]=m);let h=m,_,v;t[4]!==p.length||t[5]!==u?(_=()=>{p.length===0&&u()},v=[p.length,u],t[4]=p.length,t[5]=u,t[6]=_,t[7]=v):(_=t[6],v=t[7]),X.useEffect(_,v);let y,b;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==h||t[12]!==n?(y=()=>{if(a)return;let e=n.trim();if(e.length>0&&h.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&h.some(e=>e.name===t)){r(t);return}let i=h[0]?.name;i&&r(i)},b=[d,a,r,h,n],t[8]=d,t[9]=a,t[10]=r,t[11]=h,t[12]=n,t[13]=y,t[14]=b):(y=t[13],b=t[14]),X.useEffect(y,b);let x=n.trim().length>0?n:void 0,S;t[15]===i?S=t[16]:(S=T(`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]=S);let C;t[17]===c?C=t[18]:(C=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=C);let w;t[19]===C?w=t[20]:(w=(0,$.jsx)(fe,{placeholder:C}),t[19]=C,t[20]=w);let E;t[21]!==o||t[22]!==S||t[23]!==w?(E=(0,$.jsx)(me,{id:o,size:`lg`,className:S,children:w}),t[21]=o,t[22]=S,t[23]=w,t[24]=E):E=t[24];let D;t[25]===h?D=t[26]:(D=h.length>0&&(0,$.jsx)(K,{children:h.map(nt)}),t[25]=h,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(pe,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let k;return t[30]!==a||t[31]!==r||t[32]!==x||t[33]!==E||t[34]!==O?(k=(0,$.jsxs)(he,{value:x,onValueChange:r,disabled:a,children:[E,O]}),t[30]=a,t[31]=r,t[32]=x,t[33]=E,t[34]=O,t[35]=k):k=t[35],k};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return E(e.mode)}function nt(e){return(0,$.jsx)(W,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var rt=10485760,it=5,at=e=>{let t=(0,xe.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(j,{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)(k,{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)(ne,{children:[r,(0,$.jsx)(M,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,xe.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},st=e=>{let t=x(e.path),n=e.icon?ye[e.icon]:null,r=e.color?be[e.color]:void 0,i=(0,$.jsx)(k,{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:`relative top-px flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(ve,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=ee(),[s,c]=X.useState(``),[l,u]=X.useState(()=>[{id:Pe(),prompt:``,models:[]}]),[d,p]=X.useState(``),[m,g]=X.useState([]),[v,y]=X.useState(!1),[x,S]=X.useState([]),[C,w]=X.useState(!1),[E,se]=X.useState(!1),[ce,N]=X.useState(!0),P=X.useRef(null),F=o(e=>e.currentDirectory??null),I=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},[]),L=h(e=>e.activeProjectId),ue=h(e=>e.setActiveProjectIdOnly),z=h(e=>e.projects),[B,V]=X.useState(()=>L??null);X.useEffect(()=>{if(L){V(L);return}!B&&z.length>0&&V(z[0].id)},[L,z,B]);let H=X.useMemo(()=>B?z.find(e=>e.id===B)??null:null,[z,B]),de=H?.path??F,U=f(e=>{V(e),e!==L&&ue(e)}),G=X.useMemo(()=>{if(H?.path)return{id:H.id,path:H.path};let e=F??I;return e?{id:`path:${e}`,path:e}:null},[H,F,I]),[K]=X.useState(()=>typeof window<`u`&&t()),q=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),J=re(),Y=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__YURI_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},[]),ge=X.useMemo(()=>K&&q||J?`pl-[5.5rem]`:`pl-3`,[K,q,J]),_e=X.useMemo(()=>!K||!q||Y===null?``:Y>=26?`h-12`:Y<=15?`h-14`:``,[K,q,Y]),ve=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&K&&await A()}),ye=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),be=!!r;X.useEffect(()=>{if(be)return window.addEventListener(`keydown`,ye,!0),()=>window.removeEventListener(`keydown`,ye,!0)},[be]);let[xe,Se]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=We(de),we=X.useRef(!1),Te=Z===!0,Q=Te&&ce;X.useEffect(()=>{if(Z===!1){we.current=!0,N(!1);return}Z===!0&&we.current&&(we.current=!1,N(!0))},[Z]);let Ee=Me(e=>e.createMultiRun),De=Me(e=>e.error),Oe=Me(e=>e.clearError);X.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&u(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),X.useEffect(()=>{if(!G)return;let e=!1;return se(!0),(async()=>{try{let t=await O(G);e||S(t)}catch{}finally{e||se(!1)}})(),()=>{e=!0}},[G]);let ke=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=f(e=>{u(t=>t.filter(t=>t.id!==e))}),je=f(()=>{u(e=>[...e,{id:Pe(),prompt:``,models:[]}])}),Ne=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>rt){D.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)});g(t=>[...t,{id:Pe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),D.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&D.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),P.current&&(P.current.value=``)},Fe=e=>{g(t=>t.filter(t=>t.id!==e))},Ie=X.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let t=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(t.length!==0&&!(Ie<1)){y(!0),Oe();try{B&&B!==L&&ue(B);let e=m.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=x.filter(e=>e.trim().length>0),i=t.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:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Q?xe:void 0,isolateRuns:Q,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await Ee(a);o&&(o.firstSessionId&&b.getState().setCurrentSession(o.firstSessionId),n?.())}finally{y(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Ie>=1&&de&&!Ce&&(Z===!1||!Q||xe)),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:ve,className:T(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,ge,_e),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)(ne,{children:[(0,$.jsx)(j,{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)(k,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(M,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(te,{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)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),z.length>0?(0,$.jsxs)(he,{value:B??void 0,onValueChange:U,children:[(0,$.jsx)(me,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:H?(0,$.jsx)(fe,{children:st(H)}):(0,$.jsx)(fe,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(pe,{fitContent:!0,children:z.map(e=>(0,$.jsx)(W,{value:e.id,className:`max-w-[24rem]`,children:st(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)(ot,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(R,{id:`group-name`,value:s,onChange:e=>c(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)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Xe,{directory:de,value:xe,onChange:Se,disabled:!Q,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)(le,{checked:ce,onChange:N,disabled:!Te,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)(ot,{htmlFor:`multirun-agent`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)(Ze,{value:d,onChange:p,id:`multirun-agent`})]})]}),(0,$.jsxs)(oe,{open:C,onOpenChange:w,children:[(0,$.jsxs)(ae,{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)(k,{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)(k,{name:`arrow-down-s`,className:T(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,C&&`rotate-180`)})]}),(0,$.jsx)(ie,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:E?(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)(R,{value:e,onChange:e=>{let n=[...x];n[t]=e.target.value,S(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>S(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)(k,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S([...x,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(k,{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)(ot,{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:P,type:`file`,multiple:!0,className:`hidden`,onChange:Ne,accept:`*/*`}),(0,$.jsxs)(ne,{children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>P.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)(k,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(M,{children:a(`multirun.launcher.attachments.tooltip`)})]}),m.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)(k,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(k,{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:()=>Fe(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(k,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(lt,{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)(k,{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:[!Q&&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)(k,{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)(_,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(_,{type:`submit`,size:`sm`,disabled:!Re||v,children:v?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Ie})})})]})})]})},lt=e=>{let t=(0,xe.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=ee(),[c,l]=X.useState(!1),[u,d]=X.useState(``),[p,m]=X.useState(!1),[h,g]=X.useState(``),_=X.useRef(null),v=X.useRef(null),y=X.useRef(null),b;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(b=e=>{n.models.length>=it||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=b):b=t[3];let x=f(b),S;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(S=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]=S):S=t[7];let C=f(S),w;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(w=(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]=w):w=t[11];let T=f(w),E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(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){g(e.substring(1,i)),m(!0),l(!1);return}}m(!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);(!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
3
3
  `)?(d(t),l(!0)):l(!1);return}l(!1)},t[12]=E):E=t[12];let D=f(E),O;t[13]!==n.id||t[14]!==a?(O=e=>{a(n.id,{prompt:e})},t[13]=n.id,t[14]=a,t[15]=O):O=t[15];let A=f(O),te;t[16]!==n.prompt||t[17]!==A||t[18]!==D?(te=e=>{let t=n.prompt,r=_.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=B(t,i===-1?r:i,r,`@${a}`);A(o.text),l(!1),d(``),requestAnimationFrame(()=>{let e=_.current;e&&(e.selectionStart=o.caret,e.selectionEnd=o.caret,e.focus()),D(o.text,o.caret)})},t[16]=n.prompt,t[17]=A,t[18]=D,t[19]=te):te=t[19];let j=f(te),M;t[20]!==n.prompt||t[21]!==A||t[22]!==D?(M=e=>{let t=n.prompt,r=_.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=B(t,i===-1?r:i,r,`@${e}`);A(a.text),l(!1),d(``),requestAnimationFrame(()=>{let e=_.current;e&&(e.selectionStart=a.caret,e.selectionEnd=a.caret,e.focus()),D(a.text,a.caret)})},t[20]=n.prompt,t[21]=A,t[22]=D,t[23]=M):M=t[23];let ne=f(M),re;t[24]!==A||t[25]!==D?(re=e=>{let t=`/${e.name} `;A(t),m(!1),g(``),requestAnimationFrame(()=>{let e=_.current;e&&(e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length),D(t,t.length)})},t[24]=A,t[25]=D,t[26]=re):re=t[26];let ie=f(re),ae;t[27]!==p||t[28]!==c?(ae=e=>{if(p&&y.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)){e.preventDefault(),y.current.handleKeyDown(e.key);return}c&&v.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),v.current.handleKeyDown(e.key))},t[27]=p,t[28]=c,t[29]=ae):ae=t[29];let oe=f(ae),ce=r+1,N;t[30]!==s||t[31]!==ce?(N=s(`multirun.launcher.groups.groupLabel`,{index:ce}),t[30]=s,t[31]=ce,t[32]=N):N=t[32];let P;t[33]===N?P=t[34]:(P=(0,$.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:N}),t[33]=N,t[34]=P);let F;t[35]!==i||t[36]!==n.id||t[37]!==o||t[38]!==s?(F=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)(k,{name:`close`,className:`h-3.5 w-3.5`})}),t[35]=i,t[36]=n.id,t[37]=o,t[38]=s,t[39]=F):F=t[39];let I;t[40]!==P||t[41]!==F?(I=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[P,F]}),t[40]=P,t[41]=F,t[42]=I):I=t[42];let L;t[43]===s?L=t[44]:(L=s(`multirun.launcher.groups.prompt.label`),t[43]=s,t[44]=L);let R;t[45]===L?R=t[46]:(R=(0,$.jsx)(ot,{required:!0,children:L}),t[45]=L,t[46]=R);let le=n.prompt,V;t[47]!==A||t[48]!==D?(V=e=>{let t=e.target.value;A(t);let n=e.target.selectionStart??t.length;D(t,n)},t[47]=A,t[48]=D,t[49]=V):V=t[49];let H;t[50]===s?H=t[51]:(H=s(`multirun.launcher.groups.prompt.placeholder`),t[50]=s,t[51]=H);let de;t[52]!==n.prompt||t[53]!==oe||t[54]!==V||t[55]!==H?(de=(0,$.jsx)(se,{ref:_,value:le,onChange:V,onKeyDown:oe,placeholder:H,className:`typography-meta min-h-[80px] max-h-[200px] resize-none overflow-y-auto field-sizing-content`,required:!0}),t[52]=n.prompt,t[53]=oe,t[54]=V,t[55]=H,t[56]=de):de=t[56];let U;t[57]!==h||t[58]!==ie||t[59]!==p?(U=p?(0,$.jsx)(ue,{ref:y,searchQuery:h,onCommandSelect:ie,onClose:()=>m(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[57]=h,t[58]=ie,t[59]=p,t[60]=U):U=t[60];let fe;t[61]!==ne||t[62]!==j||t[63]!==u||t[64]!==c?(fe=c?(0,$.jsx)(z,{ref:v,searchQuery:u,onFileSelect:j,onAgentSelect:ne,onSkillSelect:e=>ne(e.name),onClose:()=>l(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[61]=ne,t[62]=j,t[63]=u,t[64]=c,t[65]=fe):fe=t[65];let W;t[66]!==de||t[67]!==U||t[68]!==fe?(W=(0,$.jsxs)(`div`,{className:`relative`,children:[de,U,fe]}),t[66]=de,t[67]=U,t[68]=fe,t[69]=W):W=t[69];let pe;t[70]!==R||t[71]!==W?(pe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[R,W]}),t[70]=R,t[71]=W,t[72]=pe):pe=t[72];let G;t[73]===s?G=t[74]:(G=s(`multirun.launcher.models.info`,{max:it}),t[73]=s,t[74]=G);let K;t[75]===G?K=t[76]:(K=(0,$.jsx)(at,{children:G}),t[75]=G,t[76]=K);let me;t[77]===s?me=t[78]:(me=s(`multirun.launcher.models.label`),t[77]=s,t[78]=me);let he;t[79]!==K||t[80]!==me?(he=(0,$.jsx)(ot,{required:!0,info:K,children:me}),t[79]=K,t[80]=me,t[81]=he):he=t[81];let q;t[82]!==n.models||t[83]!==x||t[84]!==C||t[85]!==T?(q=(0,$.jsx)(Ie,{selectedModels:n.models,onAdd:x,onRemove:C,onUpdate:T,minModels:1,maxModels:it}),t[82]=n.models,t[83]=x,t[84]=C,t[85]=T,t[86]=q):q=t[86];let J;t[87]!==he||t[88]!==q?(J=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[he,q]}),t[87]=he,t[88]=q,t[89]=J):J=t[89];let Y;return t[90]!==I||t[91]!==pe||t[92]!==J?(Y=(0,$.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-3`,children:[I,pe,J]}),t[90]=I,t[91]=pe,t[92]=J,t[93]=Y):Y=t[93],Y};export{Q as a,Pe as i,Ze as n,we as o,Ie as r,ct as t};
@@ -1 +1 @@
1
- import{n as e}from"./platform-CNdx57HN.js";import{a as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-DHO20zYy.js";var r=t(`YuriUpdateConfig`);async function i(){if(!e())throw new n;let t=await r.getConfiguration();if(t.channel!==`stable`&&t.channel!==`beta`||typeof t.shellApiVersion!=`number`||!Number.isInteger(t.shellApiVersion)||t.shellApiVersion<1)throw Error(`Invalid native update configuration`);return{channel:t.channel,shellApiVersion:t.shellApiVersion}}export{i as t};
1
+ import{n as e}from"./platform-B2ylz14u.js";import{a as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-DfbaAnUB.js";var r=t(`YuriUpdateConfig`);async function i(){if(!e())throw new n;let t=await r.getConfiguration();if(t.channel!==`stable`&&t.channel!==`beta`||typeof t.shellApiVersion!=`number`||!Number.isInteger(t.shellApiVersion)||t.shellApiVersion<1)throw Error(`Invalid native update configuration`);return{channel:t.channel,shellApiVersion:t.shellApiVersion}}export{i as t};
@@ -1 +1 @@
1
- import{a as e}from"./mobileBackNavigation-Ch0aK3t9.js";var t=(e=>{let t=new Map,n=()=>{let e=0;for(let n of t.values())e+=n;return e};return{hold(r){let i=(t.get(r)??0)+1;t.set(r,i),n()===1&&e.conceal();let a=!1;return()=>{if(a)return;a=!0;let i=(t.get(r)??1)-1;i<=0?t.delete(r):t.set(r,i),n()===0&&e.reveal()}}}})(e),n=new Map,r=e=>t.hold(e),i=e=>{n.has(e)||n.set(e,t.hold(e))},a=e=>{let t=n.get(e);t&&(n.delete(e),t())},o=`btw-page`,s=`btw-sheet`,c=`text-selection`;export{r as a,i,s as n,a as o,c as r,o as t};
1
+ import{a as e}from"./mobileBackNavigation-B8wJO_pZ.js";var t=(e=>{let t=new Map,n=()=>{let e=0;for(let n of t.values())e+=n;return e};return{hold(r){let i=(t.get(r)??0)+1;t.set(r,i),n()===1&&e.conceal();let a=!1;return()=>{if(a)return;a=!0;let i=(t.get(r)??1)-1;i<=0?t.delete(r):t.set(r,i),n()===0&&e.reveal()}}}})(e),n=new Map,r=e=>t.hold(e),i=e=>{n.has(e)||n.set(e,t.hold(e))},a=e=>{let t=n.get(e);t&&(n.delete(e),t())},o=`btw-page`,s=`btw-sheet`,c=`text-selection`;export{r as a,i,s as n,a as o,c as r,o as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-input-store-CquhCIoR.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/platform-CNdx57HN.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-zustand-CTekDqaS.js","assets/vendor-base-ui-wXsskyKm.js","assets/prompt-attachment-upload-D1c308Ba.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/runtime-file-resource-DKJJoOOc.js","assets/vendor-react-BkccXcWz.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/summaries-BQMyJaaw.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/input-store-PqhVEhUI.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/uuid-D-SDZijH.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r}from"./runtime-switch-DEPKHgdL.js";import{r as i}from"./summaries-BQMyJaaw.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Ba as o,Ua as s}from"./ui-CU6n15y3.js";import{i as c,n as l,r as u}from"./remoteProjectQueries-BunVM5PM.js";var d=e({applyRemoteProjectRoute:()=>f,seedRemoteProjectDraft:()=>p});async function f(e,a=()=>!0){if(!e.hostId||!e.hubId||!e.directory)throw Error(`Incomplete remote session route`);let d=t(),f=n(),p=r(),m=await l();if(!a())return!1;if(!m.supported||m.hubId!==e.hubId||d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to a different or unsupported Hub`);let h=e.projectId?m.projects.find(t=>t.hostId===e.hostId&&t.id===e.projectId):i(m.projects,m.hubId,e.hostId,e.directory,(await u(c(m),e.hostId)).worktrees);if(!a())return!1;if(d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to an inactive Hub`);if(!h)throw Error(`Remote Project is not referenced by this Hub`);let g={hubId:m.hubId,hostId:h.hostId,directory:e.directory,...e.instanceId||h.instanceId?{instanceId:e.instanceId||h.instanceId}:{}};g.instanceId&&c(m).resolve(g).sdk();let _=o.getState();return _.upsertRemoteProject(h,m.hubId),_.setActiveProjectIdOnly(h.id),s.getState().openRemoteSession(h,g,e.isNewSession?null:e.sessionId),!0}async function p(e,n){let r=t(),{seedRemoteDraft:i}=await a(async()=>{let{seedRemoteDraft:e}=await import(`./remote-input-store-CquhCIoR.js`).then(e=>e.a);return{seedRemoteDraft: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]));r===t()&&await i(e,n)}export{d as n,p as r,f as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-input-store-CE88ZLsw.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/platform-B2ylz14u.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-zustand-CTekDqaS.js","assets/vendor-base-ui-wXsskyKm.js","assets/prompt-attachment-upload-m0vbcftI.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/runtime-file-resource-9kLrAtnQ.js","assets/vendor-react-BkccXcWz.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/summaries-BQMyJaaw.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/input-store-BtvRZZcg.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/uuid-D-SDZijH.js"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r}from"./runtime-switch-DEPKHgdL.js";import{r as i}from"./summaries-BQMyJaaw.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Va as o,Wa as s}from"./ui-lbbchWJP.js";import{i as c,n as l,r as u}from"./remoteProjectQueries-zO4jYbru.js";var d=e({applyRemoteProjectRoute:()=>f,seedRemoteProjectDraft:()=>p});async function f(e,a=()=>!0){if(!e.hostId||!e.hubId||!e.directory)throw Error(`Incomplete remote session route`);let d=t(),f=n(),p=r(),m=await l();if(!a())return!1;if(!m.supported||m.hubId!==e.hubId||d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to a different or unsupported Hub`);let h=e.projectId?m.projects.find(t=>t.hostId===e.hostId&&t.id===e.projectId):i(m.projects,m.hubId,e.hostId,e.directory,(await u(c(m),e.hostId)).worktrees);if(!a())return!1;if(d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to an inactive Hub`);if(!h)throw Error(`Remote Project is not referenced by this Hub`);let g={hubId:m.hubId,hostId:h.hostId,directory:e.directory,...e.instanceId||h.instanceId?{instanceId:e.instanceId||h.instanceId}:{}};g.instanceId&&c(m).resolve(g).sdk();let _=o.getState();return _.upsertRemoteProject(h,m.hubId),_.setActiveProjectIdOnly(h.id),s.getState().openRemoteSession(h,g,e.isNewSession?null:e.sessionId),!0}async function p(e,n){let r=t(),{seedRemoteDraft:i}=await a(async()=>{let{seedRemoteDraft:e}=await import(`./remote-input-store-CE88ZLsw.js`).then(e=>e.a);return{seedRemoteDraft: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]));r===t()&&await i(e,n)}export{d as n,p as r,f as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useUIStore-68ZPpgYA.js";import{Pt as t,Va as n,Wa as r}from"./ui-lbbchWJP.js";import{i,n as a}from"./remoteProjectQueries-zO4jYbru.js";function o(i,a,o,s=i.path,c=!1,l){a.assertCurrent(),n.getState().setActiveProjectIdOnly(i.id),r.getState().openRemoteSession(i,{hubId:a.hubId,hostId:i.hostId,directory:s,...i.instanceId?{instanceId:i.instanceId}:{}},o,l),e.getState().setActiveMainTab(`chat`),c&&t.getState().openRemoteProject()}async function s(e,t=!1){let r=await a(),s=r.projects.find(t=>t.id===e.id&&t.hostId===e.hostId&&t.path===e.path);if(!s)throw Error(`Remote project is not registered in the current Hub`);let c=i(r);c.assertCurrent(),n.getState().upsertRemoteProject(s,r.hubId),o(s,c,null,s.path,t)}export{o as n,s as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remoteProjectQueries-zO4jYbru.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/platform-B2ylz14u.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-base-ui-wXsskyKm.js","assets/client-BuCd-T7s.js","assets/vendor-zustand-CTekDqaS.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/safeStorage-DTOhKN0V.js","assets/prompt-attachment-upload-m0vbcftI.js","assets/runtime-file-resource-9kLrAtnQ.js","assets/vendor-react-BkccXcWz.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/summaries-BQMyJaaw.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/navigation-atykJu0I.js","assets/ui-lbbchWJP.js","assets/gitApiHttp-CrPYe9Oc.js","assets/useUIStore-68ZPpgYA.js","assets/useMobileHtmlPreviewStore-BYunNOBo.js","assets/uuid-D-SDZijH.js","assets/vendor-sonner-DX3nfJx4.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/i18n-CYty_Jft.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-BDr-X6Ry.js","assets/tour-CMXP3Kif.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/input-store-BtvRZZcg.js","assets/toolHelpers-iEHVHQ9p.js","assets/useAssistantUIStore-BUWPTwNV.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as t}from"./useUIStore-68ZPpgYA.js";import{Et as n,Vi as r,f as i}from"./ui-lbbchWJP.js";import{r as a,t as o}from"./sessionLookup-MXum2sR5.js";var s=0;async function c(e){let t=o(e.trim());if(t)return{status:`found`,directory:t.directory};let n=await r(e);return n?{status:`found`,directory:n.directory}:{status:`not-found`}}async function l(r){let o=typeof r?.sessionId==`string`?r.sessionId.trim():``;if(!o)return;let c=typeof r.directory==`string`?r.directory.trim():``,l=++s,u=()=>l===s,d=r.probe===`unconfirmed`?`unresolved`:`not-found`;if(t.getState().setActiveMainTab(`chat`),r.probe===`ambiguous`){n(o,`unresolved`);return}let f=await a(o,{trySessionGet:!1});if(u()){if(f){i.getState().setCurrentSession(o,f.directory);return}if(!c){n(o,d);return}try{let[{supportsRemoteProjects:t,ensureRemoteHostCatalog:r},{resolveRemoteProjectOwner:i},{applyRemoteProjectRoute:a}]=await Promise.all([e(()=>import(`./remoteProjectQueries-zO4jYbru.js`).then(e=>e.l),__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])),e(()=>import(`./summaries-BQMyJaaw.js`).then(e=>e.i),__vite__mapDeps([27,1,8,9])),e(()=>import(`./navigation-atykJu0I.js`).then(e=>e.n),__vite__mapDeps([30,1,2,3,27,8,9,28,31,5,4,6,7,12,10,32,15,16,17,11,13,14,18,19,20,21,22,23,24,25,26,29,33,34,35,36,37,38,0,39,40,41,42,43,44,45,46,47,48]))]);if(!t()){n(o,d);return}let s=await r();if(!u())return;if(!s.supported){n(o,d);return}let l=[...new Set(s.projects.map(e=>e.hostId))].flatMap(e=>{let t=i(s.projects,s.hubId,e,c);return t?[t]:[]});if(l.length!==1){n(o,d);return}let[f]=l;await a({sessionId:o,directory:c,hostId:f.hostId,hubId:s.hubId,projectId:f.id,isNewSession:!1},u)}catch{u()&&n(o,d)}}}export{l as openSessionFromDeepLink,c as probeSessionLink};
@@ -0,0 +1 @@
1
+ import{w as e}from"./runtime-auth-DA-qfGHk.js";import{r as t,t as n}from"./runtime-switch-DEPKHgdL.js";import{t as r}from"./runtimeAPIRegistry-C2VogTny.js";import{t as i}from"./pathNormalization-ewtPqJWn.js";var a=[`local`,`remote`,null],o=[`ok`,`not-configured`,`unreachable`,`pairing-expired`,`incompatible`,`wrong-service`,`missing`];function s(e){if(!e||typeof e!=`object`)return{valid:!1};let t=e,n=t.target,r=t.status;if(n!==null&&(typeof n!=`string`||!a.includes(n))||typeof r!=`string`||!o.includes(r))return{valid:!1};if(n===`remote`||n===`local`){if(r===`ok`&&n===`local`)return{valid:!0,outcome:{target:`local`,status:`ok`}};if(r===`ok`&&n===`remote`)return typeof t.hostId!=`string`||typeof t.url!=`string`?{valid:!1}:{valid:!0,outcome:{target:`remote`,status:`ok`,hostId:t.hostId,url:t.url}};if(r===`unreachable`)return n===`local`?{valid:!0,outcome:{target:`local`,status:`unreachable`}}:typeof t.hostId!=`string`||typeof t.url!=`string`?{valid:!1}:{valid:!0,outcome:{target:`remote`,status:`unreachable`,hostId:t.hostId,url:t.url}};if(r===`incompatible`||r===`wrong-service`||r===`pairing-expired`)return n!==`remote`||typeof t.hostId!=`string`||typeof t.url!=`string`?{valid:!1}:{valid:!0,outcome:{target:`remote`,status:r,hostId:t.hostId,url:t.url}};if(r===`missing`)return n!==`remote`||typeof t.hostId!=`string`?{valid:!1}:{valid:!0,outcome:{target:`remote`,status:`missing`,hostId:t.hostId}}}if(n===null){if(r===`not-configured`)return{valid:!0,outcome:{target:null,status:`not-configured`}};if(r===`missing`)return{valid:!1}}return{valid:!1}}function c(e){if(!e.isDesktopShell)return null;let t=e.bootOutcome;if(!t)return null;if(t.status===`ok`){if(t.target===`local`)return{screen:`main`};if(t.target===`remote`)return{screen:`main`,hostId:t.hostId,url:t.url}}if(t.target===null&&t.status===`not-configured`)return{screen:`chooser`};if(t.target===`local`&&t.status===`unreachable`)return{screen:`recovery`,variant:`local-unavailable`};if(t.target===`remote`){if(t.status===`unreachable`)return{screen:`recovery`,variant:`remote-unreachable`,hostId:t.hostId,url:t.url};if(t.status===`pairing-expired`)return{screen:`recovery`,variant:`remote-pairing-expired`,hostId:t.hostId,url:t.url};if(t.status===`incompatible`)return{screen:`recovery`,variant:`remote-incompatible`,hostId:t.hostId,url:t.url};if(t.status===`wrong-service`)return{screen:`recovery`,variant:`remote-wrong-service`,hostId:t.hostId,url:t.url};if(t.status===`missing`)return{screen:`recovery`,variant:`remote-missing`,hostId:t.hostId}}return null}function l(e){return e.isDesktopShell?e.bootOutcomeKnown?e.bootViewIsMain===!1||e.isInitialized:!1:e.isInitialized}function ee(e){return e.isDesktopShell&&!e.isDesktopLocalOriginActive}function u(){if(f()!==`valid`)return null;let e=s(d());return e.valid?e.outcome:null}var d=()=>{if(typeof window>`u`)return;let e=window.__YURI_DESKTOP_BOOT_OUTCOME__;if(e!=null)return e;let t=window.__YURI_DESKTOP_BOOT__;if(t&&typeof t.getOutcome==`function`)try{return t.getOutcome()}catch{return}return e};function f(){if(typeof window>`u`)return`not-injected`;let e=d();return e==null?`not-injected`:s(e).valid?`valid`:`malformed`}var p=()=>typeof window>`u`?null:window.__YURI_ELECTRON__??null,m=()=>typeof window>`u`?null:window.__YURI_DESKTOP__??null,h=()=>p()?.runtime===`electron`,g=()=>h()&&p()?.packaged===!0,te=e=>{if(!h())return null;let t=m()?.getPathForFile?.(e);return typeof t==`string`&&t.trim()?t:null},_=()=>{if(typeof window>`u`)return null;let e=window.__YURI_PLATFORM__;return typeof e==`string`?e:null},ne=()=>{if(!h())return!1;let e=_();return e===`win32`||e===`linux`},re=(e=_())=>e===`linux`?`left`:`right`,v=(e,t=_())=>e===`left`||e===`right`?e:re(t),y=()=>typeof m()?.invoke==`function`,b=()=>h()&&y(),x=()=>y()&&M()&&m()?.isDocumentRestricted?.()!==!0,S=()=>h()&&M()?m()?.guiPlugins:void 0,C=()=>h()?m()?.guiPlugins:void 0,w=()=>h()?m()?.viewExport:void 0,T=()=>h()?m()?.menuShortcuts:void 0,ie=()=>h()?m()?.sessionLinks:void 0,E=async(e,t)=>{let n=m();return typeof n?.invoke==`function`?n.invoke(e,t??{}):null},ae=async e=>{if(!b()||!M())throw Error(`unsupported`);let t=await E(e.type===`status`?`desktop_remote_desktop_status`:e.type===`enabled`?`desktop_remote_desktop_enable`:`desktop_remote_desktop_permission`,{...e});if(!t||typeof t.supported!=`boolean`||typeof t.enabled!=`boolean`||typeof t.screenRecording!=`string`||typeof t.accessibility!=`boolean`||typeof t.helperAvailable!=`boolean`||typeof t.ready!=`boolean`)throw Error(`invalid_desktop_status`);return t},oe=async()=>{if(!b()||!M())return null;try{let e=await E(`desktop_get_launch_at_login`);return!e||typeof e.supported!=`boolean`||typeof e.enabled!=`boolean`?null:e}catch(e){return console.warn(`Failed to get launch at login status`,e),null}},se=async e=>{if(!b()||!M())return null;try{let t=await E(`desktop_set_launch_at_login`,{enabled:e});return!t||typeof t.supported!=`boolean`||typeof t.enabled!=`boolean`?null:t}catch(e){return console.warn(`Failed to set launch at login status`,e),null}},ce=async()=>{if(!b()||!M())return null;try{let e=await E(`desktop_get_minimize_to_tray`);return!e||typeof e.supported!=`boolean`||typeof e.enabled!=`boolean`?null:e}catch(e){return console.warn(`Failed to get minimize to tray status`,e),null}},le=async e=>{if(!b()||!M())return null;try{let t=await E(`desktop_set_minimize_to_tray`,{enabled:e});return!t||typeof t.supported!=`boolean`||typeof t.enabled!=`boolean`?null:t}catch(e){return console.warn(`Failed to set minimize to tray status`,e),null}},ue=async()=>{if(!b()||!M())return null;try{let e=await E(`desktop_get_keep_awake`);return!e||typeof e.supported!=`boolean`||typeof e.enabled!=`boolean`||typeof e.active!=`boolean`?null:e}catch(e){return console.warn(`Failed to get keep awake status`,e),null}},D=async e=>{if(!b()||!M())return null;try{let t=await E(`desktop_set_keep_awake`,{enabled:e});return!t||typeof t.supported!=`boolean`||typeof t.enabled!=`boolean`||typeof t.active!=`boolean`?null:t}catch(e){return console.warn(`Failed to set keep awake status`,e),null}},O=e=>{let t=e.trim();if(!t)return null;try{return new URL(t).origin}catch{try{return new URL(t.endsWith(`/`)?t:`${t}/`).origin}catch{return null}}},k=e=>{let t=e.trim();if(!t)return null;try{return new URL(t)}catch{try{return new URL(t.endsWith(`/`)?t:`${t}/`)}catch{return null}}},A=e=>e.replace(/^\[|\]$/g,``).toLowerCase(),j=e=>{let t=A(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`},M=()=>{if(typeof window>`u`||!N()||e())return!1;let r=t();if(r.startsWith(`host:`))return!1;if(r===`local`)return!0;let i=typeof window.__YURI_LOCAL_ORIGIN__==`string`?window.__YURI_LOCAL_ORIGIN__:``,a=k(i),o=k(n());if(!o&&a&&u()?.target===`local`)return!0;if(a&&o){if(a.origin===o.origin)return!0;let e=a.port||(a.protocol===`https:`?`443`:`80`),t=o.port||(o.protocol===`https:`?`443`:`80`);return a.protocol===o.protocol&&e===t&&j(a.hostname)&&j(o.hostname)}let s=k(window.location.origin);if(a&&s){if(a.origin===s.origin)return!0;let e=a.port||(a.protocol===`https:`?`443`:`80`),t=s.port||(s.protocol===`https:`?`443`:`80`);return a.protocol===s.protocol&&e===t&&j(a.hostname)&&j(s.hostname)}let c=O(i),l=O(window.location.origin)||window.location.origin;return c&&l&&c===l?!0:!!(s&&j(s.hostname))},N=()=>typeof window>`u`?!1:h(),P=async()=>{if(!N())return!1;try{return await E(`desktop_start_window_drag`),!0}catch{return!1}},F=()=>r()?.runtime?.isVSCode===!0,I=()=>{let e=r()?.runtime?.platform;return e===`web`?!0:e===`desktop`||e===`vscode`?!1:!F()},L=async()=>{if(typeof window<`u`){let e=window.__YURI_HOME__;if(e&&e.length>0)return e}return null},R=async e=>{if(y()&&M())try{let e=await m()?.openDialog?.({directory:!0,multiple:!1,title:`Select Working Directory`});return!e||typeof e!=`string`?{success:!1,error:`Directory selection cancelled`}:{success:!0,path:e}}catch(e){return console.warn(`Failed to request directory access`,e),{success:!1,error:e instanceof Error?e.message:String(e)}}return{success:!0,path:e}},z=e=>typeof e==`object`&&!!e&&!Array.isArray(e),B=async e=>{if(y()&&M())try{let t=await m()?.openDialog?.({directory:!1,multiple:!1,title:`Select File`,returnGrant:!0,...e?.filters?{filters:e.filters}:{},...e?.defaultPath?{defaultPath:e.defaultPath}:{}});if(!t)return{success:!1,error:`File selection cancelled`};if(typeof t==`string`)return{success:!0,path:t};if(!z(t))return{success:!1,error:`File selection cancelled`};let n=typeof t.path==`string`?t.path:``;return n?{success:!0,path:n,outsideFileGrant:typeof t.outsideFileGrant==`string`?t.outsideFileGrant:void 0}:{success:!1,error:`File selection cancelled`}}catch(e){return console.warn(`Failed to request file access`,e),{success:!1,error:e instanceof Error?e.message:String(e)}}return{success:!1,error:`Native file picker not available`}},V=async e=>{let t=typeof e==`string`?e.trim():``;if(!t)return{success:!1,error:`Path is required`};if(!y()||!M())return{success:!1,error:`Native file access not available`};try{let e=await m()?.grantFileAccess?.(t);if(!z(e))return{success:!1,error:`File access was not granted`};let n=typeof e.path==`string`?e.path:``,r=typeof e.outsideFileGrant==`string`?e.outsideFileGrant:``;return!n||!r?{success:!1,error:`File access was not granted`}:{success:!0,path:n,outsideFileGrant:r}}catch(e){return console.warn(`Failed to request existing file access`,e),{success:!1,error:e instanceof Error?e.message:String(e)}}},H=async e=>({success:!0}),U=async e=>({success:!0}),W=async e=>{if(!y())throw Error(`Desktop update checker is unavailable`);let t=await E(`desktop_check_for_updates`,{channelOverride:e});if(!t)throw Error(`Desktop update checker returned no result`);return t},de=async e=>{y()&&await E(`desktop_ota_ready`,{version:e})},fe=()=>E(`desktop_get_app_version`),pe=async e=>{let t=m();return typeof t?.listen==`function`?t.listen(`yuri:update-progress`,t=>{let n=t?.payload;if(!n||typeof n!=`object`)return;let r=n;e({event:typeof r.event==`string`?r.event:void 0,data:r.data&&typeof r.data==`object`?r.data:void 0})}):null},me=async e=>{let t=m();return typeof t?.listen==`function`?t.listen(`yuri:update-ready`,t=>{let n=t?.payload;if(!n||typeof n!=`object`)return;let r=n;e({version:typeof r.version==`string`?r.version:null,downloaded:r.downloaded===!0})}):null},he=async e=>{if(!y())return!1;let t=m(),n=null,r=0,i;try{return typeof e==`function`&&t?.listen&&(n=await t.listen(`yuri:update-progress`,t=>{let n=t?.payload;if(!n||typeof n!=`object`)return;let a=n,o=typeof a.event==`string`?a.event:null,s=a.data&&typeof a.data==`object`?a.data:null;if(o===`Started`){r=0,i=typeof s?.contentLength==`number`?s.contentLength:void 0,e({downloaded:r,total:i});return}if(o===`Progress`){let t=s?.downloaded,n=s?.total;typeof t==`number`&&(r=t),typeof n==`number`&&(i=n),e({downloaded:r,total:i});return}o===`Finished`&&e({downloaded:r,total:i})})),await E(`desktop_download_and_install_update`),!0}catch(e){throw e instanceof Error?e:Error(String(e))}finally{if(n)try{let e=n();e instanceof Promise&&await e}catch{}}},ge=async()=>y()?G({applyUpdate:!0}):!1,G=async({applyUpdate:e=!1}={})=>{if(!y())return!1;try{return await E(`desktop_restart`,e?{applyUpdate:!0}:void 0),!0}catch(e){return console.warn(`Failed to restart desktop app`,e),!1}},_e=async()=>{if(!y()||!M())return null;try{let e=await E(`desktop_get_lan_address`);return typeof e==`string`&&e.trim().length>0?e.trim():null}catch(e){return console.warn(`Failed to get desktop LAN address`,e),null}},K=async()=>{if(!y())return!1;if(M())return!0;try{return await E(`desktop_runtime_is_local_machine`)===!0}catch{return!1}},q=async(e,t)=>{if(!await K())return!1;let n=e?.trim();if(!n)return!1;try{return await E(`desktop_open_path`,{path:n,app:typeof t==`string`&&t.trim().length>0?t.trim():void 0}),!0}catch(e){return console.warn(`Failed to open path`,e),!1}},ve=async e=>{if(!y()||!M())return null;let t=e?.trim();if(!t)return null;try{let e=await E(`desktop_is_binary_path`,{path:t});return typeof e==`boolean`?e:null}catch{return null}},ye=async e=>{if(!y()||!M()||!e.trim())return!1;try{return await E(`desktop_is_directory_path`,{path:e.trim()})===!0}catch{return!1}},be=async e=>{if(!y()||!M())return!1;let t=e?.trim();if(!t)return!1;try{return await E(`desktop_reveal_path`,{path:t}),!0}catch{return q(t)}},xe=async(e,t)=>{if(!y()||!M())return null;let n=e?.trim();if(!n)return null;try{let e=await E(`desktop_save_markdown_file`,{defaultFileName:n,content:t});return typeof e==`string`&&e.trim().length>0?e:null}catch(e){return console.warn(`Failed to save markdown file`,e),null}},Se=async(e,n,r,i)=>{if(!y()||!i&&!M())return!1;if(i)return t()===`host:${i}`&&(await E(`desktop_open_ssh_in_app`,{projectPath:e,appId:n,hostId:i}),!0);let a=e?.trim(),o=n?.trim(),s=r?.trim();if(!a||!o||!s)return!1;try{return await E(`desktop_open_in_app`,{projectPath:a,appId:o,appName:s}),!0}catch(e){return console.warn(`Failed to open project in app`,e),!1}},Ce=async(e,t,n)=>{if(!y()||!M())return!1;let r=e?.trim(),i=t?.trim(),a=n?.trim();if(!r||!i||!a)return!1;try{return await E(`desktop_open_file_in_app`,{filePath:r,appId:i,appName:a}),!0}catch(e){return console.warn(`Failed to open file in app`,e),!1}},we=async(e,t)=>{if(!y())return{apps:[],success:!1,hasCache:!1,isCacheStale:!1};if(_()===`linux`)return{apps:[],success:!0,hasCache:!1,isCacheStale:!1};let n=Array.isArray(e)?e.filter(e=>typeof e==`string`):[];if(n.length===0)return{apps:[],success:!0,hasCache:!1,isCacheStale:!1};try{let e=await E(`desktop_get_installed_apps`,{apps:n,force:t===!0||void 0});if(!e||typeof e!=`object`)return{apps:[],success:!1,hasCache:!1,isCacheStale:!1};let r=e;return r.supported===!1?{apps:[],success:!0,hasCache:!1,isCacheStale:!1}:Array.isArray(r.apps)?{apps:r.apps.filter(e=>e&&typeof e==`object`).map(e=>{let t=e;return{name:typeof t.name==`string`?t.name:``,appName:typeof t.appName==`string`?t.appName:void 0,label:typeof t.label==`string`?t.label:void 0,iconDataUrl:typeof t.iconDataUrl==`string`?t.iconDataUrl:null}}).filter(e=>e.name.length>0),success:!0,hasCache:r.hasCache===!0,isCacheStale:r.isCacheStale===!0}:{apps:[],success:!1,hasCache:!1,isCacheStale:!1}}catch(e){return console.warn(`Failed to fetch installed apps`,e),{apps:[],success:!1,hasCache:!1,isCacheStale:!1}}},J=`yuri-remote-location:`,Te=`yuri-remote-session:`,Ee=`remote-new-session`,Y=(e,t)=>{if(!e||e!==e.trim()||Array.from(e).some(e=>e.charCodeAt(0)<32))throw Error(`Invalid ${t}`);return e},X=e=>{let t=i(e.directory);if(!t)throw Error(`A Location requires a directory`);return e.hostId?J+JSON.stringify([Y(e.hubId,`Hub identity`),Y(e.hostId,`Host identity`),t]):t},Z=(e,t)=>{if(!e.startsWith(J))return{hubId:t,directory:e};let n=JSON.parse(e.slice(21));if(!Array.isArray(n)||n.length!==3||!n.every(e=>typeof e==`string`))throw Error(`Invalid remote Location key`);let[r,a,o]=n;if(Y(r,`Hub identity`),Y(a,`Host identity`),!i(o))throw Error(`Invalid Location directory`);return{hubId:r,hostId:a,directory:o}},De=e=>X(Z(e,`local`)),Oe=(e,t)=>(Y(t,`Session identity`),e.hostId?Te+JSON.stringify([X(e),t]):t),ke=(e,t)=>{if(!e)return t;if(Y(e,`Host identity`),!(t===`/api`||t.startsWith(`/api/`)||t===`/health`))throw Error(`Only runtime API paths can be routed to a Remote Host`);let n=t.split(`?`)[0];if(n===`/api/hosts`||n.startsWith(`/api/hosts/`))throw Error(`Nested Remote Host aggregation is not supported`);return`/api/hosts/${encodeURIComponent(e)}${t}`},Ae=e=>e.hostId?JSON.stringify([e.hubId,e.hostId]):e.hubId,Q=()=>typeof window>`u`?!1:window.Capacitor?.isNativePlatform?.()===!0||window.location.protocol===`capacitor:`,je=()=>{if(typeof window>`u`||!Q()||$()!==`ios`)return!1;let e=navigator.userAgent||``,t=navigator.maxTouchPoints??0;return/iPad/i.test(e)||/Macintosh|MacIntel/i.test(e)&&t>1},$=()=>{if(typeof window<`u`){let e=window.Capacitor?.getPlatform?.();if(e===`ios`||e===`android`)return e}return F()?`vscode`:N()?`desktop`:`web`};export{be as $,y as A,I as B,oe as C,w as D,ie as E,M as F,q as G,me as H,N as I,V as J,Se as K,h as L,ve as M,ye as N,te as O,K as P,ge as Q,g as R,_e as S,ce as T,de as U,pe as V,Ce as W,v as X,B as Y,G as Z,fe as _,ke as a,P as at,L as b,Oe as c,l as ct,x as d,c as dt,xe as et,b as f,ee as ft,we as g,he as h,Ee as i,H as it,E as j,_ as k,De as l,f as lt,ae as m,Q as n,se as nt,Ae as o,U as ot,W as p,R as q,je as r,le as rt,X as s,ne as st,$ as t,D as tt,Z as u,u as ut,S as v,T as w,ue as x,C as y,F as z};