@yuriai/web 0.2.20 → 0.2.24-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentAvatar-MK9jNcwx.js → AgentAvatar-uHQNjXpd.js} +1 -1
- package/dist/assets/AssistantView-CqihS590.js +3 -0
- package/dist/assets/{DiagramView-ys2UVvx1.js → DiagramView-CAl2hJW0.js} +1 -1
- package/dist/assets/{FadeInOnReveal-B1g8C4P7.js → FadeInOnReveal-C4jDW1zu.js} +1 -1
- package/dist/assets/{GuiPluginSurface-C1KQZUmj.js → GuiPluginSurface-D6-If8cj.js} +1 -1
- package/dist/assets/{GuiPluginWindow-D4TIvZDn.js → GuiPluginWindow-CBFALwNv.js} +1 -1
- package/dist/assets/Icon-B0ebXdpZ.js +1 -0
- package/dist/assets/{ImageLoadingPlaceholder-DM2ifWd8.js → ImageLoadingPlaceholder-BsOal94e.js} +1 -1
- package/dist/assets/{LoadingImage-BoaGSpZ_.js → LoadingImage-DU15BNuP.js} +1 -1
- package/dist/assets/MarkdownRenderer-D_rTN88T.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-DL069I2q.js → MarkdownRendererImpl-DlSWKQY_.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-CwR_p-oQ.js → MarkstreamRendererImpl-BSDk1Jis.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-C7Z7mVZV.js → MobileDetailNavigation-B2IiMT5p.js} +1 -1
- package/dist/assets/{MobileResizableSheet-ChrM2_er.js → MobileResizableSheet-C5UIcZMP.js} +1 -1
- package/dist/assets/{MobileShareBridge-DtXwoQtk.js → MobileShareBridge-CfcbqwW6.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-BT7U61qi.js → MobileTabPageHeader-9JAqOR2k.js} +1 -1
- package/dist/assets/{MultiRunWindow-CFWkmiwx.js → MultiRunWindow-BYI4hg_P.js} +1 -1
- package/dist/assets/{OnboardingScreen-Bb3wmiKY.js → OnboardingScreen-D5tX10Ru.js} +1 -1
- package/dist/assets/{OverlayScrollbar-DD6avzvO.js → OverlayScrollbar-Cd3itQWo.js} +1 -1
- package/dist/assets/SettingsView-BgwM4FwF.js +29 -0
- package/dist/assets/{SettingsWindow-jF7nPmJG.js → SettingsWindow-JHqJTA6L.js} +1 -1
- package/dist/assets/{TerminalView-Cms4rfIE.js → TerminalView-CqJgchfl.js} +1 -1
- package/dist/assets/{ToolOutputDialog-CBSb39qy.js → ToolOutputDialog-CrXMwUq9.js} +4 -4
- package/dist/assets/{YuriLogo-CeZsIqiE.js → YuriLogo-mo6nZ3PX.js} +1 -1
- package/dist/assets/{appThemeRegistry-Bps27som.js → appThemeRegistry-7-Ucu_cy.js} +1 -1
- package/dist/assets/{button--mt1oJ-H.js → button-RqfOQVDY.js} +1 -1
- package/dist/assets/{capgoAdapter-ZBPKiKyL.js → capgoAdapter-9z4borwr.js} +1 -1
- package/dist/assets/{collapsible-Dh2xZynB.js → collapsible-Dv8u92TF.js} +1 -1
- package/dist/assets/desktop-5DP3-Bao.js +1 -0
- package/dist/assets/{desktopHosts-B4HMNmrx.js → desktopHosts-CrVcscUO.js} +1 -1
- package/dist/assets/{desktopRelayRestore-CRl62mqn.js → desktopRelayRestore-DJFLfsuw.js} +1 -1
- package/dist/assets/{device-Coc5tapU.js → device-BKQ_0FdZ.js} +1 -1
- package/dist/assets/{diagram-CrQbE7QP.js → diagram-ChmjoQ5M.js} +1 -1
- package/dist/assets/{dialog-BG9W4FO9.js → dialog-BNwN9E77.js} +1 -1
- package/dist/assets/{dropdown-menu.styles-BOP49Dw2.js → dropdown-menu.styles-BeD-5cZr.js} +1 -1
- package/dist/assets/{es-CuWYQYZ1.js → es-BA49Soe0.js} +3 -3
- package/dist/assets/{fileMentionTouchSelection-m4Xsn0cx.js → fileMentionTouchSelection-3kl7GJMx.js} +1 -1
- package/dist/assets/{fileReferenceActions-BnPPqYXw.js → fileReferenceActions-B1o8IWgw.js} +1 -1
- package/dist/assets/{fr-yebDRPGw.js → fr-BC5SbQkf.js} +3 -3
- package/dist/assets/{gitApi-C1pkEDXu.js → gitApi-CdlAr0G6.js} +1 -1
- package/dist/assets/{gitApiHttp-CoNokuDM.js → gitApiHttp-Bnr4_wxy.js} +2 -2
- package/dist/assets/{host-BqNFap4A.js → host-DgJqhX6n.js} +1 -1
- package/dist/assets/{input-BMUm4I0i.js → input-0mf9njqM.js} +1 -1
- package/dist/assets/insertionBoundaries-CgOdACbG.js +1 -0
- package/dist/assets/{ja-f1wDEfxS.js → ja-ZVSLBCEX.js} +3 -3
- package/dist/assets/{ko-n8CMb8k9.js → ko-UEhdI-6j.js} +3 -3
- package/dist/assets/{main-djohnOii.js → main-F2ObdRqm.js} +2 -2
- package/dist/assets/main-nOs3EBA9.js +169 -0
- package/dist/assets/{markdownHeightCache-BWrnxGTO.js → markdownHeightCache-CghsqV5O.js} +1 -1
- package/dist/assets/{mcpQueries-BfSiXImW.js → mcpQueries-DS2belW7.js} +1 -1
- package/dist/assets/{miniChat-DXN8mcdi.js → miniChat-CnBDNbrx.js} +2 -2
- package/dist/assets/{mobile--08sYbKy.js → mobile-CV3-MHwD.js} +2 -2
- package/dist/assets/{mobileBackNavigation-EIV61ZvG.js → mobileBackNavigation-CX8dmR4X.js} +1 -1
- package/dist/assets/{multirun-Dfuqt2Sd.js → multirun-sEG8DT8R.js} +1 -1
- package/dist/assets/{native-config-Cswl9jqU.js → native-config-QhKCjYzE.js} +1 -1
- package/dist/assets/{persistence-CNEHspb4.js → persistence-BPb2hZ3c.js} +2 -2
- package/dist/assets/{pl-BpveZ1bR.js → pl-CtZa8Aps.js} +3 -3
- package/dist/assets/{platform-Q45KPuGv.js → platform-wGCQUVxr.js} +1 -1
- package/dist/assets/{projectMeta-CuVxfoYb.js → projectMeta-CVrggbn1.js} +1 -1
- package/dist/assets/{pt-BR-bq37AHb6.js → pt-BR-BLYFPwVu.js} +3 -3
- package/dist/assets/{readiness-DDF6yf-o.js → readiness-BtYBkmgM.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-Cfs2xjgL.js → renderElectronMiniChatApp-yG8H5XZA.js} +2 -2
- package/dist/assets/renderMobileApp-QbFlyIjX.js +28 -0
- package/dist/assets/{runtimeConfig-DTkP4z43.js → runtimeConfig-JLSevBwB.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BMAP5ZCY.js → runtimeEndpointReset-CWadQNbz.js} +15 -15
- package/dist/assets/{scheduledTaskNavigation-7slq1geN.js → scheduledTaskNavigation-Dhcdlsyj.js} +1 -1
- package/dist/assets/{sessionChangeSummary-BYv_KUyn.js → sessionChangeSummary-BWq51EyC.js} +1 -1
- package/dist/assets/{sessionLookup-Cx0pE6yS.js → sessionLookup-CKLauQ7F.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-D_efLXen.js → sortable-tabs-strip-B2s-35-E.js} +1 -1
- package/dist/assets/{speechSettingsQueries-BxHtdoOT.js → speechSettingsQueries-B95s6DcZ.js} +3 -3
- package/dist/assets/src-BWW10gG6.css +2 -0
- package/dist/assets/{store-CKBj6kYd.js → store-DRfILWJT.js} +3 -3
- package/dist/assets/{terminalApi-DFhCeMya.js → terminalApi-Cjd7Jry6.js} +1 -1
- package/dist/assets/{textarea-CNvFHvhC.js → textarea-Brud1txt.js} +1 -1
- package/dist/assets/{tooltip-C-gdI2Am.js → tooltip-Bs7jQMa0.js} +1 -1
- package/dist/assets/types-BecUO32k.js +2 -0
- package/dist/assets/{uk-Ds3imyqV.js → uk-CLu6Q5Pq.js} +3 -3
- package/dist/assets/{useAppFontEffects-Ucq0gPN8.js → useAppFontEffects-CW0A51vF.js} +53 -53
- package/dist/assets/{useDesktopWindowControlsLayout-BEscodj1.js → useDesktopWindowControlsLayout-CjGMTYs8.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-BWRQNoDF.js → useEffectiveDirectory-Cu4UQ0_Y.js} +1 -1
- package/dist/assets/{useFontPreferences-DmeLn0t9.js → useFontPreferences-CGThMzt0.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-DzkVc9H_.js → useMobileNavigationStore-BDtGCgi3.js} +16 -16
- package/dist/assets/useWorkerHighlightedLines-_RnSE1vt.js +7 -0
- package/dist/assets/{zh-CN-BNJ3ElZ9.js → zh-CN-794F19S6.js} +3 -3
- package/dist/assets/{zh-TW-C0jQloeH.js → zh-TW-CIVkGGCd.js} +3 -3
- package/dist/index.html +13 -13
- package/dist/mini-chat.html +13 -13
- package/dist/mobile.html +13 -13
- package/package.json +1 -1
- package/server/index.d.ts +9 -0
- package/server/index.js +10 -0
- package/server/lib/assistants/DOCUMENTATION.md +15 -0
- package/server/lib/assistants/harness.js +1 -4
- package/server/lib/assistants/harness.test.js +38 -0
- package/server/lib/assistants/summary.test.js +32 -0
- package/server/lib/realtime-proxy.js +2 -1
- package/server/lib/relay/tunnel-host.js +1 -0
- package/server/lib/remote-desktop/DOCUMENTATION.md +54 -0
- package/server/lib/remote-desktop/protocol.js +26 -0
- package/server/lib/remote-desktop/protocol.test.js +18 -0
- package/server/lib/remote-desktop/runtime.js +112 -0
- package/server/lib/remote-desktop/runtime.test.js +135 -0
- package/server/lib/ui-auth/DOCUMENTATION.md +2 -0
- package/server/lib/ui-auth/ui-auth.js +2 -1
- package/dist/assets/AssistantView-CVf9ta92.js +0 -3
- package/dist/assets/Icon-C93bLV0e.js +0 -1
- package/dist/assets/MarkdownRenderer-B8LWUc6A.js +0 -2
- package/dist/assets/SettingsView-B4xkRLZ3.js +0 -29
- package/dist/assets/desktop-CiqEZVr5.js +0 -1
- package/dist/assets/insertionBoundaries-WLpirs0A.js +0 -1
- package/dist/assets/main-CNmq04w8.js +0 -169
- package/dist/assets/renderMobileApp-B66uW5zc.js +0 -28
- package/dist/assets/src-DHHaXffU.css +0 -2
- package/dist/assets/types-BHKyslK4.js +0 -2
- package/dist/assets/useWorkerHighlightedLines-Dz6lLZ-1.js +0 -7
package/dist/index.html
CHANGED
|
@@ -560,15 +560,15 @@
|
|
|
560
560
|
opacity: 0.72;
|
|
561
561
|
}
|
|
562
562
|
</style>
|
|
563
|
-
<script type="module" crossorigin src="/assets/main-
|
|
563
|
+
<script type="module" crossorigin src="/assets/main-F2ObdRqm.js"></script>
|
|
564
564
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
565
565
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-BaBM02zI.js">
|
|
566
566
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DhMY9eiB.js">
|
|
567
567
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-DfALP7-b.js">
|
|
568
568
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
569
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
570
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
571
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
569
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-5DP3-Bao.js">
|
|
570
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CrVcscUO.js">
|
|
571
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-DJFLfsuw.js">
|
|
572
572
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
573
573
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
574
574
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
@@ -581,22 +581,22 @@
|
|
|
581
581
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-DWgXfxGx.js">
|
|
582
582
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
583
583
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
584
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
584
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-BPb2hZ3c.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
586
586
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-Bd-OEFmO.js">
|
|
587
587
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
588
588
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
589
589
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
590
590
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-DtsKbFf3.js">
|
|
591
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
592
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
591
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-Bnr4_wxy.js">
|
|
592
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-Cjd7Jry6.js">
|
|
593
593
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-xvItwYMc.js">
|
|
594
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
595
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
596
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
597
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
598
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
599
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
594
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-wGCQUVxr.js">
|
|
595
|
+
<link rel="modulepreload" crossorigin href="/assets/types-BecUO32k.js">
|
|
596
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-9z4borwr.js">
|
|
597
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-QhKCjYzE.js">
|
|
598
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-JLSevBwB.js">
|
|
599
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BWW10gG6.css">
|
|
600
600
|
</head>
|
|
601
601
|
<body class="h-full bg-background text-foreground">
|
|
602
602
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -77,15 +77,15 @@
|
|
|
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-CnBDNbrx.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-BaBM02zI.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DhMY9eiB.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-DfALP7-b.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-5DP3-Bao.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CrVcscUO.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-DJFLfsuw.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
@@ -98,22 +98,22 @@
|
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-DWgXfxGx.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-BPb2hZ3c.js">
|
|
102
102
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-Bd-OEFmO.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
105
105
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
106
106
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
107
107
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-DtsKbFf3.js">
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-Bnr4_wxy.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-Cjd7Jry6.js">
|
|
110
110
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-xvItwYMc.js">
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
116
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-wGCQUVxr.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/types-BecUO32k.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-9z4borwr.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-QhKCjYzE.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-JLSevBwB.js">
|
|
116
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BWW10gG6.css">
|
|
117
117
|
</head>
|
|
118
118
|
<body class="h-full bg-background text-foreground">
|
|
119
119
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,15 +64,15 @@
|
|
|
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-CV3-MHwD.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-BaBM02zI.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DhMY9eiB.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-DfALP7-b.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-5DP3-Bao.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CrVcscUO.js">
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-DJFLfsuw.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
@@ -85,22 +85,22 @@
|
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-DWgXfxGx.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-BPb2hZ3c.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-Bd-OEFmO.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
94
94
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-DtsKbFf3.js">
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-Bnr4_wxy.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-Cjd7Jry6.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-xvItwYMc.js">
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
103
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-wGCQUVxr.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/types-BecUO32k.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-9z4borwr.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-QhKCjYzE.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-JLSevBwB.js">
|
|
103
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BWW10gG6.css">
|
|
104
104
|
</head>
|
|
105
105
|
<body class="h-full bg-background text-foreground">
|
|
106
106
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
package/server/index.d.ts
CHANGED
|
@@ -31,6 +31,15 @@ export interface StartWebUiServerOptions {
|
|
|
31
31
|
messageQueueAttachmentRoot?: string | null;
|
|
32
32
|
hostUpdateStateFile?: string;
|
|
33
33
|
getHostUpdateVersion?: () => string;
|
|
34
|
+
remoteDesktopAdapter?: {
|
|
35
|
+
supported: boolean;
|
|
36
|
+
readonly enabled: boolean;
|
|
37
|
+
start: (options: { send: (message: unknown) => boolean; onEnded: () => void; signal: AbortSignal; client: { id: string; label: string } | null }) => Promise<{
|
|
38
|
+
handle: (message: unknown) => void | Promise<void>;
|
|
39
|
+
close: () => void;
|
|
40
|
+
}>;
|
|
41
|
+
stop?: () => void;
|
|
42
|
+
};
|
|
34
43
|
hostUpdateAdapter?: {
|
|
35
44
|
host: 'cli' | 'electron';
|
|
36
45
|
supported: boolean;
|
package/server/index.js
CHANGED
|
@@ -122,6 +122,7 @@ import { createProjectConfigRuntime } from './lib/projects/project-config.js';
|
|
|
122
122
|
import { createRemoteClientAuthRuntime } from './lib/client-auth/remote-clients.js';
|
|
123
123
|
import { createHostUpdateRuntime } from './lib/host-update/runtime.js';
|
|
124
124
|
import { createCliUpdateAdapter } from './lib/host-update/cli.js';
|
|
125
|
+
import { attachRemoteDesktop } from './lib/remote-desktop/runtime.js';
|
|
125
126
|
import { getOrCreateInstallId } from './lib/package-manager.js';
|
|
126
127
|
import { applyRuntimeCorsHeaders } from './lib/request-cors.js';
|
|
127
128
|
import { createClientPairingRuntime } from './lib/client-auth/pairing.js';
|
|
@@ -1920,6 +1921,14 @@ async function main(options = {}) {
|
|
|
1920
1921
|
}, 0);
|
|
1921
1922
|
}
|
|
1922
1923
|
uiAuthController = bootstrapResult.uiAuthController;
|
|
1924
|
+
const remoteDesktopRuntime = attachRemoteDesktop({
|
|
1925
|
+
app, server, adapter: options.remoteDesktopAdapter, uiAuthController, isRequestOriginAllowed,
|
|
1926
|
+
isClientActive: async (id) => {
|
|
1927
|
+
const clients = await remoteClientAuthRuntime.listClients();
|
|
1928
|
+
return clients.some((client) => client.id === id && !client.revokedAt
|
|
1929
|
+
&& (!client.expiresAt || Date.parse(client.expiresAt) > Date.now()));
|
|
1930
|
+
},
|
|
1931
|
+
});
|
|
1923
1932
|
realtimeProxyRuntime = attachRealtimeProxy({
|
|
1924
1933
|
app,
|
|
1925
1934
|
server,
|
|
@@ -2228,6 +2237,7 @@ async function main(options = {}) {
|
|
|
2228
2237
|
console.warn('[message-queue] Failed to close durable database during shutdown');
|
|
2229
2238
|
}
|
|
2230
2239
|
realtimeProxyRuntime.stop();
|
|
2240
|
+
remoteDesktopRuntime.stop();
|
|
2231
2241
|
liveActivityRefreshRuntime.dispose();
|
|
2232
2242
|
notificationTriggerRuntime.dispose();
|
|
2233
2243
|
if (relayReconcileTimer) clearInterval(relayReconcileTimer);
|
|
@@ -48,6 +48,21 @@ show temporary error feedback until a newer message arrives; reconnect/restart d
|
|
|
48
48
|
not recover errors. Errors do not become list previews, unread counts, or LLM memory.
|
|
49
49
|
Worker-card execution status remains part of the card's authoritative state.
|
|
50
50
|
|
|
51
|
+
## Contact attachment chronology
|
|
52
|
+
|
|
53
|
+
Historical files stay on their original user message in model context. The
|
|
54
|
+
completion adapter's pending-file fallback contains only the current turn's
|
|
55
|
+
`userParts`, never files collected from history. A text-only confirmation must
|
|
56
|
+
not resubmit older images or documents as new attachments; a new upload must not
|
|
57
|
+
be mixed with historical files. This also holds across tool follow-up completions.
|
|
58
|
+
The Host owns this behavior for web, Electron, hosted mobile and Capacitor clients;
|
|
59
|
+
no transcript migration or attachment deletion is needed.
|
|
60
|
+
|
|
61
|
+
When a turn falls out of the bounded history window, its file parts fall out with
|
|
62
|
+
it. Rolling summaries receive text only, not original attachment bytes; relevant
|
|
63
|
+
facts already described in conversation may survive as summary text. Stored
|
|
64
|
+
attachments remain available in the transcript UI.
|
|
65
|
+
|
|
51
66
|
## Avatar identity
|
|
52
67
|
|
|
53
68
|
`avatarSeed` is an optional nonempty string (maximum 256 characters) on create
|
|
@@ -544,10 +544,7 @@ export async function runContactTurn({
|
|
|
544
544
|
// streamFn receives the model; completions needs providerID/modelID.
|
|
545
545
|
model.name = `${providerID}/${modelID}`;
|
|
546
546
|
|
|
547
|
-
const pendingFileParts =
|
|
548
|
-
...(Array.isArray(history) ? history.flatMap((message) => completionFileParts(message.parts)) : []),
|
|
549
|
-
...completionFileParts(userParts),
|
|
550
|
-
];
|
|
547
|
+
const pendingFileParts = completionFileParts(userParts);
|
|
551
548
|
const prior = Array.isArray(history)
|
|
552
549
|
? history.map((message) => (
|
|
553
550
|
message.role === 'assistant'
|
|
@@ -363,6 +363,44 @@ describe('createContactStreamFn', () => {
|
|
|
363
363
|
})
|
|
364
364
|
})
|
|
365
365
|
|
|
366
|
+
it.each([
|
|
367
|
+
{ name: 'text-only confirmation', currentParts: [] },
|
|
368
|
+
{ name: 'new image', currentParts: [{ type: 'file', mime: 'image/png', url: 'data:image/png;base64,bmV3', filename: 'current.png' }] },
|
|
369
|
+
{ name: 'new text file', currentParts: [{ type: 'file', mime: 'text/plain', url: 'data:text/plain;base64,bmV3', filename: 'current.txt' }] },
|
|
370
|
+
])('keeps historical attachments on their original message for a $name through tool follow-ups', async ({ currentParts }) => {
|
|
371
|
+
const historicalParts = [
|
|
372
|
+
{ type: 'file', mime: 'image/png', url: 'data:image/png;base64,b2xk', filename: 'earlier.png' },
|
|
373
|
+
{ type: 'file', mime: 'text/plain', url: 'data:text/plain;base64,b2xk', filename: 'earlier.txt' },
|
|
374
|
+
]
|
|
375
|
+
const requests = []
|
|
376
|
+
const execute = vi.fn(async () => ({ content: [{ type: 'text', text: 'Checked.' }] }))
|
|
377
|
+
await runContactTurn({
|
|
378
|
+
assistant: { providerID: 'p', modelID: 'm' },
|
|
379
|
+
history: [
|
|
380
|
+
{ role: 'user', content: 'Read these earlier attachments.', parts: historicalParts },
|
|
381
|
+
{ role: 'assistant', content: 'Read them.' },
|
|
382
|
+
{ role: 'user', content: 'Change the scheduled task model.' },
|
|
383
|
+
{ role: 'assistant', content: 'Should the remaining task use that model too?' },
|
|
384
|
+
],
|
|
385
|
+
userText: 'Yes.',
|
|
386
|
+
userParts: [{ type: 'text', text: 'Yes.' }, ...currentParts],
|
|
387
|
+
tools: [{ name: 'probe', description: 'Check.', parameters: { type: 'object', properties: {} }, execute }],
|
|
388
|
+
createChatCompletion: async ({ body }) => {
|
|
389
|
+
requests.push(body.messages)
|
|
390
|
+
return requests.length === 1 ? toolCall('probe', {}) : { text: 'Done.' }
|
|
391
|
+
},
|
|
392
|
+
})
|
|
393
|
+
expect(execute).toHaveBeenCalledTimes(1)
|
|
394
|
+
expect(requests).toHaveLength(2)
|
|
395
|
+
for (const messages of requests) {
|
|
396
|
+
expect(messages.find((message) => message.content === 'Read these earlier attachments.').parts).toEqual(historicalParts)
|
|
397
|
+
expect(messages.findLast((message) => message.role === 'user')).toEqual({
|
|
398
|
+
role: 'user', content: 'Yes.', ...(currentParts.length > 0 ? { parts: currentParts } : {}),
|
|
399
|
+
})
|
|
400
|
+
expect(messages.some((message) => message.role === 'assistant' && message.content === 'Should the remaining task use that model too?')).toBe(true)
|
|
401
|
+
}
|
|
402
|
+
})
|
|
403
|
+
|
|
366
404
|
it('keeps thinking off and never installs bash/edit/read/write when sending attachments', async () => {
|
|
367
405
|
const prompt = vi.fn(async function prompt() {
|
|
368
406
|
this.state.messages = [{
|
|
@@ -66,6 +66,38 @@ describe('ensureContactSummary', () => {
|
|
|
66
66
|
db.close();
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
it('drops original attachments with compressed turns while retaining text context and the stored upload', async () => {
|
|
70
|
+
const db = openDb();
|
|
71
|
+
try {
|
|
72
|
+
const image = { type: 'file', mime: 'image/png', url: 'data:image/png;base64,b2xk', filename: 'earlier.png' };
|
|
73
|
+
const messageID = crypto.randomUUID();
|
|
74
|
+
insertContactMessage(db, {
|
|
75
|
+
messageID, assistantID: 'a', role: 'user', turnID: crypto.randomUUID(), bubbleIndex: 0, createdAt: Date.now(),
|
|
76
|
+
ordinal: nextContactOrdinal(db, 'a'), status: 'complete',
|
|
77
|
+
parts: [{ type: 'text', text: 'Explain the earlier screenshot.' }, image],
|
|
78
|
+
});
|
|
79
|
+
add(db, 'a', 'assistant', 'The earlier screenshot shows a rejected appeal.');
|
|
80
|
+
fill(db, 'a', 40);
|
|
81
|
+
|
|
82
|
+
const complete = vi.fn(async () => 'Earlier discussion concerned a rejected appeal.');
|
|
83
|
+
expect(await ensureContactSummary(db, 'a', { complete })).toBe(true);
|
|
84
|
+
const input = complete.mock.calls[0][0];
|
|
85
|
+
expect(input.user).toContain('The earlier screenshot shows a rejected appeal.');
|
|
86
|
+
expect(JSON.stringify(input)).not.toContain(image.url);
|
|
87
|
+
expect(JSON.stringify(input)).not.toContain(image.filename);
|
|
88
|
+
|
|
89
|
+
const history = contactHistoryForLlm(db, 'a');
|
|
90
|
+
expect(history[0].content).toContain('Earlier discussion concerned a rejected appeal.');
|
|
91
|
+
expect(history.every((message) => !message.parts?.length)).toBe(true);
|
|
92
|
+
expect(JSON.stringify(history)).not.toContain(image.url);
|
|
93
|
+
expect(JSON.stringify(history)).not.toContain('Explain the earlier screenshot.');
|
|
94
|
+
const stored = db.prepare('SELECT part_json FROM assistant_contact_part WHERE message_id=? ORDER BY ordinal').all(messageID);
|
|
95
|
+
expect(stored.map((row) => JSON.parse(row.part_json))).toEqual(expect.arrayContaining([expect.objectContaining(image)]));
|
|
96
|
+
} finally {
|
|
97
|
+
db.close();
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
69
101
|
it('keeps the previous state when the model fails', async () => {
|
|
70
102
|
const db = openDb();
|
|
71
103
|
fill(db, 'a', 40);
|
|
@@ -14,7 +14,8 @@ const isAllowedSsePath = (pathname) => {
|
|
|
14
14
|
const isAllowedWebSocketPath = (pathname) => {
|
|
15
15
|
return pathname === '/api/event/ws'
|
|
16
16
|
|| pathname === '/api/global/event/ws'
|
|
17
|
-
|| pathname === '/api/terminal/ws'
|
|
17
|
+
|| pathname === '/api/terminal/ws'
|
|
18
|
+
|| pathname === '/api/remote-desktop/ws';
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const normalizeBaseUrl = (value) => {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Remote desktop
|
|
2
|
+
|
|
3
|
+
## Ownership and supported runtimes
|
|
4
|
+
|
|
5
|
+
- `runtime.js` owns the authenticated `/api/remote-desktop/ws` session and `/api/remote-desktop` capability response. The routes are installed before the OpenCode proxy/SPA fallback.
|
|
6
|
+
- Electron injects a process-local adapter from `packages/electron/remote-desktop.mjs`. Only that Electron Host's physical primary display is captured, irrespective of which OpenCode/runtime the desktop window currently shows.
|
|
7
|
+
- The first native input adapter is macOS (Quartz events, Screen Recording and Accessibility consent). CLI/headless, Windows and Linux Hosts return `supported: false`, and WS upgrade returns 501. VS Code explicitly returns 501 rather than proxying these routes to OpenCode.
|
|
8
|
+
- Hosted mobile and Capacitor iOS/Android use the same receiving browser UI. No native WebRTC plugin, new dependency, separate desktop server, or OpenCode changes are required.
|
|
9
|
+
|
|
10
|
+
## Authorization and lifetime
|
|
11
|
+
|
|
12
|
+
Remote desktop is opt-in. The native-only approval store also owns an `enabled` Boolean that defaults false when missing or malformed; pre-existing device approvals do not imply the feature is enabled. `/api/remote-desktop` exposes `{ supported, enabled }`, and WS upgrades are rejected with 403 while disabled, before starting native consent or capture. The native adapter checks the preference independently. Only local main-frame desktop IPC can inspect setup permissions, change the switch, or request a fixed macOS permission pane. There is no HTTP endpoint to enable it remotely.
|
|
13
|
+
|
|
14
|
+
The local desktop Settings → Remote instances → Remote desktop group checks Screen Recording, Accessibility for the app and the actual helper executable, and helper installation. The helper's check-only mode posts no input events. Enabling requires all checks to pass and a successful atomic preference write. Closing the switch immediately ends active and pending native sessions. Failed disable persistence leaves the current app run blocked rather than restoring remote access; a restart may still load the old persisted preference, so the failure is visible and must be retried. Preferences and device IDs share the existing serialized native store without replacing each other. UI permission reads use Query, mutations refresh only their native setup/capability keys, stale runtime completions are rejected, and read failures preserve the last snapshot with explicit error feedback. Non-desktop and remote-runtime Settings cannot change local macOS grants. Unsupported desktop platforms show an unsupported state.
|
|
15
|
+
|
|
16
|
+
The WebSocket must authenticate a paired client or a real password-protected owner session. Password-less/forged owner cookies, loopback source, and raw bearer credentials in query parameters do not qualify. Browser sockets use the existing scoped `yuri_url_token`; the Host checks origin even when password auth is disabled. Both tunnel and URL-token allowlists include exactly `/api/remote-desktop/ws`. Desktop realtime proxying also permits this exact path. No Relay wire-frame types or crypto format change.
|
|
17
|
+
|
|
18
|
+
The first native session requires local confirmation on the Mac. The unchecked-by-default “Always allow this device” checkbox can persist approval for that authenticated client ID only, so later connections work unattended. Other devices and owner-cookie sessions still require confirmation. A dedicated Electron-owned `remote-desktop-approvals.json` stores at most 256 public client IDs, never tokens, in native userData; missing/malformed data does not authorize a device. Adding a new approval evicts the oldest when full, requiring that device to re-confirm. Writes reuse the serialized atomic settings store; failed writes close capture without claiming the approval was saved. The native sharing window can Stop or Forget device; Forget stops immediately and removes its approval. If removal fails, native error feedback directs the owner to revoke pairing. Remote client revocation remains authoritative and also prevents remembered approval from granting access.
|
|
19
|
+
|
|
20
|
+
There is one active or pending capture per Host. Closing the native sharing window also stops capture. Stopping the Host, closing the remote view/socket, backgrounding the phone, removing/changing a display, or a native failure stops the session. Client pings are every 5 seconds; 20 seconds without a ping ends the Host session. Active client revocation is checked every 5 seconds, failing closed on store failure. Maximum session length is one hour. Initial client startup has a 60-second deadline, capability requests a 10-second deadline, and native capture startup a 15-second deadline after the local approval.
|
|
21
|
+
|
|
22
|
+
Runtime generation/transport identity are captured when opening the view. No input or delayed auth result can connect to a different Host. Failure is not an empty success. Reconnection is explicit, not an unattended loop that repeatedly opens native permission dialogs. Closing a pending session aborts the local approval; a later startup completion is immediately disposed. EOF on the helper's pipe releases a held mouse button.
|
|
23
|
+
|
|
24
|
+
## Media and control
|
|
25
|
+
|
|
26
|
+
The isolated file-origin capture window uses Electron's `desktopCapturer` screen identity and Chromium's desktop `getUserMedia`, constrained to 1920×1080 and 30 fps. Chromium owns negotiated video codec and hardware acceleration; H.264 is not forced. A WebRTC offer/answer and trickle ICE pass over the authenticated WS. Media uses WebRTC DTLS-SRTP. Over Relay, the fingerprint-bearing signaling and control are also protected by the existing E2EE tunnel; media does not use Yuri's tunnel encryption format.
|
|
27
|
+
|
|
28
|
+
`YURI_REMOTE_DESKTOP_ICE_SERVERS` optionally supplies an RTCIceServer JSON array (maximum 8 entries). It is configured on the Desktop Host, not the Relay, and passed to both peers for that session. No external STUN service is contacted by default. Deployment-managed TURN credentials are visible to the paired receiving client as necessary for WebRTC and are never persisted or logged by this feature. Prefer short-lived credentials. A TURN credential minting service is not included.
|
|
29
|
+
|
|
30
|
+
If WebRTC fails, is unavailable, or produces no decoded video within 7 seconds of the answer, the client requests JPEG fallback through the existing runtime WS. This works over Relay without TURN. Fallback is at most 1440×900, JPEG quality 0.65, maximum 512 KiB per frame, and at most approximately 12 frames/second. Only one frame is outstanding: the receiver ACKs after image decode, and capture skips work until ACK. Thus effective frame rate also depends on RTT/encode/decode time; this is not a 30-fps WAN guarantee. WS buffering is capped at 512 KiB. The video fallback shares the connection with other Relay traffic.
|
|
31
|
+
|
|
32
|
+
The UI calls JPEG fallback “Compatibility stream”, not “Encrypted tunnel”: direct `ws://` transport is not E2EE. Use HTTPS/WSS for direct network connections and TLS for public Relay ingress. JPEG carried through Relay benefits from the existing endpoint-to-endpoint encrypted tunnel; a plain direct LAN connection does not acquire that property merely by using this feature.
|
|
33
|
+
|
|
34
|
+
Control always stays on the authenticated WS, including when video is P2P. `protocol.js` bounds and projects pointer coordinates, scroll deltas, text (1024 UTF-16 code units), key names, SDP (64 KiB), and ICE candidate fields. There is no arbitrary shell/keycode/file/clipboard API. WS messages are capped at 96 KiB; input is serialized with at most 32 queued commands and 150 messages/second. The native helper checks permission and active display again, and accepts only its own bounded JSON command vocabulary.
|
|
35
|
+
|
|
36
|
+
## Mobile interaction and performance
|
|
37
|
+
|
|
38
|
+
The Projects homepage plus menu ends with a Remote desktop icon/action after instance choices. The chat header overflow menu exposes the same action. `MobileApp` owns one open state, one shared handler and one `RemoteDesktopPanel`; the homepage receives that handler through `MobilePhoneShell` and its Projects container. Opening from chat closes the overflow menu without changing the chat/session route. Android Back dismisses the remote desktop before underlying navigation, and underlying root/header swipe navigation is blocked while it is open. The panel uses the current runtime, not a separately selected machine. Tap clicks, double tap is delivered as native double-click, drag moves a held mouse, and long press right-clicks. Scroll mode turns single-finger movement into scrolling. Two fingers zoom (1–5×) around their midpoint and pan the local viewport without sending mouse input. Switching from dragging to pinching releases the mouse; lifting one finger after pinching never generates a click. Letterboxing is excluded from coordinate mapping.
|
|
39
|
+
|
|
40
|
+
Pointer moves are coalesced to one animation-frame update, zoom transforms update the DOM directly, and frames do not enter a shared store or React state. Repeated transport state notifications are deduplicated. A memo boundary isolates the open panel from unrelated homepage streaming renders. Resize, close, cancellation and transport changes clear pending gestures. Text entry and common navigation keys are available below the screen.
|
|
41
|
+
|
|
42
|
+
Mobile controls use gamepad-style translucent icon buttons at the lower corners instead of a persistent toolbar or expandable action menu: scroll mode and fit on the left, keyboard on the right. Buttons use the shared mobile glass style at 60% opacity (fully visible on hover, focus or selection). Text entry and navigation keys open in a floating panel above the buttons; it scrolls within short landscape/keyboard layouts without changing viewport geometry. Controls are siblings of the remote pointer surface so their touches never become native desktop input. Hiding the keyboard does not reconnect or change scroll mode. Transport names are not displayed in the operation UI.
|
|
43
|
+
|
|
44
|
+
## Validation and remaining platform gates
|
|
45
|
+
|
|
46
|
+
Focused tests cover message validation, real auth/origin gates, revocation, single ownership, delayed startup/abort, real Relay WS dispatch/fragmentation, runtime switching, decoded-frame ACK, coordinate mapping, pinch cancellation, and 50 unrelated homepage renders. The Electron evidence fixture runs the production capture page/preload with a synthetic canvas, a real Chromium WebRTC receiver and JPEG fallback; it does not capture or control the user's desktop. A separate local visual fixture was checked in Chromium at 390×844 and 844×390 using the production panel and synthetic screen data. That checks panel layout, not physical-phone rendering or real desktop capture.
|
|
47
|
+
|
|
48
|
+
Development-only native acceptance additionally exercised the production adapter and input helper against the real macOS desktop: JPEG frames decoded at 1440×810, and a fixed 26-character test string reached an isolated test textarea through Quartz input. The focused test window reported native/window/DOM keyboard focus. An earlier run received frames but not the text; that run did not measure focus and its cause is unresolved. This is not yet a repeatability guarantee. No real screen images or user-entered text were retained. The permission probe returned granted Screen Recording and Accessibility when Electron was started through macOS Launch Services; starting the same executable as a shell child reported denied/untrusted. Permission checks must be made under the actual launch context rather than inferred from the app's path or a Settings toggle.
|
|
49
|
+
|
|
50
|
+
Additional local checks confirmed new capture can start while the Mac remains locked (108 non-black JPEG frames), and the user reported the one-shot dummy password input test succeeded; no login was submitted. Transitioning an existing capture into lock still ended the session, and a later transition trace timed out awaiting local consent. These are distinct outcomes: locked capture/input is not evidence that lock/unlock transitions or correct-password unlocking are reliable.
|
|
51
|
+
|
|
52
|
+
The native setup adapter was also exercised via Launch Services with real app/helper permissions: it reported default-off, all required permissions granted, then enabled and disabled correctly using a test-only in-memory preference store. The production Settings group was visually checked at 900px and 350px widths using simulated native status; that does not prove release-signed IPC/permission onboarding. Focused tests cover disabled authenticated upgrades, native default-off, enable checks and failed writes, pending approval cancellation, active-session stop, local-only IPC classification, setup UI guidance and failed refresh preservation.
|
|
53
|
+
|
|
54
|
+
These tests do **not** prove macOS TCC permission inheritance for a release-signed helper, successful password-based unlocking, reliable lock/unlock transitions, iPhone WKWebView playback/gestures, WAN codec negotiation, throughput, battery or latency. Before shipping, verify those on a signed preview installer and a physical phone, including permission denial/regrant, display changes, disconnect while dragging, direct connection, Relay-only fallback and optional TURN. Native main/preload/helper changes require a new desktop installer; UI OTA alone cannot provide them.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const KEYS = new Set(['Enter', 'Backspace', 'Tab', 'Escape', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Delete', 'Home', 'End', 'PageUp', 'PageDown']);
|
|
2
|
+
const unit = (n) => typeof n === 'number' && Number.isFinite(n) && n >= 0 && n <= 1;
|
|
3
|
+
|
|
4
|
+
export function parseDesktopMessage(value) {
|
|
5
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('invalid_message');
|
|
6
|
+
const { type } = value;
|
|
7
|
+
if (type === 'ack' || type === 'fallback' || type === 'ping' || type === 'release') return { type };
|
|
8
|
+
if (type === 'answer' && typeof value.sdp === 'string' && value.sdp.length <= 65536) return { type, sdp: value.sdp };
|
|
9
|
+
if (type === 'ice' && (value.candidate === null || (typeof value.candidate === 'object'
|
|
10
|
+
&& typeof value.candidate.candidate === 'string' && value.candidate.candidate.length <= 2048))) {
|
|
11
|
+
return { type, candidate: value.candidate === null ? null : {
|
|
12
|
+
candidate: value.candidate.candidate,
|
|
13
|
+
sdpMid: typeof value.candidate.sdpMid === 'string' ? value.candidate.sdpMid.slice(0, 128) : null,
|
|
14
|
+
sdpMLineIndex: Number.isInteger(value.candidate.sdpMLineIndex) ? value.candidate.sdpMLineIndex : null,
|
|
15
|
+
} };
|
|
16
|
+
}
|
|
17
|
+
if (type === 'pointer' && ['move', 'down', 'up', 'click', 'right'].includes(value.action) && unit(value.x) && unit(value.y)) {
|
|
18
|
+
return { type, action: value.action, x: value.x, y: value.y };
|
|
19
|
+
}
|
|
20
|
+
if (type === 'scroll' && Number.isFinite(value.dx) && Number.isFinite(value.dy)) {
|
|
21
|
+
return { type, dx: Math.max(-1000, Math.min(1000, value.dx)), dy: Math.max(-1000, Math.min(1000, value.dy)) };
|
|
22
|
+
}
|
|
23
|
+
if (type === 'text' && typeof value.text === 'string' && value.text.length > 0 && value.text.length <= 1024) return { type, text: value.text };
|
|
24
|
+
if (type === 'key' && KEYS.has(value.key)) return { type, key: value.key };
|
|
25
|
+
throw new Error('invalid_message');
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
import { parseDesktopMessage } from './protocol.js';
|
|
3
|
+
|
|
4
|
+
it.each([null, [], {}, { type: 'exec', command: 'something' }, { type: 'text', text: 'x'.repeat(1025) },
|
|
5
|
+
{ type: 'key', key: 'arbitrary' }, { type: 'pointer', action: 'down', x: NaN, y: 0 },
|
|
6
|
+
{ type: 'pointer', action: 'click', x: 2, y: 0 }, { type: 'scroll', dx: Infinity, dy: 0 },
|
|
7
|
+
{ type: 'answer', sdp: 'x'.repeat(65537) }, { type: 'ice', candidate: { candidate: 'x'.repeat(2049) } },
|
|
8
|
+
])('rejects invalid or oversized messages %#', value => {
|
|
9
|
+
expect(() => parseDesktopMessage(value)).toThrow('invalid_message');
|
|
10
|
+
});
|
|
11
|
+
it('projects only permitted fields and bounds scroll and input', () => {
|
|
12
|
+
expect(parseDesktopMessage({ type: 'pointer', action: 'down', x: 0.2, y: 0.7, command: 'ignored' })).toEqual({ type: 'pointer', action: 'down', x: 0.2, y: 0.7 });
|
|
13
|
+
expect(parseDesktopMessage({ type: 'scroll', dx: -2000, dy: 5000 })).toEqual({ type: 'scroll', dx: -1000, dy: 1000 });
|
|
14
|
+
expect(parseDesktopMessage({ type: 'text', text: '中文🙂' })).toEqual({ type: 'text', text: '中文🙂' });
|
|
15
|
+
expect(parseDesktopMessage({ type: 'ice', candidate: { candidate: 'candidate:test', sdpMid: '0', sdpMLineIndex: 0, unexpected: 'ignored' } })).toEqual({
|
|
16
|
+
type: 'ice', candidate: { candidate: 'candidate:test', sdpMid: '0', sdpMLineIndex: 0 },
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { WebSocketServer } from 'ws';
|
|
2
|
+
import { parseDesktopMessage } from './protocol.js';
|
|
3
|
+
|
|
4
|
+
const REMOTE_DESKTOP_WS_PATH = '/api/remote-desktop/ws';
|
|
5
|
+
|
|
6
|
+
export function attachRemoteDesktop({ app, server, adapter, uiAuthController, isRequestOriginAllowed, isClientActive = async () => true }) {
|
|
7
|
+
const wss = new WebSocketServer({ noServer: true, maxPayload: 96 * 1024, perMessageDeflate: false });
|
|
8
|
+
let stopping = false;
|
|
9
|
+
let occupied = false;
|
|
10
|
+
const reject = (socket, code) => {
|
|
11
|
+
if (!socket.destroyed) socket.end(`HTTP/1.1 ${code} Rejected\r\nConnection: close\r\nContent-Length: 0\r\n\r\n`, () => socket.destroy());
|
|
12
|
+
};
|
|
13
|
+
app.get('/api/remote-desktop', (_req, res) => {
|
|
14
|
+
res.setHeader('Cache-Control', 'no-store');
|
|
15
|
+
res.json({ supported: adapter?.supported === true, enabled: adapter?.enabled === true });
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
wss.on('connection', (ws, req, auth) => {
|
|
19
|
+
let session;
|
|
20
|
+
let closed = false;
|
|
21
|
+
let lastPing = Date.now();
|
|
22
|
+
let count = 0;
|
|
23
|
+
let windowStart = Date.now();
|
|
24
|
+
const startedAt = Date.now();
|
|
25
|
+
let queued = 0;
|
|
26
|
+
let chain = Promise.resolve();
|
|
27
|
+
const abort = new AbortController();
|
|
28
|
+
const send = (value) => {
|
|
29
|
+
if (closed || ws.readyState !== 1 || ws.bufferedAmount > 512 * 1024) return false;
|
|
30
|
+
ws.send(Buffer.isBuffer(value) ? value : JSON.stringify(value));
|
|
31
|
+
return true;
|
|
32
|
+
};
|
|
33
|
+
const close = () => {
|
|
34
|
+
if (closed) return;
|
|
35
|
+
closed = true;
|
|
36
|
+
abort.abort();
|
|
37
|
+
clearInterval(timer);
|
|
38
|
+
// Keep the slot until asynchronous startup/consent has finished cleaning up.
|
|
39
|
+
if (session) { session.close(); occupied = false; }
|
|
40
|
+
};
|
|
41
|
+
const fail = (code) => {
|
|
42
|
+
send({ type: 'error', code });
|
|
43
|
+
ws.close(1011, code);
|
|
44
|
+
close();
|
|
45
|
+
};
|
|
46
|
+
const timer = setInterval(() => {
|
|
47
|
+
if (Date.now() - lastPing > 20000 || Date.now() - startedAt > 60 * 60 * 1000) { ws.terminate(); close(); return; }
|
|
48
|
+
if (auth.type === 'client') void isClientActive(auth.clientId ?? auth.client?.id).then((active) => {
|
|
49
|
+
if (!active) { ws.close(4001, 'authentication_required'); close(); }
|
|
50
|
+
}).catch(() => { ws.terminate(); close(); });
|
|
51
|
+
}, 5000);
|
|
52
|
+
timer.unref?.();
|
|
53
|
+
ws.on('close', close);
|
|
54
|
+
ws.on('error', close);
|
|
55
|
+
ws.on('message', (data, binary) => {
|
|
56
|
+
if (closed) return;
|
|
57
|
+
if (Date.now() - windowStart >= 1000) { count = 0; windowStart = Date.now(); }
|
|
58
|
+
if (binary || ++count > 150 || queued >= 32) { fail('rate_limited'); return; }
|
|
59
|
+
let message;
|
|
60
|
+
try { message = parseDesktopMessage(JSON.parse(data.toString())); }
|
|
61
|
+
catch { fail('invalid_message'); return; }
|
|
62
|
+
if (message.type === 'ping') { lastPing = Date.now(); send({ type: 'pong' }); return; }
|
|
63
|
+
queued++;
|
|
64
|
+
chain = chain.then(async () => {
|
|
65
|
+
await start;
|
|
66
|
+
if (!closed && session) await session.handle(message);
|
|
67
|
+
}).catch(() => fail('desktop_failed')).finally(() => { queued--; });
|
|
68
|
+
});
|
|
69
|
+
const start = (async () => {
|
|
70
|
+
try {
|
|
71
|
+
session = await adapter.start({ send, onEnded: () => fail('desktop_ended'), signal: abort.signal,
|
|
72
|
+
client: auth.type === 'client' ? { id: auth.clientId ?? auth.client?.id, label: auth.client?.label ?? '' } : null });
|
|
73
|
+
if (closed) { session.close(); occupied = false; }
|
|
74
|
+
} catch (error) {
|
|
75
|
+
occupied = false;
|
|
76
|
+
fail(['disabled', 'permission_required', 'permission_denied', 'unsupported', 'helper_unavailable'].includes(error.code) ? error.code : 'desktop_failed');
|
|
77
|
+
}
|
|
78
|
+
})();
|
|
79
|
+
void start;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const upgrade = (req, socket, head) => {
|
|
83
|
+
let pathname;
|
|
84
|
+
try { pathname = new URL(req.url, 'http://localhost').pathname; } catch { return; }
|
|
85
|
+
if (pathname !== REMOTE_DESKTOP_WS_PATH) return;
|
|
86
|
+
void (async () => {
|
|
87
|
+
try {
|
|
88
|
+
const auth = await uiAuthController.resolveAuthContext(req, null, { allowClientAuth: true, allowUrlToken: true });
|
|
89
|
+
// Password-less owner cookies are not authentication. Relay loopback is not trusted.
|
|
90
|
+
if (!auth || (auth.type !== 'client' && !uiAuthController.enabled)) return reject(socket, 401);
|
|
91
|
+
if (!await isRequestOriginAllowed(req)) return reject(socket, 403);
|
|
92
|
+
if (!adapter?.supported) return reject(socket, 501);
|
|
93
|
+
if (adapter.enabled !== true) return reject(socket, 403);
|
|
94
|
+
if (stopping || occupied) return reject(socket, 409);
|
|
95
|
+
if (socket.destroyed) return;
|
|
96
|
+
occupied = true;
|
|
97
|
+
try { wss.handleUpgrade(req, socket, head, (ws) => wss.emit('connection', ws, req, auth)); }
|
|
98
|
+
catch { occupied = false; socket.destroy(); }
|
|
99
|
+
} catch { reject(socket, 401); }
|
|
100
|
+
})();
|
|
101
|
+
};
|
|
102
|
+
server.on('upgrade', upgrade);
|
|
103
|
+
return {
|
|
104
|
+
stop() {
|
|
105
|
+
stopping = true;
|
|
106
|
+
server.off('upgrade', upgrade);
|
|
107
|
+
for (const ws of wss.clients) ws.terminate();
|
|
108
|
+
wss.close();
|
|
109
|
+
adapter?.stop?.();
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|