@yuriai/web 0.2.40-beta.3 → 0.2.40-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/dist/assets/{AgentAvatar-kQhfwlay.js → AgentAvatar-B7KbxN8Y.js} +1 -1
  2. package/dist/assets/AssistantConversationSurface-BnK_KTBO.js +3 -0
  3. package/dist/assets/{AssistantUnreadBadge-B2SY-_-u.js → AssistantUnreadBadge-vu4ZhTft.js} +1 -1
  4. package/dist/assets/{AssistantView-C_hiAuTd.js → AssistantView-CEfEWUIr.js} +1 -1
  5. package/dist/assets/DiagramView-Dlzr08J_.js +1 -0
  6. package/dist/assets/{FadeInOnReveal-CMeIdEKz.js → FadeInOnReveal-DMRmNsau.js} +1 -1
  7. package/dist/assets/{GuiPluginPage-WXqykPAg.js → GuiPluginPage-DVug4z_p.js} +1 -1
  8. package/dist/assets/GuiPluginSurface-L43o6Xv8.js +1 -0
  9. package/dist/assets/{GuiPluginWindow-BLzchKn7.js → GuiPluginWindow-tHXkS18H.js} +1 -1
  10. package/dist/assets/{Icon-DygEqfgq.js → Icon-DizeYahT.js} +1 -1
  11. package/dist/assets/{ImageLoadingPlaceholder-kbBRpDSD.js → ImageLoadingPlaceholder-BZC5m_km.js} +1 -1
  12. package/dist/assets/LoadingImage-Csw4L-Dr.js +1 -0
  13. package/dist/assets/MarkdownRenderer-D_0iKhQN.js +2 -0
  14. package/dist/assets/MarkdownRendererImpl-BZ0XgjS0.js +10 -0
  15. package/dist/assets/MarkstreamRendererImpl-DBd6Glg9.js +3 -0
  16. package/dist/assets/MobileDetailNavigation-xgwvsQuR.js +1 -0
  17. package/dist/assets/{MobileResizableSheet-Dt2U0JHY.js → MobileResizableSheet-CQQ7O-2X.js} +1 -1
  18. package/dist/assets/MobileShareBridge-IO45gM2G.js +3 -0
  19. package/dist/assets/MobileSurface-DmYgZONB.js +2 -0
  20. package/dist/assets/{MultiRunWindow-BuRo90Ma.js → MultiRunWindow-fJ3XfntS.js} +1 -1
  21. package/dist/assets/OnboardingScreen-MJS5T5rL.js +1 -0
  22. package/dist/assets/{OverlayScrollbar-B0X61qR-.js → OverlayScrollbar-jtMYTn1y.js} +1 -1
  23. package/dist/assets/SettingsView-ZWFLpPSI.js +29 -0
  24. package/dist/assets/{SettingsWindow-kCbf8IoB.js → SettingsWindow-DGRmrIWz.js} +1 -1
  25. package/dist/assets/SetupTourDialog-BYbAubwA.js +1 -0
  26. package/dist/assets/TerminalView-CoJ6_9P1.js +8 -0
  27. package/dist/assets/ToolOutputDialog-5xBwOJ6a.js +16 -0
  28. package/dist/assets/VoiceSettings-CN33koSc.js +2 -0
  29. package/dist/assets/{YuriLogo-B58GIl2v.js → YuriLogo-CvyJy_R9.js} +1 -1
  30. package/dist/assets/YuriWordmark-DnFAS-Ko.js +1 -0
  31. package/dist/assets/{assistant-attachment-cache-Cmzt4xXE.js → assistant-attachment-cache-D-LmCflm.js} +1 -1
  32. package/dist/assets/bootstrap-eLlfzqAI.js +1 -0
  33. package/dist/assets/{capgoAdapter-DO1rEVQf.js → capgoAdapter-CCLtBZL1.js} +1 -1
  34. package/dist/assets/{checkbox-BW80bcK5.js → checkbox-rOV6DjeG.js} +1 -1
  35. package/dist/assets/client-uz8O6TPX.js +7 -0
  36. package/dist/assets/{collapsible-BOL5Wx2J.js → collapsible-CKswuqAw.js} +1 -1
  37. package/dist/assets/{context-menu-CiFnjP1q.js → context-menu-B4njwT_M.js} +1 -1
  38. package/dist/assets/{desktopHosts-DovfbQPm.js → desktopHosts-135cuRCE.js} +1 -1
  39. package/dist/assets/{desktopRelayRestore-D4pbpNKN.js → desktopRelayRestore-1aUztDPU.js} +1 -1
  40. package/dist/assets/{device-DNG0cNwQ.js → device-QL8KNSLM.js} +1 -1
  41. package/dist/assets/{diagram-DRn8iIs1.js → diagram-BppQ_USn.js} +1 -1
  42. package/dist/assets/{dialog-DQp289fr.js → dialog-Bg8MJnOV.js} +1 -1
  43. package/dist/assets/{es-D0Q_CV0t.js → es-Ba3NUCtE.js} +3 -3
  44. package/dist/assets/{fileMentionTouchSelection-582p0uCX.js → fileMentionTouchSelection-D-AdTJVr.js} +1 -1
  45. package/dist/assets/fileReferenceActions-cYqdsXFz.js +1 -0
  46. package/dist/assets/{fr-DrO5SAKl.js → fr-CRhp3hyT.js} +3 -3
  47. package/dist/assets/{gitApi-vYBmQIuU.js → gitApi-DVx_V1x6.js} +11 -7
  48. package/dist/assets/gitApiHttp-DvTBxvX8.js +3 -0
  49. package/dist/assets/historyImportQueries-D_9RlrLp.js +1 -0
  50. package/dist/assets/host-DrGjjO6K.js +1 -0
  51. package/dist/assets/{i18n-UaLestuf.js → i18n-RH7UieOS.js} +1 -1
  52. package/dist/assets/image-loading-DBqnxgDH.js +1 -0
  53. package/dist/assets/{input-B281XcMR.js → input-DRjuZMeA.js} +1 -1
  54. package/dist/assets/input-store-CjUOfpyA.js +1 -0
  55. package/dist/assets/insertionBoundaries-DZtQt2Ah.js +1 -0
  56. package/dist/assets/{ja-BNeP9_GU.js → ja-D-UPjDY2.js} +3 -3
  57. package/dist/assets/{ko-DRRFD_7l.js → ko-x-z9J5z7.js} +3 -3
  58. package/dist/assets/main-BMFY9mtb.js +2 -0
  59. package/dist/assets/main-D2s9J_jN.js +169 -0
  60. package/dist/assets/{markdownHeightCache-BgYJswDy.js → markdownHeightCache-BL99DlhC.js} +1 -1
  61. package/dist/assets/{markdownTheme-CHNl6tUv.js → markdownTheme-DFDWa8Gh.js} +1 -1
  62. package/dist/assets/mcpQueries-HzYMEVWd.js +1 -0
  63. package/dist/assets/miniChat-BbJ0GKpk.js +2 -0
  64. package/dist/assets/mobile-_zUth69Z.js +2 -0
  65. package/dist/assets/mobileBackNavigation--ZdrI-Yj.js +1 -0
  66. package/dist/assets/mobileConnections-C3eGEOPy.js +2 -0
  67. package/dist/assets/multirun-CDYNyLBH.js +3 -0
  68. package/dist/assets/{native-config-BOaqa45X.js → native-config-DOawZfln.js} +1 -1
  69. package/dist/assets/navigation-Ibk_Pw-q.js +2 -0
  70. package/dist/assets/{pl-BnW5wJrl.js → pl-Cqo1FJwM.js} +3 -3
  71. package/dist/assets/platform-wF65ZFgV.js +1 -0
  72. package/dist/assets/project-preview-2H-TmJkd.js +1 -0
  73. package/dist/assets/projectActions-50e_f9dI.js +1 -0
  74. package/dist/assets/projectMeta-D1Ytss9U.js +1 -0
  75. package/dist/assets/prompt-attachment-upload-BNhDXymd.js +1 -0
  76. package/dist/assets/{pt-BR-fZW8CCVQ.js → pt-BR-C930XU1k.js} +3 -3
  77. package/dist/assets/pwa-CXupOTsD.js +2 -0
  78. package/dist/assets/queue-abort-optimistic-CQXpIlq6.js +1 -0
  79. package/dist/assets/{react-DPhQUTaH.js → react-CgRToPwO.js} +1 -1
  80. package/dist/assets/{readiness-BpVAjFhF.js → readiness-BfuZm6Yw.js} +2 -2
  81. package/dist/assets/relay-preview-frame-src-BPyz3nXA.js +1 -0
  82. package/dist/assets/remote-input-store-BOdCWpQY.js +1 -0
  83. package/dist/assets/remoteProjectQueries-CkxdZNw4.js +1 -0
  84. package/dist/assets/renderElectronMiniChatApp-pJ59iC34.js +2 -0
  85. package/dist/assets/renderMobileApp-BQFC-gOA.js +29 -0
  86. package/dist/assets/{runtime-file-download-DMY1k1af.js → runtime-file-download-D11Nnedg.js} +1 -1
  87. package/dist/assets/runtime-file-resource-CuLP3xp7.js +6 -0
  88. package/dist/assets/runtimeConfig-tHm7o_0I.js +2 -0
  89. package/dist/assets/{runtimeEndpointReset-BOdd_mJM.css → runtimeEndpointReset-BUGfn7y0.css} +1 -1
  90. package/dist/assets/runtimeEndpointReset-BhHWFNvo.js +150 -0
  91. package/dist/assets/safeStorage-DTOhKN0V.js +1 -0
  92. package/dist/assets/scheduledTaskNavigation-BIDtQ4wN.js +1 -0
  93. package/dist/assets/{select-CyPxbnW8.js → select-B1On-Y4Z.js} +1 -1
  94. package/dist/assets/sessionLookup-RcyTTDOy.js +1 -0
  95. package/dist/assets/sortable-tabs-strip-nD1Me06z.js +1 -0
  96. package/dist/assets/{speechSettingsQueries-CTsBn-Ib.js → speechSettingsQueries-BYhNpzDJ.js} +1 -1
  97. package/dist/assets/src-BZCFf9_1.css +2 -0
  98. package/dist/assets/{store-CzVMz42v.js → store-DunGyOfe.js} +4 -4
  99. package/dist/assets/terminalApi-madXrfqA.js +1 -0
  100. package/dist/assets/{textarea-CjJsstUF.js → textarea-Qt06OhhX.js} +1 -1
  101. package/dist/assets/{tooltip-Di_DSZ8p.js → tooltip-D382RCy1.js} +1 -1
  102. package/dist/assets/tour-CQMBn8gJ.js +1 -0
  103. package/dist/assets/{types-wnqkJWYs.js → types-CHszLAS3.js} +1 -1
  104. package/dist/assets/{uk-C4OKsNRv.js → uk-OXQSdzuT.js} +3 -3
  105. package/dist/assets/{useAppFontEffects-BRMf55oN.js → useAppFontEffects-CqXrCJVt.js} +63 -58
  106. package/dist/assets/useAppFontEffects-K31q-1OV.css +1 -0
  107. package/dist/assets/useAssistantUIStore-jOKVcBK8.js +1 -0
  108. package/dist/assets/useDesktopWindowControlsLayout-KH4UP7Gj.js +1 -0
  109. package/dist/assets/{useDictation-Sk20Gi0T.js → useDictation-Bs7TWO9r.js} +1 -1
  110. package/dist/assets/useEffectiveDirectory-CCKRdyK9.js +1 -0
  111. package/dist/assets/useFontPreferences-CPrl1_3z.js +1 -0
  112. package/dist/assets/{useMobileHtmlPreviewStore-C03uVLfX.js → useMobileHtmlPreviewStore-EOAzZiAy.js} +1 -1
  113. package/dist/assets/useMobileNavigationStore-BNtVrnSw.js +13 -0
  114. package/dist/assets/usePluginsStore-bMuGciUE.js +1 -0
  115. package/dist/assets/useProjectRuntimeAPIs-BFCXBu2J.js +1 -0
  116. package/dist/assets/{useStreamingTextThrottle-CjMALEr7.js → useStreamingTextThrottle-C8xAqcgP.js} +1 -1
  117. package/dist/assets/{useThemeSystem-CNzUUkFn.js → useThemeSystem-C57Z9mV2.js} +1 -1
  118. package/dist/assets/useUIStore-Cfmg-aDQ.js +1 -0
  119. package/dist/assets/uuid-D-SDZijH.js +1 -0
  120. package/dist/assets/{vendor-base-ui-CzHs0bHY.js → vendor-base-ui-z2M4boRm.js} +1 -1
  121. package/dist/assets/{vendor-cmdk-C_tivUtr.js → vendor-cmdk-BgHvMv5l.js} +1 -1
  122. package/dist/assets/{vendor-dnd-kit-accessibility-BOtnpZt5.js → vendor-dnd-kit-accessibility-gVi9ga0x.js} +1 -1
  123. package/dist/assets/{vendor-dnd-kit-core-DK4OoOTr.js → vendor-dnd-kit-core-Dd5yS2-T.js} +1 -1
  124. package/dist/assets/{vendor-dnd-kit-sortable-Cv69eQm1.js → vendor-dnd-kit-sortable-CV-SGi8y.js} +1 -1
  125. package/dist/assets/{vendor-framer-motion-DDMKlXiP.js → vendor-framer-motion-CF9BQLta.js} +1 -1
  126. package/dist/assets/{vendor-markstream-react-6zxyQLCD.js → vendor-markstream-react-TwEpkgfP.js} +3 -3
  127. package/dist/assets/vendor-motion-Dv27UnOI.js +1 -0
  128. package/dist/assets/{vendor-pierre-diffs-BFiZ3IhI.js → vendor-pierre-diffs-tqo4Z3TC.js} +1 -1
  129. package/dist/assets/{vendor-react-DlzBev0S.js → vendor-react-P8wFrkcT.js} +1 -1
  130. package/dist/assets/{vendor-react-drawio-Dyg1-39Q.js → vendor-react-drawio-CQW1YP2l.js} +1 -1
  131. package/dist/assets/vendor-reactuses-core-Dyjw5sZR.js +1 -0
  132. package/dist/assets/{vendor-sonner-BEHGipm5.js → vendor-sonner-B5HgJenP.js} +1 -1
  133. package/dist/assets/{vendor-stream-diffs-wcQxoPZk.js → vendor-stream-diffs-DCMtZcS3.js} +2 -2
  134. package/dist/assets/vendor-tanstack-query-core-BSjXNgF_.js +1 -0
  135. package/dist/assets/vendor-tanstack-react-query-B-KblYBV.js +1 -0
  136. package/dist/assets/{vendor-tanstack-react-virtual-DSFNK3qc.js → vendor-tanstack-react-virtual-BkuqzrEV.js} +1 -1
  137. package/dist/assets/{vendor-zustand-vDaAPGfl.js → vendor-zustand-Cwko4FG1.js} +1 -1
  138. package/dist/assets/{zh-CN-ieAs59w6.js → zh-CN-B5X8yCZV.js} +3 -3
  139. package/dist/assets/{zh-TW-WWTW1fkP.js → zh-TW-CF6zr1fk.js} +3 -3
  140. package/dist/index.html +32 -27
  141. package/dist/mini-chat.html +32 -27
  142. package/dist/mobile.html +2 -2
  143. package/package.json +3 -2
  144. package/server/index.d.ts +19 -0
  145. package/server/index.js +35 -5
  146. package/server/lib/assistants/builtin-skills.js +1 -1
  147. package/server/lib/assistants/builtin-skills.test.js +2 -0
  148. package/server/lib/client-auth/remote-clients.js +11 -0
  149. package/server/lib/content-search/DOCUMENTATION.md +5 -0
  150. package/server/lib/content-search/routes.js +4 -0
  151. package/server/lib/content-search/routes.test.js +10 -0
  152. package/server/lib/event-stream/DOCUMENTATION.md +5 -0
  153. package/server/lib/event-stream/runtime.js +3 -0
  154. package/server/lib/event-stream/upstream-reader.js +1 -1
  155. package/server/lib/gui-customization/DOCUMENTATION.md +25 -1
  156. package/server/lib/gui-customization/projects-client.mjs +59 -0
  157. package/server/lib/gui-customization/projects.js +43 -0
  158. package/server/lib/gui-customization/projects.test.js +103 -0
  159. package/server/lib/gui-customization/remote-connections-client.mjs +2 -8
  160. package/server/lib/gui-customization/session-skill-command.mjs +8 -0
  161. package/server/lib/gui-customization/session-skill.js +15 -10
  162. package/server/lib/gui-customization/session-skill.test.js +21 -2
  163. package/server/lib/gui-customization/skill/SKILL.md +3 -1
  164. package/server/lib/gui-customization/skill/references/projects.md +63 -0
  165. package/server/lib/gui-customization/skill/references/remote-connections.md +11 -0
  166. package/server/lib/message-queue/DOCUMENTATION.md +4 -0
  167. package/server/lib/message-queue/service.js +2 -1
  168. package/server/lib/message-queue/service.test.js +11 -0
  169. package/server/lib/notifications/DOCUMENTATION.md +12 -0
  170. package/server/lib/notifications/emitter-runtime.js +5 -0
  171. package/server/lib/notifications/runtime.js +20 -2
  172. package/server/lib/notifications/runtime.test.js +21 -0
  173. package/server/lib/notifications/session-unread-runtime.js +51 -13
  174. package/server/lib/notifications/session-unread.test.js +113 -1
  175. package/server/lib/opencode/DOCUMENTATION.md +28 -0
  176. package/server/lib/opencode/core-routes.js +16 -3
  177. package/server/lib/opencode/core-routes.test.js +28 -0
  178. package/server/lib/opencode/feature-routes-runtime.js +12 -1
  179. package/server/lib/opencode/feature-routes-runtime.test.js +4 -0
  180. package/server/lib/opencode/proxy.js +1 -0
  181. package/server/lib/opencode/routes.js +18 -4
  182. package/server/lib/opencode/routes.test.js +22 -0
  183. package/server/lib/opencode/settings-helpers.js +26 -0
  184. package/server/lib/opencode/settings-helpers.test.js +20 -0
  185. package/server/lib/opencode/settings-runtime.js +5 -3
  186. package/server/lib/opencode/settings-runtime.test.js +35 -0
  187. package/server/lib/preview/DOCUMENTATION.md +73 -0
  188. package/server/lib/preview/file-preview-path.js +37 -0
  189. package/server/lib/preview/file-target.js +38 -0
  190. package/server/lib/preview/file-target.test.js +111 -0
  191. package/server/lib/preview/proxy-runtime.js +110 -17
  192. package/server/lib/projects/DOCUMENTATION.md +12 -3
  193. package/server/lib/relay/tunnel-host.js +1 -0
  194. package/server/lib/remote-hosts/DOCUMENTATION.md +269 -0
  195. package/server/lib/remote-hosts/configuration.js +15 -0
  196. package/server/lib/remote-hosts/deadline.js +22 -0
  197. package/server/lib/remote-hosts/deadline.test.js +64 -0
  198. package/server/lib/remote-hosts/fixtures/settings-server.mjs +26 -0
  199. package/server/lib/remote-hosts/gateway.js +644 -0
  200. package/server/lib/remote-hosts/json-lifecycle.test.js +55 -0
  201. package/server/lib/remote-hosts/preview-scope.js +23 -0
  202. package/server/lib/remote-hosts/relay-client.ts +3 -0
  203. package/server/lib/remote-hosts/routes.js +432 -0
  204. package/server/lib/remote-hosts/routes.test.js +1176 -0
  205. package/server/lib/remote-hosts/settings-production.test.js +145 -0
  206. package/server/lib/remote-hosts/store.js +110 -0
  207. package/server/lib/remote-hosts/store.test.js +33 -0
  208. package/server/lib/remote-hosts/transport.js +113 -0
  209. package/server/lib/scheduled-tasks/session-skill.js +2 -1
  210. package/server/lib/scheduled-tasks/session-skill.test.js +34 -1
  211. package/server/lib/session-folders/routes.js +1 -0
  212. package/server/lib/session-index/DOCUMENTATION.md +4 -1
  213. package/server/lib/session-index/event-ingest.js +8 -0
  214. package/server/lib/session-index/event-ingest.test.js +16 -0
  215. package/server/lib/session-index/service.js +1 -0
  216. package/server/lib/session-index/service.test.js +3 -1
  217. package/server/lib/session-metadata/DOCUMENTATION.md +18 -1
  218. package/server/lib/session-title/DOCUMENTATION.md +3 -0
  219. package/server/lib/session-title/runtime.js +1 -0
  220. package/server/lib/session-title/runtime.test.js +2 -0
  221. package/server/lib/transcript-cache/DOCUMENTATION.md +4 -0
  222. package/server/lib/transcript-cache/routes.js +3 -0
  223. package/server/lib/transcript-cache/service.js +15 -0
  224. package/server/lib/transcript-cache/service.test.js +13 -0
  225. package/server/lib/ui-auth/DOCUMENTATION.md +18 -0
  226. package/server/lib/ui-auth/ui-auth.js +30 -2
  227. package/server/lib/ui-auth/ui-auth.test.js +46 -1
  228. package/dist/assets/AssistantConversationSurface-CW3U6Lhp.js +0 -3
  229. package/dist/assets/DiagramView-CzhdZEw4.js +0 -1
  230. package/dist/assets/GuiPluginSurface-BG3hENTt.js +0 -1
  231. package/dist/assets/LoadingImage-DmucvXdY.js +0 -1
  232. package/dist/assets/MarkdownRenderer-BkOMcK8x.js +0 -2
  233. package/dist/assets/MarkdownRendererImpl-B5vJtPoa.js +0 -10
  234. package/dist/assets/MarkstreamRendererImpl-1J-Gu2M2.js +0 -3
  235. package/dist/assets/MobileDetailNavigation-48o8aG28.js +0 -1
  236. package/dist/assets/MobileShareBridge-DnYT3Dbz.js +0 -3
  237. package/dist/assets/MobileTabPageHeader-D6kqRFm0.js +0 -2
  238. package/dist/assets/OnboardingScreen-Bn0RgrJU.js +0 -1
  239. package/dist/assets/SettingsView-Bla2lVqS.js +0 -29
  240. package/dist/assets/SetupTourDialog-GDRS3gDa.js +0 -1
  241. package/dist/assets/TerminalView-B1u3s7IN.js +0 -8
  242. package/dist/assets/ToolOutputDialog-CYUPmbtq.js +0 -10
  243. package/dist/assets/VoiceSettings-Dy6-nkQo.js +0 -2
  244. package/dist/assets/YuriWordmark--S-QEpRp.js +0 -1
  245. package/dist/assets/appThemeRegistry--G1XaYmo.js +0 -1
  246. package/dist/assets/bootstrap-BhC95qVC.js +0 -1
  247. package/dist/assets/fileQueries-D9l0crnM.js +0 -1
  248. package/dist/assets/fileReferenceActions-BmquJskG.js +0 -1
  249. package/dist/assets/gitApiHttp-D4d-rgcR.js +0 -9
  250. package/dist/assets/historyImportQueries-DkB2_92i.js +0 -1
  251. package/dist/assets/host-kMLXU0hK.js +0 -1
  252. package/dist/assets/image-loading-BrDob6MW.js +0 -1
  253. package/dist/assets/insertionBoundaries-CB4gv9rr.js +0 -1
  254. package/dist/assets/main-B1KrAdkh.js +0 -2
  255. package/dist/assets/main-Caf-6KmT.js +0 -169
  256. package/dist/assets/mcpQueries-CQyOFjX2.js +0 -1
  257. package/dist/assets/miniChat-zEoOVjOQ.js +0 -2
  258. package/dist/assets/mobile-Dt8wAkc4.js +0 -2
  259. package/dist/assets/mobileBackNavigation-BbKMa0Jb.js +0 -1
  260. package/dist/assets/mobileConnections-CXYj4P9M.js +0 -2
  261. package/dist/assets/multirun-9v2r_beX.js +0 -3
  262. package/dist/assets/pathNormalization-ewtPqJWn.js +0 -1
  263. package/dist/assets/platform-DMsFWy1a.js +0 -1
  264. package/dist/assets/projectActions-C-9Z8R7y.js +0 -1
  265. package/dist/assets/projectMeta-ZouOo-T_.js +0 -1
  266. package/dist/assets/pwa-syKJBLoe.js +0 -2
  267. package/dist/assets/queue-abort-optimistic-BYH5yLM2.js +0 -1
  268. package/dist/assets/renderElectronMiniChatApp-DprABvit.js +0 -2
  269. package/dist/assets/renderMobileApp-DQmX6iak.js +0 -29
  270. package/dist/assets/runtime-file-resource-CL7EVzOG.js +0 -2
  271. package/dist/assets/runtimeConfig-7Umh9QWi.js +0 -2
  272. package/dist/assets/runtimeEndpointReset-BYtLmSuX.js +0 -149
  273. package/dist/assets/scheduledTaskNavigation-FMDNRUnX.js +0 -1
  274. package/dist/assets/sessionLookup-D_fPlqqT.js +0 -1
  275. package/dist/assets/sortable-tabs-strip-BclS0Hnd.js +0 -1
  276. package/dist/assets/src-HgtAe3Q4.css +0 -2
  277. package/dist/assets/terminalApi-DK4KmfFn.js +0 -1
  278. package/dist/assets/touch-gestures-CErgaXZ7.js +0 -1
  279. package/dist/assets/tour-DDI0Zg7l.js +0 -1
  280. package/dist/assets/useAppFontEffects-RpgNbjA4.css +0 -1
  281. package/dist/assets/useAssistantUIStore-nNYL140o.js +0 -1
  282. package/dist/assets/useDesktopWindowControlsLayout-Bq9DFNYn.js +0 -1
  283. package/dist/assets/useEffectiveDirectory-5RwQ_nuK.js +0 -1
  284. package/dist/assets/useFontPreferences-DxzruDDQ.js +0 -1
  285. package/dist/assets/useMobileNavigationStore-ePbEoQwb.js +0 -17
  286. package/dist/assets/usePluginsStore-HJJZ65gd.js +0 -1
  287. package/dist/assets/useUIStore-vvNwcOk3.js +0 -1
  288. package/dist/assets/useWorkerHighlightedLines-6x1R4afJ.js +0 -7
  289. package/dist/assets/vendor-motion-C9oiAdx-.js +0 -1
  290. package/dist/assets/vendor-reactuses-core-CuTmqEMK.js +0 -1
  291. package/dist/assets/vendor-tanstack-query-core-Y_YoRHtC.js +0 -1
  292. package/dist/assets/vendor-tanstack-react-query-B-Wpqq5J.js +0 -1
