@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.
- package/dist/assets/{AgentAvatar-kQhfwlay.js → AgentAvatar-B7KbxN8Y.js} +1 -1
- package/dist/assets/AssistantConversationSurface-BnK_KTBO.js +3 -0
- package/dist/assets/{AssistantUnreadBadge-B2SY-_-u.js → AssistantUnreadBadge-vu4ZhTft.js} +1 -1
- package/dist/assets/{AssistantView-C_hiAuTd.js → AssistantView-CEfEWUIr.js} +1 -1
- package/dist/assets/DiagramView-Dlzr08J_.js +1 -0
- package/dist/assets/{FadeInOnReveal-CMeIdEKz.js → FadeInOnReveal-DMRmNsau.js} +1 -1
- package/dist/assets/{GuiPluginPage-WXqykPAg.js → GuiPluginPage-DVug4z_p.js} +1 -1
- package/dist/assets/GuiPluginSurface-L43o6Xv8.js +1 -0
- package/dist/assets/{GuiPluginWindow-BLzchKn7.js → GuiPluginWindow-tHXkS18H.js} +1 -1
- package/dist/assets/{Icon-DygEqfgq.js → Icon-DizeYahT.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-kbBRpDSD.js → ImageLoadingPlaceholder-BZC5m_km.js} +1 -1
- package/dist/assets/LoadingImage-Csw4L-Dr.js +1 -0
- package/dist/assets/MarkdownRenderer-D_0iKhQN.js +2 -0
- package/dist/assets/MarkdownRendererImpl-BZ0XgjS0.js +10 -0
- package/dist/assets/MarkstreamRendererImpl-DBd6Glg9.js +3 -0
- package/dist/assets/MobileDetailNavigation-xgwvsQuR.js +1 -0
- package/dist/assets/{MobileResizableSheet-Dt2U0JHY.js → MobileResizableSheet-CQQ7O-2X.js} +1 -1
- package/dist/assets/MobileShareBridge-IO45gM2G.js +3 -0
- package/dist/assets/MobileSurface-DmYgZONB.js +2 -0
- package/dist/assets/{MultiRunWindow-BuRo90Ma.js → MultiRunWindow-fJ3XfntS.js} +1 -1
- package/dist/assets/OnboardingScreen-MJS5T5rL.js +1 -0
- package/dist/assets/{OverlayScrollbar-B0X61qR-.js → OverlayScrollbar-jtMYTn1y.js} +1 -1
- package/dist/assets/SettingsView-ZWFLpPSI.js +29 -0
- package/dist/assets/{SettingsWindow-kCbf8IoB.js → SettingsWindow-DGRmrIWz.js} +1 -1
- package/dist/assets/SetupTourDialog-BYbAubwA.js +1 -0
- package/dist/assets/TerminalView-CoJ6_9P1.js +8 -0
- package/dist/assets/ToolOutputDialog-5xBwOJ6a.js +16 -0
- package/dist/assets/VoiceSettings-CN33koSc.js +2 -0
- package/dist/assets/{YuriLogo-B58GIl2v.js → YuriLogo-CvyJy_R9.js} +1 -1
- package/dist/assets/YuriWordmark-DnFAS-Ko.js +1 -0
- package/dist/assets/{assistant-attachment-cache-Cmzt4xXE.js → assistant-attachment-cache-D-LmCflm.js} +1 -1
- package/dist/assets/bootstrap-eLlfzqAI.js +1 -0
- package/dist/assets/{capgoAdapter-DO1rEVQf.js → capgoAdapter-CCLtBZL1.js} +1 -1
- package/dist/assets/{checkbox-BW80bcK5.js → checkbox-rOV6DjeG.js} +1 -1
- package/dist/assets/client-uz8O6TPX.js +7 -0
- package/dist/assets/{collapsible-BOL5Wx2J.js → collapsible-CKswuqAw.js} +1 -1
- package/dist/assets/{context-menu-CiFnjP1q.js → context-menu-B4njwT_M.js} +1 -1
- package/dist/assets/{desktopHosts-DovfbQPm.js → desktopHosts-135cuRCE.js} +1 -1
- package/dist/assets/{desktopRelayRestore-D4pbpNKN.js → desktopRelayRestore-1aUztDPU.js} +1 -1
- package/dist/assets/{device-DNG0cNwQ.js → device-QL8KNSLM.js} +1 -1
- package/dist/assets/{diagram-DRn8iIs1.js → diagram-BppQ_USn.js} +1 -1
- package/dist/assets/{dialog-DQp289fr.js → dialog-Bg8MJnOV.js} +1 -1
- package/dist/assets/{es-D0Q_CV0t.js → es-Ba3NUCtE.js} +3 -3
- package/dist/assets/{fileMentionTouchSelection-582p0uCX.js → fileMentionTouchSelection-D-AdTJVr.js} +1 -1
- package/dist/assets/fileReferenceActions-cYqdsXFz.js +1 -0
- package/dist/assets/{fr-DrO5SAKl.js → fr-CRhp3hyT.js} +3 -3
- package/dist/assets/{gitApi-vYBmQIuU.js → gitApi-DVx_V1x6.js} +11 -7
- package/dist/assets/gitApiHttp-DvTBxvX8.js +3 -0
- package/dist/assets/historyImportQueries-D_9RlrLp.js +1 -0
- package/dist/assets/host-DrGjjO6K.js +1 -0
- package/dist/assets/{i18n-UaLestuf.js → i18n-RH7UieOS.js} +1 -1
- package/dist/assets/image-loading-DBqnxgDH.js +1 -0
- package/dist/assets/{input-B281XcMR.js → input-DRjuZMeA.js} +1 -1
- package/dist/assets/input-store-CjUOfpyA.js +1 -0
- package/dist/assets/insertionBoundaries-DZtQt2Ah.js +1 -0
- package/dist/assets/{ja-BNeP9_GU.js → ja-D-UPjDY2.js} +3 -3
- package/dist/assets/{ko-DRRFD_7l.js → ko-x-z9J5z7.js} +3 -3
- package/dist/assets/main-BMFY9mtb.js +2 -0
- package/dist/assets/main-D2s9J_jN.js +169 -0
- package/dist/assets/{markdownHeightCache-BgYJswDy.js → markdownHeightCache-BL99DlhC.js} +1 -1
- package/dist/assets/{markdownTheme-CHNl6tUv.js → markdownTheme-DFDWa8Gh.js} +1 -1
- package/dist/assets/mcpQueries-HzYMEVWd.js +1 -0
- package/dist/assets/miniChat-BbJ0GKpk.js +2 -0
- package/dist/assets/mobile-_zUth69Z.js +2 -0
- package/dist/assets/mobileBackNavigation--ZdrI-Yj.js +1 -0
- package/dist/assets/mobileConnections-C3eGEOPy.js +2 -0
- package/dist/assets/multirun-CDYNyLBH.js +3 -0
- package/dist/assets/{native-config-BOaqa45X.js → native-config-DOawZfln.js} +1 -1
- package/dist/assets/navigation-Ibk_Pw-q.js +2 -0
- package/dist/assets/{pl-BnW5wJrl.js → pl-Cqo1FJwM.js} +3 -3
- package/dist/assets/platform-wF65ZFgV.js +1 -0
- package/dist/assets/project-preview-2H-TmJkd.js +1 -0
- package/dist/assets/projectActions-50e_f9dI.js +1 -0
- package/dist/assets/projectMeta-D1Ytss9U.js +1 -0
- package/dist/assets/prompt-attachment-upload-BNhDXymd.js +1 -0
- package/dist/assets/{pt-BR-fZW8CCVQ.js → pt-BR-C930XU1k.js} +3 -3
- package/dist/assets/pwa-CXupOTsD.js +2 -0
- package/dist/assets/queue-abort-optimistic-CQXpIlq6.js +1 -0
- package/dist/assets/{react-DPhQUTaH.js → react-CgRToPwO.js} +1 -1
- package/dist/assets/{readiness-BpVAjFhF.js → readiness-BfuZm6Yw.js} +2 -2
- package/dist/assets/relay-preview-frame-src-BPyz3nXA.js +1 -0
- package/dist/assets/remote-input-store-BOdCWpQY.js +1 -0
- package/dist/assets/remoteProjectQueries-CkxdZNw4.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-pJ59iC34.js +2 -0
- package/dist/assets/renderMobileApp-BQFC-gOA.js +29 -0
- package/dist/assets/{runtime-file-download-DMY1k1af.js → runtime-file-download-D11Nnedg.js} +1 -1
- package/dist/assets/runtime-file-resource-CuLP3xp7.js +6 -0
- package/dist/assets/runtimeConfig-tHm7o_0I.js +2 -0
- package/dist/assets/{runtimeEndpointReset-BOdd_mJM.css → runtimeEndpointReset-BUGfn7y0.css} +1 -1
- package/dist/assets/runtimeEndpointReset-BhHWFNvo.js +150 -0
- package/dist/assets/safeStorage-DTOhKN0V.js +1 -0
- package/dist/assets/scheduledTaskNavigation-BIDtQ4wN.js +1 -0
- package/dist/assets/{select-CyPxbnW8.js → select-B1On-Y4Z.js} +1 -1
- package/dist/assets/sessionLookup-RcyTTDOy.js +1 -0
- package/dist/assets/sortable-tabs-strip-nD1Me06z.js +1 -0
- package/dist/assets/{speechSettingsQueries-CTsBn-Ib.js → speechSettingsQueries-BYhNpzDJ.js} +1 -1
- package/dist/assets/src-BZCFf9_1.css +2 -0
- package/dist/assets/{store-CzVMz42v.js → store-DunGyOfe.js} +4 -4
- package/dist/assets/terminalApi-madXrfqA.js +1 -0
- package/dist/assets/{textarea-CjJsstUF.js → textarea-Qt06OhhX.js} +1 -1
- package/dist/assets/{tooltip-Di_DSZ8p.js → tooltip-D382RCy1.js} +1 -1
- package/dist/assets/tour-CQMBn8gJ.js +1 -0
- package/dist/assets/{types-wnqkJWYs.js → types-CHszLAS3.js} +1 -1
- package/dist/assets/{uk-C4OKsNRv.js → uk-OXQSdzuT.js} +3 -3
- package/dist/assets/{useAppFontEffects-BRMf55oN.js → useAppFontEffects-CqXrCJVt.js} +63 -58
- package/dist/assets/useAppFontEffects-K31q-1OV.css +1 -0
- package/dist/assets/useAssistantUIStore-jOKVcBK8.js +1 -0
- package/dist/assets/useDesktopWindowControlsLayout-KH4UP7Gj.js +1 -0
- package/dist/assets/{useDictation-Sk20Gi0T.js → useDictation-Bs7TWO9r.js} +1 -1
- package/dist/assets/useEffectiveDirectory-CCKRdyK9.js +1 -0
- package/dist/assets/useFontPreferences-CPrl1_3z.js +1 -0
- package/dist/assets/{useMobileHtmlPreviewStore-C03uVLfX.js → useMobileHtmlPreviewStore-EOAzZiAy.js} +1 -1
- package/dist/assets/useMobileNavigationStore-BNtVrnSw.js +13 -0
- package/dist/assets/usePluginsStore-bMuGciUE.js +1 -0
- package/dist/assets/useProjectRuntimeAPIs-BFCXBu2J.js +1 -0
- package/dist/assets/{useStreamingTextThrottle-CjMALEr7.js → useStreamingTextThrottle-C8xAqcgP.js} +1 -1
- package/dist/assets/{useThemeSystem-CNzUUkFn.js → useThemeSystem-C57Z9mV2.js} +1 -1
- package/dist/assets/useUIStore-Cfmg-aDQ.js +1 -0
- package/dist/assets/uuid-D-SDZijH.js +1 -0
- package/dist/assets/{vendor-base-ui-CzHs0bHY.js → vendor-base-ui-z2M4boRm.js} +1 -1
- package/dist/assets/{vendor-cmdk-C_tivUtr.js → vendor-cmdk-BgHvMv5l.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-accessibility-BOtnpZt5.js → vendor-dnd-kit-accessibility-gVi9ga0x.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-core-DK4OoOTr.js → vendor-dnd-kit-core-Dd5yS2-T.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-sortable-Cv69eQm1.js → vendor-dnd-kit-sortable-CV-SGi8y.js} +1 -1
- package/dist/assets/{vendor-framer-motion-DDMKlXiP.js → vendor-framer-motion-CF9BQLta.js} +1 -1
- package/dist/assets/{vendor-markstream-react-6zxyQLCD.js → vendor-markstream-react-TwEpkgfP.js} +3 -3
- package/dist/assets/vendor-motion-Dv27UnOI.js +1 -0
- package/dist/assets/{vendor-pierre-diffs-BFiZ3IhI.js → vendor-pierre-diffs-tqo4Z3TC.js} +1 -1
- package/dist/assets/{vendor-react-DlzBev0S.js → vendor-react-P8wFrkcT.js} +1 -1
- package/dist/assets/{vendor-react-drawio-Dyg1-39Q.js → vendor-react-drawio-CQW1YP2l.js} +1 -1
- package/dist/assets/vendor-reactuses-core-Dyjw5sZR.js +1 -0
- package/dist/assets/{vendor-sonner-BEHGipm5.js → vendor-sonner-B5HgJenP.js} +1 -1
- package/dist/assets/{vendor-stream-diffs-wcQxoPZk.js → vendor-stream-diffs-DCMtZcS3.js} +2 -2
- package/dist/assets/vendor-tanstack-query-core-BSjXNgF_.js +1 -0
- package/dist/assets/vendor-tanstack-react-query-B-KblYBV.js +1 -0
- package/dist/assets/{vendor-tanstack-react-virtual-DSFNK3qc.js → vendor-tanstack-react-virtual-BkuqzrEV.js} +1 -1
- package/dist/assets/{vendor-zustand-vDaAPGfl.js → vendor-zustand-Cwko4FG1.js} +1 -1
- package/dist/assets/{zh-CN-ieAs59w6.js → zh-CN-B5X8yCZV.js} +3 -3
- package/dist/assets/{zh-TW-WWTW1fkP.js → zh-TW-CF6zr1fk.js} +3 -3
- package/dist/index.html +32 -27
- package/dist/mini-chat.html +32 -27
- package/dist/mobile.html +2 -2
- package/package.json +3 -2
- package/server/index.d.ts +19 -0
- package/server/index.js +35 -5
- package/server/lib/assistants/builtin-skills.js +1 -1
- package/server/lib/assistants/builtin-skills.test.js +2 -0
- package/server/lib/client-auth/remote-clients.js +11 -0
- package/server/lib/content-search/DOCUMENTATION.md +5 -0
- package/server/lib/content-search/routes.js +4 -0
- package/server/lib/content-search/routes.test.js +10 -0
- package/server/lib/event-stream/DOCUMENTATION.md +5 -0
- package/server/lib/event-stream/runtime.js +3 -0
- package/server/lib/event-stream/upstream-reader.js +1 -1
- package/server/lib/gui-customization/DOCUMENTATION.md +25 -1
- package/server/lib/gui-customization/projects-client.mjs +59 -0
- package/server/lib/gui-customization/projects.js +43 -0
- package/server/lib/gui-customization/projects.test.js +103 -0
- package/server/lib/gui-customization/remote-connections-client.mjs +2 -8
- package/server/lib/gui-customization/session-skill-command.mjs +8 -0
- package/server/lib/gui-customization/session-skill.js +15 -10
- package/server/lib/gui-customization/session-skill.test.js +21 -2
- package/server/lib/gui-customization/skill/SKILL.md +3 -1
- package/server/lib/gui-customization/skill/references/projects.md +63 -0
- package/server/lib/gui-customization/skill/references/remote-connections.md +11 -0
- package/server/lib/message-queue/DOCUMENTATION.md +4 -0
- package/server/lib/message-queue/service.js +2 -1
- package/server/lib/message-queue/service.test.js +11 -0
- package/server/lib/notifications/DOCUMENTATION.md +12 -0
- package/server/lib/notifications/emitter-runtime.js +5 -0
- package/server/lib/notifications/runtime.js +20 -2
- package/server/lib/notifications/runtime.test.js +21 -0
- package/server/lib/notifications/session-unread-runtime.js +51 -13
- package/server/lib/notifications/session-unread.test.js +113 -1
- package/server/lib/opencode/DOCUMENTATION.md +28 -0
- package/server/lib/opencode/core-routes.js +16 -3
- package/server/lib/opencode/core-routes.test.js +28 -0
- package/server/lib/opencode/feature-routes-runtime.js +12 -1
- package/server/lib/opencode/feature-routes-runtime.test.js +4 -0
- package/server/lib/opencode/proxy.js +1 -0
- package/server/lib/opencode/routes.js +18 -4
- package/server/lib/opencode/routes.test.js +22 -0
- package/server/lib/opencode/settings-helpers.js +26 -0
- package/server/lib/opencode/settings-helpers.test.js +20 -0
- package/server/lib/opencode/settings-runtime.js +5 -3
- package/server/lib/opencode/settings-runtime.test.js +35 -0
- package/server/lib/preview/DOCUMENTATION.md +73 -0
- package/server/lib/preview/file-preview-path.js +37 -0
- package/server/lib/preview/file-target.js +38 -0
- package/server/lib/preview/file-target.test.js +111 -0
- package/server/lib/preview/proxy-runtime.js +110 -17
- package/server/lib/projects/DOCUMENTATION.md +12 -3
- package/server/lib/relay/tunnel-host.js +1 -0
- package/server/lib/remote-hosts/DOCUMENTATION.md +269 -0
- package/server/lib/remote-hosts/configuration.js +15 -0
- package/server/lib/remote-hosts/deadline.js +22 -0
- package/server/lib/remote-hosts/deadline.test.js +64 -0
- package/server/lib/remote-hosts/fixtures/settings-server.mjs +26 -0
- package/server/lib/remote-hosts/gateway.js +644 -0
- package/server/lib/remote-hosts/json-lifecycle.test.js +55 -0
- package/server/lib/remote-hosts/preview-scope.js +23 -0
- package/server/lib/remote-hosts/relay-client.ts +3 -0
- package/server/lib/remote-hosts/routes.js +432 -0
- package/server/lib/remote-hosts/routes.test.js +1176 -0
- package/server/lib/remote-hosts/settings-production.test.js +145 -0
- package/server/lib/remote-hosts/store.js +110 -0
- package/server/lib/remote-hosts/store.test.js +33 -0
- package/server/lib/remote-hosts/transport.js +113 -0
- package/server/lib/scheduled-tasks/session-skill.js +2 -1
- package/server/lib/scheduled-tasks/session-skill.test.js +34 -1
- package/server/lib/session-folders/routes.js +1 -0
- package/server/lib/session-index/DOCUMENTATION.md +4 -1
- package/server/lib/session-index/event-ingest.js +8 -0
- package/server/lib/session-index/event-ingest.test.js +16 -0
- package/server/lib/session-index/service.js +1 -0
- package/server/lib/session-index/service.test.js +3 -1
- package/server/lib/session-metadata/DOCUMENTATION.md +18 -1
- package/server/lib/session-title/DOCUMENTATION.md +3 -0
- package/server/lib/session-title/runtime.js +1 -0
- package/server/lib/session-title/runtime.test.js +2 -0
- package/server/lib/transcript-cache/DOCUMENTATION.md +4 -0
- package/server/lib/transcript-cache/routes.js +3 -0
- package/server/lib/transcript-cache/service.js +15 -0
- package/server/lib/transcript-cache/service.test.js +13 -0
- package/server/lib/ui-auth/DOCUMENTATION.md +18 -0
- package/server/lib/ui-auth/ui-auth.js +30 -2
- package/server/lib/ui-auth/ui-auth.test.js +46 -1
- package/dist/assets/AssistantConversationSurface-CW3U6Lhp.js +0 -3
- package/dist/assets/DiagramView-CzhdZEw4.js +0 -1
- package/dist/assets/GuiPluginSurface-BG3hENTt.js +0 -1
- package/dist/assets/LoadingImage-DmucvXdY.js +0 -1
- package/dist/assets/MarkdownRenderer-BkOMcK8x.js +0 -2
- package/dist/assets/MarkdownRendererImpl-B5vJtPoa.js +0 -10
- package/dist/assets/MarkstreamRendererImpl-1J-Gu2M2.js +0 -3
- package/dist/assets/MobileDetailNavigation-48o8aG28.js +0 -1
- package/dist/assets/MobileShareBridge-DnYT3Dbz.js +0 -3
- package/dist/assets/MobileTabPageHeader-D6kqRFm0.js +0 -2
- package/dist/assets/OnboardingScreen-Bn0RgrJU.js +0 -1
- package/dist/assets/SettingsView-Bla2lVqS.js +0 -29
- package/dist/assets/SetupTourDialog-GDRS3gDa.js +0 -1
- package/dist/assets/TerminalView-B1u3s7IN.js +0 -8
- package/dist/assets/ToolOutputDialog-CYUPmbtq.js +0 -10
- package/dist/assets/VoiceSettings-Dy6-nkQo.js +0 -2
- package/dist/assets/YuriWordmark--S-QEpRp.js +0 -1
- package/dist/assets/appThemeRegistry--G1XaYmo.js +0 -1
- package/dist/assets/bootstrap-BhC95qVC.js +0 -1
- package/dist/assets/fileQueries-D9l0crnM.js +0 -1
- package/dist/assets/fileReferenceActions-BmquJskG.js +0 -1
- package/dist/assets/gitApiHttp-D4d-rgcR.js +0 -9
- package/dist/assets/historyImportQueries-DkB2_92i.js +0 -1
- package/dist/assets/host-kMLXU0hK.js +0 -1
- package/dist/assets/image-loading-BrDob6MW.js +0 -1
- package/dist/assets/insertionBoundaries-CB4gv9rr.js +0 -1
- package/dist/assets/main-B1KrAdkh.js +0 -2
- package/dist/assets/main-Caf-6KmT.js +0 -169
- package/dist/assets/mcpQueries-CQyOFjX2.js +0 -1
- package/dist/assets/miniChat-zEoOVjOQ.js +0 -2
- package/dist/assets/mobile-Dt8wAkc4.js +0 -2
- package/dist/assets/mobileBackNavigation-BbKMa0Jb.js +0 -1
- package/dist/assets/mobileConnections-CXYj4P9M.js +0 -2
- package/dist/assets/multirun-9v2r_beX.js +0 -3
- package/dist/assets/pathNormalization-ewtPqJWn.js +0 -1
- package/dist/assets/platform-DMsFWy1a.js +0 -1
- package/dist/assets/projectActions-C-9Z8R7y.js +0 -1
- package/dist/assets/projectMeta-ZouOo-T_.js +0 -1
- package/dist/assets/pwa-syKJBLoe.js +0 -2
- package/dist/assets/queue-abort-optimistic-BYH5yLM2.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-DprABvit.js +0 -2
- package/dist/assets/renderMobileApp-DQmX6iak.js +0 -29
- package/dist/assets/runtime-file-resource-CL7EVzOG.js +0 -2
- package/dist/assets/runtimeConfig-7Umh9QWi.js +0 -2
- package/dist/assets/runtimeEndpointReset-BYtLmSuX.js +0 -149
- package/dist/assets/scheduledTaskNavigation-FMDNRUnX.js +0 -1
- package/dist/assets/sessionLookup-D_fPlqqT.js +0 -1
- package/dist/assets/sortable-tabs-strip-BclS0Hnd.js +0 -1
- package/dist/assets/src-HgtAe3Q4.css +0 -2
- package/dist/assets/terminalApi-DK4KmfFn.js +0 -1
- package/dist/assets/touch-gestures-CErgaXZ7.js +0 -1
- package/dist/assets/tour-DDI0Zg7l.js +0 -1
- package/dist/assets/useAppFontEffects-RpgNbjA4.css +0 -1
- package/dist/assets/useAssistantUIStore-nNYL140o.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-Bq9DFNYn.js +0 -1
- package/dist/assets/useEffectiveDirectory-5RwQ_nuK.js +0 -1
- package/dist/assets/useFontPreferences-DxzruDDQ.js +0 -1
- package/dist/assets/useMobileNavigationStore-ePbEoQwb.js +0 -17
- package/dist/assets/usePluginsStore-HJJZ65gd.js +0 -1
- package/dist/assets/useUIStore-vvNwcOk3.js +0 -1
- package/dist/assets/useWorkerHighlightedLines-6x1R4afJ.js +0 -7
- package/dist/assets/vendor-motion-C9oiAdx-.js +0 -1
- package/dist/assets/vendor-reactuses-core-CuTmqEMK.js +0 -1
- package/dist/assets/vendor-tanstack-query-core-Y_YoRHtC.js +0 -1
- package/dist/assets/vendor-tanstack-react-query-B-Wpqq5J.js +0 -1
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { isVisibleSession } from '../session-index/service.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/** Lifecycle boundaries and startup repair do work; streaming deltas never read or write. */
|
|
5
5
|
export function createSessionUnreadRuntime({ store, loadSession, hub, resolveDirectory = value => value, retryMs = 1000 }) {
|
|
6
6
|
const flights = new Map();
|
|
7
7
|
const queues = new Map();
|
|
8
|
+
const unreconciled = new Set(Object.entries(store.snapshot().sessions)
|
|
9
|
+
.filter(([, row]) => row.unreadCount > 0).map(([id]) => id));
|
|
10
|
+
let reconciliation = null;
|
|
8
11
|
let disposed = false;
|
|
9
12
|
const directoryOf = session => resolveDirectory(session.location?.directory ?? session.directory ?? '');
|
|
10
13
|
const visible = session => session && !session.parentID && isVisibleSession(session);
|
|
11
14
|
const apply = async ({ payload, id, kind }) => {
|
|
12
15
|
if (kind === 'deleted') { store.remove(id); return; }
|
|
13
16
|
const session = await loadSession(id);
|
|
14
|
-
if (disposed
|
|
17
|
+
if (disposed) return;
|
|
18
|
+
if (!visible(session)) { store.remove(id); return; }
|
|
19
|
+
if (kind === 'refresh') return;
|
|
15
20
|
store.observe({ id, directory: directoryOf(session), kind, eventAt: payload.created, sequence: payload.durable?.seq });
|
|
16
21
|
};
|
|
17
22
|
const drain = (id, queue) => {
|
|
@@ -22,7 +27,16 @@ export function createSessionUnreadRuntime({ store, loadSession, hub, resolveDir
|
|
|
22
27
|
await apply(queue.items[0]);
|
|
23
28
|
queue.items.shift().resolve();
|
|
24
29
|
queue.attempt = 0;
|
|
25
|
-
} catch {
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (queue.items[0].retry === false) {
|
|
32
|
+
queue.items.shift().reject(error);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
queue.items = queue.items.filter(item => {
|
|
36
|
+
if (item.retry !== false) return true;
|
|
37
|
+
item.reject(error);
|
|
38
|
+
return false;
|
|
39
|
+
});
|
|
26
40
|
// Preserve the failed boundary and its following run boundaries in order.
|
|
27
41
|
// Other sessions have independent queues and can continue normally.
|
|
28
42
|
const delay = Math.min(retryMs * 2 ** Math.min(queue.attempt++, 5), 30000);
|
|
@@ -41,6 +55,35 @@ export function createSessionUnreadRuntime({ store, loadSession, hub, resolveDir
|
|
|
41
55
|
if (pending) drain(id, pending);
|
|
42
56
|
});
|
|
43
57
|
};
|
|
58
|
+
const enqueue = (payload, id, kind, retry = true) => {
|
|
59
|
+
const queue = queues.get(id) ?? { items: [], timer: null, attempt: 0 };
|
|
60
|
+
if (!retry && queue.timer) return Promise.reject(new Error('Session identity retry pending'));
|
|
61
|
+
queues.set(id, queue);
|
|
62
|
+
const completion = new Promise((resolve, reject) => {
|
|
63
|
+
queue.items.push({ payload, id, kind, retry, resolve, reject });
|
|
64
|
+
});
|
|
65
|
+
drain(id, queue);
|
|
66
|
+
return completion;
|
|
67
|
+
};
|
|
68
|
+
const reconcileStored = () => {
|
|
69
|
+
if (reconciliation) return reconciliation;
|
|
70
|
+
if (!unreconciled.size) return Promise.resolve();
|
|
71
|
+
const ids = [...unreconciled];
|
|
72
|
+
let cursor = 0;
|
|
73
|
+
let failed = false;
|
|
74
|
+
reconciliation = Promise.all(Array.from({ length: Math.min(4, ids.length) }, async () => {
|
|
75
|
+
while (!disposed && cursor < ids.length) {
|
|
76
|
+
const id = ids[cursor++];
|
|
77
|
+
try {
|
|
78
|
+
await enqueue({}, id, 'refresh', false);
|
|
79
|
+
unreconciled.delete(id);
|
|
80
|
+
} catch { failed = true; }
|
|
81
|
+
}
|
|
82
|
+
})).then(() => {
|
|
83
|
+
if (failed) throw new Error('Stored session identity unavailable');
|
|
84
|
+
}).finally(() => { reconciliation = null; });
|
|
85
|
+
return reconciliation;
|
|
86
|
+
};
|
|
44
87
|
const processEvent = (envelope) => {
|
|
45
88
|
const raw = envelope?.payload ?? envelope;
|
|
46
89
|
const payload = raw?.payload ?? raw;
|
|
@@ -51,15 +94,10 @@ export function createSessionUnreadRuntime({ store, loadSession, hub, resolveDir
|
|
|
51
94
|
const kind = type === 'session.execution.started' || (type === 'session.status' && body.status?.type === 'busy') ? 'running'
|
|
52
95
|
: type === 'session.execution.succeeded' || type === 'session.idle' ? 'complete'
|
|
53
96
|
: type === 'session.execution.failed' || type === 'session.error' ? 'error'
|
|
54
|
-
: type === 'session.deleted' ? 'deleted'
|
|
97
|
+
: type === 'session.deleted' ? 'deleted'
|
|
98
|
+
: type === 'session.metadata.updated' || type === 'session.updated' || type === 'yuri:session-metadata' ? 'refresh' : null;
|
|
55
99
|
if (!kind || disposed) return Promise.resolve();
|
|
56
|
-
|
|
57
|
-
queues.set(id, queue);
|
|
58
|
-
const completion = new Promise(resolve => {
|
|
59
|
-
queue.items.push({ payload, id, kind, resolve });
|
|
60
|
-
});
|
|
61
|
-
drain(id, queue);
|
|
62
|
-
return completion;
|
|
100
|
+
return enqueue(payload, id, kind);
|
|
63
101
|
};
|
|
64
102
|
const unsubscribe = hub?.subscribeEvent(event => {
|
|
65
103
|
void processEvent(event).catch(() => console.warn('[session-unread] lifecycle update failed'));
|
|
@@ -67,8 +105,8 @@ export function createSessionUnreadRuntime({ store, loadSession, hub, resolveDir
|
|
|
67
105
|
return {
|
|
68
106
|
processEvent,
|
|
69
107
|
registerRoutes(app) {
|
|
70
|
-
app.get('/api/yuri/session-unread', (_req, res) => {
|
|
71
|
-
try { res.json(store.snapshot()); }
|
|
108
|
+
app.get('/api/yuri/session-unread', async (_req, res) => {
|
|
109
|
+
try { await reconcileStored(); res.json(store.snapshot()); }
|
|
72
110
|
catch { res.status(503).json({ error: 'Session unread state unavailable' }); }
|
|
73
111
|
});
|
|
74
112
|
app.put('/api/yuri/session-unread/:id', express.json({ limit: '8kb' }), async (req, res) => {
|
|
@@ -11,10 +11,12 @@ import { createSessionUnreadRuntime } from './session-unread-runtime.js';
|
|
|
11
11
|
const cleanup = [];
|
|
12
12
|
afterEach(async () => { for (const close of cleanup.splice(0).reverse()) await close(); });
|
|
13
13
|
const fixture = (options = {}) => {
|
|
14
|
+
const { seed, ...runtimeOptions } = options;
|
|
14
15
|
const changed = vi.fn();
|
|
15
16
|
const store = createSessionUnreadStore({ dbPath: ':memory:', onChanged: changed });
|
|
17
|
+
seed?.(store);
|
|
16
18
|
const loadSession = vi.fn(async id => ({ id, title: 'Conversation', location: { directory: '/project' } }));
|
|
17
|
-
const runtime = createSessionUnreadRuntime({ store, loadSession, ...
|
|
19
|
+
const runtime = createSessionUnreadRuntime({ store, loadSession, ...runtimeOptions });
|
|
18
20
|
cleanup.push(() => runtime.close());
|
|
19
21
|
const event = (type, sessionID = 'one', created = undefined, seq = undefined) => runtime.processEvent({
|
|
20
22
|
payload: { type, data: { sessionID }, created, ...(seq ? { durable: { seq } } : {}) },
|
|
@@ -25,6 +27,116 @@ const fixture = (options = {}) => {
|
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
describe('shared session unread', () => {
|
|
30
|
+
it('excludes explicitly linked CLI workers without guessing from titles or agent names', async () => {
|
|
31
|
+
const { store, event, loadSession, app } = fixture();
|
|
32
|
+
loadSession.mockImplementation(async id => ({ id, title: 'Worker', agent: 'general', directory: '/project',
|
|
33
|
+
metadata: { yuri: { worker: { parentSessionID: id === 'worker' ? 'root' : '' } } },
|
|
34
|
+
}));
|
|
35
|
+
await event('session.execution.succeeded', 'worker');
|
|
36
|
+
await event('session.execution.failed', 'worker');
|
|
37
|
+
expect((await request(app).put('/api/yuri/session-unread/worker').send({ unread: true })).status).toBe(400);
|
|
38
|
+
await event('session.execution.succeeded', 'ordinary');
|
|
39
|
+
expect(Object.keys(store.snapshot().sessions)).toEqual(['ordinary']);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('reconciles persisted child/worker attention once and retains unread state for ordinary roots', async () => {
|
|
43
|
+
const { app, store, loadSession } = fixture({ seed: store => {
|
|
44
|
+
for (const id of ['child', 'worker', 'missing', 'root']) store.mark({ id, directory: '/project', unread: true });
|
|
45
|
+
} });
|
|
46
|
+
loadSession.mockImplementation(async id => id === 'missing' ? null : ({ id, directory: '/project',
|
|
47
|
+
...(id === 'child' ? { parentID: 'root' } : {}),
|
|
48
|
+
...(id === 'worker' ? { metadata: { yuri: { worker: { parentSessionID: 'root' } } } } : {}),
|
|
49
|
+
}));
|
|
50
|
+
const first = await request(app).get('/api/yuri/session-unread');
|
|
51
|
+
expect(first.status).toBe(200);
|
|
52
|
+
expect(Object.keys(first.body.sessions)).toEqual(['root']);
|
|
53
|
+
expect(first.body.sessions.root).toMatchObject({ unreadCount: 1, manual: true });
|
|
54
|
+
expect(store.snapshot()).toEqual(first.body);
|
|
55
|
+
expect((await request(app).get('/api/yuri/session-unread')).body).toEqual(first.body);
|
|
56
|
+
expect(loadSession).toHaveBeenCalledTimes(4);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('preserves failed startup identities, repairs independent rows, and retries only the failed row', async () => {
|
|
60
|
+
const { app, store, loadSession } = fixture({ seed: store => {
|
|
61
|
+
for (const id of ['child', 'root']) store.mark({ id, unread: true });
|
|
62
|
+
} });
|
|
63
|
+
loadSession.mockImplementation(async id => {
|
|
64
|
+
if (id === 'root') throw new Error('temporarily unavailable');
|
|
65
|
+
return { id, parentID: 'root' };
|
|
66
|
+
});
|
|
67
|
+
expect((await request(app).get('/api/yuri/session-unread')).status).toBe(503);
|
|
68
|
+
expect(Object.keys(store.snapshot().sessions)).toEqual(['root']);
|
|
69
|
+
loadSession.mockResolvedValue({ id: 'root', directory: '/project' });
|
|
70
|
+
expect((await request(app).get('/api/yuri/session-unread')).body.sessions.root.unreadCount).toBe(1);
|
|
71
|
+
expect(loadSession.mock.calls.map(([id]) => id)).toEqual(['child', 'root', 'root']);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('removes prior attention when authoritative metadata makes a session hidden without a new completion', async () => {
|
|
75
|
+
const { event, store, loadSession, changed } = fixture();
|
|
76
|
+
await event('session.execution.succeeded');
|
|
77
|
+
loadSession.mockResolvedValue({ id: 'one', metadata: { yuri: { worker: { parentSessionID: 'root' } } } });
|
|
78
|
+
await event('session.metadata.updated');
|
|
79
|
+
expect(store.snapshot().sessions.one).toBeUndefined();
|
|
80
|
+
expect(changed).toHaveBeenCalledTimes(2);
|
|
81
|
+
await event('session.execution.succeeded');
|
|
82
|
+
expect(store.snapshot().sessions.one).toBeUndefined();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('coalesces startup snapshots, caps identity reads at four, and performs no warm snapshot reads', async () => {
|
|
86
|
+
const { app, loadSession } = fixture({ seed: store => {
|
|
87
|
+
for (let i = 0; i < 24; i++) store.mark({ id: `session-${i}`, unread: true });
|
|
88
|
+
store.mark({ id: 'already-read', unread: true });
|
|
89
|
+
const revision = store.snapshot().sessions['already-read'].revision;
|
|
90
|
+
store.mark({ id: 'already-read', unread: false, expectedRevision: revision });
|
|
91
|
+
} });
|
|
92
|
+
let active = 0;
|
|
93
|
+
let peak = 0;
|
|
94
|
+
loadSession.mockImplementation(async id => {
|
|
95
|
+
peak = Math.max(peak, ++active);
|
|
96
|
+
await new Promise(resolve => setTimeout(resolve, 1));
|
|
97
|
+
active--;
|
|
98
|
+
return { id, directory: '/project' };
|
|
99
|
+
});
|
|
100
|
+
const snapshots = await Promise.all([request(app).get('/api/yuri/session-unread'), request(app).get('/api/yuri/session-unread')]);
|
|
101
|
+
expect(snapshots.map(result => result.status)).toEqual([200, 200]);
|
|
102
|
+
expect(peak).toBe(4);
|
|
103
|
+
expect(loadSession).toHaveBeenCalledTimes(24);
|
|
104
|
+
await request(app).get('/api/yuri/session-unread');
|
|
105
|
+
expect(loadSession).toHaveBeenCalledTimes(24);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('returns retryable snapshot failure rather than waiting forever behind a failed lifecycle boundary', async () => {
|
|
109
|
+
const { app, event, loadSession, store } = fixture({ seed: store => store.mark({ id: 'one', unread: true }) });
|
|
110
|
+
loadSession.mockRejectedValue(new Error('offline'));
|
|
111
|
+
void event('session.execution.started');
|
|
112
|
+
expect((await request(app).get('/api/yuri/session-unread')).status).toBe(503);
|
|
113
|
+
expect(store.snapshot().sessions.one.unreadCount).toBe(1);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('keeps persisted unread and revision on cleanup write failure, then repairs only that row on retry', async () => {
|
|
117
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'yuri-unread-repair-'));
|
|
118
|
+
cleanup.push(() => fs.rmSync(dir, { recursive: true, force: true }));
|
|
119
|
+
const dbPath = path.join(dir, 'state.sqlite');
|
|
120
|
+
const store = createSessionUnreadStore({ dbPath });
|
|
121
|
+
store.mark({ id: 'worker', unread: true });
|
|
122
|
+
store.mark({ id: 'root', unread: true });
|
|
123
|
+
const previous = store.snapshot();
|
|
124
|
+
const loadSession = vi.fn(async id => ({ id, ...(id === 'worker' ? { parentID: 'root' } : {}) }));
|
|
125
|
+
const runtime = createSessionUnreadRuntime({ store, loadSession });
|
|
126
|
+
cleanup.push(() => runtime.close());
|
|
127
|
+
const app = express();
|
|
128
|
+
runtime.registerRoutes(app);
|
|
129
|
+
const Database = createRequire(import.meta.url)('better-sqlite3');
|
|
130
|
+
const db = new Database(dbPath);
|
|
131
|
+
cleanup.push(() => db.close());
|
|
132
|
+
db.exec("CREATE TRIGGER reject_cleanup BEFORE DELETE ON session_unread BEGIN SELECT RAISE(ABORT, 'write failed'); END");
|
|
133
|
+
expect((await request(app).get('/api/yuri/session-unread')).status).toBe(503);
|
|
134
|
+
expect(store.snapshot()).toEqual(previous);
|
|
135
|
+
db.exec('DROP TRIGGER reject_cleanup');
|
|
136
|
+
expect(Object.keys((await request(app).get('/api/yuri/session-unread')).body.sessions)).toEqual(['root']);
|
|
137
|
+
expect(loadSession.mock.calls.map(([id]) => id)).toEqual(['worker', 'root', 'worker']);
|
|
138
|
+
});
|
|
139
|
+
|
|
28
140
|
it('records completion with no clients, deduplicates succeeded/idle, and rearms on a new run', async () => {
|
|
29
141
|
const { store, event, changed } = fixture();
|
|
30
142
|
await event('session.execution.succeeded');
|
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
## Purpose
|
|
4
4
|
This module provides OpenCode server integration utilities for the web server runtime, including configuration management and provider authentication.
|
|
5
5
|
|
|
6
|
+
## Hub-only project layout and discovery
|
|
7
|
+
|
|
8
|
+
Production settings routes receive a synchronous SQLite projection from the
|
|
9
|
+
current Remote Host store. Full settings and both bootstrap variants expose
|
|
10
|
+
read-only `hasRemoteProjects:boolean`; clients cannot persist or override it.
|
|
11
|
+
Bootstrap excludes layout and project/Host contents. The projection creates no
|
|
12
|
+
upstream IO, timer or subscription. Reference changes invalidate through the
|
|
13
|
+
existing safe `yuri:project-order-changed` global event.
|
|
14
|
+
|
|
15
|
+
Full GET/PUT `/api/config/settings` exposes `hubProjectLayout`:
|
|
16
|
+
`{hubId:string, order:string[], collapsed:Record<string,boolean>}`. IDs identify
|
|
17
|
+
local projects or current-Hub remote references, never remote paths or remote
|
|
18
|
+
project IDs. Missing layout reads as current Hub + empty order/map. A foreign
|
|
19
|
+
Hub layout is not projected; writes with the wrong Hub ID return 409. Malformed
|
|
20
|
+
shape/capacity returns 400 before commit. Each list/map is bounded to 10,000
|
|
21
|
+
entries and each ID to 512 characters.
|
|
22
|
+
|
|
23
|
+
The existing settings write lock reads strict disk state and merges incoming
|
|
24
|
+
order first, then omitted previous order entries; collapse merges by key (false
|
|
25
|
+
explicitly expands). This is layout only, not collection replacement: omitted
|
|
26
|
+
projects/references are never removed. Local filesystem validation is not run
|
|
27
|
+
on layout IDs and no layout is written upstream. Concurrent saves serialize;
|
|
28
|
+
failed or unchanged saves emit no order tip, and failed writes preserve the
|
|
29
|
+
previous atomic settings file. Existing local `projects` update validation is
|
|
30
|
+
unchanged. After a changed commit, existing `yuri:project-order-changed` prompts
|
|
31
|
+
other clients to fetch current settings. A write may contain only layout; do not
|
|
32
|
+
serialize remote paths into `projects`.
|
|
33
|
+
|
|
6
34
|
OpenCode upstream calls are V2-only: startup/readiness probes use `/api/info`
|
|
7
35
|
without a legacy health fallback. Both Host SSE entrypoints forward upstream
|
|
8
36
|
to `/api/event`; the Host-owned global WebSocket route is unchanged. Status
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { MANAGED_SCHEDULED_TASK_TOOL_PATH } from '../scheduled-tasks/managed-tool-contract.js';
|
|
2
2
|
import { authorizeScheduledTaskSkillRequest, SCHEDULED_TASK_SKILL_PATH } from '../scheduled-tasks/session-skill-contract.js';
|
|
3
3
|
import { REMOTE_CONNECTIONS_SKILL_PATH } from '../gui-customization/remote-connections.js';
|
|
4
|
+
import { PROJECTS_SKILL_PATH } from '../gui-customization/projects.js';
|
|
4
5
|
import { MESSAGE_QUEUE_ADMISSION_HTTP_MAX_BYTES } from '../message-queue/service.js';
|
|
5
6
|
|
|
7
|
+
const decodeRequestPathForClassification = (pathname) => typeof pathname === 'string'
|
|
8
|
+
? pathname.replace(/%([a-f0-9]{2})/gi, (_match, hex) => String.fromCharCode(Number.parseInt(hex, 16))) : '';
|
|
9
|
+
const isFilePreviewRequestPath = (pathname) => /^\/api\/(?:hosts\/[^/]+\/api\/)?preview\/proxy\/[^/]+\/_file(?:\/|$)/i
|
|
10
|
+
.test(decodeRequestPathForClassification(pathname));
|
|
11
|
+
|
|
12
|
+
export const redactRequestPathForLog = (pathname) => {
|
|
13
|
+
if (isFilePreviewRequestPath(pathname)) return '/api/preview/proxy/_file/[preview]/[url-auth]/[resource]';
|
|
14
|
+
// Invalid envelopes can still contain credentials; never log a preview tail.
|
|
15
|
+
if (/\/api\/preview\/proxy(?:\/|$)/i.test(decodeRequestPathForClassification(pathname))) return '/api/preview/proxy/[redacted]';
|
|
16
|
+
return typeof pathname === 'string' ? pathname : '';
|
|
17
|
+
};
|
|
18
|
+
|
|
6
19
|
const parseLoopbackUrl = (rawUrl) => {
|
|
7
20
|
if (typeof rawUrl !== 'string') {
|
|
8
21
|
return null;
|
|
@@ -660,7 +673,7 @@ export const registerAuthAndAccessRoutes = (app, dependencies) => {
|
|
|
660
673
|
}
|
|
661
674
|
return res.status(403).json({ error: 'Forbidden' });
|
|
662
675
|
}
|
|
663
|
-
if (normalizedRequestPathname === SCHEDULED_TASK_SKILL_PATH || normalizedRequestPathname === REMOTE_CONNECTIONS_SKILL_PATH) {
|
|
676
|
+
if (normalizedRequestPathname === SCHEDULED_TASK_SKILL_PATH || normalizedRequestPathname === REMOTE_CONNECTIONS_SKILL_PATH || normalizedRequestPathname === PROJECTS_SKILL_PATH) {
|
|
664
677
|
if (authorizeScheduledTaskSkillRequest(req, getScheduledTaskSkillAuthHeaders())) return next();
|
|
665
678
|
return res.status(403).json({ error: 'Forbidden' });
|
|
666
679
|
}
|
|
@@ -668,7 +681,7 @@ export const registerAuthAndAccessRoutes = (app, dependencies) => {
|
|
|
668
681
|
// preview proxy validates against the registered target id/TTL. Let those
|
|
669
682
|
// requests reach that stricter check instead of failing the global UI auth
|
|
670
683
|
// gate when the short-lived browser URL auth token expires.
|
|
671
|
-
if (
|
|
684
|
+
if (requestPathname.startsWith('/api/preview/proxy/') && !isFilePreviewRequestPath(requestPathname) && hasPreviewProxyCredential(req)) {
|
|
672
685
|
return next();
|
|
673
686
|
}
|
|
674
687
|
|
|
@@ -1249,7 +1262,7 @@ export const registerCommonRequestMiddleware = (app, dependencies) => {
|
|
|
1249
1262
|
|
|
1250
1263
|
app.use((req, _res, next) => {
|
|
1251
1264
|
if (verboseRequestLogs) {
|
|
1252
|
-
console.log(`${new Date().toISOString()} - ${req.method} ${req.path}`);
|
|
1265
|
+
console.log(`${new Date().toISOString()} - ${req.method} ${redactRequestPathForLog(req.path)}`);
|
|
1253
1266
|
}
|
|
1254
1267
|
next();
|
|
1255
1268
|
});
|
|
@@ -328,6 +328,30 @@ describe('core-routes', () => {
|
|
|
328
328
|
expect(dependencies.gracefulShutdown).not.toHaveBeenCalled();
|
|
329
329
|
});
|
|
330
330
|
|
|
331
|
+
it('redacts preview path credentials before verbose request logging, including malformed envelopes', async () => {
|
|
332
|
+
const log = vi.spyOn(console, 'log').mockImplementation(() => {});
|
|
333
|
+
const app = express();
|
|
334
|
+
registerCommonRequestMiddleware(app, { express, verboseRequestLogs: true });
|
|
335
|
+
app.use((_req, res) => res.status(204).end());
|
|
336
|
+
const previewToken = 'c'.repeat(32);
|
|
337
|
+
const urlToken = `yuri_url_${'d'.repeat(32)}`;
|
|
338
|
+
const suffix = `${previewToken}/${urlToken}/index.html`;
|
|
339
|
+
try {
|
|
340
|
+
for (const route of [
|
|
341
|
+
`/api/preview/proxy/${'a'.repeat(32)}/_file/${suffix}`,
|
|
342
|
+
`/api/hosts/remote/api/preview/proxy/bad-id/_file/${suffix}`,
|
|
343
|
+
`/api/preview/proxy/bad-id/%5Ffile/${suffix}`,
|
|
344
|
+
`/api/preview/proxy/bad-id/malformed/${suffix}`,
|
|
345
|
+
]) await request(app).get(route).expect(204);
|
|
346
|
+
const output = log.mock.calls.map((args) => args.join(' ')).join('\n');
|
|
347
|
+
expect(log).toHaveBeenCalledTimes(4);
|
|
348
|
+
expect(output).not.toContain(previewToken);
|
|
349
|
+
expect(output).not.toContain(urlToken);
|
|
350
|
+
expect(output).toContain('[preview]/[url-auth]');
|
|
351
|
+
expect(output).toContain('[redacted]');
|
|
352
|
+
} finally { log.mockRestore(); }
|
|
353
|
+
});
|
|
354
|
+
|
|
331
355
|
// Global raw config saves send { content: "<jsonc string>" }. Without this
|
|
332
356
|
// prefix in the JSON middleware allowlist, PUT arrives with an empty body and
|
|
333
357
|
// the handler rejects with "Configuration content must be a string".
|
|
@@ -1322,6 +1346,10 @@ describe('core-routes', () => {
|
|
|
1322
1346
|
.get('/api/yuri/transcript-cache/session?yuri_preview_token=preview-secret')
|
|
1323
1347
|
.expect(401, 'Authentication required');
|
|
1324
1348
|
expect(requireAuth).toHaveBeenCalledTimes(2);
|
|
1349
|
+
for (const suffix of ['_file/target-token/-/index.html', '_file', '%5Ffile/bad-target/live-token/file.html']) {
|
|
1350
|
+
await request(app).get(`/api/preview/proxy/abc123/${suffix}?yuri_preview_token=arbitrary`)
|
|
1351
|
+
.set('Cookie', 'yuri_preview_token=arbitrary').expect(401, 'Authentication required');
|
|
1352
|
+
}
|
|
1325
1353
|
});
|
|
1326
1354
|
|
|
1327
1355
|
it('requires the managed bridge capability independently from UI auth', async () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { registerFsRoutes } from '../fs/routes.js';
|
|
2
2
|
import { registerRemoteConnectionsSkill } from '../gui-customization/remote-connections.js';
|
|
3
|
+
import { registerProjectsSkill } from '../gui-customization/projects.js';
|
|
3
4
|
import { registerQuotaRoutes } from '../quota/routes.js';
|
|
4
5
|
import { registerSmallModelRoutes } from '../small-model/routes.js';
|
|
5
6
|
import { registerSessionMetadataRoutes } from '../session-metadata/routes.js';
|
|
@@ -65,7 +66,8 @@ import { scanClawdHubPage } from '../skills-catalog/clawdhub/scan.js';
|
|
|
65
66
|
import { installSkillsFromClawdHub } from '../skills-catalog/clawdhub/install.js';
|
|
66
67
|
|
|
67
68
|
/** Fan-out an Yuri product SSE tip to every /api/yuri/events client. */
|
|
68
|
-
export const createYuriEventBroadcaster = ({ getYuriEventClients, writeSseEvent }) => (event) => {
|
|
69
|
+
export const createYuriEventBroadcaster = ({ getYuriEventClients, writeSseEvent, onEvent }) => (event) => {
|
|
70
|
+
onEvent?.(event);
|
|
69
71
|
const clients = getYuriEventClients();
|
|
70
72
|
for (const client of clients) {
|
|
71
73
|
try {
|
|
@@ -183,6 +185,7 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
registerOpenCodeRoutes(app, {
|
|
188
|
+
getRemoteProjectState: routeDependencies.getRemoteProjectState,
|
|
186
189
|
crypto,
|
|
187
190
|
clientReloadDelayMs,
|
|
188
191
|
getOpenCodeResolutionSnapshot,
|
|
@@ -303,6 +306,11 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
303
306
|
};
|
|
304
307
|
await refreshAssistantAllowedRoots();
|
|
305
308
|
const projectRegistry = createProjectRegistry({ persistSettings, validateDirectoryPath });
|
|
309
|
+
registerProjectsSkill(app, {
|
|
310
|
+
express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders,
|
|
311
|
+
createClient: () => makeOpenCodeV2Client({ baseUrl: buildOpenCodeUrl('/', ''), authHeaders: getOpenCodeAuthHeaders(), getRuntimeContract }),
|
|
312
|
+
registerProject: (input) => projectRegistry.register(input), readSettingsFromDiskStrict, sanitizeProjects,
|
|
313
|
+
});
|
|
306
314
|
historyImportRuntime = registerHistoryImportRoutes(app, {
|
|
307
315
|
express, uiAuthController, dataDir: yuriDataDir,
|
|
308
316
|
createClient: () => makeOpenCodeV2Client({ baseUrl: buildOpenCodeUrl('/', ''), authHeaders: getOpenCodeAuthHeaders(), getRuntimeContract }),
|
|
@@ -493,6 +501,9 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
493
501
|
const broadcastYuriEvent = createYuriEventBroadcaster({
|
|
494
502
|
getYuriEventClients,
|
|
495
503
|
writeSseEvent,
|
|
504
|
+
onEvent: (event) => {
|
|
505
|
+
if (/^yuri:session-(unread|order|folders)-changed$/.test(event?.type || '')) broadcastGlobalUiEvent?.(event);
|
|
506
|
+
},
|
|
496
507
|
});
|
|
497
508
|
sessionUnreadRuntime = createSessionUnreadRuntime({
|
|
498
509
|
store: createSessionUnreadStore({
|
|
@@ -3,6 +3,10 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
3
3
|
import { createWorktreeTopologyBroadcaster } from './feature-routes-runtime.js';
|
|
4
4
|
|
|
5
5
|
describe('feature routes runtime composition', () => {
|
|
6
|
+
it('wires session project registration to the shared registry and strict settings reader', async () => {
|
|
7
|
+
const routes = await fs.readFile(new URL('./feature-routes-runtime.js', import.meta.url), 'utf8');
|
|
8
|
+
expect(routes).toMatch(/registerProjectsSkill\(app, \{[\s\S]*?registerProject: \(input\) => projectRegistry.register\(input\), readSettingsFromDiskStrict, sanitizeProjects/);
|
|
9
|
+
});
|
|
6
10
|
it('passes the native connection adapter to shared-session admission and the protected bridge', async () => {
|
|
7
11
|
const host = await fs.readFile(new URL('../../index.js', import.meta.url), 'utf8');
|
|
8
12
|
const routes = await fs.readFile(new URL('./feature-routes-runtime.js', import.meta.url), 'utf8');
|
|
@@ -748,6 +748,7 @@ export const registerOpenCodeProxy = (app, deps) => {
|
|
|
748
748
|
|
|
749
749
|
if (subscribeGlobalUiEvent) {
|
|
750
750
|
unsubscribeHostEvents = subscribeGlobalUiEvent((payload, options = {}) => {
|
|
751
|
+
if (options.targetFilter && !options.targetFilter(res)) return;
|
|
751
752
|
const envelope = { directory: options.directory || 'global', payload };
|
|
752
753
|
const block = `data: ${JSON.stringify(envelope)}\n\n`;
|
|
753
754
|
const filtered = outboundSseFilter ? filterSseBlock(block, outboundSseFilter) : block;
|
|
@@ -38,6 +38,7 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
|
|
|
38
38
|
readSettingsFromDisk,
|
|
39
39
|
readSettingsFromDiskMigrated,
|
|
40
40
|
persistSettings,
|
|
41
|
+
getRemoteProjectState = () => null,
|
|
41
42
|
validateDirectoryPath,
|
|
42
43
|
resolveProjectDirectory,
|
|
43
44
|
getProviderSources,
|
|
@@ -63,6 +64,13 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
|
|
|
63
64
|
} = dependencies;
|
|
64
65
|
|
|
65
66
|
const upgradeOperation = createUpgradeOperationState();
|
|
67
|
+
const projectSettingsResponse = (response) => {
|
|
68
|
+
const state = getRemoteProjectState();
|
|
69
|
+
if (!state) return response;
|
|
70
|
+
return { ...response, hasRemoteProjects: state.hasRemoteProjects,
|
|
71
|
+
hubProjectLayout: response.hubProjectLayout?.hubId === state.hubId ? response.hubProjectLayout
|
|
72
|
+
: { hubId: state.hubId, order: [], collapsed: {} } };
|
|
73
|
+
};
|
|
66
74
|
const resolveDataDir = () => yuriDataDir || resolveYuriDataDir();
|
|
67
75
|
|
|
68
76
|
let authLibrary = null;
|
|
@@ -296,7 +304,7 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
|
|
|
296
304
|
app.get('/api/config/settings', async (req, res) => {
|
|
297
305
|
try {
|
|
298
306
|
const settings = await readSettingsFromDiskMigrated();
|
|
299
|
-
const response = formatSettingsResponse(settings);
|
|
307
|
+
const response = projectSettingsResponse(formatSettingsResponse(settings));
|
|
300
308
|
res.json(req.query?.bootstrap === 'true' ? projectBootstrapSettingsResponse(response) : response);
|
|
301
309
|
} catch (error) {
|
|
302
310
|
console.error('Failed to read settings:', error);
|
|
@@ -307,7 +315,7 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
|
|
|
307
315
|
app.get('/api/config/settings/bootstrap', async (_req, res) => {
|
|
308
316
|
try {
|
|
309
317
|
const settings = await readSettingsFromDiskMigrated();
|
|
310
|
-
const response = formatSettingsResponse(settings);
|
|
318
|
+
const response = projectSettingsResponse(formatSettingsResponse(settings));
|
|
311
319
|
res.json(projectBootstrapSettingsResponse(response));
|
|
312
320
|
} catch (error) {
|
|
313
321
|
console.error('Failed to read bootstrap settings:', error);
|
|
@@ -610,7 +618,13 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
|
|
|
610
618
|
app.put('/api/config/settings', async (req, res) => {
|
|
611
619
|
try {
|
|
612
620
|
const changes = req.body ?? {};
|
|
613
|
-
|
|
621
|
+
if (Object.hasOwn(changes, 'hubProjectLayout')) {
|
|
622
|
+
const state = getRemoteProjectState();
|
|
623
|
+
if (typeof changes.hubProjectLayout?.hubId !== 'string') return res.status(400).json({ error: 'Invalid Hub project layout' });
|
|
624
|
+
if (!state || changes.hubProjectLayout.hubId !== state.hubId) return res.status(409).json({ error: 'Hub project layout belongs to another Hub' });
|
|
625
|
+
}
|
|
626
|
+
const updated = projectSettingsResponse(await persistSettings(changes));
|
|
627
|
+
if (Object.prototype.hasOwnProperty.call(changes, 'projects')) app.emit('yuri:projects-changed');
|
|
614
628
|
// Only after a successful persist — failed saves must not apply runtime flags.
|
|
615
629
|
if (
|
|
616
630
|
typeof onSettingsPersisted === 'function'
|
|
@@ -626,7 +640,7 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
|
|
|
626
640
|
} catch (error) {
|
|
627
641
|
console.error('[API:PUT /api/config/settings] Failed to save settings:', error);
|
|
628
642
|
console.error('[API:PUT /api/config/settings] Error stack:', error.stack);
|
|
629
|
-
res.status(500).json({ error: 'Failed to save settings' });
|
|
643
|
+
res.status(error?.status === 400 ? 400 : 500).json({ error: 'Failed to save settings' });
|
|
630
644
|
}
|
|
631
645
|
});
|
|
632
646
|
|
|
@@ -37,6 +37,28 @@ const createDependencies = ({ formatSettingsResponse }) => ({
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
describe('settings route', () => {
|
|
40
|
+
it('projects SQLite discovery and current-Hub layout without reformatting persisted public settings', async () => {
|
|
41
|
+
let hasRemoteProjects = false;
|
|
42
|
+
const dependencies = createDependencies({ formatSettingsResponse: vi.fn(() => ({ hasRemoteProjects: true,
|
|
43
|
+
hubProjectLayout: { hubId: 'foreign', order: ['other'], collapsed: {} } })) });
|
|
44
|
+
dependencies.getRemoteProjectState = () => ({ hubId: 'hub', hasRemoteProjects });
|
|
45
|
+
dependencies.persistSettings.mockResolvedValue({ hasSummaryCustomAPIToken: true,
|
|
46
|
+
hubProjectLayout: { hubId: 'hub', order: ['local'], collapsed: {} } });
|
|
47
|
+
const app = express(); app.use(express.json()); registerOpenCodeRoutes(app, dependencies);
|
|
48
|
+
const cold = await request(app).get('/api/config/settings/bootstrap').expect(200);
|
|
49
|
+
expect(cold.body).toEqual({ schemaVersion: 1, hasRemoteProjects: false });
|
|
50
|
+
hasRemoteProjects = true;
|
|
51
|
+
expect((await request(app).get('/api/config/settings?bootstrap=true').expect(200)).body.hasRemoteProjects).toBe(true);
|
|
52
|
+
expect((await request(app).get('/api/config/settings').expect(200)).body.hubProjectLayout)
|
|
53
|
+
.toEqual({ hubId: 'hub', order: [], collapsed: {} });
|
|
54
|
+
const layout = { hubId: 'hub', order: ['local'], collapsed: {} };
|
|
55
|
+
const written = await request(app).put('/api/config/settings').send({ hubProjectLayout: layout }).expect(200);
|
|
56
|
+
expect(written.body).toMatchObject({ hasSummaryCustomAPIToken: true, hasRemoteProjects: true, hubProjectLayout: layout });
|
|
57
|
+
expect(dependencies.formatSettingsResponse).toHaveBeenCalledTimes(3);
|
|
58
|
+
dependencies.persistSettings.mockClear();
|
|
59
|
+
await request(app).put('/api/config/settings').send({ hubProjectLayout: { ...layout, hubId: 'foreign' } }).expect(409);
|
|
60
|
+
expect(dependencies.persistSettings).not.toHaveBeenCalled();
|
|
61
|
+
});
|
|
40
62
|
it('returns the full formatted response without the bootstrap query', async () => {
|
|
41
63
|
const formatted = { themeId: 'default', summaryCustomAPIToken: 'response-secret-sentinel' };
|
|
42
64
|
const formatSettingsResponse = vi.fn(() => formatted);
|
|
@@ -26,6 +26,7 @@ export const projectBootstrapSettingsResponse = (response) => {
|
|
|
26
26
|
copyString('defaultVariant');
|
|
27
27
|
copyString('defaultAgent');
|
|
28
28
|
copyBoolean('autoCreateWorktree');
|
|
29
|
+
copyBoolean('hasRemoteProjects');
|
|
29
30
|
copyBoolean('gitmojiEnabled');
|
|
30
31
|
copyBoolean('defaultFileViewerPreview');
|
|
31
32
|
copyString('zenModel');
|
|
@@ -180,6 +181,20 @@ export const createSettingsHelpers = (dependencies) => {
|
|
|
180
181
|
const candidate = payload;
|
|
181
182
|
const result = {};
|
|
182
183
|
|
|
184
|
+
if (Object.hasOwn(candidate, 'hubProjectLayout')) {
|
|
185
|
+
const layout = candidate.hubProjectLayout;
|
|
186
|
+
const validId = (id) => typeof id === 'string' && id.length > 0 && id.length <= 512;
|
|
187
|
+
if (!layout || typeof layout !== 'object' || Array.isArray(layout)
|
|
188
|
+
|| !validId(layout.hubId) || !Array.isArray(layout.order) || layout.order.length > 10000
|
|
189
|
+
|| !layout.order.every(validId) || !layout.collapsed || typeof layout.collapsed !== 'object'
|
|
190
|
+
|| Array.isArray(layout.collapsed) || Object.keys(layout.collapsed).length > 10000
|
|
191
|
+
|| !Object.entries(layout.collapsed).every(([id, value]) => validId(id) && typeof value === 'boolean')) {
|
|
192
|
+
throw Object.assign(new Error('Invalid Hub project layout'), { status: 400 });
|
|
193
|
+
}
|
|
194
|
+
result.hubProjectLayout = { hubId: layout.hubId, order: [...new Set(layout.order)],
|
|
195
|
+
collapsed: Object.fromEntries(Object.entries(layout.collapsed)) };
|
|
196
|
+
}
|
|
197
|
+
|
|
183
198
|
if (typeof candidate.themeId === 'string' && candidate.themeId.length > 0) {
|
|
184
199
|
result.themeId = candidate.themeId;
|
|
185
200
|
}
|
|
@@ -904,6 +919,17 @@ export const createSettingsHelpers = (dependencies) => {
|
|
|
904
919
|
typographySizes: nextTypographySizes
|
|
905
920
|
};
|
|
906
921
|
|
|
922
|
+
if (changes.hubProjectLayout) {
|
|
923
|
+
const incoming = changes.hubProjectLayout;
|
|
924
|
+
const prior = current.hubProjectLayout?.hubId === incoming.hubId ? current.hubProjectLayout : null;
|
|
925
|
+
next.hubProjectLayout = { hubId: incoming.hubId,
|
|
926
|
+
order: [...new Set([...incoming.order, ...(prior?.order || [])])],
|
|
927
|
+
collapsed: { ...prior?.collapsed, ...incoming.collapsed } };
|
|
928
|
+
if (next.hubProjectLayout.order.length > 10000 || Object.keys(next.hubProjectLayout.collapsed).length > 10000) {
|
|
929
|
+
throw Object.assign(new Error('Hub project layout exceeds capacity'), { status: 400 });
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
907
933
|
return next;
|
|
908
934
|
};
|
|
909
935
|
|
|
@@ -39,6 +39,26 @@ const createTestHelpersWithRealSanitizers = () => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
describe('settings helpers', () => {
|
|
42
|
+
it('merges Hub-only layout without replacing projects, references or omitted collapse entries', () => {
|
|
43
|
+
const helpers = createTestHelpers();
|
|
44
|
+
const current = { projects: [{ id: 'local', path: '/local' }],
|
|
45
|
+
hubProjectLayout: { hubId: 'hub-a', order: ['local', 'remote-a', 'remote-b'], collapsed: { 'remote-a': true, 'remote-b': true } } };
|
|
46
|
+
const changes = helpers.sanitizeSettingsUpdate({ hasRemoteProjects: true,
|
|
47
|
+
hubProjectLayout: { hubId: 'hub-a', order: ['remote-b', 'remote-b'], collapsed: { 'remote-a': false } } });
|
|
48
|
+
expect(changes).not.toHaveProperty('hasRemoteProjects');
|
|
49
|
+
const merged = helpers.mergePersistedSettings(current, changes);
|
|
50
|
+
expect(merged.projects).toEqual(current.projects);
|
|
51
|
+
expect(merged.hubProjectLayout).toEqual({ hubId: 'hub-a', order: ['remote-b', 'local', 'remote-a'],
|
|
52
|
+
collapsed: { 'remote-a': false, 'remote-b': true } });
|
|
53
|
+
expect(helpers.mergePersistedSettings(current, { hubProjectLayout: { hubId: 'hub-b', order: [], collapsed: {} } }).hubProjectLayout)
|
|
54
|
+
.toEqual({ hubId: 'hub-b', order: [], collapsed: {} });
|
|
55
|
+
for (const layout of [null, [], {}, { hubId: 'a', order: [], collapsed: [] },
|
|
56
|
+
{ hubId: 'a', order: [null], collapsed: {} }, { hubId: 'a', order: [], collapsed: { x: 'true' } }]) {
|
|
57
|
+
expect(() => helpers.sanitizeSettingsUpdate({ hubProjectLayout: layout })).toThrow('Invalid Hub project layout');
|
|
58
|
+
}
|
|
59
|
+
expect(helpers.projectBootstrapSettingsResponse({ hasRemoteProjects: false, hubProjectLayout: current.hubProjectLayout }))
|
|
60
|
+
.toEqual({ schemaVersion: 1, hasRemoteProjects: false });
|
|
61
|
+
});
|
|
42
62
|
it('ignores retired editor toolbar preferences in updates and stored settings', () => {
|
|
43
63
|
const helpers = createTestHelpers();
|
|
44
64
|
for (const expandedEditorToolbar of [true, false, null, {}, 'invalid']) {
|
|
@@ -853,10 +853,11 @@ export const createSettingsRuntime = (deps) => {
|
|
|
853
853
|
|
|
854
854
|
const persistSettings = async (changes) => runPersistedWrite(async () => {
|
|
855
855
|
const updateCurrent = typeof changes === 'function';
|
|
856
|
-
const
|
|
856
|
+
const strictRead = updateCurrent || Object.hasOwn(changes || {}, 'hubProjectLayout');
|
|
857
|
+
const stored = strictRead
|
|
857
858
|
? await readSettingsFromDiskStrict()
|
|
858
859
|
: await readSettingsFromDisk();
|
|
859
|
-
if (
|
|
860
|
+
if (strictRead && Array.isArray(stored)) throw new Error('Settings file is malformed (array payload)');
|
|
860
861
|
const { settings: current } = await migrateSettingsFromLegacyLastDirectory(stored);
|
|
861
862
|
if (typeof changes === 'function') changes = await changes(current);
|
|
862
863
|
// Log field names only — changes can carry credentials (UI password,
|
|
@@ -908,7 +909,8 @@ export const createSettingsRuntime = (deps) => {
|
|
|
908
909
|
|
|
909
910
|
await writeSettingsToDiskUnlocked(next);
|
|
910
911
|
if (JSON.stringify(stored.projects) !== JSON.stringify(next.projects)
|
|
911
|
-
|| stored.projectSortOrder !== next.projectSortOrder
|
|
912
|
+
|| stored.projectSortOrder !== next.projectSortOrder
|
|
913
|
+
|| JSON.stringify(stored.hubProjectLayout) !== JSON.stringify(next.hubProjectLayout)) {
|
|
912
914
|
onProjectOrderChanged?.();
|
|
913
915
|
}
|
|
914
916
|
return formatSettingsResponse(next);
|