@yuriai/web 0.3.6-beta.10 → 0.3.6-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -3
- package/bin/install-portable.sh +102 -0
- package/bin/install-portable.test.js +112 -0
- package/bin/lib/DOCUMENTATION.md +2 -0
- package/bin/lib/cli-startup.js +7 -2
- package/bin/lib/cli-startup.portable.test.js +30 -0
- package/bin/lib/commands-serve.js +4 -1
- package/bin/lib/commands-update.js +3 -0
- package/bin/lib/commands-update.test.js +18 -0
- package/dist/assets/{AgentAvatar-C_s-cMy0.js → AgentAvatar-CEr1CtLO.js} +1 -1
- package/dist/assets/{AgentSelector-Df4rBNQs.js → AgentSelector-B0Owr1ZK.js} +1 -1
- package/dist/assets/{ArchivedSessionsDialog-BQdqEIFM.js → ArchivedSessionsDialog-cbyQcG7B.js} +1 -1
- package/dist/assets/{AssistantConversationSurface-BOsGik2U.js → AssistantConversationSurface-DOwN0Ip3.js} +3 -3
- package/dist/assets/{AssistantSessionCard-DFi6eIIE.js → AssistantSessionCard-1CWSy8Bt.js} +2 -2
- package/dist/assets/{AssistantUnreadBadge-B9IS5LPM.js → AssistantUnreadBadge-Bi7Dojgx.js} +1 -1
- package/dist/assets/{AssistantView-yCnV95Dr.js → AssistantView-D91RZ13W.js} +1 -1
- package/dist/assets/{AssistantWorkingAvatar-Bp1KXuhO.js → AssistantWorkingAvatar-DgzJEVuK.js} +1 -1
- package/dist/assets/{AssistantsSettingsPage-pPeanepy.js → AssistantsSettingsPage-DmwV91xW.js} +1 -1
- package/dist/assets/{BinaryFileFallback-C3sgeTIN.js → BinaryFileFallback-1wT0ClU8.js} +1 -1
- package/dist/assets/{BtwPanel-BvqTaKLQ.js → BtwPanel-FrJmmj9W.js} +1 -1
- package/dist/assets/{BusyDots-CU41Xq9E.js → BusyDots-DWKGX3Sn.js} +1 -1
- package/dist/assets/{ChatContainer-DXRL0aB2.js → ChatContainer-BJadx4zz.js} +4 -4
- package/dist/assets/{ChatView-AcZ0Fl7_.js → ChatView-Bb-K_GE2.js} +1 -1
- package/dist/assets/{DiagramView-CyGBR2qn.js → DiagramView-CUCcpmvd.js} +1 -1
- package/dist/assets/{DiffView-z4ArmNTm.js → DiffView-CMWTZ175.js} +1 -1
- package/dist/assets/{DiffViewToggle-BBxj5Yby.js → DiffViewToggle-BVpHBxQo.js} +1 -1
- package/dist/assets/{ErrorBoundary-B4CbFTTY.js → ErrorBoundary-74-IYvi5.js} +1 -1
- package/dist/assets/{FadeInOnReveal-C2UMs63r.js → FadeInOnReveal-5j0frOAV.js} +1 -1
- package/dist/assets/{GuiPluginMount-JWmLTeLO.js → GuiPluginMount-CXnJtW4N.js} +1 -1
- package/dist/assets/{GuiPluginPage-BB6qitNb.js → GuiPluginPage-BrRwHot0.js} +1 -1
- package/dist/assets/{GuiPluginSurface-CKW1UPZD.js → GuiPluginSurface-BMM8XK9q.js} +1 -1
- package/dist/assets/{GuiPluginTitlebarItems-Bmo9W0sn.js → GuiPluginTitlebarItems-YkwCMWDl.js} +1 -1
- package/dist/assets/{GuiPluginWindow-B-6WWulE.js → GuiPluginWindow-D49q7RQT.js} +1 -1
- package/dist/assets/{Icon-CMNOrIAp.js → Icon-BxuNTD1G.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-FqoECDc5.js → ImageLoadingPlaceholder-wOEYYae9.js} +1 -1
- package/dist/assets/{LoadingImage-U4z75PsW.js → LoadingImage-fSoPxfqK.js} +1 -1
- package/dist/assets/{MarkdownRenderer-CckbVkti.js → MarkdownRenderer-BcCmyx3J.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-CO17sAsd.js → MarkdownRendererImpl-BBxjlBBW.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-FOsYqre1.js → MarkstreamRendererImpl-asOdM6LF.js} +1 -1
- package/dist/assets/{MobileAssistantSettingsPage-CYnXMlRV.js → MobileAssistantSettingsPage-B3nRw-O9.js} +1 -1
- package/dist/assets/{MobileAssistantTab-CtIoTTOV.js → MobileAssistantTab-DTvSg17F.js} +1 -1
- package/dist/assets/{MobileBtwPage-CqiEtHuG.js → MobileBtwPage-CaaoPuuZ.js} +1 -1
- package/dist/assets/{MobileChangesSurface-D7AUZxEK.js → MobileChangesSurface-BPI4-e0L.js} +1 -1
- package/dist/assets/{MobileChatScreen-CCNqpS3r.js → MobileChatScreen-CWBCZ4IZ.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-BncgS1Gb.js → MobileDetailNavigation-CXC4GjdP.js} +1 -1
- package/dist/assets/{MobileFilesSurface-D6Fzko7m.js → MobileFilesSurface-WPw1GU8X.js} +2 -2
- package/dist/assets/{MobileHtmlNetworkBoundary-DXkpR8iy.js → MobileHtmlNetworkBoundary-CToMn0v-.js} +2 -2
- package/dist/assets/{MobileOverlayPanel-dc8EKqfh.js → MobileOverlayPanel-DRs4pHcd.js} +1 -1
- package/dist/assets/{MobileResizableSheet-Ddf0s-Dp.js → MobileResizableSheet-DaQdMNe9.js} +1 -1
- package/dist/assets/{MobileSettingsTab-DoCREe-W.js → MobileSettingsTab-BzAKd9oe.js} +1 -1
- package/dist/assets/{MobileShareBridge-DIIhDUmO.js → MobileShareBridge-BU4o7zvA.js} +1 -1
- package/dist/assets/{MobileSurface-bA5ONMXf.js → MobileSurface-BAhIeu5y.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-DuWdhFAU.js → MobileTabPageHeader-BuGRgBJG.js} +1 -1
- package/dist/assets/{ModelLogo-Bb63bM4S.js → ModelLogo-B4ia9c7r.js} +1 -1
- package/dist/assets/{ModelSelector-Dpt_OeOA.js → ModelSelector-CoV0ELh9.js} +1 -1
- package/dist/assets/{MultiRunWindow-CIueenaz.js → MultiRunWindow-CyGYoQ6V.js} +1 -1
- package/dist/assets/{OnboardingScreen-DQz9jluT.js → OnboardingScreen-Bctdl4oS.js} +1 -1
- package/dist/assets/{OverlayScrollbar-Dsj-t--1.js → OverlayScrollbar-BbUv42hT.js} +1 -1
- package/dist/assets/{PierreDiffViewer-BPY2vUDa.js → PierreDiffViewer-0bSxnzcB.js} +1 -1
- package/dist/assets/{ProviderLogo-pBVtlU5X.js → ProviderLogo-BhzPiC4G.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-DV_D7Lmx.js → RemoteAssistantSessionCard-BDsAcZX4.js} +1 -1
- package/dist/assets/{RemoteDesktopPanel-DvF7mNsC.js → RemoteDesktopPanel-yBr4UO58.js} +1 -1
- package/dist/assets/{ScheduledTasksDialog-DbV9D6t0.js → ScheduledTasksDialog-1HTvbmGQ.js} +1 -1
- package/dist/assets/{ScrollableOverlay-T7ADHNbV.js → ScrollableOverlay-CAdxdD7C.js} +1 -1
- package/dist/assets/{SettingsGroup-ZY4tnwQZ.js → SettingsGroup-C1ui69yn.js} +1 -1
- package/dist/assets/{SettingsView-C1cFkPEn.js → SettingsView-RULyRRQP.js} +2 -2
- package/dist/assets/{SettingsWindow-CPqIwaDs.js → SettingsWindow-DPPmIElK.js} +1 -1
- package/dist/assets/{SetupTourDialog-D8MqnViH.js → SetupTourDialog-D5UX8kw1.js} +1 -1
- package/dist/assets/{SyncActions-BUkOsuvk.js → SyncActions-CtuW0cF8.js} +1 -1
- package/dist/assets/{TerminalView-CoeBAVr1.js → TerminalView-CvTlu81P.js} +1 -1
- package/dist/assets/{TextSelectionMenu-CZWUVT4Q.js → TextSelectionMenu-Cnd0PPeZ.js} +1 -1
- package/dist/assets/{ToolOutputDialog-DLxoc22s.js → ToolOutputDialog-Bk8GsZTN.js} +1 -1
- package/dist/assets/{YuriLogo-CnV3RxpE.js → YuriLogo-Cexwa29m.js} +1 -1
- package/dist/assets/{assistantMessagePreview-DyHFl0Zy.js → assistantMessagePreview-DsmKo-Rd.js} +1 -1
- package/dist/assets/{assistantQueries-BLm65-22.js → assistantQueries-DFR7-2m4.js} +1 -1
- package/dist/assets/{auto-read-context-eOYxlJjR.js → auto-read-context-CFc8sopy.js} +1 -1
- package/dist/assets/{capgoAdapter-DYyTs76s.js → capgoAdapter-CrrR1sb7.js} +1 -1
- package/dist/assets/{card-Csh0Af72.js → card-Bjer7G59.js} +1 -1
- package/dist/assets/{chatUpwardIntent-CivAb4ux.js → chatUpwardIntent-ZOlImhuf.js} +1 -1
- package/dist/assets/{checkbox-CK288doZ.js → checkbox-BnafV7fE.js} +1 -1
- package/dist/assets/{collapsible-C8knwYWk.js → collapsible-J-qWuNzr.js} +1 -1
- package/dist/assets/{connection-hint-BboPqLXQ.js → connection-hint-CVsiZdCj.js} +1 -1
- package/dist/assets/{context-menu-CBjNNTDr.js → context-menu-0Bkpdmag.js} +1 -1
- package/dist/assets/{diagram-DuMpiER6.js → diagram-Clzpe5jY.js} +1 -1
- package/dist/assets/dialog-B6B8FIrL.css +1 -0
- package/dist/assets/{dialog-BPtWiCtF.js → dialog-BhhUro-8.js} +1 -1
- package/dist/assets/{dropdown-menu-BWP9Nxwt.js → dropdown-menu-low64f9u.js} +1 -1
- package/dist/assets/{es-BelVk9R_.js → es-Bg0nG0fE.js} +2 -2
- package/dist/assets/{fileMentionTouchSelection-3GZYNOSd.js → fileMentionTouchSelection-B48eLkS9.js} +1 -1
- package/dist/assets/{fr-DtUzwB6h.js → fr-D7KYfgtA.js} +2 -2
- package/dist/assets/{gitApi-CwF3k_rj.js → gitApi-uOSHjWy6.js} +1 -1
- package/dist/assets/{i18n-BU8XOKjS.js → i18n-WsU03nwB.js} +1 -1
- package/dist/assets/{icons-C25QjTQy.js → icons-BjHPg9QC.js} +1 -1
- package/dist/assets/{input-DHQ_HUNG.js → input-Bn5-lrjt.js} +1 -1
- package/dist/assets/{insertionBoundaries-6VDrFW8E.js → insertionBoundaries-B--nM0ah.js} +1 -1
- package/dist/assets/{ja-CWta3CAu.js → ja-6g8rtjOl.js} +2 -2
- package/dist/assets/{kbd-CVXHcAl2.js → kbd-BiidNm-N.js} +1 -1
- package/dist/assets/{ko-CJFoAZPE.js → ko-Cmx7IPM8.js} +2 -2
- package/dist/assets/{main-BGVs-a-z.js → main-4G_VHm4a.js} +2 -2
- package/dist/assets/{main-CHSIwKhf.js → main-D0KOHcSW.js} +4 -4
- package/dist/assets/{markdownHeightCache-BsFEgT5Y.js → markdownHeightCache-CfBcQ5c-.js} +1 -1
- package/dist/assets/{mcpQueries-BGNMOHKb.js → mcpQueries-BDdMur9_.js} +1 -1
- package/dist/assets/miniChat-SErezL-O.js +2 -0
- package/dist/assets/{mobile-txc-T67P.js → mobile-IIghKCW_.js} +2 -2
- package/dist/assets/{mobileBackNavigation-Cpb7IiCG.js → mobileBackNavigation-CihY-ZWs.js} +1 -1
- package/dist/assets/{mobileConnections-5xypkCyd.js → mobileConnections-C6FuJ0fM.js} +2 -2
- package/dist/assets/{multirun-B5_-5JYt.js → multirun-D3ah7H0A.js} +1 -1
- package/dist/assets/{native-config-DLw0Zm99.js → native-config-6EqKnDU2.js} +1 -1
- package/dist/assets/{nativeComposerCover-Btj57e5V.js → nativeComposerCover-F38clCeD.js} +1 -1
- package/dist/assets/{navigation-C2qzByuq.js → navigation-BFoRE4u8.js} +1 -1
- package/dist/assets/{openRemoteProjectSession-BFp0YlF-.js → openRemoteProjectSession-FtIejPwF.js} +1 -1
- package/dist/assets/{openSessionFromDeepLink-DUPajGkN.js → openSessionFromDeepLink-DMS6SIo7.js} +2 -2
- package/dist/assets/{pl-BwZ6CWJm.js → pl-TBhIGAPK.js} +2 -2
- package/dist/assets/{pluginPresentation-wl8POjDE.js → pluginPresentation-BnpV06pV.js} +1 -1
- package/dist/assets/{pt-BR-DPAcgEDe.js → pt-BR-R4yjA2X6.js} +2 -2
- package/dist/assets/pwa-BsyIaDZ4.js +2 -0
- package/dist/assets/{queue-abort-optimistic-s-DVErY6.js → queue-abort-optimistic-BrAat9L-.js} +1 -1
- package/dist/assets/{quota-BEyQ6n-w.js → quota-C7uYEfoX.js} +1 -1
- package/dist/assets/{reference-history-B9H6MkUC.js → reference-history-B5vQfNKz.js} +1 -1
- package/dist/assets/{remoteSessionReference-BHvAalXk.js → remoteSessionReference-d8IANkUB.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-D3Vd8ffe.js → renderElectronMiniChatApp-DZV4b3Rq.js} +2 -2
- package/dist/assets/{renderMobileApp-BulRo1RJ.js → renderMobileApp-C6zKgF6w.js} +4 -4
- package/dist/assets/{runtimeConfig-8Z7A5ncj.js → runtimeConfig-DILpDGx-.js} +1 -1
- package/dist/assets/runtimeEndpointReset-r655-D3H.js +4 -0
- package/dist/assets/{select-BL02HQzN.js → select-CETtrHQE.js} +1 -1
- package/dist/assets/{sessionLookup-CLqpm_Sq.js → sessionLookup-D0gUdT8J.js} +1 -1
- package/dist/assets/{sessionOwnership-Zl2YX7dC.js → sessionOwnership-nyTiak2m.js} +1 -1
- package/dist/assets/{shortcuts-2XAaIaaK.js → shortcuts-DFgnwGd5.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-BsjgK90l.js → sortable-tabs-strip-D6tQk6nW.js} +1 -1
- package/dist/assets/{speechSettingsQueries-cQ6M7fJ3.js → speechSettingsQueries-B8UP0Kkn.js} +1 -1
- package/dist/assets/src-BacdFOCS.css +2 -0
- package/dist/assets/{store-DWS9gJPW.js → store-BDr-X6Ry.js} +4 -4
- package/dist/assets/{switch-ps5COI8_.js → switch-B8h1KUmC.js} +1 -1
- package/dist/assets/{textarea-DXs25Z8k.js → textarea-f9PtvCNG.js} +1 -1
- package/dist/assets/{timeFormat-CUbYRR40.js → timeFormat-D1hdmWbu.js} +1 -1
- package/dist/assets/{tooltip-DYZonA8U.js → tooltip-BQKvkayK.js} +1 -1
- package/dist/assets/{truncated-path-DJfRXALm.js → truncated-path-DUsIWNhL.js} +1 -1
- package/dist/assets/{types-b90cIxfC.js → types-B0G9z6G6.js} +1 -1
- package/dist/assets/{ui-z2JsXLmb.js → ui-CBjYsEHe.js} +6 -6
- package/dist/assets/{uk-Dw75NtHH.js → uk-stP6moLG.js} +2 -2
- package/dist/assets/{useAppFontEffects-tKUtvOIn.js → useAppFontEffects-BQLHroVK.js} +2 -2
- package/dist/assets/{useDesktopWindowControlsLayout-CNAzDasQ.js → useDesktopWindowControlsLayout-BiQv3xA1.js} +1 -1
- package/dist/assets/{useDictation-CUADIj-o.js → useDictation-DUR68U4T.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-hu13SCnK.js → useEffectiveDirectory-DynS0IQR.js} +1 -1
- package/dist/assets/{useGitStore-Dsh_ZiT1.js → useGitStore-CHE0pTk_.js} +1 -1
- package/dist/assets/{useInlineCommentDraftStore-C75YIRui.js → useInlineCommentDraftStore-CvpvoffS.js} +1 -1
- package/dist/assets/{useMcpConfigStore-BfdokvWe.js → useMcpConfigStore-CGenk3_j.js} +1 -1
- package/dist/assets/{useMobileSwipeActions-jAZpJVTB.js → useMobileSwipeActions-BYD4Qa5k.js} +1 -1
- package/dist/assets/{useMobileTranscriptSyncHint-XT7TWzKn.js → useMobileTranscriptSyncHint-CDAa-k2e.js} +1 -1
- package/dist/assets/{useModelLists-DrXScJk8.js → useModelLists-85Cks36l.js} +1 -1
- package/dist/assets/{useOpenCodeReadiness-DLqT6fD5.js → useOpenCodeReadiness-BvD_kM-L.js} +1 -1
- package/dist/assets/{usePluginsStore-DYO8nss8.js → usePluginsStore-DEIJXUJp.js} +1 -1
- package/dist/assets/{useProjectGitActions-CYWPTGNa.js → useProjectGitActions-DQvIHmjR.js} +1 -1
- package/dist/assets/{useProjectGitStore-C1Tswys-.js → useProjectGitStore-BZLEIJPC.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-BpdOaT67.js → useProjectRuntimeAPIs-Ct3aOMyH.js} +1 -1
- package/dist/assets/{useQuotaStore-CZU1NU_Z.js → useQuotaStore-BqPJ1nzk.js} +1 -1
- package/dist/assets/{useSessionBtwStore-PdQPx7tm.js → useSessionBtwStore-DWvYSycl.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-Btl31Wol.js → useStreamingTextThrottle-B8qFhmN9.js} +1 -1
- package/dist/assets/{worktreeManager-DIrqBI6K.js → worktreeManager-DcqLFxEk.js} +1 -1
- package/dist/assets/{worktreeSourceBranchPreference-DncAXqYk.js → worktreeSourceBranchPreference-DyEaTtIU.js} +1 -1
- package/dist/assets/{zh-CN-D5Jwengx.js → zh-CN-C52Ikw5n.js} +2 -2
- package/dist/assets/zh-TW-nR1tyoMc.js +15 -0
- package/dist/index.html +6 -6
- package/dist/mini-chat.html +6 -6
- package/dist/mobile.html +2 -2
- package/package.json +2 -1
- package/server/lib/gui-customization/DOCUMENTATION.md +4 -0
- package/server/lib/gui-customization/remote-connections.js +1 -0
- package/server/lib/gui-customization/remote-connections.test.js +17 -0
- package/server/lib/gui-customization/session-skill.test.js +5 -0
- package/server/lib/gui-customization/skill/references/remote-connections.md +3 -0
- package/server/lib/host-update/DOCUMENTATION.md +5 -0
- package/server/lib/host-update/cli.js +5 -2
- package/server/lib/host-update/cli.test.js +15 -2
- package/server/lib/opencode/DOCUMENTATION.md +1 -1
- package/server/lib/package-manager.js +14 -0
- package/server/lib/package-manager.test.js +7 -0
- package/server/lib/portable-installation.js +34 -0
- package/server/lib/portable-installation.test.js +38 -0
- package/dist/assets/dialog-D9CkSNCA.css +0 -1
- package/dist/assets/miniChat-ByGJ6Q_E.js +0 -2
- package/dist/assets/pwa-FAC1qERc.js +0 -2
- package/dist/assets/runtimeEndpointReset-D5p8n8Z1.js +0 -4
- package/dist/assets/src-DYCPWwUH.css +0 -2
- package/dist/assets/zh-TW-CbbaPcxZ.js +0 -15
package/dist/index.html
CHANGED
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
opacity: 0.72;
|
|
572
572
|
}
|
|
573
573
|
</style>
|
|
574
|
-
<script type="module" crossorigin src="/assets/main-
|
|
574
|
+
<script type="module" crossorigin src="/assets/main-4G_VHm4a.js"></script>
|
|
575
575
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -610,13 +610,13 @@
|
|
|
610
610
|
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-C8AU1uiY.js">
|
|
611
611
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-D2ECmoAo.js">
|
|
612
612
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-wMVtKk2v.js">
|
|
613
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
614
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
615
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
613
|
+
<link rel="modulepreload" crossorigin href="/assets/types-B0G9z6G6.js">
|
|
614
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-CrrR1sb7.js">
|
|
615
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-6EqKnDU2.js">
|
|
616
616
|
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
617
617
|
<link rel="modulepreload" crossorigin href="/assets/bootstrap-eLlfzqAI.js">
|
|
618
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
619
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
618
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-DILpDGx-.js">
|
|
619
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BacdFOCS.css">
|
|
620
620
|
</head>
|
|
621
621
|
<body class="h-full bg-background text-foreground">
|
|
622
622
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
.dark #initial-loading img { filter: invert(1); }
|
|
78
78
|
</style>
|
|
79
79
|
|
|
80
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
80
|
+
<script type="module" crossorigin src="/assets/miniChat-SErezL-O.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -116,13 +116,13 @@
|
|
|
116
116
|
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-C8AU1uiY.js">
|
|
117
117
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-D2ECmoAo.js">
|
|
118
118
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-wMVtKk2v.js">
|
|
119
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
120
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
121
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
119
|
+
<link rel="modulepreload" crossorigin href="/assets/types-B0G9z6G6.js">
|
|
120
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-CrrR1sb7.js">
|
|
121
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-6EqKnDU2.js">
|
|
122
122
|
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
123
123
|
<link rel="modulepreload" crossorigin href="/assets/bootstrap-eLlfzqAI.js">
|
|
124
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
125
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
124
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-DILpDGx-.js">
|
|
125
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BacdFOCS.css">
|
|
126
126
|
</head>
|
|
127
127
|
<body class="h-full bg-background text-foreground">
|
|
128
128
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
66
|
<style>.dark #mobile-startup-logo img { filter: invert(1); }</style>
|
|
67
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
67
|
+
<script type="module" crossorigin src="/assets/mobile-IIghKCW_.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
71
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
71
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BacdFOCS.css">
|
|
72
72
|
</head>
|
|
73
73
|
<body class="h-full bg-background text-foreground">
|
|
74
74
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuriai/web",
|
|
3
|
-
"version": "0.3.6-beta.
|
|
3
|
+
"version": "0.3.6-beta.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./server/index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"build": "bun run build:llm-bridge && vite build",
|
|
19
19
|
"build:llm-bridge": "bun scripts/build-llm-bridge.mjs && bun run build:remote-host-relay",
|
|
20
20
|
"build:remote-host-relay": "bun scripts/build-remote-host-relay.mjs",
|
|
21
|
+
"pack:portable": "node scripts/portable/build.mjs",
|
|
21
22
|
"prepack": "bun run build:llm-bridge",
|
|
22
23
|
"build:watch": "vite build --watch",
|
|
23
24
|
"type-check": "tsc --noEmit",
|
|
@@ -161,6 +161,10 @@ short tool deadline does not strand other targets. Repeated active requests join
|
|
|
161
161
|
the target operation. Saved instances survive restart; setup receipts do not.
|
|
162
162
|
The pairing operation calls the existing authenticated Host pairing API, never
|
|
163
163
|
writes pairing stores or grants SSH-only connections Relay provenance.
|
|
164
|
+
New session-created managed SSH entries use the same `download_release` default
|
|
165
|
+
as the UI. Existing saved installation choices remain unchanged. Linux portable
|
|
166
|
+
bootstrap and release alignment belong to Electron's SSH manager; the skill only
|
|
167
|
+
submits the destination and reports connection/sync/gateway evidence separately.
|
|
164
168
|
|
|
165
169
|
Package publishing includes the entire web `server` directory, so the Markdown
|
|
166
170
|
resources ship with the backend and resolve relative to this module in packaged
|
|
@@ -31,6 +31,7 @@ export function registerRemoteConnectionsSkill(app, { express, adapter, getIsSha
|
|
|
31
31
|
if (session.metadata?.yuri?.scheduledTaskSkill?.hostOrigin !== hostOrigin) return res.status(403).json({ error: 'Session is not bound to this Host' });
|
|
32
32
|
if (operation === 'describe') return res.json({ supported: true,
|
|
33
33
|
inputs: { setup: '{sshCommand, nickname?} or {id}', pair: '{id?, relayUrl?, label?}; omitted id means this local desktop', list: '{}' },
|
|
34
|
+
installation: 'New Linux SSH connections use the matching self-contained release (x64/arm64, glibc 2.36+), without system Node/npm/Python/compiler. Existing saved installation choices and macOS keep their package-manager path.',
|
|
34
35
|
completion: 'setup starts asynchronous SSH installation and config sync. Poll list until running=false; phase=ready alone does not confirm sync or Magpie gateway. Warnings mean partial completion.',
|
|
35
36
|
});
|
|
36
37
|
return res.json(await adapter[operation](input));
|
|
@@ -5,6 +5,23 @@ import { registerRemoteConnectionsSkill, REMOTE_CONNECTIONS_SKILL_PATH } from '.
|
|
|
5
5
|
|
|
6
6
|
describe('remote connection bridge availability', () => {
|
|
7
7
|
const auth = { Authorization: `Basic ${Buffer.from('opencode:fixture').toString('base64')}` };
|
|
8
|
+
it('describes self-contained Linux setup through the admitted session bridge', async () => {
|
|
9
|
+
const app = express();
|
|
10
|
+
const server = app.listen(0, '127.0.0.1');
|
|
11
|
+
await new Promise((resolve) => server.once('listening', resolve));
|
|
12
|
+
const origin = `http://127.0.0.1:${server.address().port}`;
|
|
13
|
+
registerRemoteConnectionsSkill(app, { express, adapter: {},
|
|
14
|
+
getIsSharedOpenCodeService: () => true, getOpenCodeAuthHeaders: () => auth,
|
|
15
|
+
createClient: () => ({ session: { get: async () => ({ metadata: { yuri: { scheduledTaskSkill: { hostOrigin: origin } } } }) } }),
|
|
16
|
+
});
|
|
17
|
+
try {
|
|
18
|
+
const response = await request(server).post(REMOTE_CONNECTIONS_SKILL_PATH).set(auth)
|
|
19
|
+
.send({ sessionID: 'ses_one', operation: 'describe' });
|
|
20
|
+
expect(response.status).toBe(200);
|
|
21
|
+
expect(response.body.installation).toContain('self-contained release');
|
|
22
|
+
expect(response.body.installation).toContain('without system Node/npm/Python/compiler');
|
|
23
|
+
} finally { await new Promise((resolve) => server.close(resolve)); }
|
|
24
|
+
});
|
|
8
25
|
it.each([true, false])('has no native capability outside a shared desktop: shared=%s', async (shared) => {
|
|
9
26
|
const app = express();
|
|
10
27
|
const createClient = vi.fn();
|
|
@@ -62,6 +62,11 @@ describe('built-in customization instructions', () => {
|
|
|
62
62
|
expect(bound).toContain('Bound local desktop helper:');
|
|
63
63
|
expect(await fs.readFile(path.join(path.dirname(boundFile), 'references', 'projects.md'), 'utf8')).toBe(projects);
|
|
64
64
|
expect(await fs.readFile(path.join(path.dirname(boundFile), 'remote-connections.mjs'), 'utf8')).toContain('/api/yuri/session-skills/remote-connections');
|
|
65
|
+
const connections = await fs.readFile(path.join(path.dirname(boundFile), 'references', 'remote-connections.md'), 'utf8');
|
|
66
|
+
expect(connections).toContain('matching self-contained release');
|
|
67
|
+
expect(connections).toContain('not Node/npm/Python or build tools');
|
|
68
|
+
expect(connections).toContain('system Node and shell profiles unchanged');
|
|
69
|
+
expect(connections).toContain('Portable `yuri update` and HTTP self-update report unsupported');
|
|
65
70
|
expect(await fs.readFile(path.join(path.dirname(boundFile), 'session-skill-command.mjs'), 'utf8')).toContain('sessionSkillCommand');
|
|
66
71
|
await install(client, 'ses_project', { projectBinding: binding });
|
|
67
72
|
const projectEntry = put.mock.calls[3][0].value;
|
|
@@ -11,6 +11,8 @@ A helper result with `terminal:true` ends the workflow immediately. HTTP 401/403
|
|
|
11
11
|
3. Start each target independently, then poll `list` until every requested instance has `running:false`. Setup saves/reuses the instance, installs or aligns the managed Yuri/OpenCode runtime, establishes SSH forwarding and pushes configuration. A repeated active setup shares the same target operation. A failed target does not cancel the others.
|
|
12
12
|
4. Report each target separately: `phase:ready` confirms SSH/service readiness, `sync:complete` confirms transfer, and `magpie:ready` confirms gateway health. Warnings and failed/missing checks mean partial completion, not success. Authentication/host-key interaction uses the existing native prompt where available; otherwise the user must prepare their SSH key/agent or saved settings. Keep the other targets progressing.
|
|
13
13
|
|
|
14
|
+
New managed Linux connections download the desktop's matching self-contained release (x64/arm64, glibc 2.36+). It includes private Node, precompiled native modules and OpenCode; the target needs bash, curl or wget, tar and a SHA-256 utility, not Node/npm/Python or build tools. Setup verifies the package before activation and keeps system Node and shell profiles unchanged. Existing saved npm/bun choices and macOS targets retain their package-manager path. Unsupported systems and failed downloads/preflight remain explicit failures, not a request to install a compiler.
|
|
15
|
+
|
|
14
16
|
If the user also requested a project on that machine, continue with [remote project registration](projects.md#connected-remote-projects-and-sessions) through the separately bound project helper. Rediscover the authenticated target with `remote-hosts` after setup; an SSH readiness receipt alone does not register a project or supply its Hub/Host/instance identity.
|
|
15
17
|
|
|
16
18
|
The local Host is the configuration source, regardless of other windows' selected runtimes. If Magpie is **installed**, setup selects its native configuration/authorization transfer when available, provisions the remote headless CLI and verifies its server gateway. An installed but unconfigured source reports `magpie_source_not_configured`; it does not silently switch to a different credential source. Without Magpie, setup uses OpenCode's credential API. Local-path/file plugins are filtered from SSH configuration copies; registry plugins remain.
|
|
@@ -24,6 +26,7 @@ For managed SSH connections, report these checks separately. Use the bound helpe
|
|
|
24
26
|
- **Reconnect:** retry the saved instance ID after disconnecting, and again after restarting the desktop. Each attempt must finish with `running:false` and `phase:ready`; open that remote workspace and verify an authenticated operation against its OpenCode service. A prior ready receipt or a standalone web server's health response does not establish this result.
|
|
25
27
|
- **Runtime readiness:** the executable selected by managed SSH startup must load its server dependencies, load native modules in the selected runtime, and reach authenticated service readiness. A CLI version response or successful package installation alone is insufficient. Record the actual runtime/package versions when available; otherwise mark that evidence unavailable.
|
|
26
28
|
- **Update:** when a different target version is available, reconnect through the normal managed entry. Verify that version alignment completes, the running remote Host reports the target version, and its workspace remains usable. Disconnect and reconnect once more to confirm the updated installation is selected again. Record the before/target/running versions; without a version transition, report update acceptance as unverified.
|
|
29
|
+
- **Portable update:** managed reconnect owns release alignment through the stable launcher. Old release files remain available; download/checksum/preflight failure does not activate the candidate. Portable `yuri update` and HTTP self-update report unsupported; use normal managed reconnect rather than an npm workaround.
|
|
27
30
|
- **Installation ownership:** the executable used on subsequent connections must resolve to the installation that the managed updater replaces. A manually deployed checkout, wrapper or redirected executable requires evidence that an update replaces the selected installation and the next connection uses it; successful startup alone does not prove updateability.
|
|
28
31
|
|
|
29
32
|
Report connection, runtime and update evidence independently from configuration-sync and gateway receipts. If an update or startup fails, report its failed stage and retain the saved instance for retry; success requires a subsequent normal managed connection to reach readiness. These are acceptance criteria, not authorization to rewrite runtime files, executable links or credentials outside the supported setup flow.
|
|
@@ -75,6 +75,11 @@ unsupported or fail preflight without stopping the Host. Use their installation
|
|
|
75
75
|
or service manager instead. Other data scopes sharing one global installation
|
|
76
76
|
must be administratively drained; the installation lock prevents competing
|
|
77
77
|
remote helpers but does not coordinate arbitrary external package managers.
|
|
78
|
+
A self-contained Linux release reports
|
|
79
|
+
`portable_installation_requires_release` without probing a package manager.
|
|
80
|
+
Stop it and use its bundled release installer, or reconnect through an updated
|
|
81
|
+
desktop for SSH version alignment. Neither HTTP updates nor `yuri update` may
|
|
82
|
+
fall back to installing a global npm copy.
|
|
78
83
|
A helper killed before its `finally` cleanup leaves an installation lock in the
|
|
79
84
|
user cache; an operator must verify no helper remains before removing that lock.
|
|
80
85
|
Workers deliberately do not race to reap presumed stale locks.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fork } from 'node:child_process';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
4
5
|
import { discoverCliRelease } from './releases.js';
|
|
5
6
|
|
|
6
7
|
const workerFile = fileURLToPath(new URL('./cli-worker.js', import.meta.url));
|
|
@@ -22,13 +23,14 @@ function startWorker(message, detached = false) {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export function createCliUpdateAdapter({ packageRoot, dataDir, getPort, shutdown, currentVersion, env = process.env }) {
|
|
25
|
-
const
|
|
26
|
+
const portable = existsSync(path.join(packageRoot, '..', 'portable.json'));
|
|
27
|
+
const unsupported = portable || process.platform === 'win32' || !packageRoot.replaceAll('\\', '/').includes('/node_modules/')
|
|
26
28
|
|| existsSync('/.dockerenv') || env.CONTAINER || env.container || env.INVOCATION_ID || env.PM2_HOME;
|
|
27
29
|
const configuration = () => ({ packageRoot, dataDir, port: getPort(), pid: process.pid });
|
|
28
30
|
let checkedAt = 0;
|
|
29
31
|
const adapter = {
|
|
30
32
|
host: 'cli', external: true, supported: !unsupported,
|
|
31
|
-
reason: unsupported ? 'managed_or_development_installation' : null,
|
|
33
|
+
reason: portable ? 'portable_installation_requires_release' : unsupported ? 'managed_or_development_installation' : null,
|
|
32
34
|
inspect: (channel) => discoverCliRelease(channel, currentVersion),
|
|
33
35
|
async refreshSupport() {
|
|
34
36
|
if (unsupported || Date.now() - checkedAt < 60_000) return;
|
|
@@ -37,6 +39,7 @@ export function createCliUpdateAdapter({ packageRoot, dataDir, getPort, shutdown
|
|
|
37
39
|
checkedAt = Date.now();
|
|
38
40
|
},
|
|
39
41
|
async assertReady() {
|
|
42
|
+
if (unsupported) throw new Error('This installation must be updated through its installer or service manager');
|
|
40
43
|
const { child, ready } = startWorker({ mode: 'probe', ...configuration() });
|
|
41
44
|
try { await ready; } finally { if (child.connected) child.disconnect(); child.unref(); }
|
|
42
45
|
},
|
|
@@ -2,13 +2,14 @@ import { EventEmitter } from 'node:events';
|
|
|
2
2
|
import { beforeEach, expect, it, vi } from 'vitest';
|
|
3
3
|
import { createCliUpdateAdapter } from './cli.js';
|
|
4
4
|
|
|
5
|
-
const fixture = vi.hoisted(() => ({ fork: vi.fn(), inspect: vi.fn(), reject: false, children: [] }));
|
|
5
|
+
const fixture = vi.hoisted(() => ({ fork: vi.fn(), inspect: vi.fn(), reject: false, children: [], portable: false }));
|
|
6
6
|
vi.mock('node:child_process', () => ({ fork: (...args) => fixture.fork(...args) }));
|
|
7
|
-
vi.mock('node:fs', () => ({ existsSync: () =>
|
|
7
|
+
vi.mock('node:fs', () => ({ existsSync: (file) => fixture.portable && file.endsWith('/portable.json') }));
|
|
8
8
|
vi.mock('./releases.js', () => ({ discoverCliRelease: (...args) => fixture.inspect(...args) }));
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
11
|
fixture.reject = false; fixture.children = []; fixture.inspect.mockReset(); fixture.fork.mockReset();
|
|
12
|
+
fixture.portable = false;
|
|
12
13
|
fixture.fork.mockImplementation(() => {
|
|
13
14
|
const child = Object.assign(new EventEmitter(), {
|
|
14
15
|
connected: true, unref: vi.fn(), kill: vi.fn(), disconnect: vi.fn(), send: vi.fn(),
|
|
@@ -57,3 +58,15 @@ it('advertises development and externally supervised installations as unsupporte
|
|
|
57
58
|
expect(host.supported).toBe(false);
|
|
58
59
|
expect(fixture.fork).not.toHaveBeenCalled();
|
|
59
60
|
});
|
|
61
|
+
|
|
62
|
+
it('advertises portable installs as unsupported without package-manager probes or shutdown', async () => {
|
|
63
|
+
fixture.portable = true;
|
|
64
|
+
const shutdown = vi.fn();
|
|
65
|
+
const host = adapter(shutdown);
|
|
66
|
+
expect(host.supported).toBe(false);
|
|
67
|
+
expect(host.reason).toBe('portable_installation_requires_release');
|
|
68
|
+
await host.refreshSupport();
|
|
69
|
+
await expect(host.assertReady()).rejects.toThrow('installer');
|
|
70
|
+
expect(fixture.fork).not.toHaveBeenCalled();
|
|
71
|
+
expect(shutdown).not.toHaveBeenCalled();
|
|
72
|
+
});
|
|
@@ -81,7 +81,7 @@ encoding, not removed V1 endpoints.
|
|
|
81
81
|
- `packages/web/server/lib/opencode/v1-migration-gate.js`: pure V1→v2 migration admission gate (`GET /api/experimental/migration/v1` → whether transcript may be fetched).
|
|
82
82
|
- `packages/web/server/lib/opencode/managed-capabilities-runtime.js`: managed-child scheduled-task resources, config injection, rotating bridge identity, and bridge authorization.
|
|
83
83
|
- `packages/web/server/lib/opencode/env-runtime.js`: OpenCode CLI/binary resolution and shell environment runtime.
|
|
84
|
-
- `packages/web/server/lib/opencode/ensure-cli.js`: detect local `opencode` version and install the latest stable official V2 into the Yuri data dir when no usable CLI exists. Registry lookup failures remain errors; verified cached installations can be reused offline.
|
|
84
|
+
- `packages/web/server/lib/opencode/ensure-cli.js`: detect local `opencode` version and install the latest stable official V2 into the Yuri data dir when no usable CLI exists. Registry lookup failures remain errors; verified cached installations can be reused offline. The self-contained Linux launcher's PATH supplies its native OpenCode as an ordinary discovered CLI; explicit settings/environment selection still wins.
|
|
85
85
|
- `packages/web/server/lib/opencode/upgrade-screen.js`: startup gate for the running OpenCode below `2.0.20`. Client/schema dependencies accept compatible 2.x updates; fresh installations and required upgrades resolve latest stable 2.x at installation time. The compatible execution floor is independently `2.0.20` (credential API). An unreadable running version is unavailable even when the local CLI is compatible. `POST /api/opencode/install-required` upgrades the selected shared global CLI in place; other supported local installations use the owned-cache installer. Global upgrades do not persist a binary override, so subsequent launches still follow shell discovery. Success requires the running service to meet both the floor and selected target. External services are not replaced; compatible newer shared services are not automatically downgraded. Failure restores binary selection and reports `upgraded: false`, without claiming process or package-manager rollback.
|
|
86
86
|
- `packages/web/server/lib/opencode/env-config.js`: OpenCode-related environment variable parsing and validation (host/port/hostname).
|
|
87
87
|
- `packages/web/server/lib/opencode/hmr-state-runtime.js`: HMR-persistent runtime state initialization, auth-state bootstrap, and HMR sync helpers.
|
|
@@ -4,6 +4,7 @@ import fs from 'fs';
|
|
|
4
4
|
import os from 'os';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
|
+
import { readPortableInstallation, portableUpdateError } from './portable-installation.js';
|
|
7
8
|
|
|
8
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
10
|
const __dirname = path.dirname(__filename);
|
|
@@ -401,6 +402,17 @@ export function detectPackageManagerDetails() {
|
|
|
401
402
|
};
|
|
402
403
|
}
|
|
403
404
|
|
|
405
|
+
const portable = readPortableInstallation();
|
|
406
|
+
if (portable) {
|
|
407
|
+
return {
|
|
408
|
+
packageManager: 'portable',
|
|
409
|
+
reason: 'self-contained-bundle',
|
|
410
|
+
packagePath: getCurrentPackagePath(),
|
|
411
|
+
packageManagerCommand: null,
|
|
412
|
+
globalNodeModulesRoot: null,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
404
416
|
if (cachedDetectedPm) {
|
|
405
417
|
return {
|
|
406
418
|
packageManager: cachedDetectedPm,
|
|
@@ -660,6 +672,8 @@ function isPackageInstalledWith(pm) {
|
|
|
660
672
|
* Get the update command for the detected package manager
|
|
661
673
|
*/
|
|
662
674
|
export function getUpdateCommand(pm = detectPackageManager()) {
|
|
675
|
+
const portable = readPortableInstallation();
|
|
676
|
+
if (portable || pm === 'portable') throw portableUpdateError(portable?.root || path.resolve(__dirname, '../../..'));
|
|
663
677
|
const pmCommand = quoteCommand(resolvePackageManagerCommand(pm));
|
|
664
678
|
switch (pm) {
|
|
665
679
|
case 'pnpm':
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
2
3
|
|
|
3
4
|
// Mock child_process to prevent real spawnSync calls that would hang in tests
|
|
4
5
|
vi.mock('node:child_process', () => ({
|
|
@@ -395,6 +396,12 @@ describe('getCurrentVersion', () => {
|
|
|
395
396
|
});
|
|
396
397
|
|
|
397
398
|
describe('CLI update exports', () => {
|
|
399
|
+
it('never falls back to a shell package manager for portable installations', () => {
|
|
400
|
+
const before = spawnSync.mock.calls.length;
|
|
401
|
+
expect(() => executeUpdate('portable', { silent: true })).toThrow('self-contained Yuri installation');
|
|
402
|
+
expect(spawnSync.mock.calls.length).toBe(before);
|
|
403
|
+
});
|
|
404
|
+
|
|
398
405
|
it('exports package-manager helpers used by the update command', () => {
|
|
399
406
|
expect(typeof detectPackageManager).toBe('function');
|
|
400
407
|
expect(typeof executeUpdate).toBe('function');
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
export function readPortableInstallation(packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..')) {
|
|
6
|
+
const root = path.dirname(packageRoot);
|
|
7
|
+
const marker = path.join(root, 'portable.json');
|
|
8
|
+
if (!fs.existsSync(marker)) return null;
|
|
9
|
+
const manifest = JSON.parse(fs.readFileSync(marker, 'utf8'));
|
|
10
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
11
|
+
if (path.basename(packageRoot) !== 'lib' || manifest.format !== 1 || pkg.name !== '@yuriai/web'
|
|
12
|
+
|| manifest.version !== pkg.version || manifest.platform !== process.platform || manifest.arch !== process.arch) {
|
|
13
|
+
throw new Error('Invalid Yuri portable installation; reinstall the matching Linux release');
|
|
14
|
+
}
|
|
15
|
+
let launcher = path.join(root, 'yuri');
|
|
16
|
+
if (path.basename(path.dirname(root)) === 'versions') {
|
|
17
|
+
const current = path.join(root, '../..', 'current');
|
|
18
|
+
if (fs.existsSync(current) && fs.realpathSync(current) === fs.realpathSync(root)) {
|
|
19
|
+
launcher = path.join(current, 'yuri');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return { root, manifest, launcher };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function portableUpdateError(root) {
|
|
26
|
+
const quote = (value) => `'${value.replace(/'/g, "'\\''")}'`;
|
|
27
|
+
const target = path.basename(path.dirname(root)) === 'versions'
|
|
28
|
+
? ` --install-dir ${quote(path.resolve(root, '../..'))} --no-link` : '';
|
|
29
|
+
return new Error(
|
|
30
|
+
`This is a self-contained Yuri installation, not an npm package. ` +
|
|
31
|
+
`Stop its running servers, then run: bash ${quote(path.join(root, 'install.sh'))} --version <version>${target}. ` +
|
|
32
|
+
'SSH-managed installations are updated when reconnecting from Yuri Desktop.'
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { afterEach, expect, it } from 'vitest';
|
|
5
|
+
import { readPortableInstallation } from './portable-installation.js';
|
|
6
|
+
|
|
7
|
+
const directories = [];
|
|
8
|
+
afterEach(() => { for (const root of directories.splice(0)) fs.rmSync(root, { recursive: true, force: true }); });
|
|
9
|
+
|
|
10
|
+
it('recognizes only a valid sibling manifest and never infers ownership from environment', () => {
|
|
11
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'yuri-portable-owner-'));
|
|
12
|
+
directories.push(root);
|
|
13
|
+
const lib = path.join(root, 'lib');
|
|
14
|
+
fs.mkdirSync(lib);
|
|
15
|
+
fs.writeFileSync(path.join(lib, 'package.json'), JSON.stringify({ name: '@yuriai/web', version: '1.2.3' }));
|
|
16
|
+
expect(readPortableInstallation(lib)).toBeNull();
|
|
17
|
+
fs.writeFileSync(path.join(root, 'portable.json'), JSON.stringify({
|
|
18
|
+
format: 1, version: '1.2.3', platform: process.platform, arch: process.arch,
|
|
19
|
+
}));
|
|
20
|
+
expect(readPortableInstallation(lib)).toMatchObject({ root, manifest: { version: '1.2.3' } });
|
|
21
|
+
fs.writeFileSync(path.join(root, 'portable.json'), '{"format":1,"version":"9.9.9"}');
|
|
22
|
+
expect(() => readPortableInstallation(lib)).toThrow('Invalid Yuri portable installation');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('uses the installer current symlink for startup without guessing a stable entry for manual archives', () => {
|
|
26
|
+
const install = fs.mkdtempSync(path.join(os.tmpdir(), 'yuri-portable-stable-'));
|
|
27
|
+
directories.push(install);
|
|
28
|
+
const root = path.join(install, 'versions/1.2.3-linux-x64');
|
|
29
|
+
const lib = path.join(root, 'lib');
|
|
30
|
+
fs.mkdirSync(lib, { recursive: true });
|
|
31
|
+
fs.writeFileSync(path.join(lib, 'package.json'), JSON.stringify({ name: '@yuriai/web', version: '1.2.3' }));
|
|
32
|
+
fs.writeFileSync(path.join(root, 'portable.json'), JSON.stringify({
|
|
33
|
+
format: 1, version: '1.2.3', platform: process.platform, arch: process.arch,
|
|
34
|
+
}));
|
|
35
|
+
expect(readPortableInstallation(lib).launcher).toBe(path.join(root, 'yuri'));
|
|
36
|
+
fs.symlinkSync('versions/1.2.3-linux-x64', path.join(install, 'current'));
|
|
37
|
+
expect(readPortableInstallation(lib).launcher).toBe(path.join(install, 'current/yuri'));
|
|
38
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.yuri-picker-backdrop{transition-duration:.18s}@media (prefers-reduced-motion:reduce){.yuri-picker-backdrop{transition-duration:0s}}.yuri-picker-dialog{--yuri-picker-header-end-inset:1.5rem;max-height:min(42rem,80dvh)}.yuri-picker-dialog:has(>[data-slot=dialog-close]){--yuri-picker-header-end-inset:3rem}.yuri-picker-dialog .yuri-picker-header{padding:calc(1rem * var(--padding-scale,1)) var(--yuri-picker-header-end-inset) calc(.5rem * var(--padding-scale,1)) calc(1.5rem * var(--padding-scale,1));text-align:left;flex-shrink:0}.yuri-picker-dialog .yuri-picker-title{min-width:0;font-size:calc(13 * var(--dpt));font-weight:500;line-height:calc(20 * var(--dpt))}.yuri-picker-dialog .yuri-picker-search{margin:0 calc(1.5rem * var(--padding-scale,1)) calc(.5rem * var(--padding-scale,1));flex-shrink:0}.yuri-picker-dialog .yuri-picker-search [data-slot=input]{height:calc(2.5rem * var(--padding-scale,1));box-shadow:none;font-size:calc(14 * var(--dpt));line-height:calc(20 * var(--dpt));background:0 0}.yuri-picker-dialog .yuri-picker-search:has(svg) [data-slot=input]{padding-left:calc(1.5rem * var(--padding-scale,1));padding-right:0}.yuri-picker-dialog .yuri-picker-search>svg,.yuri-picker-dialog .yuri-picker-search>.relative>svg{left:0}.yuri-picker-dialog .yuri-picker-search:focus-within{box-shadow:inset 0 -1px 0 var(--interactive-border)}.yuri-picker-dialog .yuri-picker-list{overscroll-behavior:contain;min-height:0;padding:calc(.25rem * var(--padding-scale,1)) calc(.5rem * var(--padding-scale,1)) calc(.75rem * var(--padding-scale,1));flex:1;overflow-y:auto}.yuri-picker-dialog .yuri-picker-row{min-width:0;min-height:calc(2.25rem * var(--padding-scale,1));padding:calc(.5rem * var(--padding-scale,1)) calc(1rem * var(--padding-scale,1));border:0;border-radius:.5rem}.yuri-picker-dialog .yuri-picker-row+.yuri-picker-row{margin-top:calc(.125rem * var(--padding-scale,1))}.yuri-picker-dialog .yuri-picker-label{font-size:calc(13 * var(--dpt));font-weight:400;line-height:calc(20 * var(--dpt))}.yuri-picker-dialog .yuri-picker-meta{font-size:calc(11 * var(--dpt));font-weight:400;line-height:calc(17 * var(--dpt))}.yuri-picker-dialog .yuri-picker-empty{padding:calc(2.5rem * var(--padding-scale,1)) calc(1rem * var(--padding-scale,1));font-size:calc(12 * var(--dpt));line-height:calc(20 * var(--dpt));border:0}.yuri-picker-dialog .yuri-picker-footer{padding:calc(.25rem * var(--padding-scale,1)) calc(1.5rem * var(--padding-scale,1)) calc(1rem * var(--padding-scale,1));flex-shrink:0}.yuri-picker-dialog .yuri-picker-section+.yuri-picker-section{margin-top:calc(.75rem * var(--padding-scale,1))}.yuri-picker-dialog .yuri-picker-section-title{padding:0 calc(1rem * var(--padding-scale,1)) calc(.25rem * var(--padding-scale,1));font-size:calc(11 * var(--dpt));font-weight:400;line-height:calc(17 * var(--dpt))}.yuri-picker-dialog .yuri-picker-form{margin:0 calc(1.5rem * var(--padding-scale,1)) calc(.75rem * var(--padding-scale,1));flex-shrink:0}.yuri-picker-dialog .yuri-picker-rows>.yuri-picker-row{margin-block:0}.yuri-picker-dialog .yuri-picker-rows>.yuri-picker-row+.yuri-picker-row{margin-top:calc(.125rem * var(--padding-scale,1))}.yuri-picker-dialog .yuri-help-shortcut-row{align-items:center;gap:calc(1rem * var(--padding-scale,1));grid-template-columns:minmax(0,1fr) minmax(0,45%);display:grid}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderElectronMiniChatApp-D3Vd8ffe.js","assets/rolldown-runtime-hePW80VL.js","assets/platform-CNdx57HN.js","assets/runtime-auth-DA-qfGHk.js","assets/runtime-switch-DEPKHgdL.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-base-ui-wXsskyKm.js","assets/gitApiHttp-C8AU1uiY.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/vendor-zustand-CTekDqaS.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/safeStorage-DTOhKN0V.js","assets/client-QcYZg8_d.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/prompt-attachment-upload-D1c308Ba.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/useUIStore-P32bzAJc.js","assets/useMobileHtmlPreviewStore-BYunNOBo.js","assets/uuid-D-SDZijH.js","assets/vendor-sonner-DX3nfJx4.js","assets/ui-z2JsXLmb.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/remoteProjectQueries-BunVM5PM.js","assets/i18n-BU8XOKjS.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-DWS9gJPW.js","assets/tour-CMXP3Kif.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/input-store-PqhVEhUI.js","assets/toolHelpers-iEHVHQ9p.js","assets/useAssistantUIStore-DEiMjSqf.js","assets/Icon-CMNOrIAp.js","assets/tooltip-DYZonA8U.js","assets/useGitStore-Dsh_ZiT1.js","assets/MarkdownRenderer-CckbVkti.js","assets/useEffectiveDirectory-hu13SCnK.js","assets/markdownHeightCache-BsFEgT5Y.js","assets/dualLimitLru-D8Sphgua.js","assets/imageSource-B39pFDdo.js","assets/shortcuts-2XAaIaaK.js","assets/assistantQueries-BLm65-22.js","assets/assistantPresentation-DRbsH1Ej.js","assets/useAppFontEffects-tKUtvOIn.js","assets/desktopHosts-DFa3lf0i.js","assets/desktopRelayRestore-CGq-Ylgq.js","assets/dialog-BPtWiCtF.js","assets/dialog-D9CkSNCA.css","assets/useThemeSystem-BIXghnHj.js","assets/react-CPBNl-S9.js","assets/device-CtdJ8KBJ.js","assets/themes-BgDJcxRc.js","assets/gitApi-CwF3k_rj.js","assets/input-DHQ_HUNG.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/checkbox-CK288doZ.js","assets/pwa-FAC1qERc.js","assets/YuriLogo-CnV3RxpE.js","assets/ErrorBoundary-B4CbFTTY.js","assets/card-Csh0Af72.js","assets/contextPanelEmbeddedChat-Dm5R_b5X.js","assets/theme-validation-BGYdrOu7.js","assets/BusyDots-CU41Xq9E.js","assets/spacedFileMention-Ds4GtgiF.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/ScrollableOverlay-T7ADHNbV.js","assets/OverlayScrollbar-Dsj-t--1.js","assets/MobileResizableSheet-Ddf0s-Dp.js","assets/vendor-framer-motion-D5NyyC73.js","assets/MobileWindowStack-DGLdgoGr.js","assets/dropdown-menu-BWP9Nxwt.js","assets/dropdown-menu.styles-BDla58Rm.js","assets/useProjectRuntimeAPIs-BpdOaT67.js","assets/terminalApi-D2ECmoAo.js","assets/useProjectGitStore-C1Tswys-.js","assets/useDebouncedValue-BHlMPqY8.js","assets/MobileOverlayPanel-dc8EKqfh.js","assets/githubAuthQueries-IJPWBo0B.js","assets/worktreeManager-DIrqBI6K.js","assets/worktreeSourceBranchPreference-DncAXqYk.js","assets/remote-input-store-CquhCIoR.js","assets/vendor-cmdk-BDWoZLve.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-BsjgK90l.js","assets/vendor-dnd-kit-core-qy5stxu5.js","assets/vendor-dnd-kit-accessibility-u0XSXxKq.js","assets/vendor-dnd-kit-sortable-CiTIuX4o.js","assets/auto-read-context-eOYxlJjR.js","assets/audio-session-BFWjrDbp.js","assets/browserVoiceService-x5Pci8L3.js","assets/queue-abort-optimistic-s-DVErY6.js","assets/fileMentionAutocompleteState-B9411b4o.js","assets/vendor-fuzzysort-ukaRp9PC.js","assets/useFontPreferences-BY0TXvWI.js","assets/speechSettingsQueries-cQ6M7fJ3.js","assets/ChatContainer-DXRL0aB2.js","assets/vendor-pierre-diffs-B0OmIhMO.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/mobileAppContext-BQgdTp5T.js","assets/vendor-tanstack-react-virtual-qsd3nvZb.js","assets/useInlineCommentDraftStore-C75YIRui.js","assets/truncated-path-DJfRXALm.js","assets/kbd-CVXHcAl2.js","assets/appThemeRegistry-BdjrGBQ4.js","assets/agentColors-DWSbQXy2.js","assets/mobileBackNavigation-Cpb7IiCG.js","assets/rasterizePng-056Poix7.js","assets/ImageLoadingPlaceholder-FqoECDc5.js","assets/image-loading-DA9JEHD8.css","assets/LoadingImage-U4z75PsW.js","assets/SessionSurfaceContext-BP4NCKp6.js","assets/TextSelectionMenu-CZWUVT4Q.js","assets/useSessionBtwStore-PdQPx7tm.js","assets/nativeComposerCover-Btj57e5V.js","assets/AgentAvatar-C_s-cMy0.js","assets/vendor-dicebear-core-CV95S5Pg.js","assets/vendor-dicebear-styles-C4OfoX7R.js","assets/connection-hint-BboPqLXQ.js","assets/chatUpwardIntent-CivAb4ux.js","assets/textarea-DXs25Z8k.js","assets/fileMentionTouchSelection-3GZYNOSd.js","assets/insertionBoundaries-6VDrFW8E.js","assets/ModelLogo-Bb63bM4S.js","assets/zhipuai-coding-plan-CcFj8zKy.js","assets/useDictation-CUADIj-o.js","assets/BtwPanel-BvqTaKLQ.js","assets/inlineMessageLinks-DC78iKO5.js","assets/vendor-motion-vLNN8EMu.js","assets/vendor-marked-S3gCOYp1.js","assets/timeFormat-CUbYRR40.js","assets/reference-history-B9H6MkUC.js","assets/reference-history-8C8nv-EP.css","assets/useModelLists-DrXScJk8.js","assets/ProviderLogo-pBVtlU5X.js","assets/useOpenCodeReadiness-DLqT6fD5.js","assets/ToolOutputDialog-DLxoc22s.js","assets/runtime-file-download-wMVtKk2v.js","assets/tap-LkQum5bB.js","assets/markdownTheme-D84XyNiT.js","assets/markdown-worker-oBGEB9Eg.js","assets/DiffViewToggle-BBxj5Yby.js","assets/touch-gestures-DOoBxhz5.js","assets/select-BL02HQzN.js","assets/projectMeta-vIaGFaQr.js","assets/permission-rules-DoQUXKll.js","assets/FadeInOnReveal-C2UMs63r.js","assets/useStreamingTextThrottle-Btl31Wol.js","assets/ChatContainer-K31q-1OV.css","assets/useDesktopWindowControlsLayout-CNAzDasQ.js","assets/quota-BEyQ6n-w.js","assets/sessionChangeSummary-BCF9VwAA.js","assets/openRemoteProjectSession-BFp0YlF-.js","assets/AssistantConversationSurface-BOsGik2U.js","assets/MobileShareBridge-DIIhDUmO.js","assets/mobileConnections-5xypkCyd.js","assets/MobileDetailNavigation-BncgS1Gb.js","assets/assistant-attachment-cache-Y7yhlQcv.js","assets/AssistantWorkingAvatar-Bp1KXuhO.js","assets/AssistantSessionCard-DFi6eIIE.js","assets/sessionLookup-CLqpm_Sq.js","assets/scheduledTaskNavigation-DpfZSGu8.js","assets/router-DXUi1sBd.js","assets/AssistantConversationSurface-B59k-lXE.css","assets/src-DYCPWwUH.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import"./modulepreload-polyfill-P2Xu9kJm.js";import{o as e}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t}from"./runtimeConfig-8Z7A5ncj.js";/* empty css */window.__YURI_RUNTIME_APIS__=t(),e(async()=>{let{renderElectronMiniChatApp:e}=await import(`./renderElectronMiniChatApp-D3Vd8ffe.js`);return{renderElectronMiniChatApp:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188])).then(({renderElectronMiniChatApp:e})=>{e(window.__YURI_RUNTIME_APIS__??t())});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/assistant-attachment-cache-Y7yhlQcv.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-auth-DA-qfGHk.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/runtime-file-resource-DKJJoOOc.js","assets/platform-CNdx57HN.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-base-ui-wXsskyKm.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"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,l as n}from"./runtime-switch-DEPKHgdL.js";import{n as r}from"./runtime-fetch-V-iMWR8t.js";import{A as i,I as a,d as o,k as s}from"./platform-CNdx57HN.js";import{f as c,s as l,v as u}from"./desktopHosts-DFa3lf0i.js";import{i as d,n as f,r as p}from"./desktopRelayRestore-CGq-Ylgq.js";import{ot as m,st as h}from"./vendor-base-ui-wXsskyKm.js";import{n as g}from"./pathNormalization-ewtPqJWn.js";import{n as _}from"./vendor-react-BkccXcWz.js";import{r as v}from"./vendor-tanstack-query-core-BSjXNgF_.js";import{i as ee,n as te,r as ne,s as re,u as ie}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{G as ae,W as y}from"./runtime-file-resource-DKJJoOOc.js";import{o as b}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{co as x,no as oe,qi as S,t as C}from"./ui-z2JsXLmb.js";import{n as se,t as ce}from"./i18n-BU8XOKjS.js";import{i as le,t as ue}from"./store-DWS9gJPW.js";import{n as de}from"./react-CPBNl-S9.js";import{f as fe,n as w,p as T,s as pe}from"./shortcuts-2XAaIaaK.js";import{i as me,n as he,r as ge,t as _e}from"./vendor-simplewebauthn-browser-Dwhcdg_5.js";var E=_(),D=[`desktopHostSwitch`],O=class extends Error{result;host;constructor(e,t){super(e.reason),this.name=`DesktopHostSwitchError`,this.result=e,this.host=t}},k=(e,t)=>ue(le.getState().dictionary,e,t),ve=async e=>{let{host:t}=e;if(t.id===`local`){if(a()&&!o())return await i(`desktop_switch_to_local`),{ok:!0,via:`direct`,status:{status:`ok`,latencyMs:0}};let r=(e.localApiOrigin||``).trim();if(!r)throw new O({ok:!1,status:{status:`unreachable`,latencyMs:0},reason:`unreachable`},t);return n({apiBaseUrl:r,clientToken:e.localClientToken||null,runtimeKey:p(t)}),{ok:!0,via:`direct`,status:{status:`ok`,latencyMs:0}}}let r=await d(t,{cachedProbe:e.cachedProbe});if(!r.ok)throw new O(r,t);return r},A=null,ye=()=>A||(A=new v(y,{mutationKey:D,mutationFn:ve,onError:(e,t)=>{if(!(e instanceof O)){C.error(k(`desktopHostSwitcher.toast.instanceUnreachable`,{host:u(t.host.label)}),{description:e instanceof Error?e.message:String(e)});return}if(e.result.reason!==`unsupported`){if(e.result.status.status===`auth`){if(c(e.host)){C.error(k(`mobile.connect.pairing.expired`),{description:k(`desktopHostSwitcher.pairing.reconnectHint`),action:{label:k(`settings.remoteInstances.openLocalManager`),onClick:()=>{l().catch(()=>C.error(k(`sessionAuth.error.networkTitle`)))}}});return}C.error(k(`desktopHostSwitcher.status.authRequired`));return}C.error(k(`desktopHostSwitcher.toast.instanceUnreachable`,{host:u(t.host.label)}))}}}),A.subscribe(()=>void 0),A),be=async e=>{if(f(e.host))return{ok:!0,via:`direct`,status:e.cachedProbe?.status===`ok`?e.cachedProbe:{status:`ok`,latencyMs:0}};if(y.isMutating({mutationKey:D})>0)return{ok:!1,status:{status:`unreachable`,latencyMs:0},reason:`unsupported`};try{return await ye().mutate(e)}catch(e){return e instanceof O?e.result:{ok:!1,status:{status:`unreachable`,latencyMs:0},reason:`unreachable`}}},xe=e=>{let t=(0,E.c)(2),n=e!==void 0&&e,r;return t[0]===n?r=t[1]:(r={mutationKey:D,predicate:e=>!n||!e.state.variables?.inlineProgress},t[0]=n,t[1]=r),ne(r)>0},Se=()=>{let e=(0,E.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={filters:{mutationKey:D,status:`pending`},select:Ce},e[0]=t):t=e[0],ee(t)[0]?.host.id??null};function Ce(e){return e.state.variables}var j=e=>typeof e==`object`&&!!e,M=(e,t)=>{let n=e[t];return typeof n==`string`?n:null},N=(e,t)=>{let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:null},P=(e,t)=>{let n=e[t];return typeof n==`boolean`?n:null},F=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],I=()=>s()?(e,t)=>i(e,t):null,L=e=>{if(!j(e))return;let t=P(e,`enabled`)??!1,n=M(e,`store`)?.toLowerCase()===`settings`?`settings`:`never`,r=M(e,`value`);return{enabled:t,store:n,...r?{value:r}:{}}},we=e=>e===`remote`||e===`dynamic`?e:`local`,Te=e=>{if(!j(e))return null;let t=M(e,`id`);if(!t)return null;let n=P(e,`enabled`)??!0,r=we(M(e,`type`)),i=M(e,`localHost`)||M(e,`local_host`)||void 0,a=N(e,`localPort`)??N(e,`local_port`)??void 0,o=M(e,`remoteHost`)||M(e,`remote_host`)||void 0,s=N(e,`remotePort`)??N(e,`remote_port`)??void 0;return{id:t,enabled:n,type:r,...i?{localHost:i}:{},...typeof a==`number`?{localPort:a}:{},...o?{remoteHost:o}:{},...typeof s==`number`?{remotePort:s}:{}}},Ee=e=>{if(!j(e))return null;let t=M(e,`id`),n=M(e,`sshCommand`)||M(e,`ssh_command`);if(!t||!n)return null;let r=M(e,`nickname`),i=e.sshParsed,a=j(i)?{destination:M(i,`destination`)||``,args:F(i.args)}:void 0,o=j(e.remoteYuri)?e.remoteYuri:j(e.remote_yuri)?e.remote_yuri:{},s=j(e.localForward)?e.localForward:j(e.local_forward)?e.local_forward:{},c=j(e.auth)?e.auth:{},l=M(o,`mode`)?.toLowerCase()===`external`?`external`:`managed`,u=M(o,`installMethod`)||M(o,`install_method`),d=u===`npm`||u===`download_release`||u===`upload_bundle`?u:`bun`,f=M(s,`bindHost`)||M(s,`bind_host`)||`127.0.0.1`,p=f===`localhost`||f===`0.0.0.0`?f:`127.0.0.1`,m=(Array.isArray(e.portForwards)?e.portForwards:Array.isArray(e.port_forwards)?e.port_forwards:[]).map(e=>Te(e)).filter(e=>!!e),h=N(o,`preferredPort`)??N(o,`preferred_port`),g=N(s,`preferredLocalPort`)??N(s,`preferred_local_port`),_=L(c.sshPassword||c.ssh_password),v=L(c.yuriPassword||c.yuri_password);return{id:t,...r?{nickname:r}:{},sshCommand:n,...a&&a.destination?{sshParsed:a}:{},connectionTimeoutSec:N(e,`connectionTimeoutSec`)??N(e,`connection_timeout_sec`)??60,remoteYuri:{mode:l,keepRunning:P(o,`keepRunning`)??P(o,`keep_running`)??!0,relayHost:P(o,`relayHost`)??P(o,`relay_host`)??!0,...h?{preferredPort:h}:{},installMethod:d,uploadBundleOverSsh:P(o,`uploadBundleOverSsh`)??P(o,`upload_bundle_over_ssh`)??!1},localForward:{...g?{preferredLocalPort:g}:{},bindHost:p},auth:{..._?{sshPassword:_}:{},...v?{yuriPassword:v}:{}},portForwards:m}},De=e=>{switch(e){case`config_resolved`:case`auth_check`:case`master_connecting`:case`remote_probe`:case`installing`:case`updating`:case`server_detecting`:case`server_starting`:case`forwarding`:case`ready`:case`degraded`:case`error`:return e;default:return`idle`}},R=e=>{if(!j(e))return null;let t=M(e,`id`);return t?{id:t,phase:De(M(e,`phase`)),...M(e,`detail`)?{detail:M(e,`detail`)||void 0}:{},...M(e,`localUrl`)||M(e,`local_url`)?{localUrl:M(e,`localUrl`)||M(e,`local_url`)||void 0}:{},...typeof(N(e,`localPort`)??N(e,`local_port`))==`number`?{localPort:N(e,`localPort`)??N(e,`local_port`)??void 0}:{},...typeof(N(e,`remotePort`)??N(e,`remote_port`))==`number`?{remotePort:N(e,`remotePort`)??N(e,`remote_port`)??void 0}:{},startedByUs:P(e,`startedByUs`)??P(e,`started_by_us`)??!1,retryAttempt:N(e,`retryAttempt`)??N(e,`retry_attempt`)??0,requiresUserAction:P(e,`requiresUserAction`)??P(e,`requires_user_action`)??!1,...M(e,`errorCode`)||M(e,`error_code`)?{errorCode:M(e,`errorCode`)||M(e,`error_code`)||void 0}:{},updatedAtMs:N(e,`updatedAtMs`)??N(e,`updated_at_ms`)??Date.now()}:null},Oe=e=>{if(!j(e))return null;let t=M(e,`host`),n=M(e,`source`),r=M(e,`sshCommand`)||M(e,`ssh_command`);return!t||!n||!r?null:{host:t,source:n,sshCommand:r,pattern:P(e,`pattern`)??!1}},ke=(e,t)=>({id:e,sshCommand:t,connectionTimeoutSec:60,remoteYuri:{mode:`managed`,keepRunning:!0,relayHost:!0,installMethod:`bun`,uploadBundleOverSsh:!1},localForward:{bindHost:`127.0.0.1`},auth:{},portForwards:[]}),Ae=async()=>{let e=I();if(!e)return{instances:[]};let t=await e(`desktop_ssh_instances_get`);return j(t)?{instances:(Array.isArray(t.instances)?t.instances:Array.isArray(t.desktopSshInstances)?t.desktopSshInstances:[]).map(e=>Ee(e)).filter(e=>!!e)}:{instances:[]}},je=async e=>{let t=I();t&&await t(`desktop_ssh_instances_set`,{config:{instances:e.instances}})},Me=async()=>{let e=I();if(!e)return[];let t=await e(`desktop_ssh_import_hosts`);return Array.isArray(t)?t.map(e=>Oe(e)).filter(e=>!!e):[]},Ne=async e=>{let t=I();t&&await t(`desktop_ssh_connect`,{id:e})},Pe=async e=>{let t=I();t&&await t(`desktop_ssh_disconnect`,{id:e})},Fe=async e=>{let t=I();if(!t)return[];let n=await t(`desktop_ssh_status`,{...e?{id:e}:{}});return Array.isArray(n)?n.map(e=>R(e)).filter(e=>!!e):[]},Ie=async(e,t)=>{let n=I();if(!n)return[];let r=await n(`desktop_ssh_logs`,{id:e,...typeof t==`number`?{limit:t}:{}});return Array.isArray(r)?r.filter(e=>typeof e==`string`):[]},Le=async e=>{let t=I();t&&await t(`desktop_ssh_logs_clear`,{id:e})},Re=(e,t)=>{let n=Math.max(0,Math.trunc(Number(e.fileGroups)||0)),r=Math.max(0,Math.trunc(Number(e.singleFiles)||0)),i=Math.max(0,Math.trunc(Number(e.directories)||0));return{fileGroups:Array.from({length:n},()=>!0),singleFiles:Array.from({length:r},()=>!0),directories:Array.from({length:i},()=>!0),agentsRoot:!0,providerCredentials:t?.includeProviderCredentials===!0,magpie:!1}},ze=e=>{if(!j(e))return null;let t=M(e,`path`),n=N(e,`bytes`);return!t||n===null?null:{path:t,bytes:n}},Be=e=>{if(!j(e))return null;let t=M(e,`path`),n=N(e,`fileCount`)??N(e,`file_count`),r=N(e,`bytes`);return!t||n===null||r===null?null:{path:t,fileCount:n,bytes:r}},Ve=e=>{if(e==null||!j(e))return null;let t=N(e,`fileCount`)??N(e,`file_count`),n=N(e,`bytes`);return t===null||n===null?null:{fileCount:t,bytes:n}},z=e=>{if(e==null||!j(e))return null;let t=N(e,`bytes`);return t===null?null:{bytes:t}},He=e=>{if(!j(e))return null;let t=Array.isArray(e.files)?e.files:null,n=Array.isArray(e.directories)?e.directories:null,r=F(e.deletes),i=N(e,`totalBytes`)??N(e,`total_bytes`);if(!t||!n||i===null||!(`agentsRoot`in e)&&!(`agents_root`in e))return null;let a=t.map(e=>ze(e)).filter(e=>!!e),o=n.map(e=>Be(e)).filter(e=>!!e);if(a.length!==t.length||o.length!==n.length)return null;let s=e.agentsRoot??e.agents_root,c=s==null?null:Ve(s);if(s!=null&&c===null||!(`providerCredentials`in e))return null;let l=z(e.providerCredentials);if(e.providerCredentials!==null&&l===null)return null;let u=e.direction===`pull`||e.direction===`push`?e.direction:void 0,d=e.selections,f=j(d)?{fileGroups:Array.isArray(d.fileGroups)?d.fileGroups.map(e=>e!==!1):[],singleFiles:Array.isArray(d.singleFiles)?d.singleFiles.map(e=>e!==!1):[],directories:Array.isArray(d.directories)?d.directories.map(e=>e!==!1):[],agentsRoot:d.agentsRoot!==!1,providerCredentials:d.providerCredentials===!0,magpie:d.magpie===!0}:void 0,p=B(e.selectionShape??e.selection_shape);return{files:a,directories:o,agentsRoot:c,providerCredentials:l,magpieAvailable:e.magpieAvailable===!0,magpie:z(e.magpie),deletes:r,totalBytes:i,...u?{direction:u}:{},...f?{selections:f}:{},...p?{selectionShape:p}:{}}},B=e=>{if(!j(e))return null;let t=N(e,`fileGroups`)??N(e,`file_groups`),n=N(e,`singleFiles`)??N(e,`single_files`),r=N(e,`directories`);return t===null||n===null||r===null||t<0||n<0||r<0?null:{fileGroups:t,singleFiles:n,directories:r}},Ue=e=>{if(!j(e))return null;let t=He(e.plan);if(!t)return null;let n=B(e.selectionShape??e.selection_shape)??t.selectionShape??null;return{plan:t,remoteExisting:F(e.remoteExisting??e.remote_existing),remoteAgentsRootExists:P(e,`remoteAgentsRootExists`)??P(e,`remote_agents_root_exists`)??!1,remoteProviderCredentialsExists:P(e,`remoteProviderCredentialsExists`)??!1,...n?{selectionShape:n}:{}}},We=e=>{if(!j(e)||P(e,`ok`)!==!0)return null;let t=N(e,`files`),n=N(e,`directories`),r=N(e,`deletes`),i=N(e,`totalBytes`)??N(e,`total_bytes`);if(t===null||n===null||r===null||i===null||!(`agentsRoot`in e)&&!(`agents_root`in e))return null;let a=e.agentsRoot??e.agents_root,o=null;if(a!=null){if(!j(a))return null;let e=N(a,`fileCount`)??N(a,`file_count`);if(e===null)return null;o={fileCount:e}}if(!(`providerCredentials`in e))return null;let s=z(e.providerCredentials);if(e.providerCredentials!==null&&s===null)return null;let c=F(e.magpieWarnings).filter(e=>e===`sign_in_required`||e===`plugin_install_failed`||e===`agent_settings_skipped`);return{ok:!0,files:t,directories:n,deletes:r,totalBytes:i,agentsRoot:o,providerCredentials:s,...c.length?{magpieWarnings:c}:{}}},Ge=async(e={})=>{let t=I();if(!t)return console.error(`[desktopSsh] config sync local scan skipped: desktop IPC bridge is unavailable in this window`),null;let n=await t(`desktop_ssh_sync_opencode_config`,{stage:`local`,...e.direction?{direction:e.direction}:{},...e.selections?{selections:e.selections}:{}});if(!j(n))return console.error(`[desktopSsh] config sync local scan returned a non-object payload`,n),null;let r=He(n.plan);if(!r)return console.error(`[desktopSsh] config sync local scan plan payload was not recognized`,n),null;let i=B(n.selectionShape??n.selection_shape)??r.selectionShape??null;return i?{...r,selectionShape:i}:r},Ke=async(e,t={})=>{let n=I();if(!n)return console.error(`[desktopSsh] config sync preview skipped: desktop IPC bridge is unavailable in this window`),null;let r=await n(`desktop_ssh_sync_opencode_config`,{id:e,...t.targetKind?{targetKind:t.targetKind}:{},...t.direction?{direction:t.direction}:{},...t.selections?{selections:t.selections}:{}}),i=Ue(r);return i||console.error(`[desktopSsh] config sync preview payload was not recognized`,r),i},qe=async(e,t={})=>{let n=I();if(!n)return console.error(`[desktopSsh] config sync apply skipped: desktop IPC bridge is unavailable in this window`),null;let r=await n(`desktop_ssh_sync_opencode_config`,{id:e,apply:!0,...t.targetKind?{targetKind:t.targetKind}:{},...t.direction?{direction:t.direction}:{},...t.selections?{selections:t.selections}:{}}),i=We(r);return i||console.error(`[desktopSsh] config sync apply payload was not recognized`,r),i},Je=async e=>{if(!s())return async()=>{};let t=window.__YURI_DESKTOP__?.listen;if(typeof t!=`function`)return async()=>{};let n=await t(`yuri:ssh-instance-status`,t=>{let n=R(t?.payload);n&&e(n)});return async()=>{await n()}},Ye=new Set([`shellStartup`,`configSync`,`nodeRuntimeMissing`,`packageManagerMissing`,`nativeBinding`,`yuriCliMissing`,`yuriRegistry`,`yuriInstall`,`yuriCliIncompatible`,`opencodeInstall`,`serverStart`,`sshAuth`,`sshUnreachable`,`timeout`,`unknown`]),Xe=e=>typeof e==`string`&&Ye.has(e),Ze=e=>{let t=String(e||``);return/shell startup|fresh .* shell|SSH command did not start/i.test(t)?`shellStartup`:/Initial SSH config sync failed/i.test(t)?`configSync`:/requires Node\.js \d+|no supported Node runtime/i.test(t)?`nodeRuntimeMissing`:/neither bun nor npm/i.test(t)?`packageManagerMissing`:/better-sqlite3|node_gyp_bins|gyp ERR|failed to prepare better-sqlite3/i.test(t)?`nativeBinding`:/Yuri installation completed but the executable is unavailable/i.test(t)?`yuriCliMissing`:/could not reach the npm registry|ENOTFOUND|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|CERT_HAS_EXPIRED|UNABLE_TO_GET_ISSUER_CERT|self-signed certificate|registry\.npmjs|npm error code E404|npm ERR! code E404|getaddrinfo/i.test(t)?`yuriRegistry`:/Failed to install Yuri/i.test(t)?`yuriInstall`:/Unknown option:\s*--relay-host|does not advertise --relay-host|does not support --relay-host/i.test(t)||/Unknown option:/i.test(t)?`yuriCliIncompatible`:/Failed to install OpenCode|OpenCode CLI/i.test(t)?`opencodeInstall`:/failed to become reachable|Managed Yuri server failed/i.test(t)?`serverStart`:/Permission denied|Authentication failed|publickey|keyboard-interactive/i.test(t)?`sshAuth`:/Could not resolve hostname|Connection refused|Connection timed out|ControlMaster connection timed out|SSH master process exited|Network is unreachable/i.test(t)?`sshUnreachable`:/Timed out waiting for SSH|Timed out waiting for forwarded/i.test(t)?`timeout`:`unknown`},Qe=(e,t)=>Xe(e)?e:Ze(t),$e=e=>{switch(e){case`shellStartup`:return`desktopHostSwitcher.sshError.shellStartup.title`;case`configSync`:return`desktopHostSwitcher.sshError.configSync.title`;case`nodeRuntimeMissing`:return`desktopHostSwitcher.sshError.nodeRuntimeMissing.title`;case`packageManagerMissing`:return`desktopHostSwitcher.sshError.packageManagerMissing.title`;case`nativeBinding`:return`desktopHostSwitcher.sshError.nativeBinding.title`;case`yuriCliMissing`:return`desktopHostSwitcher.sshError.yuriCliMissing.title`;case`yuriRegistry`:return`desktopHostSwitcher.sshError.yuriRegistry.title`;case`yuriInstall`:return`desktopHostSwitcher.sshError.yuriInstall.title`;case`yuriCliIncompatible`:return`desktopHostSwitcher.sshError.yuriCliIncompatible.title`;case`opencodeInstall`:return`desktopHostSwitcher.sshError.opencodeInstall.title`;case`serverStart`:return`desktopHostSwitcher.sshError.serverStart.title`;case`sshAuth`:return`desktopHostSwitcher.sshError.sshAuth.title`;case`sshUnreachable`:return`desktopHostSwitcher.sshError.sshUnreachable.title`;case`timeout`:return`desktopHostSwitcher.sshError.timeout.title`;default:return`desktopHostSwitcher.sshError.unknown.title`}},et=e=>{switch(e){case`shellStartup`:return`desktopHostSwitcher.sshError.shellStartup.guidance`;case`configSync`:return`desktopHostSwitcher.sshError.configSync.guidance`;case`nodeRuntimeMissing`:return`desktopHostSwitcher.sshError.nodeRuntimeMissing.guidance`;case`packageManagerMissing`:return`desktopHostSwitcher.sshError.packageManagerMissing.guidance`;case`nativeBinding`:return`desktopHostSwitcher.sshError.nativeBinding.guidance`;case`yuriCliMissing`:return`desktopHostSwitcher.sshError.yuriCliMissing.guidance`;case`yuriRegistry`:return`desktopHostSwitcher.sshError.yuriRegistry.guidance`;case`yuriInstall`:return`desktopHostSwitcher.sshError.yuriInstall.guidance`;case`yuriCliIncompatible`:return`desktopHostSwitcher.sshError.yuriCliIncompatible.guidance`;case`opencodeInstall`:return`desktopHostSwitcher.sshError.opencodeInstall.guidance`;case`serverStart`:return`desktopHostSwitcher.sshError.serverStart.guidance`;case`sshAuth`:return`desktopHostSwitcher.sshError.sshAuth.guidance`;case`sshUnreachable`:return`desktopHostSwitcher.sshError.sshUnreachable.guidance`;case`timeout`:return`desktopHostSwitcher.sshError.timeout.guidance`;default:return`desktopHostSwitcher.sshError.unknown.guidance`}},tt=e=>e===`unknown`||e===`yuriCliIncompatible`,nt=(e,t,n)=>{let r=typeof n==`string`?n.trim():``;return!tt(t)||!r||r===e?e:`${e}\n${r}`},V=m();function rt(e){let t=(0,E.c)(27),{errorCode:n,detail:r,className:i}=e,{t:a}=ce(),o,s,c,l,u,d;if(t[0]!==i||t[1]!==r||t[2]!==n||t[3]!==a){let e=Qe(n,r);o=a(et(e));let f;t[10]===r?f=t[11]:(f=typeof r==`string`?r.trim():``,t[10]=r,t[11]=f),s=f,c=tt(e)&&!!s&&s!==o,t[12]===i?d=t[13]:(d=oe(`space-y-1`,i),t[12]=i,t[13]=d),l=`typography-ui-label text-[var(--status-error)]`,u=a($e(e)),t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];let f;t[14]!==l||t[15]!==u?(f=(0,V.jsx)(`p`,{className:l,children:u}),t[14]=l,t[15]=u,t[16]=f):f=t[16];let p;t[17]===o?p=t[18]:(p=(0,V.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:o}),t[17]=o,t[18]=p);let m;t[19]!==s||t[20]!==c?(m=c?(0,V.jsx)(`p`,{className:`typography-meta break-words text-muted-foreground`,children:s}):null,t[19]=s,t[20]=c,t[21]=m):m=t[21];let h;return t[22]!==d||t[23]!==f||t[24]!==p||t[25]!==m?(h=(0,V.jsxs)(`div`,{className:d,children:[f,p,m]}),t[22]=d,t[23]=f,t[24]=p,t[25]=m,t[26]=h):h=t[26],h}var it=`/auth/passkey/authenticate/options`,at=`/auth/passkey/authenticate/verify`,ot=`/auth/passkey/register/options`,st=`/auth/passkey/register/verify`,ct=`/api/passkeys`,lt=`/auth/passkey/status`,ut=`/api/auth/reset`,dt={enabled:!1,hasPasskeys:!1,passkeyCount:0,rpID:null},H=async(e,t)=>r(e,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:t===void 0?void 0:JSON.stringify(t)}),U=async(e,t)=>{try{let t=await e.json();if(t&&typeof t.error==`string`&&t.error.trim())return t.error}catch{}return t},ft=e=>e instanceof me&&e.code===`ERROR_CEREMONY_ABORTED`,pt=()=>{ge.cancelCeremony()},W=()=>typeof window>`u`?{supported:!1,reason:`Passkeys are unavailable outside the browser.`}:window.isSecureContext?{supported:!0,reason:``}:{supported:!1,reason:`Passkeys require HTTPS or localhost.`},mt=async()=>{let e=W();if(!e.supported)throw Error(e.reason);let t=await H(ot,{label:typeof navigator.userAgent==`string`&&navigator.userAgent.trim()?navigator.userAgent:`This device`});if(!t.ok)throw Error(await U(t,`Could not start passkey setup.`));let{requestId:n,optionsJSON:r}=await t.json(),i=await H(st,{requestId:n,response:await he({optionsJSON:r})});if(!i.ok)throw Error(await U(i,`Could not finish passkey setup.`));return i.json().catch(()=>null)},ht=async(e,t={})=>{let n=W();if(!n.supported)throw Error(n.reason);let r=await H(it);if(!r.ok)throw Error(await U(r,`Passkey sign-in is not available right now.`));let{requestId:i,optionsJSON:a}=await r.json(),o=await H(at,{requestId:i,response:await _e({optionsJSON:a}),trustDevice:e,issueClientToken:t.issueClientToken===!0,clientLabel:t.clientLabel,clientKind:t.clientKind,dedupeKey:t.dedupeKey});if(!o.ok)throw Error(await U(o,`Passkey sign-in failed.`));return o.json().catch(()=>null)},gt=async()=>{let e=await r(lt,{method:`GET`,credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)return dt;let t=await e.json().catch(()=>null);return{enabled:t?.enabled===!0,hasPasskeys:t?.hasPasskeys===!0,passkeyCount:typeof t?.passkeyCount==`number`?t.passkeyCount:0,rpID:typeof t?.rpID==`string`&&t.rpID?t.rpID:null}},_t=async()=>{let e=await r(ct,{method:`GET`,credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)throw Error(await U(e,`Could not load passkeys.`));let t=await e.json().catch(()=>null);return Array.isArray(t?.passkeys)?t.passkeys:[]},vt=async e=>{let t=await r(`${ct}/${encodeURIComponent(e)}`,{method:`DELETE`,credentials:`include`,headers:{Accept:`application/json`}});if(!t.ok)throw Error(await U(t,`Could not remove passkey.`));return t.json().catch(()=>null)},yt=async()=>{let e=await H(ut);if(!e.ok)throw Error(await U(e,`Could not clear saved authentication.`));try{let{clearAssistantAttachmentCacheAll:e}=await b(async()=>{let{clearAssistantAttachmentCacheAll:e}=await import(`./assistant-attachment-cache-Y7yhlQcv.js`).then(e=>e.t);return{clearAssistantAttachmentCacheAll: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])),{invalidateRuntimeAuthSession:t}=await b(async()=>{let{invalidateRuntimeAuthSession:e}=await import(`./runtime-auth-DA-qfGHk.js`).then(e=>e.m);return{invalidateRuntimeAuthSession:e}},__vite__mapDeps([2,1]));await e(`auth-reset`),t()}catch{}return e.json().catch(()=>null)},bt=e(h(),1),G=(e,t)=>ue(le.getState().dictionary,e,t),xt=e=>{let t=new Date(e),n=new Date,r=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),i=new Date(n);return i.setDate(n.getDate()-1),r(t,n)?G(`common.date.today`):r(t,i)?G(`common.date.yesterday`):t.toLocaleDateString(se(),{month:`short`,day:`numeric`,year:`numeric`}).replace(`,`,``)},St=e=>{let t=new Date;if(((e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())(new Date(e),t)){let t=Date.now()-e;return t<6e4?G(`common.relative.justNow`):t<36e5?G(`common.relative.minutesAgoShort`,{count:Math.floor(t/6e4)}):G(`common.relative.hoursAgoShort`,{count:Math.floor(t/36e5)})}return xt(e)},Ct=e=>{let t=Math.max(0,Date.now()-e),n=6e4,r=60*n,i=24*r,a=7*i,o=365*i;return t<r?G(`common.relative.minutesAgoCompact`,{count:Math.max(1,Math.floor(t/n))}):t<i?G(`common.relative.hoursAgoCompact`,{count:Math.floor(t/r)}):t<a?G(`common.relative.daysAgoCompact`,{count:Math.floor(t/i)}):t<5*a?G(`common.relative.weeksAgoCompact`,{count:Math.floor(t/a)}):t<o?G(`common.relative.monthsAgoCompact`,{count:Math.floor(t/2592e6)}):G(`common.relative.yearsAgoCompact`,{count:Math.floor(t/o)})},wt=(e,t)=>Tt(g(e),g(t)),Tt=(e,t)=>!e||!t?!1:e===t?!0:t===`/`?e.startsWith(`/`):e.startsWith(`${t}/`),K=e=>e.toLowerCase().replace(/^opencode[/-]?/i,``).replace(/[-_]/g,``).trim(),Et=(e,t)=>e?K(e)!==K(t):!1,Dt=e=>{if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim().length>0){let t=Number(e);if(Number.isFinite(t))return t}},Ot=e=>Dt(e.time?.created)??0,kt=(e,t,n)=>{let r=n.has(e.id),i=n.has(t.id);return r===i?r&&i?Ot(t)-Ot(e):S(t)-S(e):r?-1:1},At=e=>{let t=new Map;return e.forEach(e=>{t.set(e.id,e)}),Array.from(t.values())},jt=e=>`__archived__:${e}`,Mt=(e,t)=>{let n=g(e.directory??null),r=g(e.project?.worktree??null),i=n??r;if(!i)return`unassigned`;if(t&&i===t)return`project root`;let a=(t&&i.startsWith(`${t}/`)?i.slice(t.length+1):i).split(`/`).filter(Boolean);return a[a.length-1]??`unassigned`},Nt=`box-border w-full px-2 py-1.5 text-left typography-micro text-muted-foreground/70 select-none`,Pt=`bg-[color-mix(in_srgb,var(--surface-foreground)_6%,transparent)] dark:bg-[color-mix(in_srgb,var(--surface-foreground)_11%,transparent)]`,Ft=`hover:bg-[color-mix(in_srgb,var(--surface-foreground)_3.5%,transparent)] dark:hover:bg-[color-mix(in_srgb,var(--surface-foreground)_8%,transparent)]`,It=e=>{let t=Math.max(0,e);return t===0?8:30+(t-1)*14},Lt=(e,t)=>{if(!t)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.length;if(i===0)return e;let a=[],o=0,s=n.indexOf(r,o);for(;s!==-1;){s>o&&a.push(e.slice(o,s));let t=e.slice(s,s+i);a.push((0,V.jsx)(`mark`,{className:`bg-transparent font-[inherit] text-[var(--primary-base)]`,children:t},`${s}-${t}`)),o=s+i,s=n.indexOf(r,o)}return o<e.length&&a.push(e.slice(o)),a.length>0?a:e},Rt=`/api/browser-providers`,zt=`/api/browser-providers/selection`,Bt=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,Vt=200,Ht=e=>`/api/browser-providers/${encodeURIComponent(e)}/surface/ws`,q=e=>!!e&&typeof e==`object`&&!Array.isArray(e),J=e=>typeof e==`string`&&Bt.test(e)?e:null,Ut=e=>{if(!q(e))return null;let t=J(e.id),n=typeof e.name==`string`?e.name.trim():``;return!t||!n||n.length>Vt?null:{id:t,name:n,surface:e.surface===!0}},Wt=e=>{if(!q(e)||!Array.isArray(e.providers))return null;let t=[],n=new Set;for(let r of e.providers){let e=Ut(r);!e||n.has(e.id)||(n.add(e.id),t.push(e))}let r=J(e.selectedId);return{providers:t,selectedId:r&&n.has(r)?r:null}},Gt=e=>{if(!q(e))return null;let t=J(e.selectedId);return t?{selectedId:t}:null},Kt=e=>e?.selectedId?e.providers.find(t=>t.id===e.selectedId)??null:null,qt=e=>!!(e&&e.providers.length>0),Jt=e=>Kt(e)!==null,Y=e=>typeof e==`number`&&Number.isFinite(e),Yt=e=>{if(!q(e)||typeof e.type!=`string`)return null;if(e.type===`hello`&&typeof e.viewerId==`string`&&e.viewerId.length>0)return{type:`hello`,viewerId:e.viewerId};if(e.type===`frame`){let t=e.mime===`image/jpeg`||e.mime===`image/png`?e.mime:null;if(!t||!Y(e.seq)||!Y(e.width)||!Y(e.height)||!Y(e.bytes)||e.bytes<1||typeof e.agentActive!=`boolean`)return null;let n=typeof e.title==`string`?e.title:void 0;return{type:`frame`,seq:e.seq,width:e.width,height:e.height,mime:t,bytes:e.bytes,title:n,agentActive:e.agentActive}}if(e.type===`control`){let t=e.controller===`none`||e.controller===`agent`||e.controller===`user`?e.controller:null;return!t||typeof e.mine!=`boolean`?null:{type:`control`,controller:t,mine:e.mine}}return e.type===`resized`&&Y(e.width)&&Y(e.height)?{type:`resized`,width:e.width,height:e.height}:e.type===`error`&&typeof e.code==`string`&&typeof e.message==`string`?{type:`error`,code:e.code,message:e.message}:e.type===`ended`&&(e.reason===`service-stopped`||e.reason===`extension-unavailable`||e.reason===`host-shutdown`)?{type:`ended`,reason:e.reason}:null},X=class extends Error{status;constructor(e){super(`browser_provider_request_failed:${e}`),this.name=`BrowserProviderRequestError`,this.status=e}},Z=(e=t())=>ae.browserProviders.catalog(e),Xt=async e=>{let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return null}},Zt=async e=>{let t=await r(Rt,{method:`GET`,headers:{Accept:`application/json`},signal:e}),n=await Xt(t);if(!t.ok)throw new X(t.status);let i=Wt(n);if(!i)throw new X(t.status||502);return i},Qt=(e=t())=>({queryKey:Z(e),queryFn:({signal:e})=>Zt(e),staleTime:5e3,refetchOnWindowFocus:!0,refetchInterval:e=>{let t=e.state.error;return t instanceof X&&(t.status===404||t.status===501)?!1:15e3}}),$t=e=>{let t=(0,E.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=Qt(),t[0]=n):n=t[0];let r=e?.enabled??!0,i;return t[1]===r?i=t[2]:(i={...n,enabled:r},t[1]=r,t[2]=i),re(i)},en=(e=y,n=t())=>e.getQueryData(Z(n))??null,tn=(e,t)=>e?.providers.some(e=>e.id===t)?{providers:e.providers,selectedId:t}:null,nn=async(e,n=y,i)=>{let a=t(),o=await r(zt,{method:`PUT`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({id:e}),signal:i}),s=await Xt(o);if(!o.ok)throw new X(o.status);let c=Gt(s);if(!c||c.selectedId!==e||t()!==a)throw new X(o.status||502);let l=tn(n.getQueryData(Z(a)),c.selectedId);if(!l)throw new X(409);return l},rn=()=>{let e=(0,E.c)(2),n=ie(),r;return e[0]===n?r=e[1]:(r={mutationFn:e=>nn(e,n),onMutate:async e=>{let r=t(),i=Z(r);await n.cancelQueries({queryKey:i});let a=n.getQueryData(i),o=tn(a,e);return o&&n.setQueryData(i,o),{previous:a,key:i,transport:r}},onError:(e,r,i)=>{!i||t()!==i.transport||n.setQueryData(i.key,i.previous)},onSuccess:(e,r,i)=>{!i||t()!==i.transport||n.setQueryData(i.key,e)}},e[0]=n,e[1]=r),te(r)},an=Object.freeze([]),on=()=>an,sn=()=>()=>{};function cn(){let e=(0,E.c)(4),t=(0,bt.useContext)(de),n;e[0]===t?n=e[1]:(n=t?e=>t.subscribe(e):sn,e[0]=t,e[1]=n);let r=n,i;return e[2]===t?i=e[3]:(i=t?()=>t.getCommandShortcuts():on,e[2]=t,e[3]=i),(0,bt.useSyncExternalStore)(r,i,on)}function Q(e){let t=T(e).split(`+`),n=t.pop()??``;return new KeyboardEvent(`keydown`,{key:n,metaKey:t.includes(`mod`)&&x(),ctrlKey:t.includes(`ctrl`)||t.includes(`mod`)&&!x(),shiftKey:t.includes(`shift`),altKey:t.includes(`alt`)})}function ln(e,t){return[e,t].every(e=>e&&T(e)!==`__unassigned__`)?w(Q(e),t)||w(Q(t),e):!1}function $(e){let t=e.key;return(!t||t===`Dead`)&&e.code===`Backquote`&&(t="`"),e.altKey&&/^(Key.|Digit.)$/.test(e.code)&&(t=e.code.replace(/^(Key|Digit)/,``)),`${Number(e.metaKey)}${Number(e.ctrlKey)}${Number(e.shiftKey)}${Number(e.altKey)}:${fe(t)}`}function un(e,t){let n=new Map;for(let r of e)for(let e of pe(r,t)){let i=T(e);if(!i||i===`__unassigned__`)continue;let a=t[r.id],o={action:r,combo:i,customized:typeof a==`string`&&T(a)===i},s=i.split(`+`),c=s.pop();for(let e of[!1,!0])for(let t of[!1,!0]){let r=new KeyboardEvent(`keydown`,{key:c,metaKey:e,ctrlKey:t,shiftKey:s.includes(`shift`),altKey:s.includes(`alt`)});if(!w(r,i))continue;let a=$(r),l=n.get(a)??[];l.push(o),n.set(a,l)}}for(let e of n.values())e.sort((e,t)=>Number(t.customized)-Number(e.customized)||(t.action.priority??0)-(e.action.priority??0)||Number(e.action.id.startsWith(`gui-plugin:`))-Number(t.action.id.startsWith(`gui-plugin:`))||(e.action.id<t.action.id?-1:+(e.action.id>t.action.id)));return{match(e,t){return n.get($(e))?.find(e=>!t||t(e.action))}}}var dn=[`standalone`,`minimal-ui`,`fullscreen`,`window-controls-overlay`],fn=`yuri.pwaRecentSessions`,pn=e=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(display-mode: ${e})`).matches,mn=()=>typeof window>`u`?`browser`:typeof document<`u`&&document.referrer.startsWith(`android-app://`)?`twa`:window.navigator.standalone?`standalone`:dn.find(e=>pn(e))??`browser`;export{qe as $,dt as A,Qe as B,Et as C,Mt as D,Lt as E,mt as F,Ne as G,$e as H,yt as I,Ae as J,Pe as K,vt as L,_t as M,W as N,ht as O,ft as P,Fe as Q,rt as R,It as S,K as T,Re as U,et as V,ke as W,Ie as X,je as Y,Le as Z,kt as _,ln as a,Se as at,St as b,$t as c,Yt as d,Ge as et,Jt as f,Ft as g,Pt as h,Q as i,xe as it,gt as j,pt as k,rn as l,Nt as m,mn as n,Je as nt,cn as o,qt as p,Me as q,un as r,be as rt,en as s,fn as t,Ke as tt,Ht as u,At as v,wt as w,jt as x,Ct as y,nt as z};
|