@yuriai/web 0.2.36 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/assets/AgentAvatar-Dpot7DG_.js +1 -0
- package/dist/assets/AssistantContactStatus-DBUeAOcC.js +3 -0
- package/dist/assets/AssistantUnreadBadge-uMPRfRqu.js +1 -0
- package/dist/assets/AssistantView-9v8wufOH.js +1 -0
- package/dist/assets/DiagramView-D317a0U8.js +1 -0
- package/dist/assets/FadeInOnReveal-DlU4WRpc.js +1 -0
- package/dist/assets/GuiPluginSurface-DHMppLxf.js +1 -0
- package/dist/assets/GuiPluginWindow-CWP-ZcJj.js +1 -0
- package/dist/assets/Icon-3udlHlix.js +1 -0
- package/dist/assets/ImageLoadingPlaceholder-D2CKCkHe.js +1 -0
- package/dist/assets/LoadingImage-CzTb95Cn.js +1 -0
- package/dist/assets/MarkdownRenderer-C1KveBTm.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-DBaGpRQS.js → MarkdownRendererImpl-Dfj5yBQH.js} +2 -2
- package/dist/assets/MarkstreamRendererImpl-DBWfVjRS.js +3 -0
- package/dist/assets/MobileDetailNavigation-D6pHFCLd.js +1 -0
- package/dist/assets/MobileResizableSheet-B9lJQT-Q.js +1 -0
- package/dist/assets/MobileShareBridge-BJDkko0y.js +4 -0
- package/dist/assets/MobileTabPageHeader-BdZ4z7qY.js +2 -0
- package/dist/assets/MultiRunWindow-C4sUyQMj.js +1 -0
- package/dist/assets/OnboardingScreen-tF0G9FoO.js +1 -0
- package/dist/assets/OverlayScrollbar-BhUMMoCN.js +1 -0
- package/dist/assets/SettingsView-Dk2vpPHM.js +29 -0
- package/dist/assets/SettingsWindow-Cl_MVXqd.js +1 -0
- package/dist/assets/SetupTourDialog-BGvxww7E.js +1 -0
- package/dist/assets/TerminalView-DCVU9yPv.js +8 -0
- package/dist/assets/{ToolOutputDialog-BhD4QiRH.js → ToolOutputDialog-BSNWZM5u.js} +4 -4
- package/dist/assets/VoiceSettings-C3KZYlyP.js +2 -0
- package/dist/assets/YuriLogo-CMoJ3Apd.js +1 -0
- package/dist/assets/{YuriWordmark-CGDlDvEH.js → YuriWordmark-DiB7p_ho.js} +1 -1
- package/dist/assets/{appThemeRegistry-2DEQy44q.js → appThemeRegistry-axRbeIwY.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-oatc8F4t.js → assistant-attachment-cache-B7NHgRWA.js} +1 -1
- package/dist/assets/bootstrap-CH0Mo2ok.js +9 -0
- package/dist/assets/{capgoAdapter-Dz8eMW5Y.js → capgoAdapter-C8QhPFlX.js} +1 -1
- package/dist/assets/checkbox-C641Uk-q.js +1 -0
- package/dist/assets/collapsible-YNp0uGvK.js +1 -0
- package/dist/assets/context-menu-BHe5nbZ0.js +1 -0
- package/dist/assets/desktop-DLxQTjzu.js +1 -0
- package/dist/assets/desktopHosts-Dk0D5ATF.js +1 -0
- package/dist/assets/desktopRelayRestore-COTsQw8C.js +1 -0
- package/dist/assets/{device-w1ioiqv3.js → device-BGox1QjM.js} +1 -1
- package/dist/assets/diagram-DZJvm12J.js +1 -0
- package/dist/assets/dialog-So-nuji1.js +1 -0
- package/dist/assets/{es-CPoqPlVn.js → es-BC7jaA0J.js} +2 -2
- package/dist/assets/{fileMentionTouchSelection-B-oPBD2a.js → fileMentionTouchSelection-CcBab6jA.js} +1 -1
- package/dist/assets/fileQueries-BBcsALlC.js +1 -0
- package/dist/assets/{fileReferenceActions-DrAZHld4.js → fileReferenceActions-DRECILCs.js} +1 -1
- package/dist/assets/{fileReferenceParser-1HHDBUum.js → fileReferenceParser-BayaidRM.js} +1 -1
- package/dist/assets/{fr-F7aQyu3-.js → fr-BIvcfHvS.js} +2 -2
- package/dist/assets/{gitApi-Dy__-dVB.js → gitApi-CXUPuRTB.js} +5 -5
- package/dist/assets/historyImportQueries-MpkoiK56.js +1 -0
- package/dist/assets/host-CzMYcPbz.js +1 -0
- package/dist/assets/image-loading-2ppAWcFZ.js +1 -0
- package/dist/assets/input-BK1Dm9vD.js +1 -0
- package/dist/assets/insertionBoundaries-DQRAPE-y.js +1 -0
- package/dist/assets/{ja-BVQSzC4w.js → ja-Dx_d9fYc.js} +2 -2
- package/dist/assets/{ko-DW2WaBw6.js → ko-CLQ_FtRR.js} +2 -2
- package/dist/assets/main-BVl-5tBj.js +169 -0
- package/dist/assets/main-CM26G9n0.js +2 -0
- package/dist/assets/{markdownHeightCache-D0fP62uP.js → markdownHeightCache-DMZ5GgoP.js} +1 -1
- package/dist/assets/mcpQueries-BFbulSUU.js +1 -0
- package/dist/assets/miniChat-CD9Pz0ZW.js +2 -0
- package/dist/assets/mobile-B3bArIND.js +2 -0
- package/dist/assets/{mobileBackNavigation-B-dgoPw6.js → mobileBackNavigation-D3-dwiiY.js} +1 -1
- package/dist/assets/multirun-CEyNjbIS.js +3 -0
- package/dist/assets/{native-config-CLcCZ6JT.js → native-config-stLNU1o7.js} +1 -1
- package/dist/assets/path-utils-HRmerlyU.js +1 -0
- package/dist/assets/{pl-BWVfAt6z.js → pl-BkPum7Gu.js} +3 -3
- package/dist/assets/platform-h8km2dnF.js +1 -0
- package/dist/assets/projectActions-C-9Z8R7y.js +1 -0
- package/dist/assets/projectMeta-2FoNc0nP.js +1 -0
- package/dist/assets/{pt-BR-BifD1KYG.js → pt-BR-DfT7YLHn.js} +2 -2
- package/dist/assets/pwa-CCJwn58X.js +2 -0
- package/dist/assets/queue-abort-optimistic-BZd3gflI.js +1 -0
- package/dist/assets/readiness-Djew2NvN.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-DdvkzG1o.js +2 -0
- package/dist/assets/renderMobileApp-D4aaygxO.js +28 -0
- package/dist/assets/runtime-file-download-Bz4NbKDi.js +1 -0
- package/dist/assets/runtime-file-resource-Btl3euLf.js +2 -0
- package/dist/assets/runtimeConfig-D4pEnoIh.js +2 -0
- package/dist/assets/runtimeEndpointReset-6jhYadQt.css +1 -0
- package/dist/assets/runtimeEndpointReset-DvSz9Dmf.js +149 -0
- package/dist/assets/{scheduledTaskNavigation-7dD6PWMD.js → scheduledTaskNavigation-BhsMoXS3.js} +1 -1
- package/dist/assets/select-IPdYq29J.js +1 -0
- package/dist/assets/sessionLookup-7Ux2A4fS.js +1 -0
- package/dist/assets/sortable-tabs-strip-pQbSLRMg.js +1 -0
- package/dist/assets/{speechSettingsQueries-sb0ZHAri.js → speechSettingsQueries-Cl_-LtPL.js} +1 -1
- package/dist/assets/src-BHDTEDdR.css +2 -0
- package/dist/assets/{store-Dvb_y7vz.js → store-BKKodkCp.js} +3 -3
- package/dist/assets/terminalApi-D2kNkPrJ.js +1 -0
- package/dist/assets/textarea-DSOIfiVX.js +1 -0
- package/dist/assets/tooltip-BuZUnYeV.js +1 -0
- package/dist/assets/{types-DD3a5G5L.js → types-DAssRFbW.js} +1 -1
- package/dist/assets/{uk-3_q1FN3X.js → uk-DgzBKB1K.js} +2 -2
- package/dist/assets/url-DO6Zrx1P.js +1 -0
- package/dist/assets/{useAppFontEffects-BBRIHYET.js → useAppFontEffects-Cjtcc4Sq.js} +58 -58
- package/dist/assets/{useAssistantUIStore-cHle1U5H.js → useAssistantUIStore-Jmh6rESU.js} +1 -1
- package/dist/assets/useDesktopWindowControlsLayout-BJx2ijlY.js +1 -0
- package/dist/assets/useDictation-BafHajO_.js +1 -0
- package/dist/assets/useEffectiveDirectory-AQOtdYdf.js +1 -0
- package/dist/assets/{useFontPreferences-D-AOjd9H.js → useFontPreferences-OCLG7Btz.js} +1 -1
- package/dist/assets/useMobileNavigationStore-l2L-r3RJ.js +17 -0
- package/dist/assets/usePluginsStore-DaZr5OE_.js +1 -0
- package/dist/assets/{useStreamingTextThrottle-C2ORuOtg.js → useStreamingTextThrottle-C1Dm4frL.js} +1 -1
- package/dist/assets/{useUIStore-B61bCFEM.js → useUIStore-DPo791La.js} +1 -1
- package/dist/assets/useWorkerHighlightedLines-DhJbTxdK.js +7 -0
- package/dist/assets/vendor-reactuses-core-CuTmqEMK.js +1 -0
- package/dist/assets/{zh-CN-DvlJbsyJ.js → zh-CN-DTKScxtm.js} +2 -2
- package/dist/assets/{zh-TW-B4FmXnzP.js → zh-TW-JOn8l2o2.js} +2 -2
- package/dist/index.html +19 -23
- package/dist/mini-chat.html +19 -23
- package/dist/mobile.html +19 -23
- package/package.json +1 -1
- package/server/index.js +4 -3
- package/server/lib/assistants/DOCUMENTATION.md +37 -5
- package/server/lib/assistants/contact-store.js +8 -1
- package/server/lib/assistants/contact-tools.js +6 -6
- package/server/lib/assistants/contact-tools.test.js +4 -2
- package/server/lib/assistants/harness.js +14 -8
- package/server/lib/assistants/harness.test.js +33 -0
- package/server/lib/assistants/pi-tools.js +15 -2
- package/server/lib/assistants/pi-tools.test.js +35 -1
- package/server/lib/assistants/service.js +6 -9
- package/server/lib/assistants/service.test.js +90 -12
- package/server/lib/assistants/summary.js +2 -0
- package/server/lib/assistants/tool-execution.js +53 -0
- package/server/lib/assistants/tool-execution.test.js +82 -0
- package/server/lib/assistants/yuri-project.http.test.js +2 -3
- package/server/lib/assistants/yuri-tools.js +1 -1
- package/server/lib/git/DOCUMENTATION.md +3 -0
- package/server/lib/git/service.js +9 -3
- package/server/lib/git/worktrees.catalog.test.js +31 -0
- package/server/lib/notifications/DOCUMENTATION.md +34 -0
- package/server/lib/notifications/session-unread-runtime.js +101 -0
- package/server/lib/notifications/session-unread-store.js +93 -0
- package/server/lib/notifications/session-unread.test.js +176 -0
- package/server/lib/opencode/feature-routes-runtime.js +22 -1
- package/server/lib/opencode/session-directory-runtime.js +29 -3
- package/server/lib/opencode/session-directory-runtime.test.js +78 -0
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +12 -0
- package/server/lib/scheduled-tasks/runtime.js +24 -0
- package/server/lib/scheduled-tasks/runtime.test.js +41 -0
- package/server/lib/session-index/DOCUMENTATION.md +9 -0
- package/server/lib/session-index/sync-runtime.js +10 -1
- package/dist/assets/AgentAvatar-0zDTBIBH.js +0 -1
- package/dist/assets/AssistantContactStatus-CqBzrMI3.js +0 -3
- package/dist/assets/AssistantUnreadBadge-CqMHWeGm.js +0 -1
- package/dist/assets/AssistantView-DSnDwWGc.js +0 -1
- package/dist/assets/DiagramView-xGg1oS8b.js +0 -1
- package/dist/assets/FadeInOnReveal-C_UU65YY.js +0 -1
- package/dist/assets/GuiPluginSurface-Dpiaq__1.js +0 -1
- package/dist/assets/GuiPluginWindow-B0oHkEwj.js +0 -1
- package/dist/assets/Icon-BNzwtZlI.js +0 -1
- package/dist/assets/ImageLoadingPlaceholder-CH4TCRvH.js +0 -1
- package/dist/assets/LoadingImage-C6jr50EL.js +0 -1
- package/dist/assets/MarkdownRenderer-BonJRvHM.js +0 -2
- package/dist/assets/MarkstreamRendererImpl-DcxDrUW1.js +0 -3
- package/dist/assets/MobileDetailNavigation-DacHr77a.js +0 -1
- package/dist/assets/MobileResizableSheet-DZ7Kq3ZS.js +0 -1
- package/dist/assets/MobileShareBridge-CKDkjJIK.js +0 -4
- package/dist/assets/MobileTabPageHeader-CT5jeuHU.js +0 -2
- package/dist/assets/MultiRunWindow-GFioSTDw.js +0 -1
- package/dist/assets/OnboardingScreen-DAiSh2kq.js +0 -1
- package/dist/assets/OverlayScrollbar-5yODT_nG.js +0 -1
- package/dist/assets/SettingsView-BoDwWc6-.js +0 -29
- package/dist/assets/SettingsWindow-BGPVsXUi.js +0 -1
- package/dist/assets/SetupTourDialog-CM8-QHJ3.js +0 -1
- package/dist/assets/TerminalView-BnR50Mgm.js +0 -8
- package/dist/assets/VoiceSettings-BeMRGXfr.js +0 -2
- package/dist/assets/YuriLogo-D7QXHCf6.js +0 -1
- package/dist/assets/bootstrap-Bi91NjXG.js +0 -3
- package/dist/assets/button-CPRnAdlm.js +0 -1
- package/dist/assets/checkbox-DZkjNegP.js +0 -1
- package/dist/assets/collapsible-CP7z1jKL.js +0 -1
- package/dist/assets/context-menu-B8yin969.js +0 -1
- package/dist/assets/desktop-BAmoc_34.js +0 -1
- package/dist/assets/desktopHosts-BLU1tGSX.js +0 -1
- package/dist/assets/desktopRelayRestore-2BIIs8mZ.js +0 -1
- package/dist/assets/diagram-O7VUqG75.js +0 -1
- package/dist/assets/dialog-Dq8l3IQC.js +0 -1
- package/dist/assets/fileQueries-C2Rs6TPz.js +0 -1
- package/dist/assets/gitApiHttp-CKrsk1tw.js +0 -7
- package/dist/assets/historyImportQueries-C8VK9R5_.js +0 -1
- package/dist/assets/host-z9PU8q1e.js +0 -1
- package/dist/assets/image-loading-DKQOYtti.js +0 -1
- package/dist/assets/input-9A1m0Yjq.js +0 -1
- package/dist/assets/insertionBoundaries-DdpR3zaP.js +0 -1
- package/dist/assets/main-B2Bi3ueT.js +0 -2
- package/dist/assets/main-CpoO7VOS.js +0 -169
- package/dist/assets/mcpQueries-DcbmHgNY.js +0 -1
- package/dist/assets/miniChat-C52LB0Yu.js +0 -2
- package/dist/assets/mobile-U4WSU-8R.js +0 -2
- package/dist/assets/multirun-VckoCH5p.js +0 -3
- package/dist/assets/path-utils-jGozTg9d.js +0 -1
- package/dist/assets/pathNormalization-ewtPqJWn.js +0 -1
- package/dist/assets/platform-sEg2IOLZ.js +0 -1
- package/dist/assets/projectActions-BX0cjZoq.js +0 -1
- package/dist/assets/projectMeta-BYNpABmO.js +0 -1
- package/dist/assets/pwa--whpkoe7.js +0 -2
- package/dist/assets/queryRuntime-2dx7jbt9.js +0 -1
- package/dist/assets/queue-abort-optimistic-CsU9CtHa.js +0 -1
- package/dist/assets/readiness-CafO-iNt.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-BOZWsCQP.js +0 -2
- package/dist/assets/renderMobileApp-Cc6uK66H.js +0 -28
- package/dist/assets/runtime-file-download-D6bwc3Kj.js +0 -1
- package/dist/assets/runtime-file-resource-BP4P52ry.js +0 -2
- package/dist/assets/runtimeAPIRegistry-C2VogTny.js +0 -1
- package/dist/assets/runtimeConfig-Coh1hryT.js +0 -2
- package/dist/assets/runtimeEndpointReset-BP4JwHFJ.css +0 -1
- package/dist/assets/runtimeEndpointReset-Bwm_RwzE.js +0 -149
- package/dist/assets/select-BNDVM5KL.js +0 -1
- package/dist/assets/sessionLookup-BI6ygHcL.js +0 -1
- package/dist/assets/sortable-tabs-strip-lZ6K_9ug.js +0 -1
- package/dist/assets/src-B_i0g2Ca.css +0 -2
- package/dist/assets/terminalApi-Bo6KWljy.js +0 -1
- package/dist/assets/textarea-Ds63PD7U.js +0 -1
- package/dist/assets/tooltip-C25g1ojI.js +0 -1
- package/dist/assets/url-MRa-FtQa.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-CTSEy8Ep.js +0 -1
- package/dist/assets/useDictation-ozXiBIfG.js +0 -1
- package/dist/assets/useEffectiveDirectory-DO311OTB.js +0 -1
- package/dist/assets/useMobileNavigationStore-D59MROJU.js +0 -17
- package/dist/assets/usePluginsStore-3VJgeLvf.js +0 -1
- package/dist/assets/useWorkerHighlightedLines-DaoXaYxw.js +0 -7
- package/dist/assets/vendor-reactuses-core-DWo5Wn6R.js +0 -1
package/dist/index.html
CHANGED
|
@@ -571,44 +571,40 @@
|
|
|
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-CM26G9n0.js"></script>
|
|
575
575
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
578
578
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
579
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
580
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
581
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
582
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
579
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-HRmerlyU.js">
|
|
580
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-DLxQTjzu.js">
|
|
581
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-Dk0D5ATF.js">
|
|
582
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-COTsQw8C.js">
|
|
583
583
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CzHs0bHY.js">
|
|
584
584
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-vDaAPGfl.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
586
586
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-cQ47ywrT.js">
|
|
587
587
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
588
588
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
589
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
589
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-DPo791La.js">
|
|
590
590
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DlzBev0S.js">
|
|
591
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-Y_YoRHtC.js">
|
|
592
|
-
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-2dx7jbt9.js">
|
|
593
591
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
594
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
595
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
596
|
-
<link rel="modulepreload" crossorigin href="/assets/bootstrap-Bi91NjXG.js">
|
|
592
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-Y_YoRHtC.js">
|
|
597
593
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-B-Wpqq5J.js">
|
|
598
|
-
<link rel="modulepreload" crossorigin href="/assets/fileQueries-
|
|
594
|
+
<link rel="modulepreload" crossorigin href="/assets/fileQueries-BBcsALlC.js">
|
|
599
595
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
600
|
-
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
601
596
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
602
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
603
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
604
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
605
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
606
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
607
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
608
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
609
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
610
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
611
|
-
<link rel="
|
|
597
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-Btl3euLf.js">
|
|
598
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-h8km2dnF.js">
|
|
599
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
600
|
+
<link rel="modulepreload" crossorigin href="/assets/bootstrap-CH0Mo2ok.js">
|
|
601
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-D2kNkPrJ.js">
|
|
602
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Bz4NbKDi.js">
|
|
603
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DAssRFbW.js">
|
|
604
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-C8QhPFlX.js">
|
|
605
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-stLNU1o7.js">
|
|
606
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-D4pEnoIh.js">
|
|
607
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BHDTEDdR.css">
|
|
612
608
|
</head>
|
|
613
609
|
<body class="h-full bg-background text-foreground">
|
|
614
610
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -77,44 +77,40 @@
|
|
|
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-CD9Pz0ZW.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-HRmerlyU.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-DLxQTjzu.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-Dk0D5ATF.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-COTsQw8C.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CzHs0bHY.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-vDaAPGfl.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-cQ47ywrT.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
94
94
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-DPo791La.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DlzBev0S.js">
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-Y_YoRHtC.js">
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-2dx7jbt9.js">
|
|
99
97
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/bootstrap-Bi91NjXG.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-Y_YoRHtC.js">
|
|
103
99
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-B-Wpqq5J.js">
|
|
104
|
-
<link rel="modulepreload" crossorigin href="/assets/fileQueries-
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/fileQueries-BBcsALlC.js">
|
|
105
101
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
106
|
-
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
107
102
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
116
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
117
|
-
<link rel="
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-Btl3euLf.js">
|
|
104
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-h8km2dnF.js">
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/bootstrap-CH0Mo2ok.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-D2kNkPrJ.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Bz4NbKDi.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DAssRFbW.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-C8QhPFlX.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-stLNU1o7.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-D4pEnoIh.js">
|
|
113
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BHDTEDdR.css">
|
|
118
114
|
</head>
|
|
119
115
|
<body class="h-full bg-background text-foreground">
|
|
120
116
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,44 +64,40 @@
|
|
|
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-B3bArIND.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/path-utils-HRmerlyU.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-DLxQTjzu.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-Dk0D5ATF.js">
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-COTsQw8C.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CzHs0bHY.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-vDaAPGfl.js">
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-cQ47ywrT.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-DPo791La.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DlzBev0S.js">
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-Y_YoRHtC.js">
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-2dx7jbt9.js">
|
|
86
84
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/bootstrap-Bi91NjXG.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-Y_YoRHtC.js">
|
|
90
86
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-B-Wpqq5J.js">
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/fileQueries-
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/fileQueries-BBcsALlC.js">
|
|
92
88
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
93
|
-
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
94
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
104
|
-
<link rel="
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-Btl3euLf.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-h8km2dnF.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/bootstrap-CH0Mo2ok.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-D2kNkPrJ.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Bz4NbKDi.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DAssRFbW.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-C8QhPFlX.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-stLNU1o7.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-D4pEnoIh.js">
|
|
100
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BHDTEDdR.css">
|
|
105
101
|
</head>
|
|
106
102
|
<body class="h-full bg-background text-foreground">
|
|
107
103
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
projectSessionLifecyclePayload,
|
|
95
95
|
projectSessionWithStoredMap,
|
|
96
96
|
} from './lib/session-metadata/session-projection.js';
|
|
97
|
-
import { createScheduledTasksRuntime } from './lib/scheduled-tasks/runtime.js';
|
|
97
|
+
import { createScheduledTasksRuntime, isScheduledTasksRuntimeEnabled } from './lib/scheduled-tasks/runtime.js';
|
|
98
98
|
import { createScheduledTaskRunHistoryStore } from './lib/scheduled-tasks/run-history-store.js';
|
|
99
99
|
import { createServerStartupRuntime } from './lib/opencode/server-startup-runtime.js';
|
|
100
100
|
import { createTunnelWiringRuntime } from './lib/opencode/tunnel-wiring-runtime.js';
|
|
@@ -1185,9 +1185,9 @@ const waitForAgentPresence = (...args) => openCodeLifecycleRuntime.waitForAgentP
|
|
|
1185
1185
|
const refreshOpenCodeAfterConfigChange = (...args) => openCodeLifecycleRuntime.refreshOpenCodeAfterConfigChange(...args);
|
|
1186
1186
|
const startHealthMonitoring = () => openCodeLifecycleRuntime.startHealthMonitoring(HEALTH_CHECK_INTERVAL);
|
|
1187
1187
|
const triggerHealthCheck = () => openCodeLifecycleRuntime.triggerHealthCheck();
|
|
1188
|
-
const scheduledTaskRunHistoryStore = createScheduledTaskRunHistoryStore({
|
|
1188
|
+
const scheduledTaskRunHistoryStore = isScheduledTasksRuntimeEnabled() ? createScheduledTaskRunHistoryStore({
|
|
1189
1189
|
dbPath: path.join(YURI_DATA_DIR, 'scheduled-task-runs.sqlite'),
|
|
1190
|
-
});
|
|
1190
|
+
}) : null;
|
|
1191
1191
|
const scheduledTasksRuntime = createScheduledTasksRuntime({
|
|
1192
1192
|
projectConfigRuntime,
|
|
1193
1193
|
listProjects: async () => {
|
|
@@ -1505,6 +1505,7 @@ async function main(options = {}) {
|
|
|
1505
1505
|
getOpenCodeAuthHeaders,
|
|
1506
1506
|
waitForOpenCodeReady,
|
|
1507
1507
|
fetchFn: indexSessionDirectories.fetchSessionList,
|
|
1508
|
+
createFetchBatch: indexSessionDirectories.createFetchBatch,
|
|
1508
1509
|
isDirectoryMissing: indexSessionDirectories.isDirectoryMissing,
|
|
1509
1510
|
resolveDirectory: indexSessionDirectories.resolveDirectory,
|
|
1510
1511
|
projectSessions: (sessions) => {
|
|
@@ -106,6 +106,21 @@ return the timestamp actually inserted, and snapshot tests require a finite valu
|
|
|
106
106
|
|
|
107
107
|
## Recoverable contact errors
|
|
108
108
|
|
|
109
|
+
Every contact tool invocation has a Host-enforced 300-second ceiling, including
|
|
110
|
+
pi file/shell tools, Yuri operations, deferred tools, read-only background tools,
|
|
111
|
+
and result-phase resource references. Existing shorter deadlines remain in force.
|
|
112
|
+
The bash schema and execution arguments also cap/default `timeout` at 300 seconds;
|
|
113
|
+
the pi Node execution environment kills the shell process group on timeout/abort.
|
|
114
|
+
This bounds tool execution, not model inference or an admitted worker's lifetime.
|
|
115
|
+
|
|
116
|
+
`tool-execution.js` owns the turn-local deadline and cancellation wrapper. A timeout
|
|
117
|
+
aborts its signal, returns an explicit error/unknown outcome, suppresses late
|
|
118
|
+
updates, and disables further operations for that contact turn (including queued
|
|
119
|
+
calls in the same batch). It never retries an ambiguous mutation. Uncooperative
|
|
120
|
+
external operations may still commit after cancellation; read authoritative state
|
|
121
|
+
before a later retry. Completed side effects are not rolled back. User cancellation
|
|
122
|
+
also releases the waiter without waiting for an uncooperative tool to finish.
|
|
123
|
+
|
|
109
124
|
Contact model requests have no Yuri generation time limit (`timeoutMs: 0`).
|
|
110
125
|
Empty text-only model replies recover in the same generation call with capped
|
|
111
126
|
exponential backoff (500ms up to 30s), without an attempt limit, until a reply or
|
|
@@ -225,11 +240,23 @@ reasoning display.
|
|
|
225
240
|
|
|
226
241
|
### Scheduled-task result review
|
|
227
242
|
|
|
243
|
+
Scheduled and assigned-worker result bubbles keep their stable Host `turnID`
|
|
244
|
+
provenance in the LLM-only history projection. They are explicitly marked as
|
|
245
|
+
background notifications, not answers to an adjacent user request or fresh user
|
|
246
|
+
authorization. The same projection feeds rolling summaries, whose instructions
|
|
247
|
+
retain this distinction. SQLite/UI reply text is unchanged; existing transcripts
|
|
248
|
+
need no migration.
|
|
249
|
+
|
|
228
250
|
- `schedule_task` retains the existing assistant/project/task mapping. The task
|
|
229
251
|
prompt preserves the user's delivery intent. A terminal run is handed from the
|
|
230
252
|
scheduler to `reportScheduledTaskResult`; prompt admission and intermediate
|
|
231
253
|
session events do not wake the contact. Associations created after the run
|
|
232
254
|
started do not receive its historical result.
|
|
255
|
+
- A new task belongs to the calling contact, and its result returns there. The
|
|
256
|
+
task tool description and pre-load `yuri.tasks` description expose that ownership.
|
|
257
|
+
For another contact's work, the coordinator creates/resolves that contact and
|
|
258
|
+
sends the complete scheduling request with `message_assistant`; the recipient
|
|
259
|
+
creates it with its normal tools. A message admission is not task completion.
|
|
233
260
|
- Each live owner receives a read-only contact-lane turn with the captured
|
|
234
261
|
contact configuration, the run's original task prompt, authoritative outcome,
|
|
235
262
|
error and bounded worker output. `read_session` can fetch the full result.
|
|
@@ -561,7 +588,7 @@ and keep their existing error result handling.
|
|
|
561
588
|
- **Completion receipt:** consuming a successful notification-enabled watch inserts one additional ordinary session-reference card in the same transaction as the old card update and release. Its stable resume-derived receipt ID is claimed once across Hosts. It does not create/rearm a watch or fabricate a text bubble, and remains available even if the model review is silent or fails. Existing UI session-summary diff presentation is reused (real non-zero changes only); parent idle alone cannot override the server's busy/retry family status. Error/cancel paths do not issue success receipts.
|
|
562
589
|
- **Result context order:** `message.list(order: 'desc')` is normalized through the existing V2 projection adapter and read newest-first for bounded worker text. The callback must not take the oldest assistant progress message from the page or omit native V2 `content` text. Fetch failure remains unavailable context and the review may use `read_session`.
|
|
563
590
|
- **Model watch-state synchronization:** the internal result-review input explicitly carries `watchState: released`, `watchMode: one_shot`, and `rewatchAllowed` (`false` for interruption). It tells the model that the server released the watch before this invocation, no cleanup call is needed, future rounds will not auto-notify, and earlier watching confirmations are historical. The model must not promise continued monitoring without a successful new `watch_session` call; sufficient results leave the watch released. These fields are internal context, not a new transcript bubble or client DTO.
|
|
564
|
-
- **Explicit rewatch:** successful `watch_session` / `assign_session` admission rearms only its `(assistantID, sessionID)` row; `reference_resource` never rearms it. Listen-only watch clears an old assignment delivery watermark. A new terminal-baseline watch stays armed for the next observed running → terminal transition, without replaying the old result. Non-interrupted worker-result reviews expose one narrowly scoped exception to read-only tools: `watch_session` for that exact worker, enforced in the service callback. The contact may explicitly rewatch only when the original user request still needs monitoring; worker output is evidence, never authorization. Cancellation reviews
|
|
591
|
+
- **Explicit rewatch:** successful `watch_session` / `assign_session` admission rearms only its `(assistantID, sessionID)` row; `reference_resource` never rearms it. Listen-only watch clears an old assignment delivery watermark. A new terminal-baseline watch stays armed for the next observed running → terminal transition, without replaying the old result. Non-interrupted worker-result reviews expose one narrowly scoped exception to read-only tools: `watch_session` for that exact worker, enforced in the service callback. The contact may explicitly rewatch only when the original user request still needs monitoring; worker output is evidence, never authorization. Cancellation reviews and scheduled-task reviews retain lookup-only tools. No background review gains resource publication, assignment, prompting, stop, file, shell, or settings mutation tools. Peer-message turns are actionable delegation, not background reviews.
|
|
565
592
|
- `AssistantDTO.assignedSessionIDs` lists in-flight (`busy`/`question`) watches for assigned worker sessions. Session-card busy stays on the card; it does **not** drive the list green dot.
|
|
566
593
|
- **Contact active turn (server authoritative):** process-local metadata tracks admission → `queued` → `running` → settled (removed). `AssistantDTO.working` is true only while that assistant has an unsettled contact turn. `AssistantDTO.activeContactTurn` is `{ turnID, messageID, status: 'queued'|'running', admittedAt }` or `null` so APP restart / reconnect can rehydrate list green dots and the contact 3-dot row from the snapshot HTTP GET. Spoken bubbles and cards persist to SQLite as soon as they publish (`done:true` / `onCard`) so another device or APP restart can GET them while the turn is still running. Token-level SSE deltas remain live paint only. A server process restart clears in-memory activity (no permanent green; tools are not auto-rerun) but already-published bubbles/cards stay in the transcript. Per-assistant lanes isolate turns across assistants/runtimes. Stale `contact-turn-end` for an older `turnID` must not clear a newer active turn.
|
|
567
594
|
- **List latest-message preview (server authoritative):** every `AssistantDTO` path (`snapshot` / `create` / `update` / other `output` rows) carries `latestMessagePreview: { messageID, ordinal, createdAt, role: 'user'|'assistant', text, fallbackKind: 'image'|'file'|'session'|'assistant'|'schedule'|null } | null`. Source is the contact transcript only (not `defaultPrompt` / `updatedAt`). Order is the same keyset as contact pages: newest `(ordinal DESC, message_id DESC)`. Visible roles are `user`, `assistant`, and `peer` (peer maps to `role: 'user'` because inbound DMs are user-visible). Internal assigned-session settle markers (`oc.settle.*`) are excluded in the SQL candidate probe (and again in `buildContactMessagePreview`). Recoverable errors are excluded in SQL and the preview projector and cannot replace the preview. Plain text is sanitized and capped at `CONTACT_PREVIEW_MAX_CHARS` (500) with no data-URL/base64 bodies. File-only rows set `fallbackKind` `image`/`file`; pure cards set `session`/`assistant`/`schedule`. Empty transcript → `null`. **Snapshot cost:** one prepared statement reused per assistant (`assistant_id` + indexed `ORDER BY ordinal DESC, message_id DESC LIMIT candidateLimit`, catalog ≤100) collecting only those bounded candidates, then **one** parts `IN` query — not a window/`ROW_NUMBER` over full multi-assistant history and not HTTP N+1. SQL already drops pure settle tails so they cannot exhaust the LIMIT and hide an older real bubble; remaining non-preview empty rows may still consume a candidate slot within that same LIMIT. Admission, assistant completion, peer DM, card insert, wipe, and clear-memory already bump domain revision / `yuri:assistants-changed`; clients re-GET snapshot for the new preview. Clear-memory keeps transcript rows so the preview still reflects the last bubble; clear-history / reset remove rows so the preview becomes the wipe confirm (or `null` after a full unbounded wipe with no remaining user).
|
|
@@ -637,14 +664,19 @@ Reply language follows the user's latest substantive message and conversation co
|
|
|
637
664
|
materialize (owned read) may still complete for the running turn.
|
|
638
665
|
- Legacy data-URL migration: batch 20 / 50 MiB, write disk first, CAS-replace `part_json`; failure keeps old JSON.
|
|
639
666
|
|
|
640
|
-
**Inter-assistant DM (
|
|
667
|
+
**Inter-assistant DM (actionable delegation)**
|
|
641
668
|
|
|
642
669
|
- `message_assistant` is the contact tool for natural language (给 PeerQA 说一声 / tell PeerQA). It calls in-process `deliverPeerMessage` and confirms delivery, not completion of the recipient reply. No card required. The user never types `/dm`.
|
|
643
670
|
- `POST /:fromAssistantID/contact/dm` `{ toAssistantID, text, parts?, messageID? }` delivers into B’s contact transcript as `role: 'peer'` with `fromAssistantID` / `fromAssistantName`. Admission remains synchronous (HTTP 201) and queues exactly one asynchronous recipient turn using that message ID. Same ID + sender + recipient + canonical parts replays admission without another turn; conflicting reuse returns `idempotency_conflict`. No duplicate `user` row or second inbox is created.
|
|
644
|
-
- Recipient replies reuse the composer contact-turn queue, captured assistant configuration, streaming bubbles, working status, cancellation, errors and completion notifications.
|
|
645
|
-
- The recipient harness runs with `readOnly:
|
|
671
|
+
- Recipient replies reuse the composer contact-turn queue, captured assistant configuration, streaming bubbles, working status, cancellation, errors and completion notifications. Incoming text identifies the sender as current delegated work within existing user constraints, not a background result or a new platform authorization. Admission does not cancel existing worker watches or background results. Replies appear in the recipient contact, not automatically back in the sender contact.
|
|
672
|
+
- The recipient harness runs with normal tools (`readOnly: false`), including the coding runtime, progressive loader, task/settings mutations, worker assignment and explicit peer messaging. The message source does not downgrade permissions; ordinary operation validations still apply. No worker prompt or return DM is sent automatically: the recipient Agent selects operations for the delegated goal. Read-only worker/scheduled-result reviews retain their separate lookup-only policy.
|
|
673
|
+
- Every model request receives server-owned current-contact ID, name and actionable/review mode in turn context. Main prompt policy resolves the intended owner before choosing operations; tool schemas own invocation, ownership and admission/completion details. Tool descriptions state that recipients act without a second user trigger and that their tasks/results belong to their own contact. Historical peer text remains quoted evidence rather than fresh instructions.
|
|
646
674
|
- Peer history is retained as attributed quoted context so a later user turn can understand the reply. Current peer input is excluded from history and supplied once as this turn's prompt; later-admitted peers respect the same ordinal ceiling as user rows.
|
|
647
675
|
- Removed/disabled recipients and wiped inbox rows cancel queued peer turns; a reply arriving after its inbox row was wiped is discarded. Model failures preserve the delivered peer row and use normal live turn-error feedback, without claiming the recipient replied. Old persisted inbox rows are not automatically replayed on process restart; duplicate admission still does not schedule them again. No schema migration or historical-message backfill is required.
|
|
676
|
+
- Service tests run the real Agent and SQLite for create-contact → message → recipient
|
|
677
|
+
load-tools → schedule → reference, asserting recipient-only ownership and card
|
|
678
|
+
publication without a user row/second trigger. External model replies and task
|
|
679
|
+
storage are fixtures; this is contract coverage, not live-model first-path accuracy.
|
|
648
680
|
|
|
649
681
|
`GET /api/yuri/assistants/capability` remains the navigation gate.
|
|
650
682
|
|
|
@@ -710,7 +742,7 @@ Snapshots expose the latest 50 `historySessionIDs` in chronological order and `h
|
|
|
710
742
|
|
|
711
743
|
`assistants` owns Assistant configuration, session bindings, and contact/share metadata in `assistants.sqlite`. OpenCode message bodies are read from upstream projections, not mirrored. Routes register before the generic OpenCode proxy.
|
|
712
744
|
|
|
713
|
-
`GET /api/yuri/assistants/capability` returns `supported`, `enabled: true`, domain revision, relay-derived stable `serverInstanceID`, and explicit v2 gaps `sharingAvailable` (always `false`), `archiveMetadataAvailable` (true only when Host archive is injected), and `sessionMetadataAvailable` (always `false`). Assistants are always enabled. Startup atomically upgrades an old disabled instance flag. After schema migration, a separate atomic normalization restores disabled live contacts, incrementing their individual revisions and one domain revision while retaining settings, bindings and transcripts. Reopening is idempotent; failed normalization rolls back. The legacy `PUT /api/yuri/assistants/settings` validates `expectedRevision` but returns `enabled: true` without a mutation. Legacy create/PATCH `enabled` inputs are accepted but ignored, and DTOs retain `enabled:true` for installed clients. No individual disable setting or runtime admission/background-review gate remains. CRUD and snapshots live under `/api/yuri/assistants`. Session routes are `POST /:id/session/ensure`, `/:id/session/new`, and `/:id/session/compact`; composer sends use `POST /:id/messages` (contact harness, not `session.prompt`); contact history is `GET /:id/contact/messages` (full transcript, including rows before a clear-memory boundary); contact reset wipe is `POST /:id/contact/reset`; shared contact read watermark is `POST /:id/contact/read`; session cards are `POST /:id/contact/cards`;
|
|
745
|
+
`GET /api/yuri/assistants/capability` returns `supported`, `enabled: true`, domain revision, relay-derived stable `serverInstanceID`, and explicit v2 gaps `sharingAvailable` (always `false`), `archiveMetadataAvailable` (true only when Host archive is injected), and `sessionMetadataAvailable` (always `false`). Assistants are always enabled. Startup atomically upgrades an old disabled instance flag. After schema migration, a separate atomic normalization restores disabled live contacts, incrementing their individual revisions and one domain revision while retaining settings, bindings and transcripts. Reopening is idempotent; failed normalization rolls back. The legacy `PUT /api/yuri/assistants/settings` validates `expectedRevision` but returns `enabled: true` without a mutation. Legacy create/PATCH `enabled` inputs are accepted but ignored, and DTOs retain `enabled:true` for installed clients. No individual disable setting or runtime admission/background-review gate remains. CRUD and snapshots live under `/api/yuri/assistants`. Session routes are `POST /:id/session/ensure`, `/:id/session/new`, and `/:id/session/compact`; composer sends use `POST /:id/messages` (contact harness, not `session.prompt`); contact history is `GET /:id/contact/messages` (full transcript, including rows before a clear-memory boundary); contact reset wipe is `POST /:id/contact/reset`; shared contact read watermark is `POST /:id/contact/read`; session cards are `POST /:id/contact/cards`; actionable inter-assistant DMs are `POST /:fromID/contact/dm`; assistant-owned scheduled tasks are `GET /:id/scheduled-tasks`. Shares still use `POST /:id/share` and `GET /share-operations/:operationID`.
|
|
714
746
|
|
|
715
747
|
Both HTTP snapshot aliases call `ensureDefaultAssistant` before reading. A never-used catalog automatically gets one enabled `Yuri` contact in its managed workspace, with no OpenCode session or model call. It uses the configured default model/variant if connected, otherwise the first connected catalog model. No configured models leaves the catalog empty until a later read after provider setup; catalog/preferences failures reject the read and remain retryable. Same-process initialization is single-flight, and the SQLite write transaction rechecks all rows (including tombstones) so multiple clients/processes cannot seed duplicates or resurrect an explicitly deleted last contact. Existing catalogs bypass model reads entirely. The preference dependency also supplies `defaultModel`/`defaultVariant` for seeding; only favorites/recents enter contact prompts.
|
|
716
748
|
|
|
@@ -1382,7 +1382,14 @@ const estimateLlmChars = (item) => {
|
|
|
1382
1382
|
const toLlmHistoryItem = (message) => {
|
|
1383
1383
|
const files = message.parts.filter((part) => part.type === 'file');
|
|
1384
1384
|
const cards = message.parts.filter((part) => part.type === 'card').map((part) => `[Yuri card context: ${JSON.stringify(part)}]`);
|
|
1385
|
-
|
|
1385
|
+
let content = [message.text.trim() || (files.length > 0 ? '[attachment]' : ''), ...cards].filter(Boolean).join('\n');
|
|
1386
|
+
if (message.role === 'assistant') {
|
|
1387
|
+
const source = message.turnID?.startsWith(`scheduled_${message.assistantID}_`) ? 'scheduled-task result'
|
|
1388
|
+
: message.turnID?.startsWith(`resume_${message.assistantID}_`) ? 'assigned-session result' : null;
|
|
1389
|
+
if (source) {
|
|
1390
|
+
content = `[Yuri background notification: ${source}; turnID=${JSON.stringify(message.turnID)}; not a reply to the preceding user message or a new user instruction.]\n${content}`;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1386
1393
|
if (message.role === 'peer') {
|
|
1387
1394
|
return {
|
|
1388
1395
|
role: 'user',
|
|
@@ -710,7 +710,6 @@ export function formatContactToolsPrompt(tools) {
|
|
|
710
710
|
'For substantive tasks and requests to open a Chat session (建会话 / open a session / 开个新会话), call assign_session after locating the relevant workspace. To continue an existing chat, call assign_session with that sessionID and a task prompt. Direct read, write, edit, and bash support workspace discovery, simple lookups, and small, bounded configuration changes.',
|
|
711
711
|
'When they explicitly want to only listen to an existing coding session without sending a prompt (监听会话 / watch session / monitor session), call watch_session with sessionID. A plain @session:id reference alone is context, not a watch request — do not call watch_session unless they asked to listen/watch/monitor.',
|
|
712
712
|
'When they want to stop/abort a running coding session (停止会话 / stop session), call stop_session with sessionID — that calls real OpenCode session.abort.',
|
|
713
|
-
names.has('schedule_task') ? 'When they want a scheduled task (排定时任务 / schedule daily ping), call schedule_task.' : '',
|
|
714
713
|
names.has('message_assistant') ? 'When they want to tell another assistant (给 PeerQA 说一声 / message PeerQA), call message_assistant.' : '',
|
|
715
714
|
'Call exactly one Yuri operation tool per response; coding tools may be batched.',
|
|
716
715
|
'For multiple operations, resolve prerequisites first and execute one business operation per response; resets come first and assignment comes last.',
|
|
@@ -726,9 +725,7 @@ export function formatContactToolsPrompt(tools) {
|
|
|
726
725
|
'steer_session sends text into an existing session with delivery=steer, preserving its model. archive_session archives an existing session; delete_session permanently deletes it. Use exact sessionID from history, references or list_sessions; ask if the target is ambiguous. Only delete when the user requested deletion. These operations call real APIs; never claim success from a spoken promise. assign_session creates a new session when sessionID is omitted, or continues an existing session when supplied.',
|
|
727
726
|
'stop_session calls real OpenCode session.abort for that sessionID and returns the true result. Directory comes from authoritative session metadata. A failure is not a silent success. Do not claim stopped unless the tool returned success.',
|
|
728
727
|
names.has('create_assistant') ? 'create_assistant reuses already-connected OpenCode providers (providerID/modelID). Mode is continuous.' : '',
|
|
729
|
-
names.has('schedule_task') ? 'schedule_task writes the same payload as PUT /api/projects/:id/scheduled-tasks onto a registered project. It only creates new tasks.' : '',
|
|
730
728
|
names.has('update_scheduled_task') ? 'To change existing scheduled tasks, call list_scheduled_tasks, then update_scheduled_task with the exact taskID and projectID. Update one task per call and pass only changed fields.' : '',
|
|
731
|
-
names.has('message_assistant') ? 'message_assistant inserts a sourced peer message and queues one read-only reply from the recipient in their contact. It never runs promptAsync or mutates sessions or files. Recipient replies cannot relay messages or assign work.' : '',
|
|
732
729
|
'A reply without the tool call does nothing — agreeing in Chinese (好的 / 我来创建 / 我去说一声) is not sending.',
|
|
733
730
|
'Never say 已创建, 已发送, 已停止, created, scheduled, opened, watched, stopped, or sent unless the tool already returned success.',
|
|
734
731
|
'With an empty registered catalog, first discover the user-requested workspace through list_sessions and directory lookups. Load project capabilities when available, register the directory, then assign work; use Settings only if registration support is unavailable.',
|
|
@@ -1333,8 +1330,10 @@ export function createContactTools({
|
|
|
1333
1330
|
name: SCHEDULE_TASK_TOOL_NAME,
|
|
1334
1331
|
label: 'Schedule task',
|
|
1335
1332
|
description: [
|
|
1336
|
-
'Create a scheduled task on a registered project
|
|
1333
|
+
'Create a new scheduled task (排定时任务 / schedule daily ping) on a registered project, owned by THIS calling contact. Its eventual result returns to this contact for a read-only result review.',
|
|
1334
|
+
'To give another contact a scheduled task, use message_assistant to send that contact the full scheduling request; they create it with their own tools. This tool has no recipient/owner override.',
|
|
1337
1335
|
'Needs name, prompt, and a daily/weekly/once/cron schedule (time + timezone).',
|
|
1336
|
+
'Preserve the user reporting intent in prompt: deliver requested findings, or keep successful background work quiet when no report is wanted.',
|
|
1338
1337
|
'Reuses this contact\'s provider/model unless the user named another connected model.',
|
|
1339
1338
|
'After success, call reference_resource to send its schedule card.',
|
|
1340
1339
|
].join(' '),
|
|
@@ -1405,9 +1404,10 @@ export function createContactTools({
|
|
|
1405
1404
|
name: MESSAGE_ASSISTANT_TOOL_NAME,
|
|
1406
1405
|
label: 'Message assistant',
|
|
1407
1406
|
description: [
|
|
1408
|
-
'Send a
|
|
1407
|
+
'Send a message or delegate work to another Yuri assistant contact and queue a normal actionable turn with their tools, skills and permissions. The user does not need to repeat or trigger it in the recipient chat.',
|
|
1409
1408
|
'Resolve the recipient by display name (to/name) or toAssistantID.',
|
|
1410
|
-
'
|
|
1409
|
+
'Send the full goal, context and constraints, including schedule details when that contact should own a scheduled task. The recipient can create tasks and assign workers under normal validations.',
|
|
1410
|
+
'Keeps sender attribution; replies and owned task results appear in the recipient contact, not automatically back here. Success confirms message admission and queued execution, not task completion.',
|
|
1411
1411
|
].join(' '),
|
|
1412
1412
|
parameters: messageAssistantParameters,
|
|
1413
1413
|
execute: async (_toolCallId, params) => {
|
|
@@ -186,7 +186,6 @@ describe('contact tool protocol', () => {
|
|
|
186
186
|
expect(prompt).toContain('get_assistant_settings');
|
|
187
187
|
expect(prompt).toContain('update_assistant_settings');
|
|
188
188
|
expect(prompt).toContain('create_assistant');
|
|
189
|
-
expect(prompt).toContain('schedule_task');
|
|
190
189
|
expect(prompt).toContain('message_assistant');
|
|
191
190
|
expect(prompt).toContain('assign_session');
|
|
192
191
|
expect(prompt).toContain('watch_session');
|
|
@@ -199,7 +198,6 @@ describe('contact tool protocol', () => {
|
|
|
199
198
|
expect(prompt).toContain('默认提示词');
|
|
200
199
|
expect(prompt).toContain('助手设定');
|
|
201
200
|
expect(prompt).toContain('建助理');
|
|
202
|
-
expect(prompt).toContain('排定时任务');
|
|
203
201
|
expect(prompt).toContain('说一声');
|
|
204
202
|
expect(prompt).toContain('监听会话');
|
|
205
203
|
expect(prompt).toContain('停止会话');
|
|
@@ -219,6 +217,10 @@ describe('contact tool protocol', () => {
|
|
|
219
217
|
expect(prompt).not.toContain('yuri-tool');
|
|
220
218
|
expect(prompt).not.toContain('Available Yuri tools:');
|
|
221
219
|
expect(prompt).toContain('connected catalog');
|
|
220
|
+
const schedule = createContactTools().find((tool) => tool.name === 'schedule_task');
|
|
221
|
+
expect(schedule.description).toContain('排定时任务');
|
|
222
|
+
expect(schedule.description).toContain('owned by THIS calling contact');
|
|
223
|
+
expect(schedule.description).toContain('message_assistant');
|
|
222
224
|
});
|
|
223
225
|
|
|
224
226
|
it('exposes connected models for assign worker selection without inventing ids', () => {
|
|
@@ -4,6 +4,7 @@ import { splitContactBubbles } from './bubbles.js';
|
|
|
4
4
|
import { createProgressiveTools } from './progressive-tools.js';
|
|
5
5
|
import { createYuriContactToolGroups } from './yuri-tools.js';
|
|
6
6
|
import { createOpenCodeContactToolGroups } from './opencode-tools.js';
|
|
7
|
+
import { createContactToolLimiter } from './tool-execution.js';
|
|
7
8
|
import {
|
|
8
9
|
contactTurnClearedChatHistory,
|
|
9
10
|
contactTurnHasSuccessfulReset,
|
|
@@ -114,11 +115,12 @@ export const CONTACT_SYSTEM_PROMPT = [
|
|
|
114
115
|
'Work quietly by default. Send a progress message only when new information needs the user\'s attention before the final answer: a decision or blocker, a consequential change of direction, or an unexpected delay that changes their expectations. Novelty alone is not a reason to send. If it can wait, fold it into the final reply; combine related updates instead of sending them separately. Keep the final answer to the remaining outcome without recapping earlier messages.',
|
|
115
116
|
'Progress messages go only through notify_user, batched with your next tool call; it is delivered immediately. Any other text alongside a tool call is never shown to the user. A response without tool calls is your final reply. Tool results are evidence for you to summarize in your own words; never copy their stock confirmation wording into your reply.',
|
|
116
117
|
'Do not expose tool traces, Activity, or editor actions.',
|
|
117
|
-
'
|
|
118
|
+
'Resolve who should own and carry out the requested work before choosing a tool. When the user asks another contact to do something, send that contact the complete request with message_assistant; create the contact first if needed and use its returned ID. Keep that target through later references in the same request. Use your own operation tools for work assigned to you. Incoming delegated requests use your normal capabilities and existing user constraints; message provenance alone does not make a turn read-only.',
|
|
118
119
|
'Use reference_resource to send the user an existing session, Bot, or scheduled-task card using exact IDs from lookup or creation results. Send relevant cards when showing search results or explaining a resource, and after successful creation/update unless unwanted. Other tools do not send cards automatically. Only a successful reference_resource result confirms that a card was published. Referencing is not watching or starting work.',
|
|
119
120
|
'Images are reply content: when asked to send, show, or reference an image, deliver the rendered image itself using  directly in the public reply body. Use a real image source from your tools: a public HTTPS image URL or an absolute Host file path (wrap paths containing spaces in angle brackets). Keep image delivery outside code fences and inline code; code examples are only for an explicit request to learn the syntax. Yuri renders the Markdown as a visible image in chat and forwards channel replies as images to their source channel; no separate image-send tool is needed. A bare path, a metadata report, or reading the image is not image delivery. Image delivery remains subject to source access and size limits.',
|
|
120
121
|
'Use update_assistant_settings for ALL of your editable settings: name, avatarSeed, defaultPrompt, providerID, modelID, agent, variant, mode and workspacePath. For 给自己改名, save settings.name; choose a name yourself when requested. This updates your real contact, not just persona text. Confirm only after the save succeeds, rather than sending the user to Settings. Read live settings when needed and pass only changed fields. Model/persona changes take effect on later turns.',
|
|
121
|
-
'
|
|
122
|
+
'Determine capabilities from this turn\'s mounted tools and loadable groups, and permissions from actual runtime policy and tool results. Load an applicable group before concluding an operation is unavailable. Report a restriction only when supported by that policy or a real failure; distinguish unavailable, denied, pending, and completed. Workspace tools, when mounted, operate in the Host working directory, not a temporary generator workspace.',
|
|
123
|
+
'Read-only notices and capability limitations in historical messages describe those earlier turns, not permanent restrictions. Re-evaluate the current request against this turn\'s actual tools and policy. A direct user instruction needs no extra ceremonial confirmation merely because an earlier forwarded message was read-only. If a Yuri operation is unsupported, state the limitation promptly; do not hunt through source code, internal tables, or configuration files to recreate it.',
|
|
122
124
|
'Load opencode.web for online search, opencode.activity for live running-session membership, or opencode.catalog for connected skills, agents, commands, MCP and references. Direct operations use the Host current authenticated connection and workspace; do not switch servers or substitute unauthenticated CLI calls. Load skill instructions only when relevant, not before every lookup. Missing live membership is not proof of successful completion; failed reads mean unknown. Native/MCP capabilities not directly offered here run in an assigned OpenCode worker with its normal permissions. Catalog discovery and reading instructions are not execution; only actual results support claims that you searched or verified something.',
|
|
123
125
|
'Understand natural language in any language, including Chinese: 开新对话 / 清除记忆 means new_conversation (LLM memory only, chat history stays), 清空聊天记录 means clear_chat_history (delete transcript), 找项目 means list_projects, 现有对话 means list_sessions, 查看助手设定 / 默认提示词 means get_assistant_settings (pass to="Name" for another assistant), 改名 / 换头像 / 改默认提示词 / 设置人设 / 换模型 means update_assistant_settings, 建助理 means load yuri.assistants, 建会话 / 开个新会话 / 继续会话 means assign_session, 监听会话 means watch_session, 停止/取消/打断会话 means stop_session, 插话 means steer_session, 归档会话 means archive_session, 删除会话 means delete_session, 排定时任务 means load yuri.tasks, 给 X 说一声 means message_assistant, 发卡片 / 引用资源 means reference_resource — never ask the user to type /card or /dm.',
|
|
124
126
|
'You receive the registered project catalog every turn. Match the user goal against project labels and paths and existing OpenCode conversations via list_sessions. Start in the user-configured working directory; managed contacts start in the current server user home directory and can inspect user-global directories with read/bash. When the starting directory has no relevant session, walk its parent directories to find the nearest relevant existing OpenCode workspace using session directory metadata, then search that workspace for the requested project or conversation. Use an unscoped list_sessions lookup when broader context is needed. Prefer the user-configured directory and explicit session context; ask a short question when several relevant targets remain. Keep discovery bounded and use actual tool results as evidence.',
|
|
@@ -126,7 +128,6 @@ export const CONTACT_SYSTEM_PROMPT = [
|
|
|
126
128
|
'Yuri and OpenCode share the assistant-local load_tools entrypoint. Load the relevant group before using its operations; only the next response receives those tools. Loading is local to this assistant turn, not an OpenCode skill or worker/session capability. Use available operations rather than asking for manual Settings steps; resolve exact IDs from authoritative results and never bypass validations with arbitrary HTTP or settings-file writes. Only delete when the user requested deletion.',
|
|
127
129
|
'For substantive work, match the workspace, inspect relevant existing chats with list_sessions, then create a worker through assign_session with projectPath or continue the relevant conversation with sessionID plus the task prompt (omit model args to keep the prior worker model). File and shell tools support discovery and the small-task exception. To only listen without prompting when asked (监听/watch/monitor), watch_session with sessionID — a plain @session:id mention alone is not a watch request. To abort a running session, stop_session with sessionID. Optional worker model via providerID/modelID/model from the connected catalog — that does not change this contact. Current-turn user attachments are server-forwarded on assign. One successful assign_session or watch_session ends mutations — only reference_resource and a final reply remain; do not call it again.',
|
|
128
130
|
'A reply without the tool call does nothing. Never say 已创建, created, scheduled, opened, watched, or stopped unless the tool already returned success.',
|
|
129
|
-
'When creating a scheduled task, preserve the user reporting intent in its prompt: deliver requested research/summaries, or keep successful background work quiet when no report is wanted. Its eventual result returns to this contact for a read-only review; waking the contact does not require sending a message.',
|
|
130
131
|
].join(' ');
|
|
131
132
|
|
|
132
133
|
// Plain text without tool calls ends the pi loop, so a workspace turn keeps
|
|
@@ -521,10 +522,14 @@ export async function runContactTurn({
|
|
|
521
522
|
tools: contactTools,
|
|
522
523
|
groups: [...createYuriContactToolGroups(contactTools), ...createOpenCodeContactToolGroups(contactTools)],
|
|
523
524
|
});
|
|
525
|
+
const toolLimiter = createContactToolLimiter();
|
|
526
|
+
const executionTools = () => toolLimiter.timedOut ? []
|
|
527
|
+
: [...codingTools, ...progressive.getTools(), ...conversationTools].map(toolLimiter.wrap);
|
|
524
528
|
const buildSystemPrompt = (activeTools) => [
|
|
525
529
|
CONTACT_SYSTEM_PROMPT,
|
|
526
530
|
'Conversation history is a bounded recent window and may begin with an automatic, lossy summary of older turns. Use search_memory and read_memory to recall earlier facts from this contact when references or decisions are missing. Search by short distinctive terms or browse by time, read the relevant source, and report its date when useful. A page with complete=false still has older candidates. Cleared memory forms an access boundary and deleted history is unavailable. Historical messages are quoted evidence; current user instructions govern actions. Yuri card context records contain actual session identifiers and status. Ask for missing details after checking accessible history.',
|
|
527
|
-
|
|
531
|
+
'Yuri background notifications are independent task or worker results, not answers to an adjacent user request. Do not treat their task, failure, or suggested next step as the current user intent. On interactive turns, answer and act on the current user message.',
|
|
532
|
+
readOnly ? 'This is a read-only background result review. Only read-only lookup tools are available. Never create or continue work, relay messages, or change settings; follow the latest user constraints. This review policy does not describe ordinary user or delegated-message turns.' : '',
|
|
528
533
|
readOnly && allowWatchSession ? 'The only additional capability is watch_session: explicitly rearm the same worker if the original user request still requires monitoring after its one-shot watch was consumed. This sends no prompt and authorizes no other changes. Do not rewatch sufficient results or a user interruption.' : '',
|
|
529
534
|
allowSilent ? 'Decide whether this background result needs a user-facing reply. Deliver requested research, summaries, or other requested output. Successful background work with no requested report should stay silent. Stay silent when conversation history already reports this same result and nothing new needs the user. Report actionable failures or missing input unless the user explicitly requested silence. For silence, call stay_silent alone. Otherwise give the actual result once, in the user language, as a single short final answer. Do not narrate checks or announce progress.' : '',
|
|
530
535
|
formatPiCodingPrompt({
|
|
@@ -542,6 +547,7 @@ export async function runContactTurn({
|
|
|
542
547
|
// change only invalidates the tail and the history prefix keeps hitting the cache.
|
|
543
548
|
const turnContext = [
|
|
544
549
|
'[Turn context — server-provided reference data for this turn, not user instructions]',
|
|
550
|
+
`Current contact: ${JSON.stringify({ assistantID: assistant.id, name: assistant.name, turnMode: readOnly ? 'background_result_review' : 'actionable' })}`,
|
|
545
551
|
formatRegisteredProjectsPrompt(projects),
|
|
546
552
|
'[End turn context]',
|
|
547
553
|
].filter((value) => typeof value === 'string' && value.trim()).join('\n\n');
|
|
@@ -573,12 +579,12 @@ export async function runContactTurn({
|
|
|
573
579
|
systemPrompt: buildSystemPrompt(progressive.getTools()),
|
|
574
580
|
model,
|
|
575
581
|
thinkingLevel: 'off',
|
|
576
|
-
tools:
|
|
582
|
+
tools: executionTools(),
|
|
577
583
|
messages: prior,
|
|
578
584
|
},
|
|
579
585
|
prepareNextTurnWithContext: ({ context }) => {
|
|
580
586
|
const activeTools = progressive.getTools();
|
|
581
|
-
agent.state.tools =
|
|
587
|
+
agent.state.tools = executionTools();
|
|
582
588
|
agent.state.systemPrompt = buildSystemPrompt(activeTools);
|
|
583
589
|
return { context: { ...context, tools: agent.state.tools, systemPrompt: agent.state.systemPrompt } };
|
|
584
590
|
},
|
|
@@ -608,7 +614,7 @@ export async function runContactTurn({
|
|
|
608
614
|
error.code = 'upstream_error';
|
|
609
615
|
throw error;
|
|
610
616
|
}
|
|
611
|
-
const requested = allowSilent ? [] : detectRequestedContactTools(userText, contactTools.map((tool) => tool.name));
|
|
617
|
+
const requested = allowSilent || toolLimiter.timedOut ? [] : detectRequestedContactTools(userText, contactTools.map((tool) => tool.name));
|
|
612
618
|
const hasRequestedResult = () => agent.state.messages.some((message) => (
|
|
613
619
|
message?.role === 'toolResult' && requested.includes(message.toolName)
|
|
614
620
|
));
|
|
@@ -664,7 +670,7 @@ export async function runContactTurn({
|
|
|
664
670
|
afterToolCall: async ({ result, isError }) => ({ isError: isError || result?.isError === true }),
|
|
665
671
|
initialState: {
|
|
666
672
|
systemPrompt: `${summaryPrompt} The only available tool is reference_resource. Use it to send the completed operation's resource card unless the user asked for no card. Then give the final reply. Never recreate or rewatch the resource, even if card publication fails.`,
|
|
667
|
-
model, thinkingLevel: 'off', tools: [referenceTool], messages: summaryHistory,
|
|
673
|
+
model, thinkingLevel: 'off', tools: [toolLimiter.wrap(referenceTool)], messages: summaryHistory,
|
|
668
674
|
},
|
|
669
675
|
streamFn: createContactStreamFn(createChatCompletion, { variant: assistant.variant, signal, globalEventHub, onBubbleDelta, cacheKey, turnMessageStart }),
|
|
670
676
|
});
|
|
@@ -26,6 +26,39 @@ const toolCall = (name, args, id) => toolBatch([[name, args, id]])
|
|
|
26
26
|
const notifyCall = (text, id) => ['notify_user', { text }, id]
|
|
27
27
|
|
|
28
28
|
describe('createContactStreamFn', () => {
|
|
29
|
+
it.each([false, true])('enforces the deadline through the real Agent for readOnly=%s without retrying', async (readOnly) => {
|
|
30
|
+
vi.useFakeTimers();
|
|
31
|
+
let started;
|
|
32
|
+
const began = new Promise((resolve) => { started = resolve; });
|
|
33
|
+
let executionSignal;
|
|
34
|
+
const execute = vi.fn((_id, _params, signal) => {
|
|
35
|
+
executionSignal = signal;
|
|
36
|
+
started();
|
|
37
|
+
return new Promise(() => {});
|
|
38
|
+
});
|
|
39
|
+
const name = readOnly ? 'read_session' : 'register_project';
|
|
40
|
+
let round = 0;
|
|
41
|
+
const pending = runContactTurn({ assistant: { providerID: 'p', modelID: 'm' }, history: [], userText: 'Run the operation once.', readOnly,
|
|
42
|
+
tools: [{ name, description: 'Fixture operation', parameters: { type: 'object', properties: {} }, execute }],
|
|
43
|
+
createChatCompletion: async ({ body }) => {
|
|
44
|
+
round++;
|
|
45
|
+
if (!readOnly && round === 1) return toolCall('load_tools', { domain: 'yuri.projects' });
|
|
46
|
+
if (round === (readOnly ? 1 : 2)) return toolCall(name, {});
|
|
47
|
+
expect(body.tools).toEqual([]);
|
|
48
|
+
expect(JSON.stringify(body.messages)).toContain('timed out after 300 seconds');
|
|
49
|
+
return { text: 'The operation timed out; its result is not confirmed.' };
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
try {
|
|
53
|
+
await began;
|
|
54
|
+
await vi.advanceTimersByTimeAsync(300_000);
|
|
55
|
+
expect((await pending).text).toContain('timed out');
|
|
56
|
+
expect(executionSignal.aborted).toBe(true);
|
|
57
|
+
expect(execute).toHaveBeenCalledTimes(1);
|
|
58
|
+
expect(round).toBe(readOnly ? 2 : 3);
|
|
59
|
+
} finally { vi.useRealTimers(); }
|
|
60
|
+
});
|
|
61
|
+
|
|
29
62
|
it('explains Markdown image delivery in the model prompt and publishes the image reply unchanged', async () => {
|
|
30
63
|
const image = '';
|
|
31
64
|
const result = await runContactTurn({ assistant: { providerID: 'p', modelID: 'm' }, history: [], userText: '找张图片发我',
|