@yuriai/web 0.1.26 → 0.2.0-beta.10
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 +4 -0
- package/dist/assets/{AgentAvatar-C2p8G_Xw.js → AgentAvatar-BeM4lXfE.js} +1 -1
- package/dist/assets/AssistantView-Dm8d0x2w.js +3 -0
- package/dist/assets/DiagramView-C4ZjTE0G.js +1 -0
- package/dist/assets/{FadeInOnReveal-DhAYqopy.js → FadeInOnReveal-B8BCjwPb.js} +1 -1
- package/dist/assets/GuiPluginLoadingNotice-DjO_uy_0.js +1 -0
- package/dist/assets/GuiPluginSurface-BvRr8l5C.js +1 -0
- package/dist/assets/GuiPluginWindow-DiSlroCy.js +1 -0
- package/dist/assets/{Icon-DKFfVCeK.js → Icon-DofI60x2.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-DD2g7FjK.js → ImageLoadingPlaceholder-CZSbfJci.js} +1 -1
- package/dist/assets/{LoadingImage-Dc7hnEQ7.js → LoadingImage-BA2Cwg_Q.js} +1 -1
- package/dist/assets/MarkdownRenderer-CMuViXr5.js +2 -0
- package/dist/assets/MarkdownRendererImpl-6Bnt3u0h.js +10 -0
- package/dist/assets/MarkstreamRendererImpl-hkXOvfpV.js +3 -0
- package/dist/assets/MobileDetailNavigation-28tDmA9W.js +1 -0
- package/dist/assets/MobileResizableSheet-CuRgnS-k.js +1 -0
- package/dist/assets/MobileShareBridge-3FLzBi3t.js +4 -0
- package/dist/assets/MobileTabPageHeader-Ca_SmN6a.js +2 -0
- package/dist/assets/{MultiRunWindow-DnKgSNFU.js → MultiRunWindow-D-_kpGx3.js} +1 -1
- package/dist/assets/OnboardingScreen-hvLlaoKt.js +1 -0
- package/dist/assets/OverlayScrollbar-Bi17Olmj.js +1 -0
- package/dist/assets/SettingsView-DKdzVs_l.js +26 -0
- package/dist/assets/{SettingsWindow-DfZZulsn.js → SettingsWindow-BBsVtas5.js} +1 -1
- package/dist/assets/TerminalView-BvQNcWMM.js +8 -0
- package/dist/assets/{ToolOutputDialog-Hdg-97em.js → ToolOutputDialog-CP3O-GS5.js} +3 -3
- package/dist/assets/{YuriLogo-CgTkNYZf.js → YuriLogo-D9cfwLdW.js} +1 -1
- package/dist/assets/appThemeRegistry-BpEwes4H.js +1 -0
- package/dist/assets/assistant-attachment-cache-Cqs65voA.js +1 -0
- package/dist/assets/button-CT7WL0lp.js +1 -0
- package/dist/assets/{capgoAdapter-CophGZfT.js → capgoAdapter-DX784Pe3.js} +1 -1
- package/dist/assets/clipboard-Bj6jZiuP.js +1 -0
- package/dist/assets/{collapsible-CbQmi7qt.js → collapsible-UDWFNcbF.js} +1 -1
- package/dist/assets/desktop-CfMDfs6c.js +1 -0
- package/dist/assets/desktopHosts-BEzVZGiW.js +1 -0
- package/dist/assets/desktopRelayRestore-aNSNYVEB.js +1 -0
- package/dist/assets/device-BDrEmxBm.js +2 -0
- package/dist/assets/{diagram-DWkoS1Uc.js → diagram-BxF_wECt.js} +1 -1
- package/dist/assets/dialog-BpsbJk8Y.js +1 -0
- package/dist/assets/download-progress-MobTWf23.js +1 -0
- package/dist/assets/dropdown-menu.styles-D6MTYFvx.js +1 -0
- package/dist/assets/{es-Le3f45R2.js → es-iuy57SFI.js} +2 -2
- package/dist/assets/{fileMentionTouchSelection-D8FLYpv9.js → fileMentionTouchSelection-B_i_7dYW.js} +2 -2
- package/dist/assets/fileQueries-voABZL1r.js +1 -0
- package/dist/assets/fileReferenceActions-CgsqIeIM.js +1 -0
- package/dist/assets/fileReferenceParser-1HHDBUum.js +1 -0
- package/dist/assets/{fr-Knp2_Wkz.js → fr-LyrJa2Qb.js} +2 -2
- package/dist/assets/gitApi-CrDc4tQM.js +10 -0
- package/dist/assets/gitApiHttp-BKM9BbT8.js +7 -0
- package/dist/assets/gui-CTKa6rbU.js +1 -0
- package/dist/assets/host-CIYNejrE.js +1 -0
- package/dist/assets/image-loading-ClQZD7Z9.js +1 -0
- package/dist/assets/{input-CAhwlkOT.js → input-D86Oqf3B.js} +1 -1
- package/dist/assets/insertionBoundaries--Mxpk0of.js +1 -0
- package/dist/assets/{ja-_KJ_VLgM.js → ja-QqNYiTeY.js} +2 -2
- package/dist/assets/{ko-CmWIeRHF.js → ko-CL-s2hwZ.js} +2 -2
- package/dist/assets/main-B-pfFh5C.js +2 -0
- package/dist/assets/main-CBw2dbar.js +169 -0
- package/dist/assets/markdown-worker-oBGEB9Eg.js +1 -0
- package/dist/assets/{markdownHeightCache-CylzGsAe.js → markdownHeightCache-DB_NzPGt.js} +1 -1
- package/dist/assets/mcpQueries-U-JjFZe4.js +1 -0
- package/dist/assets/miniChat-Divc4WsR.js +2 -0
- package/dist/assets/mobile-CHlohOym.js +2 -0
- package/dist/assets/{mobileBackNavigation-BX1Pz7aE.js → mobileBackNavigation-BTsVwetY.js} +1 -1
- package/dist/assets/multirun-0upiMbGe.js +3 -0
- package/dist/assets/native-BMAEg2E6.js +1 -0
- package/dist/assets/native-config-C83Wsn8E.js +1 -0
- package/dist/assets/native-errors-06if6eu-.js +1 -0
- package/dist/assets/path-utils-jGozTg9d.js +1 -0
- package/dist/assets/pathNormalization-ewtPqJWn.js +1 -0
- package/dist/assets/persistence-Ck0wskDR.js +3 -0
- package/dist/assets/{pl-BoXY-ki3.js → pl-AKGY_sFU.js} +2 -2
- package/dist/assets/platform-kv0OsX45.js +1 -0
- package/dist/assets/projectMeta-Dby3r3KM.js +1 -0
- package/dist/assets/{pt-BR-C3gsTrhe.js → pt-BR-BFRFGU_b.js} +2 -2
- package/dist/assets/queryRuntime-CpsVmMzy.js +1 -0
- package/dist/assets/react-BYRXYlGz.js +1 -0
- package/dist/assets/readiness-BQJwpJCM.js +1 -0
- package/dist/assets/reasoning-projection-client-BEhVknv9.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-DCn2MimJ.js +2 -0
- package/dist/assets/renderMobileApp-Ci07NPvv.js +28 -0
- package/dist/assets/runtime-fetch-BclMrQHc.js +1 -0
- package/dist/assets/runtime-file-download-CZ2qtdn9.js +1 -0
- package/dist/assets/runtime-file-resource-CEkq2Pj2.js +2 -0
- package/dist/assets/runtime-file-store-BVRgEtI-.js +1 -0
- package/dist/assets/runtime-switch-WzPG6NMR.js +1 -0
- package/dist/assets/runtimeAPIRegistry-C2VogTny.js +1 -0
- package/dist/assets/runtimeConfig-CW8O4Hdh.js +2 -0
- package/dist/assets/{runtimeEndpointReset-DmY_4gYI.css → runtimeEndpointReset-HYSytKO-.css} +1 -1
- package/dist/assets/runtimeEndpointReset-sMvhXyD5.js +149 -0
- package/dist/assets/{scheduledTaskNavigation-meXpw7b3.js → scheduledTaskNavigation-tOa4Azh_.js} +1 -1
- package/dist/assets/scheduling-DCTDfxV-.js +1 -0
- package/dist/assets/sessionChangeSummary-D1S2fFAs.js +1 -0
- package/dist/assets/sessionLookup-CB0s60IX.js +1 -0
- package/dist/assets/sortable-tabs-strip-CSXgXPyP.js +1 -0
- package/dist/assets/speechSettingsQueries-OwiKVz92.js +4 -0
- package/dist/assets/src-r07HspQy.css +2 -0
- package/dist/assets/{store-CnVXA4NH.js → store-CGMD02tA.js} +3 -3
- package/dist/assets/terminalApi-DbFIyF-J.js +1 -0
- package/dist/assets/textarea-CMvxcQhR.js +1 -0
- package/dist/assets/toolHelpers-DL452NVK.js +2 -0
- package/dist/assets/{tooltip-CFuO3PUH.js → tooltip-CnIKZ6bg.js} +1 -1
- package/dist/assets/types-CCb-BgPn.js +2 -0
- package/dist/assets/{uk-VUOVH9qH.js → uk-C21_nQhw.js} +2 -2
- package/dist/assets/url-MRa-FtQa.js +1 -0
- package/dist/assets/{useAppFontEffects-DSHn-okJ.js → useAppFontEffects-B-fcxfDS.js} +53 -53
- package/dist/assets/{useAssistantUIStore-D7JZlg_Q.js → useAssistantUIStore-4a569vpy.js} +1 -1
- package/dist/assets/useDesktopWindowControlsLayout-ak-khGJO.js +1 -0
- package/dist/assets/useEffectiveDirectory-gmGePjIo.js +1 -0
- package/dist/assets/{useFontPreferences-Daujs94n.js → useFontPreferences-Dx-plsme.js} +1 -1
- package/dist/assets/useMobileNavigationStore-Qofc0k-e.js +417 -0
- package/dist/assets/useUIStore-DqtgX2FB.js +1 -0
- package/dist/assets/{useWorkerHighlightedLines-BmZl_Azr.js → useWorkerHighlightedLines-CpGZT6ts.js} +2 -2
- package/dist/assets/vendor-effect-DV9F8PTZ.js +33 -0
- package/dist/assets/vendor-opencode-client-fxfj4IA_.js +12 -0
- package/dist/assets/vendor-opencode-plugin-CQ5ogY33.js +1 -0
- package/dist/assets/vendor-solid-js-Dmt4_-Zk.js +1 -0
- package/dist/assets/yuri-mark-black-DxEnMyCE.svg +1 -0
- package/dist/assets/{zh-CN-CqOn122C.js → zh-CN-C7PVNr9_.js} +2 -2
- package/dist/assets/{zh-TW-53yr6Fdj.js → zh-TW-DLLoB3-e.js} +2 -2
- package/dist/index.html +30 -21
- package/dist/mini-chat.html +33 -32
- package/dist/mobile.html +36 -21
- package/package.json +1 -1
- package/server/index.d.ts +2 -0
- package/server/index.js +8 -1
- package/server/lib/content-search/DOCUMENTATION.md +5 -1
- package/server/lib/content-search/runtime.js +24 -0
- package/server/lib/content-search/runtime.test.js +19 -0
- package/server/lib/fs/DOCUMENTATION.md +1 -0
- package/server/lib/fs/binary-file.d.ts +3 -0
- package/server/lib/fs/binary-file.js +21 -0
- package/server/lib/fs/routes.js +1 -21
- package/server/lib/fs/routes.test.js +43 -0
- package/server/lib/opencode/DOCUMENTATION.md +5 -0
- package/server/lib/opencode/gui-plugin-source.js +14 -0
- package/server/lib/opencode/gui-plugin-source.test.js +28 -0
- package/server/lib/opencode/plugin-gui-response.d.ts +7 -0
- package/server/lib/opencode/plugin-gui-response.js +62 -0
- package/server/lib/opencode/plugin-gui-response.test.js +89 -0
- package/server/lib/opencode/proxy.js +32 -0
- package/server/lib/relay/DOCUMENTATION.md +1 -0
- package/server/lib/relay/relay-server.e2e.test.ts +73 -3
- package/server/lib/request-cors.js +2 -2
- package/server/lib/request-cors.test.js +3 -0
- package/server/lib/session-index/DOCUMENTATION.md +4 -0
- package/server/lib/session-index/sync-runtime.js +3 -0
- package/server/lib/session-index/sync-runtime.test.js +18 -0
- package/server/plugin-gui-proxy.test.js +134 -0
- package/dist/assets/AssistantView-BpH66j_M.js +0 -3
- package/dist/assets/DiagramView-BUSKNHpA.js +0 -1
- package/dist/assets/MarkdownRenderer-Cv0uQm6P.js +0 -2
- package/dist/assets/MarkdownRendererImpl-DdA8OTyc.js +0 -10
- package/dist/assets/MarkstreamRendererImpl-C_pmUgRH.js +0 -3
- package/dist/assets/MobileDetailNavigation-C8ay670M.js +0 -1
- package/dist/assets/MobileShareBridge-BRKIMBu6.js +0 -4
- package/dist/assets/MobileTabPageHeader-DFCwfVMX.js +0 -2
- package/dist/assets/OnboardingScreen-Dau5R5ew.js +0 -1
- package/dist/assets/OverlayScrollbar-CWK4F7aC.js +0 -2
- package/dist/assets/SettingsView-Ciha0BxW.js +0 -26
- package/dist/assets/TerminalView-CIbymc9n.js +0 -8
- package/dist/assets/appThemeRegistry-dIFOkzfO.js +0 -1
- package/dist/assets/assistant-attachment-cache-CLnqffXU.js +0 -1
- package/dist/assets/button-LPikURUk.js +0 -1
- package/dist/assets/desktopHosts-DW8THEMC.js +0 -1
- package/dist/assets/desktopRelayRestore-BFn1FsR3.js +0 -1
- package/dist/assets/dialog-D8AYQa70.js +0 -1
- package/dist/assets/dropdown-menu.styles-3mrmi5fY.js +0 -1
- package/dist/assets/gitApi-CVqZBJOp.js +0 -10
- package/dist/assets/image-loading-23c-W-bq.js +0 -1
- package/dist/assets/insertionBoundaries-QcQpX59t.js +0 -1
- package/dist/assets/main-BcPly9IC.js +0 -169
- package/dist/assets/main-Di7p8GjN.js +0 -2
- package/dist/assets/markdown-worker-7FvUo2nm.js +0 -2
- package/dist/assets/mcpQueries-CW2h7NXI.js +0 -1
- package/dist/assets/miniChat-Cs-7LXyP.js +0 -2
- package/dist/assets/mobile-CGsmrhgA.js +0 -2
- package/dist/assets/multirun-BX9ykMyO.js +0 -3
- package/dist/assets/native-config-FUMqP3sd.js +0 -1
- package/dist/assets/persistence-Dzooc9Xg.js +0 -3
- package/dist/assets/platform-BT4vb0rs.js +0 -7
- package/dist/assets/projectMeta-BFtPKaOK.js +0 -1
- package/dist/assets/queryRuntime-DKGLQtb9.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-Bq0m9Qhc.js +0 -2
- package/dist/assets/renderMobileApp-P5KrVIBw.js +0 -28
- package/dist/assets/runtime-file-download-DAOam_oV.js +0 -1
- package/dist/assets/runtime-file-resource-C1k5nbWb.js +0 -2
- package/dist/assets/runtime-switch-CAZiOV2G.js +0 -1
- package/dist/assets/runtimeConfig-9HBA_MyT.js +0 -2
- package/dist/assets/runtimeEndpointReset-DeytUJtO.js +0 -149
- package/dist/assets/sessionChangeSummary-C9h6xZd8.js +0 -1
- package/dist/assets/sessionLookup-D15ec6WY.js +0 -1
- package/dist/assets/sortable-tabs-strip-Qxgcs21u.js +0 -1
- package/dist/assets/speechSettingsQueries-BiiCAU-s.js +0 -4
- package/dist/assets/src-DlJVKekb.css +0 -2
- package/dist/assets/terminalApi-bFOdIit8.js +0 -1
- package/dist/assets/textarea-bZ1VMrmO.js +0 -1
- package/dist/assets/types-ziSFePSf.js +0 -2
- package/dist/assets/url-Be8VCT8M.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-BJfaVDLo.js +0 -1
- package/dist/assets/useEffectiveDirectory-D4M0iYdf.js +0 -1
- package/dist/assets/useMobileNavigationStore-B5EmTMWP.js +0 -417
- package/dist/assets/useUIStore-NMQx_cnG.js +0 -1
- package/dist/assets/vendor-opencode-client-XDI8AfPJ.js +0 -12
package/dist/index.html
CHANGED
|
@@ -560,34 +560,44 @@
|
|
|
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-B-pfFh5C.js"></script>
|
|
564
564
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
565
565
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
566
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-
|
|
567
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
568
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
566
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-WzPG6NMR.js">
|
|
567
|
+
<link rel="modulepreload" crossorigin href="/assets/reasoning-projection-client-BEhVknv9.js">
|
|
568
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-BclMrQHc.js">
|
|
569
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
570
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-CfMDfs6c.js">
|
|
571
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-BEzVZGiW.js">
|
|
572
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-aNSNYVEB.js">
|
|
569
573
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
570
574
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
575
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
576
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-fxfj4IA_.js">
|
|
571
577
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
572
578
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
573
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
579
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-DqtgX2FB.js">
|
|
574
580
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BP2cRVqX.js">
|
|
581
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BWz0ose6.js">
|
|
582
|
+
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-CpsVmMzy.js">
|
|
575
583
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
576
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
577
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
578
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BFn1FsR3.js">
|
|
579
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-XDI8AfPJ.js">
|
|
584
|
+
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
585
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-Ck0wskDR.js">
|
|
580
586
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
587
|
+
<link rel="modulepreload" crossorigin href="/assets/fileQueries-voABZL1r.js">
|
|
588
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
589
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
581
590
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
582
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
583
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
584
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
585
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
586
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
587
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
588
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
589
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
590
|
-
<link rel="
|
|
591
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-CEkq2Pj2.js">
|
|
592
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BKM9BbT8.js">
|
|
593
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-DbFIyF-J.js">
|
|
594
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CZ2qtdn9.js">
|
|
595
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-kv0OsX45.js">
|
|
596
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CCb-BgPn.js">
|
|
597
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DX784Pe3.js">
|
|
598
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-C83Wsn8E.js">
|
|
599
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CW8O4Hdh.js">
|
|
600
|
+
<link rel="stylesheet" crossorigin href="/assets/src-r07HspQy.css">
|
|
591
601
|
</head>
|
|
592
602
|
<body class="h-full bg-background text-foreground">
|
|
593
603
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
|
@@ -614,7 +624,7 @@
|
|
|
614
624
|
<div id="root" class="h-full"></div>
|
|
615
625
|
|
|
616
626
|
<script>
|
|
617
|
-
// Fallback: hide loading screen
|
|
627
|
+
// Fallback: hide loading screen only when React has committed content.
|
|
618
628
|
// Desktop shells manage their own splash via the injected boot outcome;
|
|
619
629
|
// do not force-remove for desktop windows.
|
|
620
630
|
setTimeout(function() {
|
|
@@ -622,8 +632,7 @@
|
|
|
622
632
|
return;
|
|
623
633
|
}
|
|
624
634
|
var loading = document.getElementById('initial-loading');
|
|
625
|
-
if (loading) {
|
|
626
|
-
console.warn('Loading screen timeout - forcing hide after 10s');
|
|
635
|
+
if (loading && document.getElementById('root')?.childElementCount > 0) {
|
|
627
636
|
loading.classList.add('fade-out');
|
|
628
637
|
setTimeout(function() {
|
|
629
638
|
loading.remove();
|
package/dist/mini-chat.html
CHANGED
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
html[data-splash-variant='dark'] { --splash-background: var(--splash-background-dark); }
|
|
61
61
|
|
|
62
62
|
#initial-loading {
|
|
63
|
+
display: grid;
|
|
64
|
+
place-items: center;
|
|
63
65
|
background-color: var(--splash-background);
|
|
64
66
|
height: 100vh;
|
|
65
67
|
width: 100%;
|
|
@@ -72,54 +74,53 @@
|
|
|
72
74
|
opacity: 0;
|
|
73
75
|
pointer-events: none;
|
|
74
76
|
}
|
|
77
|
+
.dark #initial-loading img { filter: invert(1); }
|
|
75
78
|
</style>
|
|
76
79
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
80
|
+
<script type="module" crossorigin src="/assets/miniChat-Divc4WsR.js"></script>
|
|
78
81
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
79
82
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
80
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-WzPG6NMR.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/reasoning-projection-client-BEhVknv9.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-BclMrQHc.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-CfMDfs6c.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-BEzVZGiW.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-aNSNYVEB.js">
|
|
83
90
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
84
91
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-fxfj4IA_.js">
|
|
85
94
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
86
95
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-DqtgX2FB.js">
|
|
88
97
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BP2cRVqX.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BWz0ose6.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-CpsVmMzy.js">
|
|
89
100
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BFn1FsR3.js">
|
|
93
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-XDI8AfPJ.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-Ck0wskDR.js">
|
|
94
103
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
104
|
+
<link rel="modulepreload" crossorigin href="/assets/fileQueries-voABZL1r.js">
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
95
107
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
104
|
-
<link rel="
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-CEkq2Pj2.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BKM9BbT8.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-DbFIyF-J.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CZ2qtdn9.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-kv0OsX45.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CCb-BgPn.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DX784Pe3.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-C83Wsn8E.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CW8O4Hdh.js">
|
|
117
|
+
<link rel="stylesheet" crossorigin href="/assets/src-r07HspQy.css">
|
|
105
118
|
</head>
|
|
106
119
|
<body class="h-full bg-background text-foreground">
|
|
107
120
|
<div id="root" class="h-full">
|
|
108
|
-
<!--
|
|
109
|
-
|
|
110
|
-
the single Yuri cube itself. -->
|
|
111
|
-
<div id="initial-loading"></div>
|
|
121
|
+
<!-- React replaces the static logo with its startup state on first commit. -->
|
|
122
|
+
<div id="initial-loading"><img src="/assets/yuri-mark-black-DxEnMyCE.svg" width="120" height="120" alt="Yuri" /></div>
|
|
112
123
|
</div>
|
|
113
124
|
|
|
114
|
-
<script>
|
|
115
|
-
// Safety net: never let the splash hang if the app fails to dismiss it.
|
|
116
|
-
setTimeout(function() {
|
|
117
|
-
var loading = document.getElementById('initial-loading');
|
|
118
|
-
if (loading) {
|
|
119
|
-
loading.classList.add('fade-out');
|
|
120
|
-
setTimeout(function() { loading.remove(); }, 300);
|
|
121
|
-
}
|
|
122
|
-
}, 8000);
|
|
123
|
-
</script>
|
|
124
125
|
</body>
|
|
125
126
|
</html>
|
package/dist/mobile.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// paint. Without this the WebView shows its default (light) canvas until React mounts
|
|
11
11
|
// and the theme CSS variables are applied a frame later, which flashed
|
|
12
12
|
// white -> default-theme -> resolved-theme on every cold launch. Mirrors the same
|
|
13
|
-
// pre-paint logic in index.html
|
|
14
|
-
//
|
|
13
|
+
// pre-paint logic in index.html; the mobile logo lives inside the React root,
|
|
14
|
+
// so we paint the document background directly. Bundled-only: reads the
|
|
15
15
|
// theme the app itself persisted to localStorage; no server involved.
|
|
16
16
|
(function () {
|
|
17
17
|
try {
|
|
@@ -63,36 +63,51 @@
|
|
|
63
63
|
})();
|
|
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-CHlohOym.js"></script>
|
|
67
68
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
68
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-WzPG6NMR.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/assets/reasoning-projection-client-BEhVknv9.js">
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-BclMrQHc.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-CfMDfs6c.js">
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-BEzVZGiW.js">
|
|
76
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-aNSNYVEB.js">
|
|
72
77
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
73
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
79
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
80
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-fxfj4IA_.js">
|
|
74
81
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
75
82
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
76
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-DqtgX2FB.js">
|
|
77
84
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BP2cRVqX.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BWz0ose6.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-CpsVmMzy.js">
|
|
78
87
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
80
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BFn1FsR3.js">
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-XDI8AfPJ.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-Ck0wskDR.js">
|
|
83
90
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/fileQueries-voABZL1r.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
84
94
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
93
|
-
<link rel="
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-CEkq2Pj2.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BKM9BbT8.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-DbFIyF-J.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CZ2qtdn9.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-kv0OsX45.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CCb-BgPn.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DX784Pe3.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-C83Wsn8E.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CW8O4Hdh.js">
|
|
104
|
+
<link rel="stylesheet" crossorigin href="/assets/src-r07HspQy.css">
|
|
94
105
|
</head>
|
|
95
106
|
<body class="h-full bg-background text-foreground">
|
|
96
|
-
<div id="root" class="h-full"
|
|
107
|
+
<div id="root" class="h-full">
|
|
108
|
+
<div id="mobile-startup-logo" style="position:fixed;inset:0;display:grid;place-items:center" aria-label="Yuri">
|
|
109
|
+
<img src="/assets/yuri-mark-black-DxEnMyCE.svg" width="120" height="120" alt="Yuri" />
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
97
112
|
</body>
|
|
98
113
|
</html>
|
package/package.json
CHANGED
package/server/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface WebUiServerController {
|
|
|
6
6
|
httpServer: Server;
|
|
7
7
|
getPort: () => number | null;
|
|
8
8
|
getOpenCodePort: () => number | null;
|
|
9
|
+
/** Authenticated process-local client for the desktop GUI host; never expose over HTTP/IPC. */
|
|
10
|
+
getGuiPluginClient: () => import('@opencode/client').OpenCodeClient;
|
|
9
11
|
isReady: () => boolean;
|
|
10
12
|
restartOpenCode: () => Promise<void>;
|
|
11
13
|
stop: (options?: { exitProcess?: boolean; forceCloseConnections?: boolean }) => Promise<void>;
|
package/server/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './lib/brand-migration-bootstrap.js';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import express from 'express';
|
|
4
|
-
import { configureOpenCodeCredentials, openCodeCredentialSource } from './lib/opencode/auth.js';
|
|
4
|
+
import { configureOpenCodeCredentials, openCodeCredentialSource, currentClient } from './lib/opencode/auth.js';
|
|
5
|
+
import { trustedGuiPluginClient } from './lib/opencode/gui-plugin-source.js';
|
|
5
6
|
import compression from 'compression';
|
|
6
7
|
import path from 'path';
|
|
7
8
|
import { spawn, spawnSync } from 'child_process';
|
|
@@ -2159,6 +2160,12 @@ async function main(options = {}) {
|
|
|
2159
2160
|
httpServer: server,
|
|
2160
2161
|
getPort: () => tunnelRuntimeContext.getActivePort(),
|
|
2161
2162
|
getOpenCodePort: () => openCodePort,
|
|
2163
|
+
// In-process desktop only: never serialize this authenticated client to a renderer.
|
|
2164
|
+
getGuiPluginClient: () => trustedGuiPluginClient({
|
|
2165
|
+
managed: Boolean(openCodeProcess && !isExternalOpenCode),
|
|
2166
|
+
shared: openCodeLifecycleRuntime.isSharedOpenCodeService(),
|
|
2167
|
+
ready: isOpenCodeReady, url: buildOpenCodeUrl('', ''), client: currentClient,
|
|
2168
|
+
}),
|
|
2162
2169
|
getQuitRiskStatus: () => ({
|
|
2163
2170
|
scheduledTasks: scheduledTasksRuntime.getStatus(),
|
|
2164
2171
|
}),
|
|
@@ -35,7 +35,11 @@ timestamps, not installation/version timestamps or browser onboarding flags.
|
|
|
35
35
|
An absent completion marker requires initialization. A completed runtime does not
|
|
36
36
|
walk the catalog on startup or on a timer. It resumes only the durable dirty-session
|
|
37
37
|
queue populated by live events. Each dirty session is read by ID and refreshes its
|
|
38
|
-
own messages; unrelated sessions incur no upstream work. Initialization
|
|
38
|
+
own messages; unrelated sessions incur no upstream work. Initialization passes
|
|
39
|
+
resolve pending IDs outside a bounded catalog through `session.get`; excluded
|
|
40
|
+
children and expired sessions leave the dirty queue, while failed reads retain it.
|
|
41
|
+
This prevents filtered-out dirty IDs from keeping initialization in a rescan loop.
|
|
42
|
+
Initialization failures
|
|
39
43
|
retry using committed per-session checkpoints. Explicit `sync()` remains deliberate
|
|
40
44
|
catalog reconciliation; automatic scheduling uses incremental mode.
|
|
41
45
|
The event-identity hotfix adds `search_coverage.event_identity_repaired` without
|
|
@@ -84,6 +84,30 @@ export function createContentSearchRuntime({ service, getRuntimeKey, getEventRun
|
|
|
84
84
|
state.total = sessions.length;
|
|
85
85
|
state.completed = 0;
|
|
86
86
|
const recentIDs = new Set(sessions.map((session) => session.id));
|
|
87
|
+
// A time-bounded catalog cannot classify pending IDs outside its pages.
|
|
88
|
+
// Resolve those IDs directly so excluded children/expired roots cannot
|
|
89
|
+
// keep initialization dirty forever. Failed reads remain pending.
|
|
90
|
+
if (scanCatalog && !completeCatalog) for (const sessionID of pendingDirty) if (!recentIDs.has(sessionID)) {
|
|
91
|
+
try {
|
|
92
|
+
const session = await getSession({ sessionID, signal });
|
|
93
|
+
if (!current()) return;
|
|
94
|
+
if (!session?.id || !Number.isFinite(session.time?.updated)) throw new Error('Invalid dirty session');
|
|
95
|
+
if (!session.parentID && session.time.updated >= state.since && !deleted.has(sessionID)) {
|
|
96
|
+
sessions.push(session);
|
|
97
|
+
recentIDs.add(sessionID);
|
|
98
|
+
} else {
|
|
99
|
+
service.removeSession(runtime, sessionID);
|
|
100
|
+
dirty.delete(sessionID);
|
|
101
|
+
}
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (!current()) return;
|
|
104
|
+
if ((error?.status ?? error?.response?.status) === 404) {
|
|
105
|
+
service.removeSession(runtime, sessionID);
|
|
106
|
+
dirty.delete(sessionID);
|
|
107
|
+
} else state.failed++;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
state.total = sessions.length;
|
|
87
111
|
if (scanCatalog && completeCatalog) for (const id of pendingDirty) if (!recentIDs.has(id)) {
|
|
88
112
|
dirty.delete(id);
|
|
89
113
|
service.acknowledge(runtime, id, revisions.get(id));
|
|
@@ -2,6 +2,25 @@ import { expect, test, vi } from 'vitest';
|
|
|
2
2
|
import { createContentSearchService } from './service.js';
|
|
3
3
|
import { createContentSearchRuntime } from './runtime.js';
|
|
4
4
|
|
|
5
|
+
test('bounded backfill drains excluded dirty children without repeating the catalog scan', async () => {
|
|
6
|
+
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
7
|
+
const day = 86400000;
|
|
8
|
+
const now = 40 * day;
|
|
9
|
+
service.markDirty('host', 'child');
|
|
10
|
+
const listSessions = vi.fn(async () => ({ data: [{ id: 'old', time: { updated: 1 } }], cursor: { next: 'older' } }));
|
|
11
|
+
const runtime = createContentSearchRuntime({ service, getRuntimeKey: () => 'host', now: () => now,
|
|
12
|
+
listSessions, getSession: async () => ({ id: 'child', parentID: 'parent', time: { updated: now } }),
|
|
13
|
+
listMessages: vi.fn(),
|
|
14
|
+
});
|
|
15
|
+
try {
|
|
16
|
+
await runtime.sync({ incremental: true });
|
|
17
|
+
expect(service.pending('host')).toEqual([]);
|
|
18
|
+
expect(runtime.status().initializationRequired).toBe(false);
|
|
19
|
+
await runtime.sync({ incremental: true });
|
|
20
|
+
expect(listSessions).toHaveBeenCalledTimes(1);
|
|
21
|
+
} finally { await runtime.stop(); service.close(); }
|
|
22
|
+
});
|
|
23
|
+
|
|
5
24
|
test('warm startup and idle time do not scan history; durable dirty events refresh only their session', async () => {
|
|
6
25
|
vi.useFakeTimers();
|
|
7
26
|
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
@@ -6,6 +6,7 @@ Own filesystem API behavior for the web server runtime, including file operation
|
|
|
6
6
|
## Entrypoints and structure
|
|
7
7
|
- `packages/web/server/lib/fs/routes.js`: route registration and runtime-owned state for `/api/fs/*` endpoints.
|
|
8
8
|
- `packages/web/server/lib/fs/search.js`: fuzzy filesystem search runtime used by non-FS routes (for example project icon discovery).
|
|
9
|
+
- `packages/web/server/lib/fs/binary-file.js`: shared 8 KiB binary sniff for Web stat, Electron binary-path IPC, and both VS Code stat adapters. Strict UTF-8 decoding permits an incomplete trailing code point only when the opened file's size confirms more bytes remain; NUL, malformed sequences, and incomplete UTF-8 at EOF remain binary. File handles close on every outcome, and filesystem errors propagate.
|
|
9
10
|
|
|
10
11
|
## Public exports
|
|
11
12
|
- `registerFsRoutes(app, dependencies)` from `routes.js`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const BINARY_SAMPLE_BYTES = 8192;
|
|
2
|
+
|
|
3
|
+
export const isBinaryFile = async (filePath, fsPromises) => {
|
|
4
|
+
const file = await fsPromises.open(filePath, 'r');
|
|
5
|
+
try {
|
|
6
|
+
const sample = Buffer.alloc(BINARY_SAMPLE_BYTES);
|
|
7
|
+
const { bytesRead } = await file.read(sample, 0, sample.length, 0);
|
|
8
|
+
const bytes = sample.subarray(0, bytesRead);
|
|
9
|
+
if (bytes.includes(0)) return true;
|
|
10
|
+
const { size } = await file.stat();
|
|
11
|
+
try {
|
|
12
|
+
// Only a non-EOF sample may end partway through a UTF-8 code point.
|
|
13
|
+
new TextDecoder('utf-8', { fatal: true }).decode(bytes, { stream: bytesRead < size });
|
|
14
|
+
return false;
|
|
15
|
+
} catch {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
} finally {
|
|
19
|
+
await file.close();
|
|
20
|
+
}
|
|
21
|
+
};
|
package/server/lib/fs/routes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { createImageFingerprintReader } from './image-fingerprint.js';
|
|
3
|
+
import { isBinaryFile } from './binary-file.js';
|
|
3
4
|
import { createRealpathCache } from '../path-realpath-cache.js';
|
|
4
5
|
import nodeFsPromises from 'node:fs/promises';
|
|
5
6
|
import nodePath from 'node:path';
|
|
@@ -127,27 +128,6 @@ const FILE_MIME_MAP = Object.freeze({
|
|
|
127
128
|
});
|
|
128
129
|
|
|
129
130
|
const MAX_SERVE_BYTES = 100 * 1024 * 1024;
|
|
130
|
-
const BINARY_SAMPLE_BYTES = 8192;
|
|
131
|
-
|
|
132
|
-
const isBinaryFile = async (filePath, fsPromises) => {
|
|
133
|
-
const file = await fsPromises.open(filePath, 'r');
|
|
134
|
-
try {
|
|
135
|
-
const sample = Buffer.alloc(BINARY_SAMPLE_BYTES);
|
|
136
|
-
const { bytesRead } = await file.read(sample, 0, sample.length, 0);
|
|
137
|
-
const bytes = sample.subarray(0, bytesRead);
|
|
138
|
-
if (bytes.includes(0)) {
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
try {
|
|
142
|
-
new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
143
|
-
return false;
|
|
144
|
-
} catch {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
} finally {
|
|
148
|
-
await file.close();
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
131
|
|
|
152
132
|
// Only deterministic, side-effect-free git plumbing path queries are cacheable.
|
|
153
133
|
// Anything outside this allowlist (including any non-git command) runs normally
|
|
@@ -285,6 +285,48 @@ const callMkdir = async (handler, body) => {
|
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
describe('fs stat', () => {
|
|
288
|
+
it.each([
|
|
289
|
+
['two-byte code point split after byte 1', Buffer.from('a'.repeat(8191) + 'é'), false],
|
|
290
|
+
['Chinese split after byte 2', Buffer.from('a'.repeat(8190) + '好'), false],
|
|
291
|
+
['emoji split after byte 1', Buffer.from('a'.repeat(8191) + '😀'), false],
|
|
292
|
+
['emoji split after byte 2', Buffer.from('a'.repeat(8190) + '😀'), false],
|
|
293
|
+
['emoji split after byte 3', Buffer.from('a'.repeat(8189) + '😀'), false],
|
|
294
|
+
['complete Chinese at exact sample EOF', Buffer.from('a'.repeat(8189) + '好'), false],
|
|
295
|
+
['empty file', Buffer.alloc(0), false],
|
|
296
|
+
['incomplete UTF-8 at short EOF', Buffer.from([0xe5, 0xa5]), true],
|
|
297
|
+
['incomplete UTF-8 at exact sample EOF', Buffer.concat([Buffer.alloc(8191, 0x61), Buffer.from([0xe5])]), true],
|
|
298
|
+
['invalid leading byte before non-EOF boundary', Buffer.concat([Buffer.from([0xff]), Buffer.alloc(8192, 0x61)]), true],
|
|
299
|
+
['NUL before non-EOF boundary', Buffer.concat([Buffer.from([0]), Buffer.alloc(8192, 0x61)]), true],
|
|
300
|
+
['invalid continuation at non-EOF boundary', Buffer.concat([Buffer.alloc(8190, 0x61), Buffer.from([0xe5, 0x61, 0x61])]), true],
|
|
301
|
+
['overlong sequence at non-EOF boundary', Buffer.concat([Buffer.alloc(8190, 0x61), Buffer.from([0xe0, 0x80, 0x80])]), true],
|
|
302
|
+
['surrogate at non-EOF boundary', Buffer.concat([Buffer.alloc(8190, 0x61), Buffer.from([0xed, 0xa0, 0x80])]), true],
|
|
303
|
+
['out-of-range code point at non-EOF boundary', Buffer.concat([Buffer.alloc(8190, 0x61), Buffer.from([0xf4, 0x90, 0x80, 0x80])]), true],
|
|
304
|
+
])('classifies %s', async (_name, bytes, expected) => {
|
|
305
|
+
const directory = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'yuri-binary-sample-'));
|
|
306
|
+
const filePath = path.join(directory, 'report.eficy');
|
|
307
|
+
try {
|
|
308
|
+
await fs.promises.writeFile(filePath, bytes);
|
|
309
|
+
const res = await callStat(registerStat(fs.promises), { path: filePath });
|
|
310
|
+
expect(res.statusCode).toBe(200);
|
|
311
|
+
expect(res.body).toMatchObject({ isBinary: expected });
|
|
312
|
+
} finally {
|
|
313
|
+
await fs.promises.rm(directory, { recursive: true, force: true });
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it('keeps Chinese UTF-8 crossing the 8192-byte sample boundary previewable', async () => {
|
|
318
|
+
const directory = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'yuri-binary-sample-'));
|
|
319
|
+
const filePath = path.join(directory, 'report.shadcn.eficy');
|
|
320
|
+
try {
|
|
321
|
+
await fs.promises.writeFile(filePath, 'a'.repeat(8191) + '好' + 'b'.repeat(28573));
|
|
322
|
+
const res = await callStat(registerStat(fs.promises), { path: filePath });
|
|
323
|
+
expect(res.statusCode).toBe(200);
|
|
324
|
+
expect(res.body).toMatchObject({ size: 36767, isBinary: false });
|
|
325
|
+
} finally {
|
|
326
|
+
await fs.promises.rm(directory, { recursive: true, force: true });
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
|
|
288
330
|
it('reports binary content from a bounded byte sample', async () => {
|
|
289
331
|
const file = {
|
|
290
332
|
read: vi.fn(async (buffer) => {
|
|
@@ -307,6 +349,7 @@ describe('fs stat', () => {
|
|
|
307
349
|
|
|
308
350
|
it('keeps UTF-8 text previewable', async () => {
|
|
309
351
|
const file = {
|
|
352
|
+
stat: vi.fn(async () => ({ size: 23 })),
|
|
310
353
|
read: vi.fn(async (buffer) => {
|
|
311
354
|
buffer.set(Buffer.from('export const value = 1;'));
|
|
312
355
|
return { bytesRead: 23 };
|
|
@@ -24,6 +24,7 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
24
24
|
- `packages/web/server/lib/opencode/index.js`: public entrypoint (currently baseline placeholder).
|
|
25
25
|
- `packages/web/server/lib/opencode/auth.js`: host-only authoritative provider credential API reads and deletion.
|
|
26
26
|
- `packages/web/server/lib/opencode/auth-state-runtime.js`: managed OpenCode server auth password/header runtime.
|
|
27
|
+
- `gui-plugin-source.js`: process-local native GUI client admission. Requires ready managed-child/shared-service ownership plus loopback endpoint; external servers/SSH forwards cannot supply native code. The returned server controller's `getGuiPluginClient()` calls this gate, and throws stable `GUI_PLUGIN_UNTRUSTED_SOURCE` / `GUI_PLUGIN_UNAVAILABLE` codes. It is never an HTTP route or renderer-provided endpoint.
|
|
27
28
|
- `packages/web/server/lib/opencode/cli-options.js`: CLI/environment option parsing for server startup arguments.
|
|
28
29
|
- `packages/web/server/lib/opencode/cli-entry-runtime.js`: CLI entrypoint runtime that detects direct execution, forces `YURI_RUNTIME=web` unless already `ssh-remote` (so `dev:server` cannot inherit a leftover desktop env and host a relay, while SSH-managed remotes may), parses CLI options, and starts server bootstrap.
|
|
29
30
|
- `packages/web/server/lib/opencode/routes.js`: OpenCode/provider settings and auth-related route registration.
|
|
@@ -68,6 +69,10 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
68
69
|
- `packages/web/server/lib/opencode/settings-normalization-runtime.js`: path/settings normalization and sanitization helpers runtime used by settings/routes/config wiring.
|
|
69
70
|
- `packages/web/server/lib/opencode/theme-runtime.js`: custom theme JSON validation and theme directory loading runtime for settings utility routes.
|
|
70
71
|
- `packages/web/server/lib/opencode/proxy.js`: OpenCode API/SSE forwarding and readiness-gate route registration.
|
|
72
|
+
- `plugin-gui-response.js`: shared Web/Electron/VS Code code-only revision response owner for exact `GET /api/plugin/gui?id=…` (one nonempty id). The installed GUI client alias is official `@opencode/client@2.2.0`: HTTP returns `{ location, data: { code, revision, options } }`. Every call still reads the complete current upstream response through the existing auth/readiness/abort boundary; there is no Host bundle cache.
|
|
73
|
+
- Request `X-Yuri-Gui-Revision: <lowercase SHA-256 hex of UTF-8 revision>` opts into code reuse. This header and HTTP condition/range headers are stripped before upstream so Yuri always requests a complete representation. Other query and request headers retain proxy semantics.
|
|
74
|
+
- A valid upstream 200 JSON bundle (`code` string, nonempty `revision` string, `options` object) receives `X-Yuri-Gui-Revision` and `Cache-Control: private, no-store`. Matching tokens additionally receive `X-Yuri-Gui-Code: cached` and only `data.code` becomes `''`; current `options`, `revision`, location and other fields remain. Unmatched/ordinary calls preserve original body bytes. No 304 or Yuri ETag is generated. Upstream failure statuses/bodies remain failures; malformed successful bodies remain unchanged without a revision receipt.
|
|
75
|
+
- Clients restore code before SDK decoding and may persist code/revision only, never options. Browser caches must not store these option-bearing responses. Stale validators and decoded compression/length headers are removed at the response boundary. Packaged/mobile cross-origin clients receive the two response headers through CORS; Relay forwards them transparently on the same `/api/plugin/gui` path.
|
|
71
76
|
- `packages/web/server/lib/opencode/instance-recovery-runtime.js`: directory-instance health recovery before turn admission (`prompt_async` / `command` / `shell`). When OpenCode's per-directory instance is poisoned (MCP probe returns 503 empty while HTTP still accepts prompts that immediately abort as `MessageAbortedError`), dispose the instance so the next admission recreates a healthy one.
|
|
72
77
|
- `packages/web/server/lib/opencode/session-runtime.js`: session status/attention/activity runtime for OpenCode SSE events.
|
|
73
78
|
- `packages/web/server/lib/opencode/watcher.js`: global SSE watcher runtime for push/session event fanout.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A loopback URL alone is not ownership: external services and SSH forwards are excluded. */
|
|
2
|
+
export function trustedGuiPluginClient({ managed, shared, ready, url, client }) {
|
|
3
|
+
let local = false;
|
|
4
|
+
try {
|
|
5
|
+
const parsed = new URL(url);
|
|
6
|
+
local = ['http:', 'https:'].includes(parsed.protocol) && ['127.0.0.1', '[::1]', 'localhost'].includes(parsed.hostname)
|
|
7
|
+
&& !parsed.username && !parsed.password;
|
|
8
|
+
} catch { /* Missing or malformed endpoint is not a trusted source. */ }
|
|
9
|
+
if (!local || (!managed && !shared)) {
|
|
10
|
+
throw Object.assign(new Error('Native GUI source is not locally managed'), { code: 'GUI_PLUGIN_UNTRUSTED_SOURCE' });
|
|
11
|
+
}
|
|
12
|
+
if (!ready) throw Object.assign(new Error('Local GUI service is unavailable'), { code: 'GUI_PLUGIN_UNAVAILABLE' });
|
|
13
|
+
return client();
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { trustedGuiPluginClient } from './gui-plugin-source.js';
|
|
3
|
+
|
|
4
|
+
describe('desktop native GUI code source', () => {
|
|
5
|
+
it.each([
|
|
6
|
+
{ managed: true, shared: false, url: 'http://127.0.0.1:4096' },
|
|
7
|
+
{ managed: false, shared: true, url: 'http://[::1]:4096' },
|
|
8
|
+
])('accepts authoritative local ownership: %j', (source) => {
|
|
9
|
+
const value = {}; const client = vi.fn(() => value);
|
|
10
|
+
expect(trustedGuiPluginClient({ ...source, ready: true, client })).toBe(value);
|
|
11
|
+
expect(client).toHaveBeenCalledOnce();
|
|
12
|
+
});
|
|
13
|
+
it.each([
|
|
14
|
+
{ managed: false, shared: false, url: 'http://127.0.0.1:4096' },
|
|
15
|
+
{ managed: true, shared: false, url: 'https://remote.example' },
|
|
16
|
+
{ managed: false, shared: true, url: 'https://localhost.remote.example' },
|
|
17
|
+
{ managed: true, shared: false, url: 'file:///plugin.cjs' },
|
|
18
|
+
{ managed: true, shared: false, url: 'http://name:password@localhost:4096' },
|
|
19
|
+
])('rejects external/forwarded or non-local sources before obtaining credentials: %j', (source) => {
|
|
20
|
+
const client = vi.fn();
|
|
21
|
+
expect(() => trustedGuiPluginClient({ ...source, ready: true, client })).toThrow(expect.objectContaining({ code: 'GUI_PLUGIN_UNTRUSTED_SOURCE' }));
|
|
22
|
+
expect(client).not.toHaveBeenCalled();
|
|
23
|
+
});
|
|
24
|
+
it('distinguishes temporarily unavailable local service from an untrusted source', () => {
|
|
25
|
+
expect(() => trustedGuiPluginClient({ managed: true, ready: false, url: 'http://localhost:4096', client: vi.fn() }))
|
|
26
|
+
.toThrow(expect.objectContaining({ code: 'GUI_PLUGIN_UNAVAILABLE' }));
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function preparePluginGuiRequest(
|
|
2
|
+
method: string,
|
|
3
|
+
requestPath: string,
|
|
4
|
+
headers: Record<string, string>,
|
|
5
|
+
): { headers: Record<string, string>; revision: string | null } | null;
|
|
6
|
+
|
|
7
|
+
export function projectPluginGuiResponse(response: Response, requestedRevision: string | null): Promise<Response>;
|