@yuriai/web 0.3.1 → 0.3.2-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-BwB9S5gR.js → AgentAvatar-x96Bnfsu.js} +1 -1
- package/dist/assets/AssistantConversationSurface-Fb-zSPo9.js +3 -0
- package/dist/assets/AssistantSessionCard-CoCLydJP.js +2 -0
- package/dist/assets/{AssistantUnreadBadge-DJQUBf7P.js → AssistantUnreadBadge-rZCi09a_.js} +1 -1
- package/dist/assets/{AssistantView-BNYeCdPt.js → AssistantView-swsUejpX.js} +1 -1
- package/dist/assets/{DiagramView-4xy78PeY.js → DiagramView-CLS0pLZO.js} +1 -1
- package/dist/assets/{FadeInOnReveal-BSm_Y5N-.js → FadeInOnReveal-CI-IPVEK.js} +1 -1
- package/dist/assets/{GuiPluginPage-Zn-NJGcV.js → GuiPluginPage-CAJB88Hr.js} +1 -1
- package/dist/assets/{GuiPluginSurface-BzbqxS7y.js → GuiPluginSurface-BS2r8oXR.js} +1 -1
- package/dist/assets/{GuiPluginWindow-DACvDqJe.js → GuiPluginWindow-FOzqLIZ3.js} +1 -1
- package/dist/assets/{Icon-CbRhi6Fu.js → Icon-DmIDd0Q3.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-DoSf5jCj.js → ImageLoadingPlaceholder-trn5U_et.js} +1 -1
- package/dist/assets/{LoadingImage-2mWVVnaP.js → LoadingImage-C4d5T4hV.js} +1 -1
- package/dist/assets/MarkdownRenderer-BVwZ1pA4.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-Bs4elVH3.js → MarkdownRendererImpl-DS0zWiLN.js} +2 -2
- package/dist/assets/{MarkstreamRendererImpl-rHAAvqOj.js → MarkstreamRendererImpl-jAsInIUo.js} +2 -2
- package/dist/assets/{MobileDetailNavigation-l_n1taf1.js → MobileDetailNavigation-C5cGr0_z.js} +1 -1
- package/dist/assets/{MobileResizableSheet-eCQDQAYS.js → MobileResizableSheet-C1mMUPUi.js} +1 -1
- package/dist/assets/{MobileShareBridge-DGb2HExd.js → MobileShareBridge-WMVB0JDL.js} +1 -1
- package/dist/assets/MobileSurface-DvKk_z56.js +2 -0
- package/dist/assets/{MultiRunWindow-BzkslOOz.js → MultiRunWindow-sY6Pm1xj.js} +1 -1
- package/dist/assets/{OnboardingScreen-YNlP1MQe.js → OnboardingScreen-BklzeM5-.js} +1 -1
- package/dist/assets/{OverlayScrollbar-CTdoPf6E.js → OverlayScrollbar-CCiU1O4G.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-B1Pavyxf.js → RemoteAssistantSessionCard-B51iN77P.js} +1 -1
- package/dist/assets/{SettingsView-Bl2kgume.js → SettingsView-DIjOyLKA.js} +13 -13
- package/dist/assets/{SettingsWindow-IUQlRvAB.js → SettingsWindow-CImW4cF3.js} +1 -1
- package/dist/assets/{SetupTourDialog-CPBnXSzq.js → SetupTourDialog-BKQ3z7Y2.js} +1 -1
- package/dist/assets/{TerminalView-9qSzxiHi.js → TerminalView-B2vccUH6.js} +1 -1
- package/dist/assets/ToolOutputDialog-Ce0eoysA.js +16 -0
- package/dist/assets/{VoiceSettings-CfYrDKgr.js → VoiceSettings-GiwhoPor.js} +2 -2
- package/dist/assets/{YuriLogo-VXtP1vhh.js → YuriLogo-DNvrroBa.js} +1 -1
- package/dist/assets/{YuriWordmark-B7lmpLRB.js → YuriWordmark-bJX68f2Y.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-D-LmCflm.js → assistant-attachment-cache-zu9sz4ex.js} +1 -1
- package/dist/assets/{capgoAdapter-BEKE5h5I.js → capgoAdapter-CDggXiqU.js} +1 -1
- package/dist/assets/{checkbox-gVpQUiVY.js → checkbox-1rYH2bTD.js} +1 -1
- package/dist/assets/{client-1Fk5IbQR.js → client-CgAFd1ew.js} +1 -1
- package/dist/assets/{collapsible-DCBnoRLL.js → collapsible-c8Ibgdp0.js} +1 -1
- package/dist/assets/context-menu-BImF2R_w.js +1 -0
- package/dist/assets/{device-QL8KNSLM.js → device-C8ZHblkr.js} +1 -1
- package/dist/assets/{diagram-DGTlsED0.js → diagram-DgoUJTH7.js} +1 -1
- package/dist/assets/dialog-BC7o8gDY.js +1 -0
- package/dist/assets/dialog-DYOEW9DC.css +1 -0
- package/dist/assets/{fileMentionTouchSelection-YTaXrwGt.js → fileMentionTouchSelection-C4Bcy0x9.js} +1 -1
- package/dist/assets/{fileReferenceActions-cYqdsXFz.js → fileReferenceActions-DX-Stroq.js} +1 -1
- package/dist/assets/{gitApi-Bxuv7iZR.js → gitApi-v_nr2noV.js} +1 -1
- package/dist/assets/{gitApiHttp-B0FJaIhU.js → gitApiHttp-BEMPJCIG.js} +1 -1
- package/dist/assets/{historyImportQueries-D_9RlrLp.js → historyImportQueries-eR7Bj6VN.js} +1 -1
- package/dist/assets/host-iM7aLAip.js +1 -0
- package/dist/assets/{i18n-qHllte6P.js → i18n-OsFhnlRH.js} +1 -1
- package/dist/assets/{image-loading-DBqnxgDH.js → image-loading-ZB1bYt51.js} +1 -1
- package/dist/assets/{input-Bv6SbhDB.js → input-Be95umzN.js} +1 -1
- package/dist/assets/{input-store-CsY-uaSj.js → input-store-DRTu4uZc.js} +1 -1
- package/dist/assets/{insertionBoundaries-CIvMb0MT.js → insertionBoundaries-B6Qmm9AF.js} +1 -1
- package/dist/assets/{main-wQ79inDK.js → main-B_c29S7v.js} +2 -2
- package/dist/assets/main-DehtDyHn.js +169 -0
- package/dist/assets/{markdownHeightCache-D2mAXH8W.js → markdownHeightCache-DRCM6uIv.js} +1 -1
- package/dist/assets/{markdownTheme-DFDWa8Gh.js → markdownTheme-C2LJ3cJo.js} +1 -1
- package/dist/assets/{mcpQueries-CUIUymwN.js → mcpQueries-ar057Rgj.js} +1 -1
- package/dist/assets/miniChat-Ba-eW2E2.js +2 -0
- package/dist/assets/mobile-CteFNdYr.js +2 -0
- package/dist/assets/{mobileBackNavigation-DwKmPsU6.js → mobileBackNavigation-D5OGRKSr.js} +1 -1
- package/dist/assets/mobileConnections-ha4M0S0e.js +2 -0
- package/dist/assets/{multirun-Di_vmRR_.js → multirun-_MbBN5TJ.js} +1 -1
- package/dist/assets/{native-config-B3D9Nv0p.js → native-config-nNPVev0-.js} +1 -1
- package/dist/assets/{navigation-lAkZZJTN.js → navigation-DcR3_z8w.js} +2 -2
- package/dist/assets/openRemoteProjectSession-b-2cofYh.js +1 -0
- package/dist/assets/{project-preview-2H-TmJkd.js → project-preview-BhNspxqe.js} +1 -1
- package/dist/assets/projectMeta-D53IRKNO.js +1 -0
- package/dist/assets/{prompt-attachment-upload-9fjmgafL.js → prompt-attachment-upload-8bssUUT3.js} +1 -1
- package/dist/assets/pwa-BVfdVkx_.js +2 -0
- package/dist/assets/qoder-zGvP_RLr.svg +5 -0
- package/dist/assets/{queue-abort-optimistic-DYFaJQrY.js → queue-abort-optimistic-DNMz6oUq.js} +1 -1
- package/dist/assets/{react-DVXKhubI.js → react-GVgpPWOu.js} +1 -1
- package/dist/assets/{readiness-Di6b1RDu.js → readiness-BLhjWepK.js} +2 -2
- package/dist/assets/{reference-history-DO4BO4M5.js → reference-history-DhW8i1Bj.js} +1 -1
- package/dist/assets/{remote-input-store-84i8uDyM.js → remote-input-store-DFBMyVS-.js} +1 -1
- package/dist/assets/{remoteProjectQueries-Dfms-cCx.js → remoteProjectQueries-8giIAvzL.js} +1 -1
- package/dist/assets/{remoteSessionReference-CabFQNo2.js → remoteSessionReference-2EzJ0HAI.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-BkHYTNcZ.js → renderElectronMiniChatApp-BSeoyBNY.js} +2 -2
- package/dist/assets/renderMobileApp-B8zNPX8J.js +29 -0
- package/dist/assets/{runtime-file-download-D11Nnedg.js → runtime-file-download-Dc459c9e.js} +1 -1
- package/dist/assets/{runtime-file-resource-CuLP3xp7.js → runtime-file-resource-DnhWnndu.js} +1 -1
- package/dist/assets/{runtimeConfig-Ez0YVcLS.js → runtimeConfig-B5mZw-WN.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BUGfn7y0.css → runtimeEndpointReset-BIrMtGn5.css} +1 -1
- package/dist/assets/runtimeEndpointReset-xsh9V5vl.js +151 -0
- package/dist/assets/{scheduledTaskNavigation-y5g8D2ee.js → scheduledTaskNavigation-Bi7sRiFW.js} +1 -1
- package/dist/assets/{select-CrwouN4e.js → select-BRjmw6pb.js} +1 -1
- package/dist/assets/{sessionLookup-BpilZd_w.js → sessionLookup-BBqXTJRj.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-Ijc1-z3K.js → sortable-tabs-strip-DL4TMS9r.js} +1 -1
- package/dist/assets/{speechSettingsQueries-cV1mK7RB.js → speechSettingsQueries-DKopd_iw.js} +1 -1
- package/dist/assets/src-DRyZ4dLj.css +2 -0
- package/dist/assets/{store-BOD3jjMl.js → store-Dj5cSf8B.js} +1 -1
- package/dist/assets/{terminalApi-Cq0vjFe1.js → terminalApi-eR_918UZ.js} +1 -1
- package/dist/assets/{textarea-BPhvk5Vd.js → textarea-BJ8C3aZh.js} +1 -1
- package/dist/assets/{tooltip-BQ1xVNC6.js → tooltip-C88IVUw5.js} +1 -1
- package/dist/assets/types-jqOiAN4j.js +2 -0
- package/dist/assets/{useAppFontEffects-PZ3Y-JIL.js → useAppFontEffects-C28vxpqk.js} +62 -61
- package/dist/assets/{useAssistantUIStore-jOKVcBK8.js → useAssistantUIStore-CphyXHEY.js} +1 -1
- package/dist/assets/{useDesktopWindowControlsLayout-Z6PBzcuL.js → useDesktopWindowControlsLayout-Dm8OZBQF.js} +1 -1
- package/dist/assets/{useDictation-De8WB_Z7.js → useDictation-Do12BpsS.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DWiz5-Xa.js → useEffectiveDirectory-6o2SvpVe.js} +1 -1
- package/dist/assets/{useFontPreferences-CO-L-Gd7.js → useFontPreferences-DFF-uEAD.js} +1 -1
- package/dist/assets/{useMobileHtmlPreviewStore-EOAzZiAy.js → useMobileHtmlPreviewStore-DUquFMmd.js} +1 -1
- package/dist/assets/useMobileNavigationStore-zEWQLkBM.js +13 -0
- package/dist/assets/{usePluginsStore-pd_Lgl6m.js → usePluginsStore-CJNc92gY.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-Me0Uy2tM.js → useProjectRuntimeAPIs-D6zSDR6i.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-eJaQ-Vpw.js → useStreamingTextThrottle-DBPv5MtB.js} +1 -1
- package/dist/assets/{useThemeSystem-C57Z9mV2.js → useThemeSystem-D2YBbLma.js} +1 -1
- package/dist/assets/{useUIStore-Cfmg-aDQ.js → useUIStore-CYex4rbF.js} +1 -1
- package/dist/assets/{vendor-base-ui-z2M4boRm.js → vendor-base-ui-fom6orB6.js} +1 -1
- package/dist/assets/{vendor-cmdk-BgHvMv5l.js → vendor-cmdk-BKc6RGpL.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-accessibility-gVi9ga0x.js → vendor-dnd-kit-accessibility-Cf9EEJvm.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-core-Dd5yS2-T.js → vendor-dnd-kit-core-DRyd7I0I.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-sortable-CV-SGi8y.js → vendor-dnd-kit-sortable-C8S8cyRO.js} +1 -1
- package/dist/assets/{vendor-framer-motion-CF9BQLta.js → vendor-framer-motion-DiGWHm7K.js} +1 -1
- package/dist/assets/{vendor-markstream-react-TwEpkgfP.js → vendor-markstream-react-Cwc-VXWM.js} +3 -3
- package/dist/assets/vendor-motion-DtmZZeEm.js +1 -0
- package/dist/assets/{vendor-pierre-diffs-tqo4Z3TC.js → vendor-pierre-diffs-HJfPTtu2.js} +1 -1
- package/dist/assets/{vendor-react-P8wFrkcT.js → vendor-react-D5BntRmA.js} +1 -1
- package/dist/assets/{vendor-react-drawio-CQW1YP2l.js → vendor-react-drawio-DXADKcSU.js} +1 -1
- package/dist/assets/{vendor-reactuses-core-Dyjw5sZR.js → vendor-reactuses-core-B8s-Rcd-.js} +1 -1
- package/dist/assets/{vendor-sonner-B5HgJenP.js → vendor-sonner-Y-KPX915.js} +1 -1
- package/dist/assets/{vendor-stream-diffs-DCMtZcS3.js → vendor-stream-diffs-BMT21f-n.js} +2 -2
- package/dist/assets/{vendor-tanstack-react-query-B-KblYBV.js → vendor-tanstack-react-query-ChSd65dm.js} +1 -1
- package/dist/assets/{vendor-tanstack-react-virtual-BkuqzrEV.js → vendor-tanstack-react-virtual-WY42p6U6.js} +1 -1
- package/dist/assets/{vendor-zustand-Cwko4FG1.js → vendor-zustand-CNn3HHhT.js} +1 -1
- package/dist/index.html +19 -19
- package/dist/mini-chat.html +19 -19
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/server/lib/gui-customization/skill/references/work-status.md +4 -2
- package/server/lib/notifications/DOCUMENTATION.md +11 -1
- package/server/lib/notifications/session-unread-store.js +20 -6
- package/server/lib/notifications/session-unread.test.js +80 -0
- package/server/lib/relay/tunnel-host.js +12 -3
- package/server/lib/relay/tunnel-host.test.js +24 -0
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +14 -5
- package/server/lib/scheduled-tasks/runtime.js +29 -25
- package/server/lib/scheduled-tasks/runtime.test.js +88 -1
- package/dist/assets/AssistantConversationSurface-BQJZ0RY8.js +0 -3
- package/dist/assets/AssistantSessionCard-CSpwjbEO.js +0 -2
- package/dist/assets/MarkdownRenderer-BHK_Ba71.js +0 -2
- package/dist/assets/MobileSurface-lAYRO5L7.js +0 -2
- package/dist/assets/ToolOutputDialog-CmhQV6kW.js +0 -16
- package/dist/assets/context-menu-w28HFXdm.js +0 -1
- package/dist/assets/dialog-CTYD3Sbr.css +0 -1
- package/dist/assets/dialog-wyG1j1ZY.js +0 -1
- package/dist/assets/host-D9EDWNmx.js +0 -1
- package/dist/assets/main-DrYyJLms.js +0 -169
- package/dist/assets/miniChat-BTPvGmaS.js +0 -2
- package/dist/assets/mobile-DtTmIm4s.js +0 -2
- package/dist/assets/mobileConnections-BaVOE5PX.js +0 -2
- package/dist/assets/openRemoteProjectSession-APe4n1gm.js +0 -1
- package/dist/assets/projectMeta--OgVpG4Z.js +0 -1
- package/dist/assets/pwa-B6o6xxPS.js +0 -2
- package/dist/assets/renderMobileApp-tKRbh1UN.js +0 -29
- package/dist/assets/runtimeEndpointReset-C105_37x.js +0 -151
- package/dist/assets/src-INJJ62RE.css +0 -2
- package/dist/assets/types-CO7YCNVq.js +0 -2
- package/dist/assets/useMobileNavigationStore-D2FLOd1l.js +0 -13
- package/dist/assets/vendor-motion-Dv27UnOI.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{st as t}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{st as t}from"./vendor-base-ui-fom6orB6.js";var n=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},r=(e=>e?n(e):n),i=e(t(),1),a=e=>e;function o(e,t=a){let n=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(n),n}var s=e=>{let t=r(e),n=e=>o(t,e);return Object.assign(n,t),n},c=(e=>e?s(e):s),l=e=>!!e.dispatchFromDevtools&&typeof e.dispatch==`function`,u=new Map,d=e=>{let t=u.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},f=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=u.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return u.set(n.name,i),{type:`tracked`,store:e,...i}},p=(e,t)=>{if(t===void 0)return;let n=u.get(e);n&&(delete n.stores[t],Object.keys(n.stores).length===0&&u.delete(e))},m=e=>{if(!e)return;let t=e.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.includes(`api.setState`));if(n<0)return;let r=t[n+1]?.trim()||``;return/.+ (.+) .+/.exec(r)?.[1]},h=(e,t={})=>(n,r,i)=>{let{enabled:a,anonymousActionType:o,store:s,...c}=t,u;try{u=(a??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return e(n,r,i);let{connection:h,..._}=f(s,u,c),v=!0;i.setState=((e,t,a)=>{let l=n(e,t);if(!v)return l;let u=a===void 0?{type:o||m(Error().stack)||`anonymous`}:typeof a==`string`?{type:a}:a;return s===void 0?(h?.send(u,r()),l):(h?.send({...u,type:`${s}/${u.type}`},{...d(c.name),[s]:i.getState()}),l)}),i.devtools={cleanup:()=>{h&&typeof h.unsubscribe==`function`&&h.unsubscribe(),p(c.name,s)}};let y=(...e)=>{let t=v;v=!1,n(...e),v=t},b=e(i.setState,r,i);if(_.type===`untracked`?h?.init(b):(_.stores[_.store]=i,h?.init(Object.fromEntries(Object.entries(_.stores).map(([e,t])=>[e,e===_.store?b:t.getState()])))),l(i)){let e=i.dispatch;i.dispatch=(...t)=>{e(...t)}}return h.subscribe(e=>{switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return g(e.payload,e=>{if(e.type===`__setState`){if(s===void 0){y(e.state);return}Object.keys(e.state).length!==1&&console.error(`
|
|
3
3
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
4
4
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
package/dist/index.html
CHANGED
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
opacity: 0.72;
|
|
572
572
|
}
|
|
573
573
|
</style>
|
|
574
|
-
<script type="module" crossorigin src="/assets/main-
|
|
574
|
+
<script type="module" crossorigin src="/assets/main-B_c29S7v.js"></script>
|
|
575
575
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -584,37 +584,37 @@
|
|
|
584
584
|
<link rel="modulepreload" crossorigin href="/assets/platform-wF65ZFgV.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-135cuRCE.js">
|
|
586
586
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-1aUztDPU.js">
|
|
587
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-
|
|
588
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-
|
|
587
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-fom6orB6.js">
|
|
588
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-CNn3HHhT.js">
|
|
589
589
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
590
590
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
591
591
|
<link rel="modulepreload" crossorigin href="/assets/safeStorage-DTOhKN0V.js">
|
|
592
592
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
593
593
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-BM2r1f0o.js">
|
|
594
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-react-
|
|
594
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-react-D5BntRmA.js">
|
|
595
595
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BSjXNgF_.js">
|
|
596
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-
|
|
596
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-ChSd65dm.js">
|
|
597
597
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
598
598
|
<link rel="modulepreload" crossorigin href="/assets/vendor-lodash-es-BS45jPoZ.js">
|
|
599
599
|
<link rel="modulepreload" crossorigin href="/assets/vendor-js-cookie-hSOiFTtX.js">
|
|
600
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-reactuses-core-
|
|
600
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-reactuses-core-B8s-Rcd-.js">
|
|
601
601
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
602
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
603
|
-
<link rel="modulepreload" crossorigin href="/assets/prompt-attachment-upload-
|
|
604
|
-
<link rel="modulepreload" crossorigin href="/assets/client-
|
|
605
|
-
<link rel="modulepreload" crossorigin href="/assets/useMobileHtmlPreviewStore-
|
|
606
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
602
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-DnhWnndu.js">
|
|
603
|
+
<link rel="modulepreload" crossorigin href="/assets/prompt-attachment-upload-8bssUUT3.js">
|
|
604
|
+
<link rel="modulepreload" crossorigin href="/assets/client-CgAFd1ew.js">
|
|
605
|
+
<link rel="modulepreload" crossorigin href="/assets/useMobileHtmlPreviewStore-DUquFMmd.js">
|
|
606
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-CYex4rbF.js">
|
|
607
607
|
<link rel="modulepreload" crossorigin href="/assets/uuid-D-SDZijH.js">
|
|
608
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
609
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
610
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
611
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
612
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
613
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
608
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BEMPJCIG.js">
|
|
609
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-eR_918UZ.js">
|
|
610
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Dc459c9e.js">
|
|
611
|
+
<link rel="modulepreload" crossorigin href="/assets/types-jqOiAN4j.js">
|
|
612
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-CDggXiqU.js">
|
|
613
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-nNPVev0-.js">
|
|
614
614
|
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
615
615
|
<link rel="modulepreload" crossorigin href="/assets/bootstrap-eLlfzqAI.js">
|
|
616
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
617
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
616
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-B5mZw-WN.js">
|
|
617
|
+
<link rel="stylesheet" crossorigin href="/assets/src-DRyZ4dLj.css">
|
|
618
618
|
</head>
|
|
619
619
|
<body class="h-full bg-background text-foreground">
|
|
620
620
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
.dark #initial-loading img { filter: invert(1); }
|
|
78
78
|
</style>
|
|
79
79
|
|
|
80
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
80
|
+
<script type="module" crossorigin src="/assets/miniChat-Ba-eW2E2.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -90,37 +90,37 @@
|
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/platform-wF65ZFgV.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-135cuRCE.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-1aUztDPU.js">
|
|
93
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-fom6orB6.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-CNn3HHhT.js">
|
|
95
95
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/safeStorage-DTOhKN0V.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-BM2r1f0o.js">
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-react-
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-react-D5BntRmA.js">
|
|
101
101
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BSjXNgF_.js">
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-ChSd65dm.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="/assets/vendor-lodash-es-BS45jPoZ.js">
|
|
105
105
|
<link rel="modulepreload" crossorigin href="/assets/vendor-js-cookie-hSOiFTtX.js">
|
|
106
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-reactuses-core-
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-reactuses-core-B8s-Rcd-.js">
|
|
107
107
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/prompt-attachment-upload-
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/client-
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/useMobileHtmlPreviewStore-
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-DnhWnndu.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/prompt-attachment-upload-8bssUUT3.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/client-CgAFd1ew.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/useMobileHtmlPreviewStore-DUquFMmd.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-CYex4rbF.js">
|
|
113
113
|
<link rel="modulepreload" crossorigin href="/assets/uuid-D-SDZijH.js">
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
116
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
117
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
118
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
119
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BEMPJCIG.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-eR_918UZ.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Dc459c9e.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/types-jqOiAN4j.js">
|
|
118
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-CDggXiqU.js">
|
|
119
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-nNPVev0-.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="/assets/bootstrap-eLlfzqAI.js">
|
|
122
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
123
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
122
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-B5mZw-WN.js">
|
|
123
|
+
<link rel="stylesheet" crossorigin href="/assets/src-DRyZ4dLj.css">
|
|
124
124
|
</head>
|
|
125
125
|
<body class="h-full bg-background text-foreground">
|
|
126
126
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
66
|
<style>.dark #mobile-startup-logo img { filter: invert(1); }</style>
|
|
67
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
67
|
+
<script type="module" crossorigin src="/assets/mobile-CteFNdYr.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
71
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
71
|
+
<link rel="stylesheet" crossorigin href="/assets/src-DRyZ4dLj.css">
|
|
72
72
|
</head>
|
|
73
73
|
<body class="h-full bg-background text-foreground">
|
|
74
74
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@ Web desktop and Electron render the widgets in both inline and popup modes, incl
|
|
|
26
26
|
| --- | --- |
|
|
27
27
|
| `session` | Official `MountedSession` reference for **this displayed conversation**, or `undefined` before a draft has a session/directory. Yuri supports `id`, `key`, `directory`, `server`, `tab`, `pending`, `visit`, `location` on this reference; unsupported SDK members reject as elsewhere. |
|
|
28
28
|
| `directory` | Actual displayed working directory, or `null` while unresolved. Never replaced with another selected project's directory. |
|
|
29
|
-
| `runtimeId` |
|
|
29
|
+
| `runtimeId` | Opaque execution scope identity; Remote Projects include Hub/Host/Location and the captured authorization revision. Not a URL or durable cross-transport key. |
|
|
30
30
|
| `project` | Reactive `{ id?: string, name: string, directory: string } \| null`. Same project/worktree resolution as the built-in rows; a directory fallback can have no project ID. |
|
|
31
31
|
| `worktree` | Reactive `{ name: string, directory: string } \| null`. Explicit attached/discovered worktree, when known. |
|
|
32
32
|
| `git` | Reactive read-only summary described below, shared with the built-in Git rows. |
|
|
@@ -51,9 +51,11 @@ interface GitSummary {
|
|
|
51
51
|
|
|
52
52
|
Theme, locale, plugin options and authenticated client remain on `usePlugin()` / setup `ctx`. `ctx.sessions.current()` still describes the window's primary selection; use the injected session for widget-scoped requests. Existing navigation APIs retain their support boundaries: for example, file navigation for an explicitly different session can be rejected. Do not silently retarget it to the primary conversation.
|
|
53
53
|
|
|
54
|
+
Remote Projects use the current window's GUI inventory and options, not remote GUI code. Their injected `session.id`/`directory` are raw remote values; `session.key` and `session.server.id` are scoped identities, and `session.location` includes Hub/Host and the authenticated instance ID when known. The remote reference is read-only: `session.server.client` is explicitly unsupported, while `ctx.client` and screen/file still belong to the window. Widgets querying their own external service can use their configured endpoint plus the injected session ID. No remote SDK, filesystem or native capability is added by mounting the widget.
|
|
55
|
+
|
|
54
56
|
## Lifecycle and updates
|
|
55
57
|
|
|
56
|
-
Changing project/Git metadata or placement updates the existing Solid view; unrelated session/layout/stream updates do not rebuild the widget catalog or remount its DOM. Changing the displayed session ID, directory or
|
|
58
|
+
Changing project/Git metadata or placement updates the existing Solid view; unrelated session/layout/stream updates do not rebuild the widget catalog or remount its DOM. Changing the displayed session ID, directory, host or captured authorization scope creates a new mount and aborts the previous one. Multiple visible instances have independent props and signals.
|
|
57
59
|
|
|
58
60
|
Use `onCleanup` for listeners and timers, or bind DOM listeners/requests to `props.signal`. Ignore completed asynchronous work after that signal aborts. Registration and rendering exceptions use the existing plugin failure path: affected content disappears, diagnostics remain in plugin settings, and unrelated plugins stay usable. Arbitrary plugin JavaScript still runs on the window's main thread; keep expensive work out of setup/render and stop view-owned work on cleanup.
|
|
59
61
|
|
|
@@ -42,6 +42,16 @@ client notification store had no durable data to migrate).
|
|
|
42
42
|
- Successful commits publish `yuri:session-unread-changed` revision tips through
|
|
43
43
|
`/api/yuri/events`. Clients lead with GET and recover on stream-ready/reconnect.
|
|
44
44
|
|
|
45
|
+
Multiple Host processes sharing the same data directory (such as desktop and HMR)
|
|
46
|
+
also share the database but not SSE clients. Each file-backed store checks the
|
|
47
|
+
single global revision row once per second and publishes only newer revisions to
|
|
48
|
+
its own clients, including commits from another process. This is independent of
|
|
49
|
+
session count and never reads transcripts or scans session rows on a tick. Local
|
|
50
|
+
commits still publish immediately; duplicate tips are suppressed. Failed checks
|
|
51
|
+
retain the published revision and retry on the next tick. In-memory stores have
|
|
52
|
+
no timer; closing a file-backed store clears its timer. Snapshot revision and rows
|
|
53
|
+
are read in one transaction so concurrent external commits cannot mix versions.
|
|
54
|
+
|
|
45
55
|
All authenticated clients of one Host share this state (not per-device or
|
|
46
56
|
per-client-token). Web, Electron, hosted mobile and Capacitor use the same
|
|
47
57
|
authenticated runtime HTTP/SSE transport, including Relay. Standalone VS Code
|
|
@@ -68,7 +78,7 @@ Android notification-only subscriptions send the App locale in `Accept-Language`
|
|
|
68
78
|
existing contact notification path, while an explicit silent review sends
|
|
69
79
|
nothing. Unowned tasks retain `notifyOnScheduledTasks` and the manual-run gate.
|
|
70
80
|
Result handoff/recovery belongs to `scheduled-tasks`, not this notification module.
|
|
71
|
-
- `family-completion-gate.js` (with a TypeScript declaration): dependency-free, runtime-local completion barrier shared by Host fanout and the VS Code webview. The Host supplies authoritative HTTP reads; VS Code supplies official SDK reads.
|
|
81
|
+
- `family-completion-gate.js` (with a TypeScript declaration): dependency-free, runtime-local completion barrier shared by Host fanout and the VS Code webview. The Host supplies authoritative HTTP reads; VS Code supplies official SDK reads. Scheduled-task settlement/recovery also reuses its bounded `readSessionFamilyActivity` ancestry reader, with run-scoped SDK cancellation; scheduling remains owned by `scheduled-tasks`.
|
|
72
82
|
- `packages/web/server/lib/notifications/live-activity-refresh-runtime.js`: periodic Live Activity snapshot refresh (default 30s, `YURI_LIVE_ACTIVITY_REFRESH_INTERVAL_MS` overrides, `0` disables). Each tick snapshots the authoritative session states once, recomputes every persisted Live Activity token's snapshot, and pushes updates only for real changes — busy→retry transitions, newly visible top-level sessions, idle completions the event path missed, and stale-row recovery. Entries whose recomputed snapshot is unchanged never send (APNs budgets Live Activity updates per hour). Rows for sessions without authoritative server state are preserved as-is; server-side-only sub-states (`permission`/`input`/`tool`) keep their last value while the session stays busy. When no row is working anymore the refresh sends `end` and clears accepted tokens.
|
|
73
83
|
- `packages/web/server/lib/notifications/template-runtime.js`: notification template variables and session text/title enrichment runtime. Zen-model helpers are retained as compatibility stubs only.
|
|
74
84
|
- `packages/web/server/lib/notifications/message.js`: helper implementation module.
|
|
@@ -22,15 +22,29 @@ export function createSessionUnreadStore({ dbPath, onChanged = () => {} }) {
|
|
|
22
22
|
);
|
|
23
23
|
`);
|
|
24
24
|
const find = db.prepare('SELECT * FROM session_unread WHERE id = ?');
|
|
25
|
-
const
|
|
25
|
+
const readRevision = db.prepare('SELECT revision FROM unread_meta WHERE id = 1');
|
|
26
|
+
const revision = () => readRevision.get().revision;
|
|
27
|
+
let publishedRevision = revision();
|
|
28
|
+
const publish = () => {
|
|
29
|
+
const next = revision();
|
|
30
|
+
if (next <= publishedRevision) return;
|
|
31
|
+
onChanged(next);
|
|
32
|
+
publishedRevision = next;
|
|
33
|
+
};
|
|
34
|
+
// Desktop and development Hosts can share this file, but not their SSE clients.
|
|
35
|
+
const peerTimer = dbPath === ':memory:' ? null : setInterval(() => {
|
|
36
|
+
try { publish(); }
|
|
37
|
+
catch { console.warn('[session-unread] shared revision check failed; retrying'); }
|
|
38
|
+
}, 1000);
|
|
39
|
+
peerTimer?.unref();
|
|
26
40
|
const publicRow = (row) => ({
|
|
27
41
|
directory: row.directory, unreadCount: row.unreadCount, hasError: Boolean(row.hasError),
|
|
28
42
|
manual: Boolean(row.manual), revision: row.revision,
|
|
29
43
|
});
|
|
30
|
-
const snapshot = () => ({
|
|
44
|
+
const snapshot = db.transaction(() => ({
|
|
31
45
|
revision: revision(),
|
|
32
46
|
sessions: Object.fromEntries(db.prepare('SELECT * FROM session_unread').all().map(row => [row.id, publicRow(row)])),
|
|
33
|
-
});
|
|
47
|
+
}));
|
|
34
48
|
const writeRow = db.prepare(`INSERT OR REPLACE INTO session_unread
|
|
35
49
|
(id, directory, unreadCount, hasError, manual, revision, terminal, eventAt, sequence)
|
|
36
50
|
VALUES (@id, @directory, @unreadCount, @hasError, @manual, @revision, @terminal, @eventAt, @sequence)`);
|
|
@@ -46,7 +60,7 @@ export function createSessionUnreadStore({ dbPath, onChanged = () => {} }) {
|
|
|
46
60
|
writeRow.run(next.row);
|
|
47
61
|
return next.publish;
|
|
48
62
|
})();
|
|
49
|
-
if (changed)
|
|
63
|
+
if (changed) publish();
|
|
50
64
|
};
|
|
51
65
|
return {
|
|
52
66
|
snapshot,
|
|
@@ -86,8 +100,8 @@ export function createSessionUnreadStore({ dbPath, onChanged = () => {} }) {
|
|
|
86
100
|
db.prepare('UPDATE unread_meta SET revision = revision + 1 WHERE id = 1').run();
|
|
87
101
|
return true;
|
|
88
102
|
})();
|
|
89
|
-
if (changed)
|
|
103
|
+
if (changed) publish();
|
|
90
104
|
},
|
|
91
|
-
close: () => db.close(),
|
|
105
|
+
close: () => { clearInterval(peerTimer); db.close(); },
|
|
92
106
|
};
|
|
93
107
|
}
|
|
@@ -3,6 +3,7 @@ import fs from 'node:fs';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { createRequire } from 'node:module';
|
|
6
|
+
import { execFileSync } from 'node:child_process';
|
|
6
7
|
import express from 'express';
|
|
7
8
|
import request from 'supertest';
|
|
8
9
|
import { createSessionUnreadStore } from './session-unread-store.js';
|
|
@@ -184,6 +185,85 @@ describe('shared session unread', () => {
|
|
|
184
185
|
expect(second.snapshot()).toEqual(expected);
|
|
185
186
|
});
|
|
186
187
|
|
|
188
|
+
it('notifies both Host clients when another connection marks shared state read or unread', async () => {
|
|
189
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'yuri-unread-peers-'));
|
|
190
|
+
cleanup.push(() => fs.rmSync(dir, { recursive: true, force: true }));
|
|
191
|
+
const dbPath = path.join(dir, 'state.sqlite');
|
|
192
|
+
let desktopView;
|
|
193
|
+
let webView;
|
|
194
|
+
const desktopChanged = vi.fn(() => { desktopView = desktop.snapshot(); });
|
|
195
|
+
const webChanged = vi.fn(() => { webView = web.snapshot(); });
|
|
196
|
+
const desktop = createSessionUnreadStore({ dbPath, onChanged: desktopChanged });
|
|
197
|
+
cleanup.push(() => desktop.close());
|
|
198
|
+
const web = createSessionUnreadStore({ dbPath, onChanged: webChanged });
|
|
199
|
+
cleanup.push(() => web.close());
|
|
200
|
+
desktopView = desktop.snapshot();
|
|
201
|
+
webView = web.snapshot();
|
|
202
|
+
|
|
203
|
+
web.mark({ id: 'one', directory: '/project', unread: true });
|
|
204
|
+
await vi.waitFor(() => expect(desktopView).toEqual(webView), { timeout: 2500 });
|
|
205
|
+
expect(desktopView.sessions.one.unreadCount).toBe(1);
|
|
206
|
+
desktop.mark({ id: 'one', unread: false, expectedRevision: desktopView.sessions.one.revision });
|
|
207
|
+
await vi.waitFor(() => expect(webView).toEqual(desktopView), { timeout: 2500 });
|
|
208
|
+
expect(webView.sessions.one.unreadCount).toBe(0);
|
|
209
|
+
expect(desktopChanged).toHaveBeenCalledTimes(2);
|
|
210
|
+
expect(webChanged).toHaveBeenCalledTimes(2);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('suppresses repeated and non-public peer changes and clears revision timers on close', () => {
|
|
214
|
+
vi.useFakeTimers();
|
|
215
|
+
const baseline = vi.getTimerCount();
|
|
216
|
+
const memory = createSessionUnreadStore({ dbPath: ':memory:' });
|
|
217
|
+
expect(vi.getTimerCount()).toBe(baseline);
|
|
218
|
+
memory.close();
|
|
219
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'yuri-unread-peer-timers-'));
|
|
220
|
+
cleanup.push(() => fs.rmSync(dir, { recursive: true, force: true }));
|
|
221
|
+
const dbPath = path.join(dir, 'state.sqlite');
|
|
222
|
+
const desktopChanged = vi.fn();
|
|
223
|
+
const webChanged = vi.fn();
|
|
224
|
+
const desktop = createSessionUnreadStore({ dbPath, onChanged: desktopChanged });
|
|
225
|
+
const web = createSessionUnreadStore({ dbPath, onChanged: webChanged });
|
|
226
|
+
try {
|
|
227
|
+
expect(vi.getTimerCount()).toBe(baseline + 2);
|
|
228
|
+
web.mark({ id: 'one', unread: true });
|
|
229
|
+
vi.advanceTimersByTime(50_000);
|
|
230
|
+
expect(desktopChanged).toHaveBeenCalledExactlyOnceWith(1);
|
|
231
|
+
expect(webChanged).toHaveBeenCalledExactlyOnceWith(1);
|
|
232
|
+
for (let i = 0; i < 50; i++) {
|
|
233
|
+
web.observe({ id: 'one', kind: 'running', sequence: i + 1 });
|
|
234
|
+
vi.advanceTimersByTime(1000);
|
|
235
|
+
}
|
|
236
|
+
expect(desktopChanged).toHaveBeenCalledTimes(1);
|
|
237
|
+
expect(webChanged).toHaveBeenCalledTimes(1);
|
|
238
|
+
desktop.remove('one');
|
|
239
|
+
vi.advanceTimersByTime(1000);
|
|
240
|
+
expect(webChanged).toHaveBeenLastCalledWith(2);
|
|
241
|
+
expect(web.snapshot()).toEqual({ revision: 2, sessions: {} });
|
|
242
|
+
} finally {
|
|
243
|
+
desktop.close(); web.close();
|
|
244
|
+
expect(vi.getTimerCount()).toBe(baseline);
|
|
245
|
+
vi.useRealTimers();
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('detects a separate process commit without a local lifecycle event or client refresh', async () => {
|
|
250
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'yuri-unread-process-'));
|
|
251
|
+
cleanup.push(() => fs.rmSync(dir, { recursive: true, force: true }));
|
|
252
|
+
const dbPath = path.join(dir, 'state.sqlite');
|
|
253
|
+
const changed = vi.fn();
|
|
254
|
+
const store = createSessionUnreadStore({ dbPath, onChanged: changed });
|
|
255
|
+
cleanup.push(() => store.close());
|
|
256
|
+
const moduleUrl = new URL('./session-unread-store.js', import.meta.url).href;
|
|
257
|
+
execFileSync(process.execPath, ['--input-type=module', '-e', `
|
|
258
|
+
import { createSessionUnreadStore } from ${JSON.stringify(moduleUrl)};
|
|
259
|
+
const store = createSessionUnreadStore({ dbPath: ${JSON.stringify(dbPath)} });
|
|
260
|
+
store.mark({ id: 'one', directory: '/project', unread: true });
|
|
261
|
+
store.close();
|
|
262
|
+
`], { timeout: 5000 });
|
|
263
|
+
await vi.waitFor(() => expect(changed).toHaveBeenCalledExactlyOnceWith(1), { timeout: 2500 });
|
|
264
|
+
expect(store.snapshot().sessions.one.unreadCount).toBe(1);
|
|
265
|
+
});
|
|
266
|
+
|
|
187
267
|
it('isolates failures, subagents and system sessions; new execution clears only its error', async () => {
|
|
188
268
|
const { store, event, loadSession } = fixture();
|
|
189
269
|
loadSession.mockImplementation(async id => ({ id, directory: '/project',
|
|
@@ -28,6 +28,8 @@ const isAllowedHttpPath = (pathname) =>
|
|
|
28
28
|
|| pathname === '/auth'
|
|
29
29
|
|| pathname.startsWith('/auth/');
|
|
30
30
|
|
|
31
|
+
const PREVIEW_TARGETS_PATH = /^\/api\/preview\/targets(?:\/[^/]+)?\/?$/;
|
|
32
|
+
|
|
31
33
|
const ALLOWED_WS_PATHS = new Set([
|
|
32
34
|
'/api/global/event/ws',
|
|
33
35
|
'/api/event/ws',
|
|
@@ -191,7 +193,7 @@ export const createTunnelHost = ({
|
|
|
191
193
|
// HTTP
|
|
192
194
|
// -------------------------------------------------------------------------
|
|
193
195
|
|
|
194
|
-
const buildRequestHeaders = (rawHeaders) => {
|
|
196
|
+
const buildRequestHeaders = (rawHeaders, path = '') => {
|
|
195
197
|
const headers = {};
|
|
196
198
|
for (const [name, value] of Object.entries(rawHeaders)) {
|
|
197
199
|
if (typeof name !== 'string' || typeof value !== 'string') continue;
|
|
@@ -201,6 +203,13 @@ export const createTunnelHost = ({
|
|
|
201
203
|
headers[lower] = value;
|
|
202
204
|
}
|
|
203
205
|
headers['x-yuri-relay-connection'] = connectionId;
|
|
206
|
+
// Tunneled renderer fetches cannot set Origin (forbidden header), but the
|
|
207
|
+
// preview target routes require an allowed Origin. Present the loopback
|
|
208
|
+
// origin we dial, as the WS path does; scoped to these routes only so other
|
|
209
|
+
// same-origin checks keep treating tunneled requests as origin-less.
|
|
210
|
+
if (!headers.origin && PREVIEW_TARGETS_PATH.test(path)) {
|
|
211
|
+
headers.origin = `http://127.0.0.1:${getLocalPort()}`;
|
|
212
|
+
}
|
|
204
213
|
return headers;
|
|
205
214
|
};
|
|
206
215
|
|
|
@@ -245,7 +254,7 @@ export const createTunnelHost = ({
|
|
|
245
254
|
try {
|
|
246
255
|
response = await fetch(url, {
|
|
247
256
|
method,
|
|
248
|
-
headers: buildRequestHeaders(request.headers),
|
|
257
|
+
headers: buildRequestHeaders(request.headers, request.path),
|
|
249
258
|
body: requestBody,
|
|
250
259
|
duplex: hasBody ? 'half' : undefined,
|
|
251
260
|
signal: stream.abort.signal,
|
|
@@ -480,7 +489,7 @@ export const createTunnelHost = ({
|
|
|
480
489
|
url: `${request.path}${request.query ? `?${request.query}` : ''}`,
|
|
481
490
|
headers: websocket
|
|
482
491
|
? { upgrade: 'websocket', 'x-yuri-relay-connection': connectionId }
|
|
483
|
-
: buildRequestHeaders(request.headers),
|
|
492
|
+
: buildRequestHeaders(request.headers, request.path),
|
|
484
493
|
}) === true;
|
|
485
494
|
} catch {
|
|
486
495
|
authorized = false;
|
|
@@ -43,6 +43,30 @@ describe('relay admission before loopback access', () => {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
+
describe('tunneled HTTP Origin for preview target routes', () => {
|
|
47
|
+
const origins = async (method, path, headers = {}) => {
|
|
48
|
+
const fetchMock = vi.spyOn(globalThis, 'fetch').mockResolvedValue(new Response('{}'));
|
|
49
|
+
const frames = [];
|
|
50
|
+
const host = createTunnelHost({ authorizeRequest: async () => true, connectionId: 'origin-test', getLocalPort: () => 4321,
|
|
51
|
+
sendFrame: (frame) => { frames.push(decodeTunnelFrame(frame)); }, getBufferedAmount: () => 0 });
|
|
52
|
+
try {
|
|
53
|
+
await host.handleFrame(encodeTunnelFrame(TunnelFrameType.HttpRequest, 1, encodeJsonPayload({ method, path, query: '', headers })));
|
|
54
|
+
await waitFor(() => frames.some((frame) => frame.frameType === TunnelFrameType.StreamEnd));
|
|
55
|
+
return fetchMock.mock.calls[0][1].headers.origin;
|
|
56
|
+
} finally { host.close(); fetchMock.mockRestore(); }
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
it('presents the dialed loopback origin for preview target registration', async () => {
|
|
60
|
+
expect(await origins('POST', '/api/preview/targets')).toBe('http://127.0.0.1:4321');
|
|
61
|
+
expect(await origins('DELETE', '/api/preview/targets/abc123')).toBe('http://127.0.0.1:4321');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('leaves other routes origin-less and keeps an explicit origin', async () => {
|
|
65
|
+
expect(await origins('POST', '/api/system/dev-shutdown')).toBeUndefined();
|
|
66
|
+
expect(await origins('POST', '/api/preview/targets', { origin: 'yuri-ui://app' })).toBe('yuri-ui://app');
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
46
70
|
/** Minimal EventEmitter-shaped fake used only by createTunnelHost tests. */
|
|
47
71
|
class FakeWebSocket {
|
|
48
72
|
static OPEN = 1;
|
|
@@ -243,8 +243,11 @@ of at most 20 running rows every five seconds, wrapping after the last page.
|
|
|
243
243
|
Each pass has a ten-second upstream request deadline. It skips locally owned
|
|
244
244
|
executions and rows without a session; missing session association is not proof
|
|
245
245
|
of execution failure. Such rows remain unresolved rather than inventing a result.
|
|
246
|
-
Recovery checks live `session.active`
|
|
247
|
-
|
|
246
|
+
Recovery checks live `session.active` and the active sessions' authoritative parent
|
|
247
|
+
chains before examining terminal messages or Host goal state. An idle parent with
|
|
248
|
+
an active descendant remains running. Active, unavailable, malformed, unknown
|
|
249
|
+
ancestry, and incomplete results remain pending; unrelated active roots do not
|
|
250
|
+
block a confirmed-complete family.
|
|
248
251
|
A session OpenCode confirms deleted (`SessionNotFoundError`) settles as `error`.
|
|
249
252
|
Only confirmed terminal evidence finalizes history, with duration through the
|
|
250
253
|
time recovery observes completion. It neither dispatches a new prompt nor sends
|
|
@@ -348,11 +351,17 @@ Every actual run (timer or manual):
|
|
|
348
351
|
**Admission is not completion:** `session.prompt` / command return when the
|
|
349
352
|
turn is accepted, not when the agent finishes.
|
|
350
353
|
7. Wait for the real session outcome (bounded by the same watchdog):
|
|
351
|
-
- Poll `session.active` + `message.list` until the session
|
|
352
|
-
|
|
354
|
+
- Poll `session.active` + `message.list` until the session and all its descendants are idle and
|
|
355
|
+
the **latest-side** message page settles. Settlement always uses
|
|
353
356
|
`message.list({ limit: 50, order: 'desc' })` (newest first) — never
|
|
354
357
|
`order: 'asc'` page-0 + `at(-1)`, which reads an old page once the
|
|
355
|
-
|
|
358
|
+
session exceeds the limit.
|
|
359
|
+
- Family membership reuses `notifications/family-completion-gate.js`'s
|
|
360
|
+
`readSessionFamilyActivity`: only active IDs need metadata reads, shared
|
|
361
|
+
ancestors deduplicate within a probe, and concurrency is bounded to four.
|
|
362
|
+
Reads carry the run/recovery abort signal. A failed or malformed ancestry
|
|
363
|
+
read stays unknown; it cannot become successful empty activity. This same
|
|
364
|
+
rule covers ordinary and Goal runs, restart recovery, and continuation.
|
|
356
365
|
- OpenCode 2.0.16 emits a native `idle` tail whose `outcome` is authoritative:
|
|
357
366
|
`succeeded` → success; `failed` / `interrupted` → error. An unknown idle
|
|
358
367
|
outcome keeps polling. Read it only after `session.active` confirms the
|
|
@@ -3,6 +3,7 @@ import { DateTime } from 'luxon';
|
|
|
3
3
|
import parser from 'cron-parser';
|
|
4
4
|
import { makeOpenCodeV2Client } from '../opencode/v2-client.js';
|
|
5
5
|
import { getNativeSessionGoal } from '../opencode/native-goal.js';
|
|
6
|
+
import { readSessionFamilyActivity } from '../notifications/family-completion-gate.js';
|
|
6
7
|
import { buildScheduledTaskMetadata } from '../session-metadata/system-session.js';
|
|
7
8
|
import { SCHEDULED_SLOT_CLAIMED_CODE } from './run-history-store.js';
|
|
8
9
|
import {
|
|
@@ -389,6 +390,24 @@ const isSessionNotFoundError = (error) => {
|
|
|
389
390
|
return Number(error.status ?? error.statusCode ?? error.response?.status) === 404;
|
|
390
391
|
};
|
|
391
392
|
|
|
393
|
+
const isSessionFamilyBusy = async (client, sessionID, requestOptions) => {
|
|
394
|
+
const activeMap = await client.session.active(requestOptions);
|
|
395
|
+
if (!activeMap || typeof activeMap !== 'object' || Array.isArray(activeMap)) {
|
|
396
|
+
throw new Error('Unknown session activity');
|
|
397
|
+
}
|
|
398
|
+
if (Object.prototype.hasOwnProperty.call(activeMap, sessionID)) return true;
|
|
399
|
+
const { activeRoots } = await readSessionFamilyActivity({
|
|
400
|
+
loadActiveSessionIds: () => Object.keys(activeMap),
|
|
401
|
+
loadParent: async (id) => {
|
|
402
|
+
if (id === sessionID) return null;
|
|
403
|
+
const session = await client.session.get({ sessionID: id }, requestOptions);
|
|
404
|
+
if (!session || session.id !== id || session.error) throw new Error('Unknown session ancestry');
|
|
405
|
+
return session.parentID ?? null;
|
|
406
|
+
},
|
|
407
|
+
});
|
|
408
|
+
return activeRoots.has(sessionID);
|
|
409
|
+
};
|
|
410
|
+
|
|
392
411
|
const snapshotSessionOutcome = async ({
|
|
393
412
|
client,
|
|
394
413
|
sessionID,
|
|
@@ -398,21 +417,12 @@ const snapshotSessionOutcome = async ({
|
|
|
398
417
|
}) => {
|
|
399
418
|
const requestOptions = signal ? { signal } : undefined;
|
|
400
419
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
if (Object.prototype.hasOwnProperty.call(activeMap, sessionID)) {
|
|
409
|
-
return { outcome: 'busy' };
|
|
410
|
-
}
|
|
411
|
-
} catch (error) {
|
|
412
|
-
if (signal?.aborted) throw error;
|
|
413
|
-
// active failure = unknown; do not fall through to message.list success.
|
|
414
|
-
return { outcome: 'busy' };
|
|
415
|
-
}
|
|
420
|
+
try {
|
|
421
|
+
if (await isSessionFamilyBusy(client, sessionID, requestOptions)) return { outcome: 'busy' };
|
|
422
|
+
} catch (error) {
|
|
423
|
+
if (signal?.aborted) throw error;
|
|
424
|
+
// Activity or ancestry failure stays unknown, never idle-success.
|
|
425
|
+
return { outcome: 'busy' };
|
|
416
426
|
}
|
|
417
427
|
|
|
418
428
|
if (goalEnabled) {
|
|
@@ -865,16 +875,10 @@ export const createScheduledTasksRuntime = (deps) => {
|
|
|
865
875
|
signal?.throwIfAborted?.();
|
|
866
876
|
|
|
867
877
|
let sessionBusy = null;
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
sessionBusy = Object.prototype.hasOwnProperty.call(activeMap, sessionID);
|
|
873
|
-
}
|
|
874
|
-
// Malformed / thrown active stays null → unknown, keep polling.
|
|
875
|
-
} catch (error) {
|
|
876
|
-
if (signal?.aborted) throw error;
|
|
877
|
-
}
|
|
878
|
+
try {
|
|
879
|
+
sessionBusy = await isSessionFamilyBusy(client, sessionID, requestOptions);
|
|
880
|
+
} catch (error) {
|
|
881
|
+
if (signal?.aborted) throw error;
|
|
878
882
|
}
|
|
879
883
|
|
|
880
884
|
if (sessionBusy !== false) {
|