@yuriai/web 0.3.2-beta.7 → 0.3.3-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AgentAvatar-CHCjMxCF.js +1 -0
- package/dist/assets/AgentSelector-Dp2Y_etX.js +1 -0
- package/dist/assets/ArchivedSessionsDialog-DOIPVgrw.js +1 -0
- package/dist/assets/AssistantConversationSurface-HGpfVNBs.js +3 -0
- package/dist/assets/AssistantSessionCard-DedZC42m.js +2 -0
- package/dist/assets/AssistantUnreadBadge-C48KUb1r.js +1 -0
- package/dist/assets/AssistantView-CuoRAEno.js +1 -0
- package/dist/assets/AssistantWorkingAvatar-JgG_07hF.js +1 -0
- package/dist/assets/AssistantsSettingsPage-t0ADcz1K.js +1 -0
- package/dist/assets/BinaryFileFallback-CKNAgvHj.css +1 -0
- package/dist/assets/BinaryFileFallback-X1gV-nAy.js +1 -0
- package/dist/assets/BtwPanel-CHS7r31i.js +6 -0
- package/dist/assets/BusyDots-BsUVp2eN.js +4 -0
- package/dist/assets/ChatContainer-Ct4VAS3b.js +65 -0
- package/dist/assets/ChatView-Cqnu4UDM.js +3 -0
- package/dist/assets/{DiagramView-zlrPK3wP.js → DiagramView-B-etEyWo.js} +1 -1
- package/dist/assets/DiffView-DDHHqjgv.js +6 -0
- package/dist/assets/DiffViewToggle-BwJ6MYB7.js +1 -0
- package/dist/assets/DiffWorkerProvider-VFPkag9y.js +1 -0
- package/dist/assets/ErrorBoundary-BtjED190.js +1 -0
- package/dist/assets/FadeInOnReveal-BYHr1gqj.js +1 -0
- package/dist/assets/GuiPluginMount-Crvczrt6.js +1 -0
- package/dist/assets/GuiPluginPage-2WzEPF43.js +1 -0
- package/dist/assets/GuiPluginSurface-KHF2wT87.js +1 -0
- package/dist/assets/GuiPluginTitlebarItems-DxFINwbr.js +1 -0
- package/dist/assets/GuiPluginWindow-zPmRKQyC.js +1 -0
- package/dist/assets/Icon-DmykXZL1.js +1 -0
- package/dist/assets/ImageLoadingPlaceholder-CygGz74v.js +1 -0
- package/dist/assets/{LoadingImage-DDafrpn6.js → LoadingImage-Dln_32pX.js} +1 -1
- package/dist/assets/MarkdownRenderer-D719PKVi.js +2 -0
- package/dist/assets/MarkdownRendererImpl-DI1Ea45X.js +10 -0
- package/dist/assets/MarkstreamRendererImpl-D9FCjddm.js +3 -0
- package/dist/assets/MobileAssistantSettingsPage-CQ0NYrWK.js +1 -0
- package/dist/assets/MobileAssistantTab-DLUKZcit.js +1 -0
- package/dist/assets/MobileBtwPage-pxZXYPD5.js +1 -0
- package/dist/assets/MobileChangesSurface-DX--axmh.js +4 -0
- package/dist/assets/MobileChatScreen-DWBAhlAd.js +1 -0
- package/dist/assets/MobileDetailNavigation-ldTzGo19.js +1 -0
- package/dist/assets/MobileFilesSurface-BBSHFiPy.js +2 -0
- package/dist/assets/MobileHtmlNetworkBoundary-CZKls5Dm.js +2 -0
- package/dist/assets/MobileOverlayPanel-C36VWWmN.js +1 -0
- package/dist/assets/MobileResizableSheet-CqphcaKq.js +1 -0
- package/dist/assets/MobileSettingsTab-B3O2HKYI.js +1 -0
- package/dist/assets/MobileShareBridge-CW-Ga05E.js +3 -0
- package/dist/assets/MobileSurface-cmaGf3hZ.js +1 -0
- package/dist/assets/MobileTabPageHeader-D6P4K98S.js +1 -0
- package/dist/assets/ModelLogo-BkbD514M.js +1 -0
- package/dist/assets/ModelSelector-BGR6sZJR.js +1 -0
- package/dist/assets/MultiRunWindow-ChKq36k9.js +1 -0
- package/dist/assets/OnboardingScreen-BK78UY6r.js +1 -0
- package/dist/assets/OverlayScrollbar-D6vmoMkQ.js +1 -0
- package/dist/assets/PierreDiffViewer-Dx9xKT6Q.js +139 -0
- package/dist/assets/ProviderLogo-DA98yu7M.js +1 -0
- package/dist/assets/RemoteAssistantSessionCard-ClcMxJDi.js +1 -0
- package/dist/assets/RemoteDesktopPanel-C2--FcGJ.js +1 -0
- package/dist/assets/ScheduledTasksDialog-YbrfN9nF.js +3 -0
- package/dist/assets/ScrollableOverlay-stxT7gLf.js +1 -0
- package/dist/assets/SessionSurfaceContext-BP4NCKp6.js +10 -0
- package/dist/assets/SettingsGroup-D-7VEpNl.js +1 -0
- package/dist/assets/SettingsView-BAcjCVpS.js +29 -0
- package/dist/assets/SettingsWindow-DMsvU8gG.js +1 -0
- package/dist/assets/SetupTourDialog-C23oYP0n.js +1 -0
- package/dist/assets/SyncActions-BcIQyp1F.js +1 -0
- package/dist/assets/TerminalView-BhdW5u6z.js +8 -0
- package/dist/assets/TextSelectionMenu-pKMQsjmM.js +11 -0
- package/dist/assets/ToolOutputDialog-DHMoC89c.js +16 -0
- package/dist/assets/{YuriLogo-DNvrroBa.js → YuriLogo-Dpy8xIT7.js} +1 -1
- package/dist/assets/{YuriWordmark-bJX68f2Y.js → YuriWordmark-CLGHwobA.js} +1 -1
- package/dist/assets/appThemeRegistry-BdjrGBQ4.js +1 -0
- package/dist/assets/{assistant-attachment-cache-zu9sz4ex.js → assistant-attachment-cache-bRIIESGe.js} +1 -1
- package/dist/assets/assistantMessagePreview-BoElXQcc.js +1 -0
- package/dist/assets/assistantPresentation-DRbsH1Ej.js +1 -0
- package/dist/assets/assistantQueries-CU5EOlP5.js +1 -0
- package/dist/assets/audio-session-BFWjrDbp.js +1 -0
- package/dist/assets/auto-read-context-C63nte5m.js +5 -0
- package/dist/assets/{speechSettingsQueries-CJ3jPRqV.js → browserVoiceService-x5Pci8L3.js} +3 -3
- package/dist/assets/{capgoAdapter-CPyV4o5H.js → capgoAdapter-DA9oqtUT.js} +1 -1
- package/dist/assets/card-DmysoUAV.js +1 -0
- package/dist/assets/chatUpwardIntent-vaEvclo6.js +1 -0
- package/dist/assets/checkbox-BMN5hAVm.js +1 -0
- package/dist/assets/{client-CgAFd1ew.js → client-B_907PBv.js} +4 -4
- package/dist/assets/collapsible-Z0IjDAMO.js +1 -0
- package/dist/assets/connection-hint-_XZ_PuIx.js +2 -0
- package/dist/assets/context-menu-CKlB6wxo.js +1 -0
- package/dist/assets/contextPanelEmbeddedChat-Dm5R_b5X.js +1 -0
- package/dist/assets/{desktopHosts-135cuRCE.js → desktopHosts-BsTrBVja.js} +1 -1
- package/dist/assets/{desktopRelayRestore-1aUztDPU.js → desktopRelayRestore-BxbRKak_.js} +1 -1
- package/dist/assets/{device-C8ZHblkr.js → device-EIfSfSWk.js} +1 -1
- package/dist/assets/diagram-CzY6n_4N.js +1 -0
- package/dist/assets/dialog-D9CkSNCA.css +1 -0
- package/dist/assets/dialog-DGIsM7rW.js +1 -0
- package/dist/assets/dropdown-menu-BblI9sN2.js +1 -0
- package/dist/assets/{es-DuTK1iYh.js → es-Bl9cq4cA.js} +1 -1
- package/dist/assets/fileMentionAutocompleteState-B9411b4o.js +2 -0
- package/dist/assets/{fileMentionTouchSelection-DSXpR_Hq.js → fileMentionTouchSelection-BQEUty_A.js} +2 -2
- package/dist/assets/{fileReferenceActions-DX-Stroq.js → fileReferenceActions-TmbrIHBI.js} +1 -1
- package/dist/assets/{fr-C_XToFWm.js → fr-Cr4jYr7F.js} +1 -1
- package/dist/assets/{gitApi--F7MdPg9.js → gitApi-B2woehMM.js} +1 -1
- package/dist/assets/gitApiHttp-Dd-FwgCq.js +3 -0
- package/dist/assets/githubAuthQueries-DqregESf.js +1 -0
- package/dist/assets/{gui-BMN3-WPc.js → gui-KxRdG4j0.js} +1 -1
- package/dist/assets/historyImportQueries-D00KjUT2.js +1 -0
- package/dist/assets/{host-iM7aLAip.js → host-ChBHl_Vl.js} +1 -1
- package/dist/assets/{i18n-OsFhnlRH.js → i18n-D5tJwyKg.js} +1 -1
- package/dist/assets/icons-Bd-INsoy.js +1 -0
- package/dist/assets/{image-loading-ZB1bYt51.js → imageSource-BR4C9TuS.js} +1 -1
- package/dist/assets/inlineMessageLinks-DC78iKO5.js +1 -0
- package/dist/assets/input-Cf16qJ6g.js +1 -0
- package/dist/assets/{input-store-DRTu4uZc.js → input-store-BSJBQTMi.js} +1 -1
- package/dist/assets/insertionBoundaries-uc4ZzuFG.js +1 -0
- package/dist/assets/{ja-D0pDybpB.js → ja-Cm3BxxJJ.js} +1 -1
- package/dist/assets/kbd-CamdaxHJ.js +1 -0
- package/dist/assets/{ko-CAzlaaDJ.js → ko-DvHdDOxf.js} +1 -1
- package/dist/assets/main-DNlHTrMN.js +2 -0
- package/dist/assets/main-DpJ6uDTu.js +169 -0
- package/dist/assets/{markdownHeightCache-Dn_Jkp0n.js → markdownHeightCache-CHGGNhWI.js} +1 -1
- package/dist/assets/{markdownTheme-C2LJ3cJo.js → markdownTheme-D84XyNiT.js} +1 -1
- package/dist/assets/mcpQueries-XUc_D3YM.js +1 -0
- package/dist/assets/miniChat-CaNWXhjj.js +2 -0
- package/dist/assets/mobile-BzAiDSbd.js +2 -0
- package/dist/assets/mobileAppContext-BQgdTp5T.js +1 -0
- package/dist/assets/mobileBackNavigation-DRAXoPY-.js +1 -0
- package/dist/assets/mobileConnections-BGOTglit.js +2 -0
- package/dist/assets/multirun-BK3mZXUk.js +3 -0
- package/dist/assets/{native-config-CaDwggks.js → native-config-D_WRbNJv.js} +1 -1
- package/dist/assets/nativeComposerCover-wtrZ94Ug.js +1 -0
- package/dist/assets/navigation-CTmsDjzG.js +2 -0
- package/dist/assets/openRemoteProjectSession-BAdOlqax.js +1 -0
- package/dist/assets/permission-rules-DoQUXKll.js +1 -0
- package/dist/assets/{pl-BvjbUcJV.js → pl-DpyRu1OO.js} +1 -1
- package/dist/assets/{platform-wF65ZFgV.js → platform-CiUKDeXd.js} +1 -1
- package/dist/assets/pluginPresentation-BiUzFwhI.js +2 -0
- package/dist/assets/{project-preview-BhNspxqe.js → project-preview-BCtFY4Rg.js} +1 -1
- package/dist/assets/{projectActions-50e_f9dI.js → projectActions-BPmI9_mW.js} +1 -1
- package/dist/assets/projectMeta-vIaGFaQr.js +1 -0
- package/dist/assets/{prompt-attachment-upload-8bssUUT3.js → prompt-attachment-upload-B5DHrw6U.js} +1 -1
- package/dist/assets/{pt-BR-D71qrP91.js → pt-BR-B3XbDM_D.js} +1 -1
- package/dist/assets/pwa-C483VkHZ.js +2 -0
- package/dist/assets/qoder-zGvP_RLr.svg +5 -0
- package/dist/assets/queue-abort-optimistic-kruSA-oL.js +1 -0
- package/dist/assets/quota-BbYx47Ix.js +1 -0
- package/dist/assets/react-CPBNl-S9.js +1 -0
- package/dist/assets/reference-history-Dz7Csknf.js +1 -0
- package/dist/assets/{remote-input-store-DFBMyVS-.js → remote-input-store-C6UIEZxp.js} +1 -1
- package/dist/assets/remoteProjectQueries-C8382jM8.js +1 -0
- package/dist/assets/remoteSessionReference-69X1dr9g.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-D07-P4oV.js +2 -0
- package/dist/assets/renderMobileApp-DrCAcc_4.js +17 -0
- package/dist/assets/router-DXUi1sBd.js +1 -0
- package/dist/assets/{runtime-auth-mjIpsk3N.js → runtime-auth-DA-qfGHk.js} +1 -1
- package/dist/assets/{runtime-fetch-DKZOpfzo.js → runtime-fetch-V-iMWR8t.js} +1 -1
- package/dist/assets/{runtime-file-download-Dc459c9e.js → runtime-file-download-BWeoSXRb.js} +1 -1
- package/dist/assets/runtime-file-resource-Bc_ss-sW.js +2 -0
- package/dist/assets/{runtime-switch-BMjl5Y5W.js → runtime-switch-DEPKHgdL.js} +1 -1
- package/dist/assets/{runtimeConfig-CsJ6iub-.js → runtimeConfig-BwlqVwx2.js} +1 -1
- package/dist/assets/runtimeEndpointReset-B4l_KxK4.js +4 -0
- package/dist/assets/{runtimeEndpointReset-BIrMtGn5.css → runtimeEndpointReset-DuvtZAyx.css} +1 -1
- package/dist/assets/scheduledTaskNavigation-VVTOq9n2.js +1 -0
- package/dist/assets/select-BYAkkuwW.js +1 -0
- package/dist/assets/select-assistant-mmsKjj2O.js +1 -0
- package/dist/assets/session-startup-barrier-DT-hIBRf.js +1 -0
- package/dist/assets/sessionLookup-CCHKrhTS.js +1 -0
- package/dist/assets/sessionOwnership-B13jZE-0.js +2 -0
- package/dist/assets/shortcuts-WkN3Gh8v.js +1 -0
- package/dist/assets/sortAssistantContacts-CcEdm3mS.js +1 -0
- package/dist/assets/sortable-tabs-strip-CojmWPov.js +1 -0
- package/dist/assets/spacedFileMention-Ds4GtgiF.js +1 -0
- package/dist/assets/speechSettingsQueries-Byveu-YH.js +1 -0
- package/dist/assets/src-BgdyhkrP.css +2 -0
- package/dist/assets/{store-Dj5cSf8B.js → store-DdM0dMHL.js} +4 -4
- package/dist/assets/switch-CNmsFYfY.js +1 -0
- package/dist/assets/{terminalApi-eR_918UZ.js → terminalApi-DXvEquBF.js} +1 -1
- package/dist/assets/textarea-BxFr_r0x.js +1 -0
- package/dist/assets/timeFormat-DtibJGYE.js +1 -0
- package/dist/assets/tooltip-CpTbxEOE.js +1 -0
- package/dist/assets/touch-gestures-DOoBxhz5.js +1 -0
- package/dist/assets/truncated-path-CcmWjgCQ.js +1 -0
- package/dist/assets/types-ay6wuGvG.js +2 -0
- package/dist/assets/ui-BtnozFKV.js +13 -0
- package/dist/assets/{uk-C7c1Zece.js → uk-DQnRpX74.js} +1 -1
- package/dist/assets/useAppFontEffects-BBpdXOXU.js +7 -0
- package/dist/assets/{useAssistantUIStore-CphyXHEY.js → useAssistantUIStore-CpJZ4Rqs.js} +1 -1
- package/dist/assets/useDebouncedValue-BHlMPqY8.js +1 -0
- package/dist/assets/useDesktopWindowControlsLayout-E4gCLcJk.js +1 -0
- package/dist/assets/useDictation-BlXyawcK.js +1 -0
- package/dist/assets/useEffectiveDirectory-Iz3O6JPo.js +1 -0
- package/dist/assets/{useFontPreferences-DFF-uEAD.js → useFontPreferences-BiRBKhti.js} +1 -1
- package/dist/assets/useGitStore-juwpiPLM.js +1 -0
- package/dist/assets/useInlineCommentDraftStore-B2mkmAZd.js +6510 -0
- package/dist/assets/useMcpConfigStore-DwzqwuD0.js +1 -0
- package/dist/assets/{useMobileHtmlPreviewStore-DUquFMmd.js → useMobileHtmlPreviewStore-BYunNOBo.js} +1 -1
- package/dist/assets/useMobileSwipeActions-Bso2FqOI.js +1 -0
- package/dist/assets/useMobileTranscriptSyncHint-D0M5GIEa.js +10 -0
- package/dist/assets/useModelLists-CDgh3Fk-.js +1 -0
- package/dist/assets/useOpenCodeReadiness-CLJ8g7hd.js +1 -0
- package/dist/assets/usePluginsStore-r8p_sKQN.js +1 -0
- package/dist/assets/useProjectGitActions-c-fTxVgn.js +1 -0
- package/dist/assets/useProjectGitStore-B2LnlGli.js +1 -0
- package/dist/assets/useProjectRuntimeAPIs-DnAquACf.js +1 -0
- package/dist/assets/useQuotaStore-2zTsa_Q9.js +1 -0
- package/dist/assets/useSessionBtwStore-BemezL7O.js +11 -0
- package/dist/assets/{useStreamingTextThrottle-DMhoKnTy.js → useStreamingTextThrottle-DGAjmaMZ.js} +1 -1
- package/dist/assets/{useThemeSystem-D2YBbLma.js → useThemeSystem-BIXghnHj.js} +1 -1
- package/dist/assets/useUIStore-C3ewjGgP.js +1 -0
- package/dist/assets/{vendor-base-ui-fom6orB6.js → vendor-base-ui-wXsskyKm.js} +1 -1
- package/dist/assets/{vendor-cmdk-BKc6RGpL.js → vendor-cmdk-BDWoZLve.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-accessibility-Cf9EEJvm.js → vendor-dnd-kit-accessibility-u0XSXxKq.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-core-DRyd7I0I.js → vendor-dnd-kit-core-qy5stxu5.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-sortable-C8S8cyRO.js → vendor-dnd-kit-sortable-CiTIuX4o.js} +1 -1
- package/dist/assets/{vendor-framer-motion-DiGWHm7K.js → vendor-framer-motion-D5NyyC73.js} +1 -1
- package/dist/assets/{vendor-markstream-react-Cwc-VXWM.js → vendor-markstream-react-BqCCtUAV.js} +3 -3
- package/dist/assets/vendor-motion-vLNN8EMu.js +1 -0
- package/dist/assets/{vendor-pierre-diffs-HJfPTtu2.js → vendor-pierre-diffs-B0OmIhMO.js} +22 -22
- package/dist/assets/{vendor-react-D5BntRmA.js → vendor-react-BkccXcWz.js} +1 -1
- package/dist/assets/{vendor-react-drawio-DXADKcSU.js → vendor-react-drawio-C9rszQEJ.js} +1 -1
- package/dist/assets/{vendor-reactuses-core-B8s-Rcd-.js → vendor-reactuses-core-DjKFMfz7.js} +1 -1
- package/dist/assets/{vendor-sonner-Y-KPX915.js → vendor-sonner-DX3nfJx4.js} +1 -1
- package/dist/assets/{vendor-stream-diffs-BMT21f-n.js → vendor-stream-diffs-CI1nlTpw.js} +2 -2
- package/dist/assets/{vendor-tanstack-react-query-ChSd65dm.js → vendor-tanstack-react-query-DIb_ItL-.js} +1 -1
- package/dist/assets/{vendor-tanstack-react-virtual-WY42p6U6.js → vendor-tanstack-react-virtual-qsd3nvZb.js} +1 -1
- package/dist/assets/{vendor-zustand-CNn3HHhT.js → vendor-zustand-CTekDqaS.js} +1 -1
- package/dist/assets/worktreeManager-CfSTt6sD.js +1 -0
- package/dist/assets/worktreeSourceBranchPreference-C_8tzVJi.js +1 -0
- package/dist/assets/yuriEvents-BFrD5fMU.js +5 -0
- package/dist/assets/{zh-CN-D2ENuI1-.js → zh-CN-8YyNQnhE.js} +1 -1
- package/dist/assets/{zh-TW-C40BXFhK.js → zh-TW-PgJbJ5Sy.js} +1 -1
- package/dist/assets/zhipuai-coding-plan-CcFj8zKy.js +1 -0
- package/dist/index.html +26 -25
- package/dist/mini-chat.html +26 -25
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/server/lib/gui-network/DOCUMENTATION.md +9 -1
- package/server/lib/opencode/settings-helpers.js +6 -0
- package/server/lib/opencode/settings-helpers.test.js +8 -0
- package/server/lib/realtime-proxy.js +4 -2
- package/server/lib/realtime-proxy.test.js +5 -4
- package/server/lib/relay/tunnel-host.js +15 -5
- package/server/lib/relay/tunnel-host.test.js +24 -0
- package/server/lib/remote-hosts/DOCUMENTATION.md +15 -2
- package/server/lib/remote-hosts/gateway.js +14 -4
- package/server/lib/remote-hosts/routes.js +9 -1
- package/server/lib/remote-hosts/routes.test.js +137 -7
- package/server/lib/remote-hosts/transport.js +1 -1
- package/server/lib/session-index/DOCUMENTATION.md +30 -0
- package/server/lib/session-index/event-ingest.js +6 -2
- package/server/lib/session-index/event-ingest.test.js +12 -0
- package/server/lib/session-index/routes.js +26 -0
- package/server/lib/session-index/routes.test.js +53 -0
- package/server/lib/session-index/service.js +82 -4
- package/server/lib/session-index/service.test.js +125 -1
- package/server/lib/ui-auth/ui-auth.js +1 -1
- package/server/lib/ui-auth/ui-auth.test.js +3 -0
- package/dist/assets/AgentAvatar-Dy2D4-W_.js +0 -1
- package/dist/assets/AssistantConversationSurface-BZwQoBD0.js +0 -3
- package/dist/assets/AssistantSessionCard-Cb5O68ez.js +0 -2
- package/dist/assets/AssistantUnreadBadge-Dv9HXPrS.js +0 -1
- package/dist/assets/AssistantView-3fIzHGoU.js +0 -1
- package/dist/assets/FadeInOnReveal-Cb2cgQyM.js +0 -1
- package/dist/assets/GuiPluginPage-DX446Fgg.js +0 -1
- package/dist/assets/GuiPluginSurface-C34vXd2R.js +0 -1
- package/dist/assets/GuiPluginWindow-BUM2P90L.js +0 -1
- package/dist/assets/Icon-o1bRhUil.js +0 -1
- package/dist/assets/ImageLoadingPlaceholder-BS9Swwfz.js +0 -1
- package/dist/assets/MarkdownRenderer-BOLzT07h.js +0 -2
- package/dist/assets/MarkdownRendererImpl-BWmWJyQD.js +0 -10
- package/dist/assets/MarkstreamRendererImpl-C6aiJnjl.css +0 -1
- package/dist/assets/MarkstreamRendererImpl-MwrM60DK.js +0 -3
- package/dist/assets/MobileDetailNavigation-CS3FdXMF.js +0 -1
- package/dist/assets/MobileResizableSheet-Dkx27OGR.js +0 -1
- package/dist/assets/MobileShareBridge-C7SsPeA-.js +0 -3
- package/dist/assets/MobileSurface-BkMJ0lqS.js +0 -2
- package/dist/assets/MultiRunWindow-BkVFZYQl.js +0 -1
- package/dist/assets/OnboardingScreen-EMj1BesS.js +0 -1
- package/dist/assets/OverlayScrollbar-mTdNvI2t.js +0 -1
- package/dist/assets/RemoteAssistantSessionCard-CNBayb0p.js +0 -1
- package/dist/assets/SettingsView-BkXX1yqx.js +0 -29
- package/dist/assets/SettingsWindow-DEVIOawn.js +0 -1
- package/dist/assets/SetupTourDialog-DpDXKEev.js +0 -1
- package/dist/assets/TerminalView-BwZd8np-.js +0 -8
- package/dist/assets/ToolOutputDialog-C7FT1uPc.js +0 -16
- package/dist/assets/VoiceSettings-BrAyJv-I.js +0 -2
- package/dist/assets/checkbox-BcJaF7Fw.js +0 -1
- package/dist/assets/collapsible-ChjJre3f.js +0 -1
- package/dist/assets/context-menu-BRBPOV2F.js +0 -1
- package/dist/assets/diagram-BhOF-6FQ.js +0 -1
- package/dist/assets/dialog-BSyXr9ua.js +0 -1
- package/dist/assets/dialog-DYOEW9DC.css +0 -1
- package/dist/assets/fileMentionAutocompleteState-BZJqfgae.js +0 -2
- package/dist/assets/gitApiHttp-BEMPJCIG.js +0 -3
- package/dist/assets/historyImportQueries-eR7Bj6VN.js +0 -1
- package/dist/assets/input-Daki_y8O.js +0 -1
- package/dist/assets/insertionBoundaries-CnhjXWsd.js +0 -1
- package/dist/assets/main-CALE45ey.js +0 -2
- package/dist/assets/main-DEQdAD0s.js +0 -169
- package/dist/assets/mcpQueries-DB6aJ5RI.js +0 -1
- package/dist/assets/miniChat-VUMSA5V6.js +0 -2
- package/dist/assets/mobile-CiuyBKXM.js +0 -2
- package/dist/assets/mobileBackNavigation-CeY46TEx.js +0 -1
- package/dist/assets/mobileConnections-BjLYzK32.js +0 -2
- package/dist/assets/multirun-DV_l3huB.js +0 -3
- package/dist/assets/navigation-BjCFktgT.js +0 -2
- package/dist/assets/openRemoteProjectSession-C3jFz6kb.js +0 -1
- package/dist/assets/projectMeta-CwdDc3V4.js +0 -1
- package/dist/assets/pwa-QoTHytgl.js +0 -2
- package/dist/assets/queue-abort-optimistic-Bvno7WIB.js +0 -1
- package/dist/assets/react-ChbBD2fG.js +0 -1
- package/dist/assets/readiness-C9buUgS7.js +0 -2
- package/dist/assets/reference-history-BBLJypsd.js +0 -1
- package/dist/assets/remoteProjectQueries-8giIAvzL.js +0 -1
- package/dist/assets/remoteSessionReference-BHBerOUy.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-Yryt2r9g.js +0 -2
- package/dist/assets/renderMobileApp-f7DiCkl1.js +0 -29
- package/dist/assets/runtime-file-resource-DnhWnndu.js +0 -6
- package/dist/assets/runtimeEndpointReset-CWAGENV5.js +0 -151
- package/dist/assets/scheduledTaskNavigation-Bi7sRiFW.js +0 -1
- package/dist/assets/select-D_jd65HO.js +0 -1
- package/dist/assets/sessionLookup-BUyzfxAJ.js +0 -1
- package/dist/assets/sortable-tabs-strip-DMwkOrM-.js +0 -1
- package/dist/assets/src-DRyZ4dLj.css +0 -2
- package/dist/assets/textarea-DwisQCE_.js +0 -1
- package/dist/assets/tooltip-DloXgI9f.js +0 -1
- package/dist/assets/types-sn47BK8u.js +0 -2
- package/dist/assets/useAppFontEffects-zienz2u_.js +0 -6620
- package/dist/assets/useDesktopWindowControlsLayout-VfqGsgdB.js +0 -1
- package/dist/assets/useDictation-Do12BpsS.js +0 -1
- package/dist/assets/useEffectiveDirectory-DtDqspBR.js +0 -1
- package/dist/assets/useMobileNavigationStore-BkVbj6Lg.js +0 -13
- package/dist/assets/usePluginsStore-BRtWcKUj.js +0 -1
- package/dist/assets/useProjectRuntimeAPIs-BbjZTtP4.js +0 -1
- package/dist/assets/useUIStore-CYex4rbF.js +0 -1
- package/dist/assets/vendor-motion-DtmZZeEm.js +0 -1
- /package/dist/assets/{useAppFontEffects-K31q-1OV.css → ChatContainer-K31q-1OV.css} +0 -0
- /package/dist/assets/{VoiceSettings-C0HSdVvS.css → pluginPresentation-C0HSdVvS.css} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import http from 'node:http';
|
|
4
|
+
import net from 'node:net';
|
|
4
5
|
import fs from 'node:fs/promises';
|
|
5
6
|
import path from 'node:path';
|
|
6
7
|
import os from 'node:os';
|
|
@@ -19,6 +20,7 @@ import { createRemoteClientAuthRuntime } from '../client-auth/remote-clients.js'
|
|
|
19
20
|
import { createGlobalUiEventBroadcaster } from '../event-stream/runtime.js';
|
|
20
21
|
import { createRemoteHostStore } from './store.js';
|
|
21
22
|
import { createRemoteHostGateway } from './gateway.js';
|
|
23
|
+
import { createSessionIndexService } from '../session-index/service.js';
|
|
22
24
|
import { registerRemoteHostRoutes } from './routes.js';
|
|
23
25
|
import { registerTranscriptCacheRoutes } from '../transcript-cache/routes.js';
|
|
24
26
|
import { registerFsRoutes } from '../fs/routes.js';
|
|
@@ -26,6 +28,9 @@ import { createTerminalRuntime } from '../terminal/runtime.js';
|
|
|
26
28
|
import { readTerminalWsControlFrame, createTerminalWsControlFrame } from '../terminal/terminal-ws-protocol.js';
|
|
27
29
|
import { createTranscriptCacheService } from '../transcript-cache/service.js';
|
|
28
30
|
import { runRemoteProjectOperation } from '../gui-customization/projects-remote.js';
|
|
31
|
+
import { attachGuiNetwork } from '../gui-network/runtime.js';
|
|
32
|
+
import { createRequestSecurityRuntime } from '../security/request-security.js';
|
|
33
|
+
import { createBrowserSocksGateway } from '../../../../electron/browser-socks-gateway.mjs';
|
|
29
34
|
|
|
30
35
|
const require = createRequire(import.meta.url);
|
|
31
36
|
const disposers = [];
|
|
@@ -33,7 +38,7 @@ afterEach(async () => { for (const dispose of disposers.splice(0).reverse()) awa
|
|
|
33
38
|
const wait = async (test) => { await vi.waitFor(test, { timeout: 5000, interval: 10 }); };
|
|
34
39
|
|
|
35
40
|
async function host({ adapter = null, supportedRemote = true, failHubWrite = false, requestTimeoutMs = 500,
|
|
36
|
-
operationTimeoutMs = requestTimeoutMs, indexStats, requireClientAuth = false, productionTerminal = false, terminalFrames = [] } = {}) {
|
|
41
|
+
operationTimeoutMs = requestTimeoutMs, indexStats, requireClientAuth = false, productionTerminal = false, terminalFrames = [], productionGuiNetwork = false } = {}) {
|
|
37
42
|
const directory = await fs.mkdtemp(path.join(os.tmpdir(), 'yuri-remote-host-test-'));
|
|
38
43
|
const clients = createRemoteClientAuthRuntime({ fsPromises: fs, path, crypto, storePath: path.join(directory, 'clients.json') });
|
|
39
44
|
const issued = await clients.createClient({ clientKind: 'desktop-local', authMethod: 'pairing', pairingId: 'test-pairing' });
|
|
@@ -73,8 +78,9 @@ async function host({ adapter = null, supportedRemote = true, failHubWrite = fal
|
|
|
73
78
|
app.get('/auth/session', auth.handleSessionStatus);
|
|
74
79
|
app.post('/auth/url-token', auth.handleUrlAuthToken);
|
|
75
80
|
app.use('/api', auth.requireAuth);
|
|
81
|
+
const security = createRequestSecurityRuntime({ readSettingsFromDiskMigrated: async () => ({}) });
|
|
76
82
|
runtime = registerRemoteHostRoutes(app, { gateway, getAuth: () => auth, server,
|
|
77
|
-
isRequestOriginAllowed: () => true, remoteClientAuthRuntime: clients,
|
|
83
|
+
isRequestOriginAllowed: productionGuiNetwork ? security.isRequestOriginAllowed : () => true, remoteClientAuthRuntime: clients,
|
|
78
84
|
readSettings: async () => settings,
|
|
79
85
|
persistSettings: async (update) => { settings = { ...settings, ...update(settings) }; return settings; },
|
|
80
86
|
validateDirectoryPath: async (value) => typeof value === 'string' && value.startsWith('/')
|
|
@@ -90,6 +96,7 @@ async function host({ adapter = null, supportedRemote = true, failHubWrite = fal
|
|
|
90
96
|
isRequestOriginAllowed: async () => true, rejectWebSocketUpgrade: (socket) => socket.destroy(),
|
|
91
97
|
TERMINAL_INPUT_WS_HEARTBEAT_INTERVAL_MS: 30000, TERMINAL_INPUT_WS_REBIND_WINDOW_MS: 1000,
|
|
92
98
|
TERMINAL_INPUT_WS_MAX_REBINDS_PER_WINDOW: 3 }) : null;
|
|
99
|
+
const guiNetwork = productionGuiNetwork ? attachGuiNetwork({ server, uiAuthController: auth, isRequestOriginAllowed: security.isRequestOriginAllowed }) : null;
|
|
93
100
|
const terminal = new WebSocketServer({ noServer: true });
|
|
94
101
|
server.on('upgrade', async (req, socket, head) => {
|
|
95
102
|
if (productionTerminal) return;
|
|
@@ -148,7 +155,7 @@ async function host({ adapter = null, supportedRemote = true, failHubWrite = fal
|
|
|
148
155
|
const url = `http://127.0.0.1:${server.address().port}`;
|
|
149
156
|
const headers = { Authorization: `Bearer ${issued.token}`, 'Content-Type': 'application/json' };
|
|
150
157
|
disposers.push(async () => {
|
|
151
|
-
runtime.stop(); terminal.close(); transcript.close(); auth.dispose();
|
|
158
|
+
guiNetwork?.stop(); runtime.stop(); terminal.close(); transcript.close(); auth.dispose();
|
|
152
159
|
await terminalRuntime?.shutdown();
|
|
153
160
|
for (const socket of sockets) socket.destroy();
|
|
154
161
|
await new Promise((resolve) => server.close(resolve));
|
|
@@ -174,7 +181,7 @@ async function host({ adapter = null, supportedRemote = true, failHubWrite = fal
|
|
|
174
181
|
|
|
175
182
|
async function aggregate(options = {}) {
|
|
176
183
|
const remote = await host({ requireClientAuth: options.requireClientAuth, productionTerminal: options.productionTerminal,
|
|
177
|
-
terminalFrames: options.terminalFrames });
|
|
184
|
+
terminalFrames: options.terminalFrames, productionGuiNetwork: options.productionGuiNetwork });
|
|
178
185
|
let hosts = [{ id: 'remote-1', label: 'Remote', source: 'direct', apiUrl: remote.url, clientToken: remote.issued.token }];
|
|
179
186
|
const listeners = new Set();
|
|
180
187
|
const adapter = { listHosts: async () => hosts, subscribe(fn) { listeners.add(fn); return () => listeners.delete(fn); } };
|
|
@@ -182,7 +189,129 @@ async function aggregate(options = {}) {
|
|
|
182
189
|
return { hub, remote, setHosts(next) { hosts = next; for (const fn of listeners) fn(); } };
|
|
183
190
|
}
|
|
184
191
|
|
|
192
|
+
async function assertBrowserTcp(hub, route, remote) {
|
|
193
|
+
const token = (await (await hub.call('/auth/url-token', 'POST')).json()).token;
|
|
194
|
+
const address = `${hub.url.replace('http:', 'ws:')}${route}?yuri_url_token=${token}`;
|
|
195
|
+
const rejectUpgrade = (url, origin) => new Promise((resolve, reject) => {
|
|
196
|
+
const ws = new WebSocket(url, { headers: { Origin: origin } });
|
|
197
|
+
ws.on('error', () => {});
|
|
198
|
+
ws.on('unexpected-response', (_req, res) => { res.resume(); ws.terminate(); resolve(res.statusCode); });
|
|
199
|
+
ws.on('open', () => { ws.terminate(); reject(new Error('Unexpected admission')); });
|
|
200
|
+
});
|
|
201
|
+
expect(await rejectUpgrade(address, 'https://untrusted.example')).toBe(403);
|
|
202
|
+
expect(await rejectUpgrade(address.replace(token, 'invalid'), hub.url)).toBe(403);
|
|
203
|
+
const ws = new WebSocket(address, { headers: { Origin: hub.url } });
|
|
204
|
+
ws.on('error', () => {});
|
|
205
|
+
let ready;
|
|
206
|
+
const socks = createBrowserSocksGateway({ send: value => {
|
|
207
|
+
if (ws.readyState !== WebSocket.OPEN) return false;
|
|
208
|
+
ws.send(Buffer.isBuffer(value) ? value : JSON.stringify(value)); return true;
|
|
209
|
+
} });
|
|
210
|
+
ws.on('message', (bytes, binary) => {
|
|
211
|
+
if (!binary && JSON.parse(bytes).type === 'ready') { ready = JSON.parse(bytes); return; }
|
|
212
|
+
socks.receive(binary ? bytes : bytes.toString());
|
|
213
|
+
});
|
|
214
|
+
let browser;
|
|
215
|
+
const connections = new Set();
|
|
216
|
+
const destination = net.createServer(socket => {
|
|
217
|
+
connections.add(socket); socket.once('close', () => connections.delete(socket));
|
|
218
|
+
socket.on('data', bytes => socket.write(bytes));
|
|
219
|
+
});
|
|
220
|
+
try {
|
|
221
|
+
destination.listen(0, '127.0.0.1'); await once(destination, 'listening');
|
|
222
|
+
if (ws.readyState === WebSocket.CONNECTING) await once(ws, 'open');
|
|
223
|
+
await wait(() => expect(ready?.httpOrigin).toBe(`http://localhost:${remote.server.address().port}`));
|
|
224
|
+
const { port } = await socks.start();
|
|
225
|
+
browser = net.connect(port, '127.0.0.1');
|
|
226
|
+
browser.on('error', () => {});
|
|
227
|
+
await once(browser, 'connect');
|
|
228
|
+
const read = length => new Promise(resolve => {
|
|
229
|
+
const receive = () => { const bytes = browser.read(length); if (bytes) { browser.off('readable', receive); resolve(bytes); } };
|
|
230
|
+
browser.on('readable', receive); receive();
|
|
231
|
+
});
|
|
232
|
+
browser.write(Buffer.from([5, 1, 0]));
|
|
233
|
+
expect(await read(2)).toEqual(Buffer.from([5, 0]));
|
|
234
|
+
const request = Buffer.from([5, 1, 0, 1, 127, 0, 0, 1, 0, 0]);
|
|
235
|
+
request.writeUInt16BE(destination.address().port, 8); browser.write(request);
|
|
236
|
+
expect((await read(10))[1]).toBe(0);
|
|
237
|
+
const bytes = crypto.randomBytes(512 * 1024);
|
|
238
|
+
browser.write(bytes);
|
|
239
|
+
expect(await read(bytes.length)).toEqual(bytes);
|
|
240
|
+
ws.close();
|
|
241
|
+
await wait(() => expect(connections.size).toBe(0));
|
|
242
|
+
} finally {
|
|
243
|
+
browser?.destroy(); await socks.close(); ws.terminate();
|
|
244
|
+
for (const socket of connections) socket.destroy();
|
|
245
|
+
await new Promise(resolve => destination.close(resolve));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
185
249
|
describe('Remote Host production HTTP contract', () => {
|
|
250
|
+
it('pins and unpins remote sessions in the Hub DB without remote mutations or refresh resurrection', async () => {
|
|
251
|
+
const { hub, remote } = await aggregate();
|
|
252
|
+
const remotePin = vi.fn((_req, res) => res.status(204).end());
|
|
253
|
+
remote.app.post('/api/yuri/session-index/session/:id/pin', remotePin);
|
|
254
|
+
remote.app.delete('/api/yuri/session-index/session/:id/pin', remotePin);
|
|
255
|
+
const session = { id: 'pin-session', directory: '/same/path', title: 'Pin target', time: { created: 1, updated: 2 } };
|
|
256
|
+
remote.setSummaries({ directories: [{ directory: '/same/path', hasMore: false, sessions: [session] }], pinnedSessionIds: [] });
|
|
257
|
+
await hub.call('/api/hosts/remote-1/projects', 'POST', { path: '/same/path' });
|
|
258
|
+
const abort = new AbortController();
|
|
259
|
+
const stream = await fetch(`${hub.url}/api/global/event`, { headers: hub.headers, signal: abort.signal });
|
|
260
|
+
const read = async () => (await hub.call('/api/hosts/remote-1/summaries')).json();
|
|
261
|
+
const persistedPins = () => {
|
|
262
|
+
const index = createSessionIndexService({ dbPath: path.join(hub.directory, 'session-index.sqlite'),
|
|
263
|
+
getRuntimeConfig: () => ({ apiBaseUrl: `hub:${hub.store.hubId}:remote-host:remote-1` }) });
|
|
264
|
+
try { return index.snapshot().pinnedSessionIds; } finally { index.close(); }
|
|
265
|
+
};
|
|
266
|
+
const refresh = async (snapshot) => {
|
|
267
|
+
const before = (await read()).lastSyncedAt;
|
|
268
|
+
remote.setSummaries(snapshot);
|
|
269
|
+
remote.emit({ type: 'yuri:session-index-changed', properties: { cause: 'change' } });
|
|
270
|
+
await wait(async () => expect((await read()).lastSyncedAt).toBeGreaterThan(before));
|
|
271
|
+
};
|
|
272
|
+
const pinPath = '/api/hosts/remote-1/api/yuri/session-index/session/pin-session/pin';
|
|
273
|
+
try {
|
|
274
|
+
await wait(async () => expect((await read()).directories[0]?.sessions[0]?.id).toBe('pin-session'));
|
|
275
|
+
expect((await hub.call(pinPath, 'POST')).status).toBe(204);
|
|
276
|
+
expect(remotePin.mock.calls.length).toBe(0);
|
|
277
|
+
expect((await read()).pinnedSessionIds).toEqual(['pin-session']);
|
|
278
|
+
expect(persistedPins()).toEqual(['pin-session']);
|
|
279
|
+
hub.store.saveProject('remote-2', { id: 'other-project', path: '/same/path' });
|
|
280
|
+
const otherPinPath = pinPath.replace('remote-1', 'remote-2');
|
|
281
|
+
expect((await hub.call(otherPinPath, 'POST')).status).toBe(204);
|
|
282
|
+
await refresh({ directories: [{ directory: '/same/path', sessions: [session] }], pinnedSessionIds: [] });
|
|
283
|
+
expect((await read()).pinnedSessionIds).toEqual(['pin-session']);
|
|
284
|
+
const Database = require('better-sqlite3');
|
|
285
|
+
const failureDb = new Database(path.join(hub.directory, 'session-index.sqlite'));
|
|
286
|
+
try {
|
|
287
|
+
failureDb.exec("CREATE TRIGGER reject_pin_delete BEFORE UPDATE OF pinned_at ON session_summary BEGIN SELECT RAISE(ABORT, 'injected storage failure'); END");
|
|
288
|
+
expect((await hub.call(pinPath, 'DELETE')).status).toBe(503);
|
|
289
|
+
expect((await read()).pinnedSessionIds).toEqual(['pin-session']);
|
|
290
|
+
expect(persistedPins()).toEqual(['pin-session']);
|
|
291
|
+
} finally {
|
|
292
|
+
failureDb.exec('DROP TRIGGER IF EXISTS reject_pin_delete');
|
|
293
|
+
failureDb.close();
|
|
294
|
+
}
|
|
295
|
+
expect((await hub.call(pinPath, 'DELETE')).status).toBe(204);
|
|
296
|
+
expect((await hub.call(pinPath, 'DELETE')).status).toBe(204);
|
|
297
|
+
expect((await read()).pinnedSessionIds).toEqual([]);
|
|
298
|
+
expect(persistedPins()).toEqual([]);
|
|
299
|
+
expect((await (await hub.call('/api/hosts/remote-2/summaries')).json()).pinnedSessionIds).toEqual(['pin-session']);
|
|
300
|
+
await refresh({ directories: [{ directory: '/same/path', sessions: [{ ...session, time: { ...session.time, pinned: 123 } }] }], pinnedSessionIds: ['pin-session'] });
|
|
301
|
+
const snapshot = await read();
|
|
302
|
+
expect(snapshot.pinnedSessionIds).toEqual([]);
|
|
303
|
+
expect(snapshot.directories[0].sessions[0].time.pinned).toBeUndefined();
|
|
304
|
+
expect(persistedPins()).toEqual([]);
|
|
305
|
+
expect(remotePin.mock.calls.length).toBe(0);
|
|
306
|
+
const mismatched = await fetch(`${hub.url}${pinPath}`, { method: 'POST', headers: { ...hub.headers, 'x-yuri-target-instance': 'other-instance' } });
|
|
307
|
+
expect(mismatched.status).toBe(409);
|
|
308
|
+
expect(persistedPins()).toEqual([]);
|
|
309
|
+
} finally { abort.abort(); await stream.body.cancel().catch(() => {}); }
|
|
310
|
+
});
|
|
311
|
+
it('routes Browser SOCKS to the Remote Project Host with URL auth and real Origin checks', async () => {
|
|
312
|
+
const { hub, remote } = await aggregate({ productionGuiNetwork: true, requireClientAuth: true, requestTimeoutMs: 5000 });
|
|
313
|
+
await assertBrowserTcp(hub, '/api/hosts/remote-1/api/gui-network/ws', remote);
|
|
314
|
+
});
|
|
186
315
|
it('forwards metadata writes with their directory and patch, but rejects other methods and stale targets', async () => {
|
|
187
316
|
const { hub, remote } = await aggregate();
|
|
188
317
|
const writes = [];
|
|
@@ -1407,7 +1536,7 @@ describe('Remote Host production HTTP contract', () => {
|
|
|
1407
1536
|
|
|
1408
1537
|
it.each([0, 1, 2])('uses the real E2EE Relay client for Relay-only hosts, including terminal forwarding (%i)', async (iteration) => {
|
|
1409
1538
|
const productionTerminal = iteration === 2;
|
|
1410
|
-
const remote = await host({ requireClientAuth: true, productionTerminal });
|
|
1539
|
+
const remote = await host({ requireClientAuth: true, productionTerminal, productionGuiNetwork: true });
|
|
1411
1540
|
const relay = createPrivateRelayServer({ host: '127.0.0.1', port: 0 });
|
|
1412
1541
|
await relay.start();
|
|
1413
1542
|
const encryption = await generateEcdhKeyPair();
|
|
@@ -1428,7 +1557,8 @@ describe('Remote Host production HTTP contract', () => {
|
|
|
1428
1557
|
const paired = await remote.clients.createClient({ clientKind: 'desktop', authMethod: 'pairing', pairingId: 'relay-pair', usesRelay: true });
|
|
1429
1558
|
const descriptor = { id: 'relay-only', name: 'Relay Host', source: 'relay', clientToken: paired.token,
|
|
1430
1559
|
relay: { relayUrl, serverId, hostEncPubJwk: identity.hostEncPubJwk } };
|
|
1431
|
-
const hub = await host({ adapter: { listHosts: async () => [descriptor] }, requestTimeoutMs: 5000 });
|
|
1560
|
+
const hub = await host({ adapter: { listHosts: async () => [descriptor] }, requestTimeoutMs: 5000, productionGuiNetwork: true });
|
|
1561
|
+
if (iteration === 1) await assertBrowserTcp(hub, '/api/hosts/relay-only/api/gui-network/ws', remote);
|
|
1432
1562
|
if (productionTerminal) {
|
|
1433
1563
|
const authorize = hub.auth.resolveAuthContext;
|
|
1434
1564
|
let upgrades = 0;
|
|
@@ -1458,7 +1588,7 @@ describe('Remote Host production HTTP contract', () => {
|
|
|
1458
1588
|
.toMatchObject({ created: true, session: { sessionID: 'ses_relay_new', directory: registered.project.path, target } });
|
|
1459
1589
|
expect(createSession).toHaveBeenCalledOnce();
|
|
1460
1590
|
await wait(() => expect(remote.statusStreams).toBe(1));
|
|
1461
|
-
const socket = new WebSocket(`${hub.url.replace('http:', 'ws:')}/api/hosts/relay-only/api/terminal/ws`, { headers: hub.headers });
|
|
1591
|
+
const socket = new WebSocket(`${hub.url.replace('http:', 'ws:')}/api/hosts/relay-only/api/terminal/ws`, { headers: { ...hub.headers, Origin: hub.url } });
|
|
1462
1592
|
disposers.push(() => socket.terminate());
|
|
1463
1593
|
const frames = [];
|
|
1464
1594
|
if (productionTerminal) socket.on('message', (data) => frames.push(readTerminalWsControlFrame(data)));
|
|
@@ -69,7 +69,7 @@ export async function createRemoteTransport(host, { fetchImpl = fetch, signal }
|
|
|
69
69
|
if (closed) throw failure('stale_host', 409);
|
|
70
70
|
const url = new URL(route, base);
|
|
71
71
|
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
72
|
-
const socket = new WebSocket(url, protocols, { headers });
|
|
72
|
+
const socket = new WebSocket(url, protocols, { headers: { ...headers, Origin: base.origin } });
|
|
73
73
|
socket.onmessage = onMessage || null;
|
|
74
74
|
sockets.add(socket);
|
|
75
75
|
socket.once('close', () => sockets.delete(socket));
|
|
@@ -69,6 +69,9 @@ development index without changing settings or authentication storage.
|
|
|
69
69
|
Rows are partitioned by a runtime key derived from the desktop
|
|
70
70
|
`apiBaseUrl` (Electron falls back to the local sidecar URL so the key stays
|
|
71
71
|
stable between server listen and window activation).
|
|
72
|
+
Pin/unpin updates the independent pin record and summary `pinned_at` in one
|
|
73
|
+
transaction. A failed second write rolls both back; reopening cannot resurrect
|
|
74
|
+
a partially cleared pin from legacy summary backfill.
|
|
72
75
|
`service.js` exclusively owns the WAL database and stores at most the
|
|
73
76
|
newest 20 root-session summaries per runtime and directory. It also retains the
|
|
74
77
|
minimal session `model: { providerID, id, variant? }` reference (each string is
|
|
@@ -120,6 +123,33 @@ Pin and unpin use `POST` / `DELETE`
|
|
|
120
123
|
Snapshots include `pinnedSessionIds` plus `time.pinned` on any matching
|
|
121
124
|
summary row.
|
|
122
125
|
|
|
126
|
+
## Settled state
|
|
127
|
+
|
|
128
|
+
"Settled" (已搁置) is a task-view shelf, independent of archive: it never writes
|
|
129
|
+
`metadata.yuri.archive`, never removes the summary and never clears the pin.
|
|
130
|
+
Two tables sit beside `session_pin` and, like it, are not dropped by a schema
|
|
131
|
+
rebuild: `session_settle` (per runtime and session, override `settled` or `active`
|
|
132
|
+
plus the write time) and `session_settle_baseline` (one timestamp per runtime,
|
|
133
|
+
written once when the runtime is first observed, at service open or first
|
|
134
|
+
snapshot). No rows are backfilled.
|
|
135
|
+
|
|
136
|
+
Snapshot rows expose `time.settled` (a timestamp) only when settled. Projection
|
|
137
|
+
order: an override wins (`settled` → settled, `active` → not settled); with no
|
|
138
|
+
override, a session whose `activity_updated_at` predates the baseline is settled,
|
|
139
|
+
and a later one is settled once idle for the cooldown (default 7 days, clamped to
|
|
140
|
+
1..90 through `getSettleAfterDays`). The clock is read at snapshot time, so there is
|
|
141
|
+
no server timer. The projection ignores live state on purpose: the client overlays
|
|
142
|
+
running sessions and pending questions/permissions, and a stale persisted `busy`
|
|
143
|
+
must not keep an old session active.
|
|
144
|
+
|
|
145
|
+
`POST` / `DELETE` `/api/yuri/session-index/session/:id/settle` write the `settled`
|
|
146
|
+
and `active` overrides, then `publishChange()`. Manual un-settle therefore holds the
|
|
147
|
+
session active until its next real activity. A user `message.updated` or user
|
|
148
|
+
`session.inbox.enqueued` event clears the override in `event-ingest.js`; assistant
|
|
149
|
+
completion and idle events do not. `remove` (delete or archive) drops the override.
|
|
150
|
+
For Remote Projects the state lives only in the Hub's index, following the pin
|
|
151
|
+
precedent.
|
|
152
|
+
|
|
123
153
|
List snapshots (`GET /api/yuri/session-index` and the `POST /sync`
|
|
124
154
|
response body) share one Host projection: committed Host metadata is merged,
|
|
125
155
|
Host-archived rows and pins are dropped, and metadata no list consumer reads is
|
|
@@ -125,13 +125,17 @@ export const applySessionIndexEvent = (service, event, observedAt = Date.now(),
|
|
|
125
125
|
: (payload.data?.info && typeof payload.data.info === 'object' ? payload.data.info : {});
|
|
126
126
|
if (info.role !== 'user' || typeof info.sessionID !== 'string') return false;
|
|
127
127
|
const activityAt = typeof info.time?.created === 'number' ? info.time.created : observedAt;
|
|
128
|
-
|
|
128
|
+
const activityChanged = service.touchActivity(info.sessionID, activityAt);
|
|
129
|
+
const settleCleared = service.clearSettleOverride?.(info.sessionID) ?? false;
|
|
130
|
+
return activityChanged || settleCleared;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
if (baseType === 'session.inbox.enqueued') {
|
|
132
134
|
const data = payload.data ?? properties;
|
|
133
135
|
if (data.item?.type !== 'user' || typeof data.sessionID !== 'string') return false;
|
|
134
|
-
|
|
136
|
+
const activityChanged = service.touchActivity(data.sessionID, data.item.time?.created ?? payload.created ?? observedAt);
|
|
137
|
+
const settleCleared = service.clearSettleOverride?.(data.sessionID) ?? false;
|
|
138
|
+
return activityChanged || settleCleared;
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
if (baseType.startsWith('session.execution.') || baseType === 'session.retry.scheduled') {
|
|
@@ -49,6 +49,18 @@ describe('session index event ingest', () => {
|
|
|
49
49
|
expect(service.updateStatus).toHaveBeenLastCalledWith('ses_native', 'idle', 20);
|
|
50
50
|
expect(service.touchActivity).toHaveBeenLastCalledWith('ses_native', 20);
|
|
51
51
|
});
|
|
52
|
+
it('clears a settle override only on user input, not on assistant completion', () => {
|
|
53
|
+
const service = { touchActivity: vi.fn(() => false), updateStatus: vi.fn(() => false), clearSettleOverride: vi.fn(() => true) };
|
|
54
|
+
const user = { payload: { type: 'message.updated', properties: { info: { role: 'user', sessionID: 'ses_a', time: { created: 5 } } } } };
|
|
55
|
+
const assistant = { payload: { type: 'message.updated', properties: { info: { role: 'assistant', sessionID: 'ses_a' } } } };
|
|
56
|
+
expect(applySessionIndexEvent(service, assistant, 30)).toBe(false);
|
|
57
|
+
expect(service.clearSettleOverride).not.toHaveBeenCalled();
|
|
58
|
+
expect(applySessionIndexEvent(service, user, 30)).toBe(true);
|
|
59
|
+
expect(service.clearSettleOverride).toHaveBeenCalledWith('ses_a');
|
|
60
|
+
service.clearSettleOverride.mockClear();
|
|
61
|
+
expect(applySessionIndexEvent(service, { payload: { type: 'session.idle', properties: { sessionID: 'ses_a' } } }, 30)).toBe(false);
|
|
62
|
+
expect(service.clearSettleOverride).not.toHaveBeenCalled();
|
|
63
|
+
});
|
|
52
64
|
it('takes moved ownership from native data rather than the old event envelope directory', () => {
|
|
53
65
|
const service = { move: vi.fn(() => true) };
|
|
54
66
|
expect(applySessionIndexEvent(service, { directory: '/old', payload: {
|
|
@@ -156,4 +156,30 @@ export const registerSessionIndexRoutes = (app, {
|
|
|
156
156
|
sessionIndexSyncRuntime?.publishChange?.();
|
|
157
157
|
res.status(204).end();
|
|
158
158
|
});
|
|
159
|
+
|
|
160
|
+
const registerSettleRoute = (method, action, unavailableMessage) => {
|
|
161
|
+
app[method]('/api/yuri/session-index/session/:id/settle', (req, res) => {
|
|
162
|
+
if (!sessionIndexService) return unsupported(res);
|
|
163
|
+
if (typeof sessionIndexService[action] !== 'function') {
|
|
164
|
+
return res.status(501).json({ error: unavailableMessage });
|
|
165
|
+
}
|
|
166
|
+
const sessionId = req.params.id;
|
|
167
|
+
if (typeof sessionId !== 'string' || !sessionId.trim()) {
|
|
168
|
+
return res.status(400).json({ error: 'sessionId is required' });
|
|
169
|
+
}
|
|
170
|
+
let changed;
|
|
171
|
+
try {
|
|
172
|
+
changed = sessionIndexService[action](sessionId.trim());
|
|
173
|
+
} catch (error) {
|
|
174
|
+
return res.status(500).json({ error: error instanceof Error ? error.message : unavailableMessage });
|
|
175
|
+
}
|
|
176
|
+
if (!changed) {
|
|
177
|
+
return res.status(404).json({ error: 'session_not_found', sessionId: sessionId.trim() });
|
|
178
|
+
}
|
|
179
|
+
sessionIndexSyncRuntime?.publishChange?.();
|
|
180
|
+
res.status(204).end();
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
registerSettleRoute('post', 'setSettled', 'Session settle is unavailable');
|
|
184
|
+
registerSettleRoute('delete', 'clearSettled', 'Session unsettle is unavailable');
|
|
159
185
|
};
|
|
@@ -186,6 +186,59 @@ describe('session index routes', () => {
|
|
|
186
186
|
expect(res.statusCode).toBe(204);
|
|
187
187
|
});
|
|
188
188
|
|
|
189
|
+
it('settles and un-settles a session and publishes a session-index change', () => {
|
|
190
|
+
const { app, route } = registry();
|
|
191
|
+
const setSettled = vi.fn(() => true);
|
|
192
|
+
const clearSettled = vi.fn(() => true);
|
|
193
|
+
const publishChange = vi.fn();
|
|
194
|
+
registerSessionIndexRoutes(app, {
|
|
195
|
+
sessionIndexService: { snapshot: () => ({ directories: [] }), setSettled, clearSettled },
|
|
196
|
+
sessionIndexSyncRuntime: { publishChange },
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const settleRes = response();
|
|
200
|
+
route('POST', '/api/yuri/session-index/session/:id/settle')({ params: { id: 'ses_abc' } }, settleRes);
|
|
201
|
+
const unsettleRes = response();
|
|
202
|
+
route('DELETE', '/api/yuri/session-index/session/:id/settle')({ params: { id: 'ses_abc' } }, unsettleRes);
|
|
203
|
+
|
|
204
|
+
expect(setSettled).toHaveBeenCalledWith('ses_abc');
|
|
205
|
+
expect(clearSettled).toHaveBeenCalledWith('ses_abc');
|
|
206
|
+
expect(publishChange).toHaveBeenCalledTimes(2);
|
|
207
|
+
expect(settleRes.statusCode).toBe(204);
|
|
208
|
+
expect(unsettleRes.statusCode).toBe(204);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('reports settle write failures without publishing a change', () => {
|
|
212
|
+
const { app, route } = registry();
|
|
213
|
+
const publishChange = vi.fn();
|
|
214
|
+
registerSessionIndexRoutes(app, {
|
|
215
|
+
sessionIndexService: {
|
|
216
|
+
snapshot: () => ({ directories: [] }),
|
|
217
|
+
setSettled: () => { throw new Error('disk full'); },
|
|
218
|
+
clearSettled: () => false,
|
|
219
|
+
},
|
|
220
|
+
sessionIndexSyncRuntime: { publishChange },
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
const failed = response();
|
|
224
|
+
route('POST', '/api/yuri/session-index/session/:id/settle')({ params: { id: 'ses_abc' } }, failed);
|
|
225
|
+
const missing = response();
|
|
226
|
+
route('DELETE', '/api/yuri/session-index/session/:id/settle')({ params: { id: 'ses_abc' } }, missing);
|
|
227
|
+
|
|
228
|
+
expect(failed.statusCode).toBe(500);
|
|
229
|
+
expect(failed.body).toMatchObject({ error: 'disk full' });
|
|
230
|
+
expect(missing.statusCode).toBe(404);
|
|
231
|
+
expect(publishChange).not.toHaveBeenCalled();
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('returns unsupported settle routes when the index is unavailable', () => {
|
|
235
|
+
const { app, route } = registry();
|
|
236
|
+
registerSessionIndexRoutes(app, { sessionIndexService: null });
|
|
237
|
+
const res = response();
|
|
238
|
+
route('POST', '/api/yuri/session-index/session/:id/settle')({ params: { id: 'ses_abc' } }, res);
|
|
239
|
+
expect(res.statusCode).toBe(501);
|
|
240
|
+
});
|
|
241
|
+
|
|
189
242
|
it('returns 404 for pin and unpin when the session is missing', () => {
|
|
190
243
|
const { app, route } = registry();
|
|
191
244
|
const publishChange = vi.fn();
|
|
@@ -5,6 +5,15 @@ const require = createRequire(import.meta.url);
|
|
|
5
5
|
|
|
6
6
|
const SCHEMA_VERSION = 6;
|
|
7
7
|
const MAX_ROOT_SESSIONS = 20;
|
|
8
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
9
|
+
export const DEFAULT_SETTLE_AFTER_DAYS = 7;
|
|
10
|
+
export const MIN_SETTLE_AFTER_DAYS = 1;
|
|
11
|
+
export const MAX_SETTLE_AFTER_DAYS = 90;
|
|
12
|
+
|
|
13
|
+
const clampSettleAfterDays = (value) => {
|
|
14
|
+
if (!Number.isFinite(value)) return DEFAULT_SETTLE_AFTER_DAYS;
|
|
15
|
+
return Math.min(MAX_SETTLE_AFTER_DAYS, Math.max(MIN_SETTLE_AFTER_DAYS, Math.trunc(value)));
|
|
16
|
+
};
|
|
8
17
|
const HIDDEN_SESSION_TITLES = new Set(['smartfetch-secondary']);
|
|
9
18
|
const BACKGROUND_SESSION_TITLE = /^\[(?:Scheduled|Assistant|yuri-llm)\]/;
|
|
10
19
|
|
|
@@ -100,7 +109,13 @@ const toSummary = (session, fallbackDirectory, resolveDirectory = normalizeDirec
|
|
|
100
109
|
};
|
|
101
110
|
};
|
|
102
111
|
|
|
103
|
-
export const createSessionIndexService = ({
|
|
112
|
+
export const createSessionIndexService = ({
|
|
113
|
+
dbPath,
|
|
114
|
+
getRuntimeConfig = () => null,
|
|
115
|
+
resolveDirectory = (value) => value,
|
|
116
|
+
getSettleAfterDays = () => DEFAULT_SETTLE_AFTER_DAYS,
|
|
117
|
+
now = () => Date.now(),
|
|
118
|
+
} = {}) => {
|
|
104
119
|
if (typeof dbPath !== 'string' || !dbPath.trim()) return null;
|
|
105
120
|
|
|
106
121
|
const normalizeDirectory = (value) => {
|
|
@@ -184,6 +199,17 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
184
199
|
pinned_at INTEGER NOT NULL,
|
|
185
200
|
PRIMARY KEY (runtime_key, session_id)
|
|
186
201
|
);
|
|
202
|
+
CREATE TABLE IF NOT EXISTS session_settle (
|
|
203
|
+
runtime_key TEXT NOT NULL,
|
|
204
|
+
session_id TEXT NOT NULL,
|
|
205
|
+
override TEXT NOT NULL CHECK (override IN ('settled', 'active')),
|
|
206
|
+
settled_at INTEGER NOT NULL,
|
|
207
|
+
PRIMARY KEY (runtime_key, session_id)
|
|
208
|
+
);
|
|
209
|
+
CREATE TABLE IF NOT EXISTS session_settle_baseline (
|
|
210
|
+
runtime_key TEXT PRIMARY KEY,
|
|
211
|
+
baseline_at INTEGER NOT NULL
|
|
212
|
+
);
|
|
187
213
|
`);
|
|
188
214
|
const sessionSummaryColumns = new Set(
|
|
189
215
|
db.prepare("SELECT name FROM pragma_table_info('session_summary')").all().map((column) => column.name),
|
|
@@ -384,6 +410,24 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
384
410
|
SET pinned_at = ?
|
|
385
411
|
WHERE runtime_key = ? AND session_id = ?
|
|
386
412
|
`);
|
|
413
|
+
const readSettleOverrides = db.prepare('SELECT session_id AS id, override, settled_at AS settledAt FROM session_settle WHERE runtime_key = ?');
|
|
414
|
+
const upsertSettle = db.prepare(`
|
|
415
|
+
INSERT INTO session_settle(runtime_key, session_id, override, settled_at)
|
|
416
|
+
VALUES (?, ?, ?, ?)
|
|
417
|
+
ON CONFLICT(runtime_key, session_id) DO UPDATE SET override = excluded.override, settled_at = excluded.settled_at
|
|
418
|
+
`);
|
|
419
|
+
const deleteSettle = db.prepare('DELETE FROM session_settle WHERE runtime_key = ? AND session_id = ?');
|
|
420
|
+
const insertSettleBaseline = db.prepare('INSERT OR IGNORE INTO session_settle_baseline(runtime_key, baseline_at) VALUES (?, ?)');
|
|
421
|
+
const readSettleBaseline = db.prepare('SELECT baseline_at AS baselineAt FROM session_settle_baseline WHERE runtime_key = ?');
|
|
422
|
+
|
|
423
|
+
// The baseline is written once per runtime, the first time that runtime is
|
|
424
|
+
// observed. Sessions whose last activity predates it are settled by default;
|
|
425
|
+
// no per-session rows are backfilled.
|
|
426
|
+
const ensureSettleBaseline = (key) => {
|
|
427
|
+
insertSettleBaseline.run(key, now());
|
|
428
|
+
return readSettleBaseline.get(key).baselineAt;
|
|
429
|
+
};
|
|
430
|
+
ensureSettleBaseline(runtimeKey());
|
|
387
431
|
|
|
388
432
|
const movedLocations = new Map();
|
|
389
433
|
const isStaleLocation = (session, directory) => {
|
|
@@ -555,6 +599,18 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
555
599
|
reconcileDirectoryAliases(key);
|
|
556
600
|
const pinRows = readPins.all(key);
|
|
557
601
|
const pinById = new Map(pinRows.map((row) => [row.id, row.pinnedAt]));
|
|
602
|
+
const settleOverrides = new Map(readSettleOverrides.all(key).map((row) => [row.id, row]));
|
|
603
|
+
const baselineAt = ensureSettleBaseline(key);
|
|
604
|
+
const cooldownMs = clampSettleAfterDays(getSettleAfterDays()) * DAY_MS;
|
|
605
|
+
const observedAt = now();
|
|
606
|
+
// Live state (running, pending questions/permissions) is overlaid by the
|
|
607
|
+
// client; this projection depends only on the override, baseline and clock.
|
|
608
|
+
const settledAtFor = (sessionID, activityUpdatedAt) => {
|
|
609
|
+
const override = settleOverrides.get(sessionID);
|
|
610
|
+
if (override) return override.override === 'settled' ? override.settledAt : 0;
|
|
611
|
+
if (activityUpdatedAt < baselineAt) return baselineAt;
|
|
612
|
+
return observedAt - activityUpdatedAt >= cooldownMs ? activityUpdatedAt + cooldownMs : 0;
|
|
613
|
+
};
|
|
558
614
|
const directories = db.prepare(`
|
|
559
615
|
SELECT directory, cursor, has_more AS hasMore, last_synced_at AS lastSyncedAt,
|
|
560
616
|
last_full_synced_at AS lastFullSyncedAt, last_accessed_at AS lastAccessedAt
|
|
@@ -584,6 +640,9 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
584
640
|
...((pinById.get(session.id) ?? session.pinnedAt)
|
|
585
641
|
? { pinned: pinById.get(session.id) ?? session.pinnedAt }
|
|
586
642
|
: {}),
|
|
643
|
+
...(settledAtFor(session.id, session.activityUpdatedAt)
|
|
644
|
+
? { settled: settledAtFor(session.id, session.activityUpdatedAt) }
|
|
645
|
+
: {}),
|
|
587
646
|
},
|
|
588
647
|
metadata: {
|
|
589
648
|
yuri: {
|
|
@@ -608,6 +667,7 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
608
667
|
const key = runtimeKey();
|
|
609
668
|
const parent = parentForChild.get(key, sessionID);
|
|
610
669
|
const pinResult = deletePin.run(key, sessionID);
|
|
670
|
+
deleteSettle.run(key, sessionID);
|
|
611
671
|
const result = db.prepare('DELETE FROM session_summary WHERE runtime_key = ? AND session_id = ?').run(key, sessionID);
|
|
612
672
|
deleteChildrenWithParent.run(key, sessionID);
|
|
613
673
|
deleteChild.run(key, sessionID);
|
|
@@ -717,7 +777,7 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
717
777
|
return result.changes > 0;
|
|
718
778
|
};
|
|
719
779
|
|
|
720
|
-
const setPinned = (sessionID, pinnedAt = Date.now()) => {
|
|
780
|
+
const setPinned = db.transaction((sessionID, pinnedAt = Date.now()) => {
|
|
721
781
|
if (typeof sessionID !== 'string' || !sessionID) return false;
|
|
722
782
|
const timestamp = toTimestamp(pinnedAt);
|
|
723
783
|
if (!timestamp) return false;
|
|
@@ -725,14 +785,29 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
725
785
|
upsertPin.run(key, sessionID, timestamp);
|
|
726
786
|
writeSummaryPinnedAt.run(timestamp, key, sessionID);
|
|
727
787
|
return true;
|
|
728
|
-
};
|
|
788
|
+
});
|
|
729
789
|
|
|
730
|
-
const clearPinned = (sessionID) => {
|
|
790
|
+
const clearPinned = db.transaction((sessionID) => {
|
|
731
791
|
if (typeof sessionID !== 'string' || !sessionID) return false;
|
|
732
792
|
const key = runtimeKey();
|
|
733
793
|
const pinResult = deletePin.run(key, sessionID);
|
|
734
794
|
const summaryResult = writeSummaryPinnedAt.run(null, key, sessionID);
|
|
735
795
|
return pinResult.changes > 0 || summaryResult.changes > 0;
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
const writeSettleOverride = (sessionID, override) => {
|
|
799
|
+
if (typeof sessionID !== 'string' || !sessionID) return false;
|
|
800
|
+
const key = runtimeKey();
|
|
801
|
+
ensureSettleBaseline(key);
|
|
802
|
+
upsertSettle.run(key, sessionID, override, now());
|
|
803
|
+
return true;
|
|
804
|
+
};
|
|
805
|
+
const setSettled = (sessionID) => writeSettleOverride(sessionID, 'settled');
|
|
806
|
+
// Manual un-settle pins the session active until its next real activity.
|
|
807
|
+
const clearSettled = (sessionID) => writeSettleOverride(sessionID, 'active');
|
|
808
|
+
const clearSettleOverride = (sessionID) => {
|
|
809
|
+
if (typeof sessionID !== 'string' || !sessionID) return false;
|
|
810
|
+
return deleteSettle.run(runtimeKey(), sessionID).changes > 0;
|
|
736
811
|
};
|
|
737
812
|
|
|
738
813
|
const replaceChildSessions = db.transaction((directory, parentSessionID, children) => {
|
|
@@ -800,6 +875,9 @@ export const createSessionIndexService = ({ dbPath, getRuntimeConfig = () => nul
|
|
|
800
875
|
move,
|
|
801
876
|
setPinned,
|
|
802
877
|
clearPinned,
|
|
878
|
+
setSettled,
|
|
879
|
+
clearSettled,
|
|
880
|
+
clearSettleOverride,
|
|
803
881
|
remove,
|
|
804
882
|
findBySessionId,
|
|
805
883
|
replaceChildSessions,
|