@@ -0,0 +1,269 @@
1
+ # Remote Host Gateway
2
+
3
+ `server/index.js` constructs this module before the generic OpenCode proxy and
4
+ stops it before closing the local session index. Electron injects the process-local
5
+ adapter from `packages/electron/remote-hosts.mjs`. The adapter reads that computer's
6
+ saved hosts/SSH manager, never the focused window's selected runtime. CLI/web/VS
7
+ Code instances without an adapter report `supported: false`; desktop and
8
+ SSH-managed PC instances expose the local-project authority protocol.
9
+
10
+ ## Ownership and persistence
11
+
12
+ - `store.js` owns `remote-hosts.sqlite`: stable Hub identity, remote-project
13
+ references, safe presentation fields, connection receipts and bounded-shape
14
+ unread/folder/order snapshots. `(hostId, path)` is unique. Missing hosts retain
15
+ their reference and display record; removing a reference never deletes remote
16
+ sessions, files or projects.
17
+ `saveProject` is explicit association/upsert; asynchronous metadata completions
18
+ use `refreshProject(reference, remote)` instead. The latter only updates the
19
+ matching existing id/Host/path/addedAt/remoteProjectId row and returns null if it was removed
20
+ or replaced. A late refresh or PATCH must never recreate a deleted reference.
21
+ `hasProjects()` uses SQLite EXISTS-style `SELECT 1 ... LIMIT 1`, never a Host
22
+ lookup, subscription or timer. Existing settings bootstrap and full settings
23
+ project it as read-only `hasRemoteProjects`. Successful reference creation or
24
+ removal sends the existing content-free `yuri:project-order-changed` global
25
+ invalidation tip, including the first/last reference transition. Clients refresh
26
+ their existing bootstrap/settings query, not an unconditional hosts request.
27
+ Hub project order and collapse live only in settings `hubProjectLayout`, not
28
+ in remote metadata or local `projects`. See the settings module contract.
29
+ - `gateway.js` owns connections, shared status/content readers, generation fences,
30
+ owner cancellation and the fair two-slot refresh queue. Remote summaries use
31
+ the existing session-index service and its newest-20 directory bound. Each
32
+ partition hashes `hub:<stable Hub ID>:remote-host:<host ID>`; no mutable local
33
+ runtime endpoint or local filesystem resolution participates.
34
+ - `transport.js` owns authenticated direct/SSH-forwarded requests and reuses the
35
+ normative E2EE Relay client. `build:remote-host-relay` compiles that client once;
36
+ normal web build/prepack and `build:llm-bridge` include the build. The generated
37
+ bundle ships inside the web server resources, not as a new dependency.
38
+ - `routes.js` owns external authorization, host-scoped HTTP/WS routing and demand
39
+ tracking on the existing global client stream. `preview-scope.js` carries only
40
+ a relative host prefix and a nonsecret marker across the remote preview pipe;
41
+ real Hub URL tokens are inserted on the Hub, never sent upstream.
42
+
43
+ There is no remote message/part/transcript table. Remote content events bypass the
44
+ Hub's transcript, message queue, search indexing and upstream watcher side effects.
45
+ Remote queue requests execute on the target machine through the prefix proxy.
46
+ The local HTTP transcript-cache rejects explicit remote scopes; client IndexedDB
47
+ is the only Hub-client content acceleration store. Configuration catalogs are
48
+ read-only projected views; raw settings/config files and machine mutations are
49
+ not proxy capabilities.
50
+
51
+ ## HTTP protocol
52
+
53
+ - `GET /api/hosts`: `{supported, hubId, hosts, projects, reason?}`; local SQLite /
54
+ saved descriptors only, no probe. Public hosts contain id/name/source/state,
55
+ available, generation, safe error/timestamps/version, never URLs/credentials.
56
+ `scopeGeneration` is an opaque in-process authorization/configuration epoch,
57
+ independent of `generation`, which identifies the physical event connection.
58
+ Releasing an unreferenced short HTTP transport leaves its scope epoch intact;
59
+ credential/target descriptor changes or observed Host removal and re-addition
60
+ create a fresh epoch, including when old credentials are restored (no ABA reuse).
61
+ The identity record has no transport, reader, timer or background IO. It is
62
+ bounded by the current saved Host catalog and cleared on shutdown. Clients fence
63
+ captured HTTP/query scopes by this epoch and continue fencing events by wire
64
+ generation. Current-connection checks still reject late physical responses.
65
+ - `GET /api/hosts/projects`: persisted Hub references.
66
+ - `POST /api/hosts/:hostId/projects {path,label?}`: remote register first, then
67
+ upsert the Hub reference. A Hub disk failure leaves the remote project intact;
68
+ retry associates the same canonical remote path and deterministic Hub ID.
69
+ - `PATCH /api/hosts/:hostId/projects/:projectId`: remote metadata write-through;
70
+ cache updates only on successful authority response.
71
+ - `DELETE` on that path removes only the reference.
72
+ - `GET /api/hosts/:hostId/summaries`: immediate SQLite snapshot, stale marker,
73
+ connection receipts and unread/folder/order snapshots. Offline live status is
74
+ `metadata.yuri.sessionStatus = {type:'unknown',lastKnown}`.
75
+ Opening a replacement status stream does not make persisted activity live:
76
+ the snapshot remains stale/unknown until that connection completes its refresh.
77
+ `worktrees` contains `projectDirectories: Record<projectRoot, string[]>` and
78
+ `staleProjectDirectories: string[]`. These are path-only metadata from the
79
+ remote Git worktree catalog, never locally resolved paths. Root subdirectories
80
+ and verified worktrees outside the project root participate in summaries,
81
+ status ingestion and content leases. Explicit project roots take precedence;
82
+ a nested source project maps only its suffix within the longest authoritative
83
+ checkout: `/repo/src` with checkouts `/repo` and `/other` maps `/other/src`,
84
+ never the entire `/other`. Filesystem presence remains a remote operation;
85
+ the Hub does not stat or resolve these paths on its own filesystem.
86
+ - `POST /api/hosts/:hostId/connect`: explicit foreground wake. The response awaits
87
+ native SSH preparation and authenticated capability admission; callers entering
88
+ the directory picker wait for this acknowledgement, not a cached status label.
89
+ Without project references no status stream is opened, so the response's live
90
+ status can still be `connecting` despite successful HTTP admission. Subsequent
91
+ short requests reuse the native manager's matching live Ready tunnel rather
92
+ than repeatedly restarting SSH initialization.
93
+ - `POST /api/hosts/:hostId/subscriptions {directory,sessionId?}`: content lease;
94
+ `DELETE /.../subscriptions/:id` releases only the authenticated owner's lease.
95
+ - The shared worktree dialog forwards read-only (`GET`/`HEAD`)
96
+ `/api/github/auth/status`, `/api/github/issues/{list,get,comments}`,
97
+ `/api/github/pulls/{list,context}`, and `/api/magic-prompts`. These exact
98
+ routes supply Host GitHub availability, linked context and prompt templates;
99
+ GitHub authentication mutations and prompt-template writes remain forbidden.
100
+ - `/api/hosts/:hostId/api/*`: supported project/session APIs preserve method,
101
+ body, query, directory headers, cancellation and streaming. Client credentials,
102
+ cookies, arbitrary destinations, recursive host APIs and machine-level writes
103
+ do not cross this boundary. Large bodies/streams do not inherit the index's
104
+ 15-second response-body deadline. Every proxy request still has a bounded
105
+ response-header wait; receiving headers clears that deadline for streaming bodies.
106
+ Snapshots/session reads use the short request budget. Mutations (including
107
+ synchronous shell) and file/preview transfers use a separate five-minute
108
+ operation header budget, rather than being cut off by the 15-second index
109
+ budget. Ordinary JSON bodies remain bounded; file/SSE bodies stay cancellable
110
+ without a fixed total-body deadline.
111
+ `deadline.js` preserves those budgets and TimeoutError semantics while clearing
112
+ deadline timers immediately when their request/connection parent is cancelled.
113
+ Its unref timers weakly retain their owner and are finalized when an abandoned
114
+ signal is collected; completed calls cannot keep a disconnected Host's timeout
115
+ work alive. Streaming responses retain only the existing response-header timer,
116
+ never a new fixed body deadline. Cancellation still reaches the transport and
117
+ all existing authorization/generation fences remain authoritative.
118
+ Gateway-owned `json()` reads additionally retain a request-local consumption
119
+ signal through body parsing and the final descriptor/current-connection check.
120
+ Their `finally` cancels only that local owner on success or failure, clearing
121
+ its deadline without cancelling the shared connection or sibling requests.
122
+ Receiving headers alone never completes this owner; raw/streaming `request()`
123
+ responses retain their existing lifecycle and budgets.
124
+ Optional file reads preserve the Remote's `x-yuri-file-exists` response header:
125
+ an existing empty file and a missing file both have empty bodies, but remain
126
+ distinct. Attachment uploads preserve `x-yuri-content-length`, `x-yuri-sha256`,
127
+ `x-yuri-mime` and `x-yuri-filename` along with their original body bytes; size
128
+ and digest validation still execute on the Remote. These allowlisted metadata
129
+ headers never replace Remote authentication or forward Hub credentials.
130
+ - `/api/hosts/:hostId/api/terminal/ws` and `/api/hosts/:hostId/api/preview/proxy/*`
131
+ mount real upgrades, mirrored in Relay and URL-token allowlists. Host removal
132
+ closes direct sockets and Relay substreams, including pending handshakes.
133
+ Client revocation tracks the raw upgrade socket before waiting for the upstream;
134
+ authorization is checked again immediately before accepting the upgrade.
135
+ Upstream message handling is installed at socket creation, before awaiting
136
+ physical connection validation or downstream authorization. Frames arriving
137
+ during admission (including the terminal protocol's immediate binary `ok`)
138
+ are held in an ordered, memory-only queue capped at 1 MiB and 256 frames.
139
+ They are forwarded with unchanged text/binary types only after the second
140
+ authorization check and client upgrade. Overflow fails the upgrade and closes
141
+ the upstream; revocation, socket closure and failure discard the queue.
142
+ Direct and E2EE Relay use the same admission path. No greeting is synthesized
143
+ and no terminal handshake timeout is extended to conceal missing frames.
144
+
145
+ The target-side local authority is `GET/POST /api/projects` and `PATCH
146
+ /api/projects/:id`. It only returns local projects. Authenticated
147
+ `/api/hosts/capabilities` advertises protocol 1 and the stable instance identity;
148
+ old/unavailable capability servers return a structured incompatible failure.
149
+ Transport admission uses this protected endpoint for both client authorization
150
+ and protocol negotiation, then reuses the result in the Gateway. It does not
151
+ require a separate `/auth/session` round trip or accept an unauthenticated health
152
+ response as authorization.
153
+
154
+ ## Real time and lifecycle
155
+
156
+ The target-side `/api/hosts/status-stream` subscribes to the target's existing
157
+ server-owned event hub and product tips. It projects only session-summary/status
158
+ fields; token/part/message deltas and inbox bodies never travel this status stream.
159
+ Native execution/inbox boundaries, unread/order/folder and project revisions are
160
+ covered. The Hub holds one such subscription per referenced host while an
161
+ authorized global client stream is present, and no periodic full-list poll.
162
+ Short HTTP operations retain only their target transport, not a status observer;
163
+ creating projects without a global stream cannot start background index scans.
164
+ After the final project reference is removed, the last temporary HTTP/WS holder
165
+ also closes that Host connection when it releases. A global Hub stream alone
166
+ does not keep an unreferenced Host alive; late release callbacks after shutdown
167
+ do not query the already-closed SQLite store.
168
+ The first status connection, reconnection and `yuri:worktree-topology-changed`
169
+ invalidate the remote worktree catalog. Ordinary summary/status changes reuse
170
+ it. Refresh requests retain the existing per-Host serial/two-Host global budget.
171
+ Those topology edges also enqueue the referenced roots and verified worktrees
172
+ through the remote `/api/yuri/session-index/sync` scheduler. Merely reading its
173
+ SQLite snapshot would leave a headless remote's imported sessions undiscovered.
174
+ Subsequent revision tips pull the updated snapshot; ordinary index tips never
175
+ enqueue the same scan again. An empty snapshot while the scheduler is active
176
+ remains stale. No remote UI window is required to initialize the index.
177
+ A failed project's catalog keeps its prior mapping with an explicit stale root;
178
+ it cannot erase another project's summaries or replace failure with empty success.
179
+ Removing a verified worktree hides its old summary partition without deleting
180
+ remote sessions. The directory resolver is built once per snapshot, rather than
181
+ reading the SQLite project/catalog tables for each session bucket.
182
+
183
+ OpenCode form reads/replies (`/api/form`) are project/session operations and pass
184
+ through the same authenticated Host proxy as permission and question operations.
185
+ Reconnection uses bounded jittered backoff; one-second source heartbeats permit
186
+ the 1.5-second stream stall detector to invalidate live status promptly.
187
+
188
+ The client's existing global stream carries:
189
+
190
+ ```ts
191
+ { type: 'yuri:host-status', properties: { hubId, hostId, host } }
192
+ { type: 'yuri:host-event', properties: { hubId, hostId, generation, directory?, payload } }
193
+ ```
194
+
195
+ Content demand is shared by `(hostId,directory,sessionId)`. Its eight-channel cap
196
+ never evicts an active reader: a ninth distinct active channel returns 429. Zero
197
+ observer channels are immediately released. Every active lease gets its own
198
+ `yuri:content-ready` payload `{id:leaseId,sessionId,channelId,readyGeneration}`;
199
+ late joiners get current ready and upstream reconnect changes readyGeneration.
200
+ Clients deduplicate by lease plus ready generation, then fetch the authority tail.
201
+ The last global stream for an owner releases all its leases. Pending acquisitions
202
+ capture the owner's cancellation generation and cannot recreate a revoked lease.
203
+
204
+ No references means zero added background network requests/readers/timers. No
205
+ clients means status/content readers, retry timers and Relay sockets are closed.
206
+ Interactive session reads/mutations preempt every host's refresh; interrupted
207
+ refreshes are requeued. Continued network waits suppress only their own host's
208
+ refresh, so a slow response cannot freeze unrelated hosts. Up to two hosts refresh concurrently,
209
+ one per host. Failure/partial/aborted reads preserve the prior snapshot.
210
+
211
+ ## Security
212
+
213
+ Aggregation requires a real desktop-local bearer or a current desktop/mobile
214
+ pairing grant. A password-less browser cookie is not a grant. URL-token requests
215
+ resolve the issuing client and recheck revocation/expiry. Every host-event send
216
+ uses a live resource filter in SSE, WS and the OpenCode SSE proxy subscriber;
217
+ unpaired global-stream consumers cannot receive remote content. Revocation
218
+ invalidates the filter before closing streams and outstanding operations.
219
+
220
+ Native setting changes reconcile ownership and replace connection generations.
221
+ SSH preparation installs its placeholder/promise before awaiting native work so
222
+ parallel cold requests share one preparation and transport. Credentials never
223
+ appear in public hosts, event envelopes or diagnostic errors. Direct candidates
224
+ of Relay-paired devices must prove server identity without credentials first.
225
+ Unpaired SSH never gets a Relay fallback. Target credentials remain in the Hub.
226
+ Native SSH errors are reduced to safe authentication/unreachable/service-starting
227
+ codes before crossing the adapter. Relay admission failures keep authorization
228
+ and incompatibility distinct from Relay unreachability; raw diagnostics remain
229
+ outside Gateway responses and receipts.
230
+
231
+ ## Validation and evidence boundary
232
+
233
+ `routes.test.js` uses real HTTP servers, production route registration/auth,
234
+ SQLite, real WS upgrades, the real E2EE tunnel client and the private Relay server.
235
+ It covers dual-write recovery, write-through, generation/authorization races,
236
+ unauthorized fanout, per-client shared content readiness, zero-work startup,
237
+ resource cleanup, host removal, preview assets/redirects, repeated Relay concurrent
238
+ requests/creation/terminal and delayed concurrent SSH preparation.
239
+ The three-Host collision fixture also checks SQLite reopen isolation, offline
240
+ retention and the global two-refresh/per-Host one-refresh budget while one Host
241
+ is stalled. The production `scripts/remote-projects-smoke.mjs` exercises the real
242
+ `startWebUiServer` middleware, registration, forwarding and reference removal;
243
+ its synthetic direct origin does not establish physical SSH/Relay/UI parity.
244
+
245
+ These are deterministic correctness/operation-count checks, not production
246
+ Electron/iOS timing, CPU/memory, WAN or physical SSH evidence. Those gates remain
247
+ separate in the feature acceptance record; do not infer them from this suite.
248
+
249
+ Latest backend validation covered 173 passing tests across the Gateway, transcript
250
+ cache, queue, content search, auth, event runtime, SSE reader, folders and Relay
251
+ cross-compatibility suites. The Gateway HTTP suite has 20 cases, including failed
252
+ metadata write preservation and remote removal/reassociation. Electron's package
253
+ suite passed 504 tests with 14 skipped native evidence cases. Web production build,
254
+ Electron main bundle, Web type-check, Electron syntax checks and focused backend
255
+ syntax checks passed. Web lint has its existing path-normalization warning;
256
+ Electron lint is a no-op. Dead-code inspection reported no Remote Host module
257
+ or notification-identity findings. The unmodified production smoke passed twice
258
+ after capability admission replaced the separate auth-session preflight.
259
+
260
+ Integration follow-up added three red-to-green production HTTP/WS cases for
261
+ revocation during handshake, bounded response-header waits and cross-host refresh
262
+ while an interactive body remains open. All 23 Gateway cases pass; the combined
263
+ auth/event-stream run passes 111 tests. The full Web project subsequently passed
264
+ 4014 tests with 20 skipped (305 passing files and 6 skipped).
265
+
266
+ This is not a complete feature acceptance result: skipped native evidence remains
267
+ unverified, and real desktop/Capacitor UI, physical SSH/WAN and production
268
+ performance must be validated by the integrating owner. No release or installer
269
+ launch is implied by bundle success.
@@ -0,0 +1,15 @@
1
+ const secretField = /^(?:api[_-]?key|password|secret|token|access[_-]?token|refresh[_-]?token|authorization|credentials?|clientToken|headers|env)$/i;
2
+
3
+ /** Config directories are read-only views, not a path to remote provider/MCP secrets. */
4
+ export function projectRemoteConfiguration(value) {
5
+ if (Array.isArray(value)) return value.map(projectRemoteConfiguration);
6
+ if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value)
7
+ .filter(([name]) => !secretField.test(name)).map(([name, child]) => [name, projectRemoteConfiguration(child)]));
8
+ if (typeof value === 'string' && /^https?:\/\//i.test(value)) {
9
+ try {
10
+ const url = new URL(value);
11
+ if (url.username || url.password) { url.username = ''; url.password = ''; return url.toString(); }
12
+ } catch { /* Non-URL text stays display metadata. */ }
13
+ }
14
+ return value;
15
+ }
@@ -0,0 +1,22 @@
1
+ const deadlines = new FinalizationRegistry((timer) => clearTimeout(timer));
2
+ // Keep the timer callback's closure separate from the returned signal and its owner.
3
+ const expire = (reference) => () => reference.deref()?.controller.abort(
4
+ new DOMException('The operation was aborted due to timeout', 'TimeoutError'),
5
+ );
6
+
7
+ export const remoteDeadlineSignal = (milliseconds, parents = []) => {
8
+ const controller = new AbortController();
9
+ const signal = AbortSignal.any([...parents, controller.signal]);
10
+ if (signal.aborted) return signal;
11
+ const owner = { controller };
12
+ const timer = setTimeout(expire(new WeakRef(owner)), milliseconds);
13
+ timer.unref?.();
14
+ signal.addEventListener('abort', () => {
15
+ clearTimeout(timer);
16
+ deadlines.unregister(owner);
17
+ }, { once: true });
18
+ // Like AbortSignal.timeout, an abandoned signal must not be retained by its timer.
19
+ // Unlike a standalone timeout, parent cancellation also disposes the deadline now.
20
+ deadlines.register(signal, timer, owner);
21
+ return signal;
22
+ };
@@ -0,0 +1,64 @@
1
+ import { afterEach, describe, expect, it, vi } from 'vitest';
2
+ import { getEventListeners } from 'node:events';
3
+ import { execFileSync } from 'node:child_process';
4
+ import { remoteDeadlineSignal } from './deadline.js';
5
+
6
+ afterEach(() => vi.useRealTimers());
7
+ describe('remote deadline lifecycle', () => {
8
+ it('keeps the full deadline and TimeoutError after response headers could have arrived', () => {
9
+ vi.useFakeTimers();
10
+ const signal = remoteDeadlineSignal(15000);
11
+ vi.advanceTimersByTime(14999); expect(signal.aborted).toBe(false);
12
+ vi.advanceTimersByTime(1);
13
+ expect(signal.reason).toBeInstanceOf(DOMException);
14
+ expect(signal.reason.name).toBe('TimeoutError');
15
+ expect(vi.getTimerCount()).toBe(0);
16
+ });
17
+ it('does no timer work for an already cancelled parent and preserves its reason', () => {
18
+ vi.useFakeTimers(); const reason = new Error('closed');
19
+ const signal = remoteDeadlineSignal(15000, [AbortSignal.abort(reason)]);
20
+ expect(signal.reason).toBe(reason); expect(vi.getTimerCount()).toBe(0);
21
+ });
22
+ it('clears all 300 child deadlines immediately when the connection closes', () => {
23
+ vi.useFakeTimers(); const parent = new AbortController();
24
+ const signals = Array.from({ length: 300 }, () => remoteDeadlineSignal(15000, [parent.signal]));
25
+ expect(vi.getTimerCount()).toBe(300);
26
+ expect(getEventListeners(parent.signal, 'abort')).toHaveLength(0);
27
+ parent.abort(); expect(vi.getTimerCount()).toBe(0);
28
+ expect(signals.every(signal => signal.aborted && signal.reason === parent.signal.reason)).toBe(true);
29
+ });
30
+ it('request cancellation disposes its deadline without cancelling another request', () => {
31
+ vi.useFakeTimers(); const connection = new AbortController(); const request = new AbortController();
32
+ const a = remoteDeadlineSignal(300000, [connection.signal, request.signal]);
33
+ const b = remoteDeadlineSignal(15000, [connection.signal]);
34
+ request.abort(new Error('request cancelled'));
35
+ expect(a.reason).toBe(request.signal.reason); expect(b.aborted).toBe(false);
36
+ expect(vi.getTimerCount()).toBe(1);
37
+ connection.abort(); expect(vi.getTimerCount()).toBe(0);
38
+ });
39
+ it('does not replace the first abort reason or fire later after cancellation', () => {
40
+ vi.useFakeTimers(); const parent = new AbortController(); const reason = new Error('first');
41
+ const signal = remoteDeadlineSignal(5000, [parent.signal]); const notify = vi.fn();
42
+ signal.addEventListener('abort', notify); parent.abort(reason); vi.advanceTimersByTime(10000);
43
+ expect(signal.reason).toBe(reason); expect(notify).toHaveBeenCalledTimes(1);
44
+ });
45
+ it('uses an unref deadline, matching the standalone timeout process-lifetime behavior', () => {
46
+ const timeout = vi.spyOn(globalThis, 'setTimeout'); const parent = new AbortController();
47
+ try {
48
+ remoteDeadlineSignal(15000, [parent.signal]);
49
+ expect(timeout.mock.results[0].value.hasRef()).toBe(false);
50
+ } finally { parent.abort(); timeout.mockRestore(); }
51
+ });
52
+ it('keeps a live signal deadline functional across collection of unrelated objects', () => {
53
+ // This checks WeakRef ownership, not a memory or latency budget.
54
+ execFileSync(process.execPath, ['--expose-gc', '--input-type=module', '-e', `
55
+ import assert from 'node:assert/strict';
56
+ import { remoteDeadlineSignal } from ${JSON.stringify(new URL('./deadline.js', import.meta.url).href)};
57
+ const signal = AbortSignal.any([remoteDeadlineSignal(200), new AbortController().signal]);
58
+ for (let i = 0; i < 4; i++) { await new Promise(resolve => setTimeout(resolve, 5)); global.gc(); }
59
+ await new Promise(resolve => setTimeout(resolve, 300));
60
+ assert.equal(signal.aborted, true);
61
+ assert.equal(signal.reason.name, 'TimeoutError');
62
+ `], { timeout: 10000 });
63
+ });
64
+ });
@@ -0,0 +1,26 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import crypto from 'node:crypto';
4
+
5
+ const config = await new Promise(resolve => process.once('message', resolve));
6
+ for (const key of Object.keys(process.env)) if (/^(YURI_|OPENCODE_)/.test(key)) delete process.env[key];
7
+ Object.assign(process.env, { HOME: config.root, XDG_CONFIG_HOME: path.join(config.root, 'config'),
8
+ XDG_DATA_HOME: path.join(config.root, 'data'), XDG_STATE_HOME: path.join(config.root, 'state'),
9
+ YURI_DATA_DIR: path.join(config.root, 'hub'), YURI_RUNTIME: 'desktop', NODE_ENV: 'development',
10
+ YURI_SKIP_OPENCODE_START: 'true', OPENCODE_HOST: config.upstream,
11
+ YURI_WEIXIN_ENABLED: '0', YURI_CHANNELS_ENABLED: '0' });
12
+ const { createRemoteClientAuthRuntime } = await import('../../client-auth/remote-clients.js');
13
+ const clients = createRemoteClientAuthRuntime({ fsPromises: fs, path, crypto,
14
+ storePath: path.join(config.root, 'hub', 'remote-clients.json') });
15
+ const credentials = [];
16
+ credentials.push(await clients.createClient({ clientKind: 'desktop-local' }));
17
+ credentials.push(await clients.createClient({ clientKind: 'mobile', authMethod: 'pairing', pairingId: 'fixture-pairing' }));
18
+ const { startWebUiServer } = await import('../../../index.js');
19
+ const hub = await startWebUiServer({ port: 0, host: '127.0.0.1', apiOnly: true,
20
+ attachSignals: false, exitOnShutdown: false, remoteHostsAdapter: { listHosts: async () => config.hosts } });
21
+ process.send({ origin: `http://127.0.0.1:${hub.getPort()}`, tokens: credentials.map(c => c.token) });
22
+ process.on('message', async message => {
23
+ if (message !== 'stop') return;
24
+ await hub.stop({ exitProcess: false, forceCloseConnections: true });
25
+ process.exit(0);
26
+ });