@yuriai/web 0.2.27-beta.8 → 0.2.28
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-BJ42lGZD.js → AgentAvatar-BybF1ayP.js} +1 -1
- package/dist/assets/AssistantContactStatus-BwpxTn0d.js +3 -0
- package/dist/assets/{AssistantUnreadBadge-QwhBfXpC.js → AssistantUnreadBadge-DqThZdCe.js} +1 -1
- package/dist/assets/{AssistantView-D7ryIKL0.js → AssistantView-DPUDCXoY.js} +1 -1
- package/dist/assets/{DiagramView-ERrGEBDp.js → DiagramView-CHVLoYrV.js} +1 -1
- package/dist/assets/{FadeInOnReveal-Bu2GvaM9.js → FadeInOnReveal-Cj3JXYvE.js} +1 -1
- package/dist/assets/{GuiPluginSurface-MzQgEZNr.js → GuiPluginSurface-CBZYeKHb.js} +1 -1
- package/dist/assets/{GuiPluginWindow-DZMmlQzx.js → GuiPluginWindow-_Z5wycnH.js} +1 -1
- package/dist/assets/{Icon-Dj4CCqCP.js → Icon-CeRMtJa8.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-BnFXgUuO.js → ImageLoadingPlaceholder-DjLaKB4o.js} +1 -1
- package/dist/assets/{LoadingImage-PBnivDKv.js → LoadingImage-DG3otL5V.js} +1 -1
- package/dist/assets/MarkdownRenderer-C8rv6z7p.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-CfyXL4rg.js → MarkdownRendererImpl-_plqOlsV.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-BGadklK1.js → MarkstreamRendererImpl-bs8HZ4Ra.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DqajQdB4.js → MobileDetailNavigation-SeT764Ps.js} +1 -1
- package/dist/assets/{MobileResizableSheet-BvdUgwA3.js → MobileResizableSheet-BY1-oo_E.js} +1 -1
- package/dist/assets/{MobileShareBridge-3oPoYnry.js → MobileShareBridge-Dw8gLtJD.js} +2 -2
- package/dist/assets/MobileTabPageHeader-EsrOCLyg.js +2 -0
- package/dist/assets/{MultiRunWindow-yhs0Ih5_.js → MultiRunWindow-C-Qw_g7N.js} +1 -1
- package/dist/assets/{OnboardingScreen-Bi1VWFQC.js → OnboardingScreen-CGqabMbp.js} +1 -1
- package/dist/assets/{OverlayScrollbar-BBDwGvGO.js → OverlayScrollbar-AGSWQKg-.js} +1 -1
- package/dist/assets/{SettingsView-BSf-SJUA.js → SettingsView-BLfFnnnX.js} +14 -14
- package/dist/assets/{SettingsWindow-BvSXVMTm.js → SettingsWindow-lyYO8Byy.js} +1 -1
- package/dist/assets/{TerminalView-DhL01N7e.js → TerminalView-OHqpkHzz.js} +1 -1
- package/dist/assets/{ToolOutputDialog-C8lnH4Ky.js → ToolOutputDialog-DU4Pb1s0.js} +1 -1
- package/dist/assets/{YuriLogo-D8asj1CS.js → YuriLogo-Bb6yHagP.js} +1 -1
- package/dist/assets/{appThemeRegistry-C-maYSdv.js → appThemeRegistry-9j-rCSlE.js} +1 -1
- package/dist/assets/{button-vXOdzd8x.js → button-Bjh2BSXh.js} +1 -1
- package/dist/assets/{capgoAdapter-DJ_h2x5D.js → capgoAdapter-DERfot6h.js} +1 -1
- package/dist/assets/{collapsible-DwDQs3Wa.js → collapsible-BEAHoxNi.js} +1 -1
- package/dist/assets/{context-menu-BabBujQ-.js → context-menu-BxLcot-3.js} +1 -1
- package/dist/assets/device-BcRP6Tjd.js +2 -0
- package/dist/assets/{diagram-HwgrQxY5.js → diagram-CXVm2vzI.js} +1 -1
- package/dist/assets/{dialog-Dnf626tb.js → dialog-nshKUSE5.js} +1 -1
- package/dist/assets/{dropdown-menu.styles-CBc_a-Nv.js → dropdown-menu.styles-M78xpvb2.js} +1 -1
- package/dist/assets/{es-BQkO-Odr.js → es-N9ZkQwG9.js} +2 -2
- package/dist/assets/fileMentionAutocompleteState-BZJqfgae.js +2 -0
- package/dist/assets/{fileMentionTouchSelection-CKPnEetl.js → fileMentionTouchSelection-B9NbPN9D.js} +2 -2
- package/dist/assets/{fileReferenceActions-g7KZLi_G.js → fileReferenceActions-CrIAce3K.js} +1 -1
- package/dist/assets/{fr-C852roK5.js → fr-CIGqV46N.js} +2 -2
- package/dist/assets/{gitApi-CVq5oKCd.js → gitApi-CY3D5CF0.js} +1 -1
- package/dist/assets/{gitApiHttp-BYOIbYIh.js → gitApiHttp-B7vYwgBh.js} +4 -4
- package/dist/assets/{gui-M_Rbwkyu.js → gui-CJjEj3l4.js} +1 -1
- package/dist/assets/host-CnVx34Dh.js +1 -0
- package/dist/assets/{image-loading-D5UhMj7Z.js → image-loading-D6kOgU4w.js} +1 -1
- package/dist/assets/{input-BtM712b1.js → input-3Re4pmHm.js} +1 -1
- package/dist/assets/insertionBoundaries-DK7XYF8d.js +1 -0
- package/dist/assets/{ja-BqC39qK6.js → ja-DAhnTq6V.js} +2 -2
- package/dist/assets/{ko-BMaChAWh.js → ko-FbMgNKcI.js} +2 -2
- package/dist/assets/main-B_THXYMs.js +2 -0
- package/dist/assets/main-CpcudEZb.js +169 -0
- package/dist/assets/{markdownHeightCache-Bf8iisO4.js → markdownHeightCache-DVWGXtAX.js} +1 -1
- package/dist/assets/{mcpQueries-DpXqegX5.js → mcpQueries-CdOYmUdO.js} +1 -1
- package/dist/assets/miniChat-DxZiTnAZ.js +2 -0
- package/dist/assets/mobile-BJuATiaC.js +2 -0
- package/dist/assets/{mobileBackNavigation-DZcI7aZg.js → mobileBackNavigation-CgZndzFA.js} +1 -1
- package/dist/assets/{multirun-hzspPepd.js → multirun-BlaYsQi2.js} +1 -1
- package/dist/assets/{native-H7K64Ulc.js → native-BYMhr-xH.js} +1 -1
- package/dist/assets/{native-config-CddZtLQ1.js → native-config-BpsFKLGl.js} +1 -1
- package/dist/assets/{persistence-BT8045Ue.js → persistence-CWuLIq1J.js} +2 -2
- package/dist/assets/{pl-Ubs8p28T.js → pl-DzX0cbiQ.js} +2 -2
- package/dist/assets/{projectMeta-CEf0QPmD.js → projectMeta-CnXHTolN.js} +1 -1
- package/dist/assets/{pt-BR-8rAOjJrs.js → pt-BR-C5yvwyDK.js} +2 -2
- package/dist/assets/queue-abort-optimistic-DCLBpirg.js +1 -0
- package/dist/assets/{readiness-Dyr7314z.js → readiness-U16Qor79.js} +1 -1
- package/dist/assets/renderElectronMiniChatApp-n-nhgy1V.js +2 -0
- package/dist/assets/renderMobileApp-DBj_7RlD.js +28 -0
- package/dist/assets/{runtimeConfig-B8VHHNxj.js → runtimeConfig-BBgkLVr_.js} +1 -1
- package/dist/assets/runtimeEndpointReset-BvSQVFfx.js +149 -0
- package/dist/assets/{scheduledTaskNavigation-Zm87Nydi.js → scheduledTaskNavigation-EomDNVu2.js} +1 -1
- package/dist/assets/sessionLookup-C_CCp7MJ.js +1 -0
- package/dist/assets/{sortable-tabs-strip-D4pVoodN.js → sortable-tabs-strip-p16Pn6Zz.js} +1 -1
- package/dist/assets/{speechSettingsQueries-RlCLMBtr.js → speechSettingsQueries-CBSEAKyj.js} +2 -2
- package/dist/assets/src-u-YDfCVw.css +2 -0
- package/dist/assets/{store-ME7oHni1.js → store-DVfZQktm.js} +4 -3
- package/dist/assets/{terminalApi-BSaclMDJ.js → terminalApi-rl9mZAlB.js} +1 -1
- package/dist/assets/{textarea-B98rsLs7.js → textarea-C6VQ7dHH.js} +1 -1
- package/dist/assets/{tooltip-B9810jbK.js → tooltip-Dnc6GA-X.js} +1 -1
- package/dist/assets/types-DnZw0gLD.js +2 -0
- package/dist/assets/{uk-LzwzUApL.js → uk-zbDcUpBy.js} +2 -2
- package/dist/assets/{useAppFontEffects-D2C1sBYM.js → useAppFontEffects-CEgDiZHu.js} +49 -49
- package/dist/assets/{useAssistantUIStore-TUN_ycy5.js → useAssistantUIStore-CfaQV3ID.js} +1 -1
- package/dist/assets/useDesktopWindowControlsLayout-B2o4IFmd.js +1 -0
- package/dist/assets/useEffectiveDirectory-BOYMJ6k7.js +1 -0
- package/dist/assets/{useFontPreferences-BlhlCJCX.js → useFontPreferences-DeqW9nRx.js} +1 -1
- package/dist/assets/useMobileNavigationStore-DlvrZQ49.js +17 -0
- package/dist/assets/{useUIStore-DRx6OgCp.js → useUIStore-C6CE42oh.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-D093jNsH.js → useWorkerHighlightedLines-EcJThS4x.js} +1 -1
- package/dist/assets/{vendor-effect-DV9F8PTZ.js → vendor-effect-X1Hqc7ba.js} +13 -13
- package/dist/assets/vendor-opencode-client-cQ47ywrT.js +23 -0
- package/dist/assets/{vendor-opencode-plugin-BBOP6WNx.js → vendor-opencode-plugin-BmdTE4Te.js} +1 -1
- package/dist/assets/vendor-opencode-schema-DWT45VBX.js +1 -0
- package/dist/assets/vendor-solid-js-D98iXT7C.js +1 -0
- package/dist/assets/vendor-zod-DZzbCm1s.js +55 -0
- package/dist/assets/{zh-CN-D-FVCeks.js → zh-CN-BHRJ7CF3.js} +2 -2
- package/dist/assets/{zh-TW-B9iH_NXL.js → zh-TW-BFI_YFd-.js} +2 -2
- package/dist/index.html +12 -12
- package/dist/mini-chat.html +12 -12
- package/dist/mobile.html +12 -12
- package/package.json +1 -1
- package/server/index.js +2 -145
- package/server/lib/assistants/DOCUMENTATION.md +63 -10
- package/server/lib/assistants/cards.js +1 -1
- package/server/lib/assistants/channel-image.js +92 -0
- package/server/lib/assistants/channel-image.test.js +76 -0
- package/server/lib/assistants/channel-output-store.test.js +41 -0
- package/server/lib/assistants/channel-output.integration.test.js +128 -0
- package/server/lib/assistants/channel-output.js +90 -0
- package/server/lib/assistants/channel-output.test.js +79 -0
- package/server/lib/assistants/channels/DOCUMENTATION.md +52 -14
- package/server/lib/assistants/channels/PROTOCOLS.md +23 -1
- package/server/lib/assistants/channels/dingtalk-chat-adapter.js +19 -7
- package/server/lib/assistants/channels/dingtalk-chat-adapter.test.js +8 -0
- package/server/lib/assistants/channels/routes.js +12 -0
- package/server/lib/assistants/channels/routes.test.js +34 -0
- package/server/lib/assistants/channels/runtime.js +117 -26
- package/server/lib/assistants/channels/runtime.test.js +179 -5
- package/server/lib/assistants/channels/sdk-adapters.js +15 -3
- package/server/lib/assistants/channels/sdk-adapters.test.js +17 -0
- package/server/lib/assistants/channels/store.js +9 -6
- package/server/lib/assistants/channels/store.test.js +21 -11
- package/server/lib/assistants/channels/transport.js +2 -1
- package/server/lib/assistants/channels/wecom-chat-adapter.js +16 -2
- package/server/lib/assistants/channels/wecom-chat-adapter.test.js +21 -0
- package/server/lib/assistants/contact-store.js +9 -3
- package/server/lib/assistants/contact-store.test.js +27 -0
- package/server/lib/assistants/contact-tools.js +65 -75
- package/server/lib/assistants/contact-tools.test.js +114 -22
- package/server/lib/assistants/harness.js +80 -34
- package/server/lib/assistants/harness.test.js +68 -20
- package/server/lib/assistants/resource-reference.integration.test.js +284 -0
- package/server/lib/assistants/routes.js +0 -3
- package/server/lib/assistants/service.js +116 -69
- package/server/lib/assistants/service.test.js +31 -17
- package/server/lib/assistants/weixin/DOCUMENTATION.md +34 -9
- package/server/lib/assistants/weixin/api.js +43 -1
- package/server/lib/assistants/weixin/api.test.js +28 -0
- package/server/lib/assistants/weixin/chat-adapter.js +8 -2
- package/server/lib/assistants/weixin/inbound.js +5 -3
- package/server/lib/assistants/weixin/inbound.test.js +20 -0
- package/server/lib/assistants/weixin/runtime.js +27 -18
- package/server/lib/assistants/weixin/runtime.test.js +36 -0
- package/server/lib/assistants/weixin/store.js +8 -4
- package/server/lib/assistants/weixin/store.test.js +21 -0
- package/server/lib/assistants/yuri-project.http.test.js +9 -3
- package/server/lib/notifications/DOCUMENTATION.md +6 -0
- package/server/lib/notifications/runtime.js +26 -15
- package/server/lib/notifications/runtime.test.js +14 -13
- package/server/lib/opencode/DOCUMENTATION.md +9 -0
- package/server/lib/opencode/auth.d.ts +6 -2
- package/server/lib/opencode/core-routes.js +0 -1
- package/server/lib/opencode/feature-routes-runtime.js +0 -24
- package/server/lib/opencode/location-release.d.ts +5 -1
- package/server/lib/opencode/managed-capabilities/scheduled-task.js +1 -1
- package/server/lib/opencode/managed-capabilities-runtime.test.js +1 -1
- package/server/lib/opencode/native-goal.js +15 -0
- package/server/lib/opencode/native-goal.test.js +17 -0
- package/server/lib/opencode/settings-helpers.js +0 -6
- package/server/lib/opencode/shutdown-runtime.js +0 -2
- package/server/lib/projects/project-config.js +3 -6
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +10 -35
- package/server/lib/scheduled-tasks/managed-tool-route.js +1 -30
- package/server/lib/scheduled-tasks/routes.js +0 -26
- package/server/lib/scheduled-tasks/runtime.js +33 -257
- package/server/lib/scheduled-tasks/runtime.test.js +24 -65
- package/server/lib/session-metadata/DOCUMENTATION.md +9 -12
- package/server/lib/session-metadata/routes.js +4 -38
- package/server/lib/session-metadata/routes.test.js +2 -2
- package/dist/assets/AssistantContactStatus-dtkObamV.js +0 -3
- package/dist/assets/MarkdownRenderer-BajF4gUU.js +0 -2
- package/dist/assets/MobileTabPageHeader-B6cRyIRH.js +0 -2
- package/dist/assets/device-BjRYYXNT.js +0 -2
- package/dist/assets/host-BW3FEJdU.js +0 -1
- package/dist/assets/insertionBoundaries-Dx3WAY6i.js +0 -1
- package/dist/assets/main-9uP2z1qT.js +0 -2
- package/dist/assets/main-Mey7bCWf.js +0 -169
- package/dist/assets/miniChat-DqZvVkme.js +0 -2
- package/dist/assets/mobile-DXAWjYcN.js +0 -2
- package/dist/assets/renderElectronMiniChatApp-DoOq8Cuo.js +0 -2
- package/dist/assets/renderMobileApp-TTxtOb8b.js +0 -28
- package/dist/assets/runtimeEndpointReset-BC6XWntz.js +0 -149
- package/dist/assets/sessionLookup-De53jDwM.js +0 -1
- package/dist/assets/src-lE4uqaHS.css +0 -2
- package/dist/assets/types-DFf9vd1b.js +0 -2
- package/dist/assets/useDesktopWindowControlsLayout-BjKaHN0x.js +0 -1
- package/dist/assets/useEffectiveDirectory-TEvyiQSC.js +0 -1
- package/dist/assets/useMobileNavigationStore-DTvJV9s-.js +0 -23
- package/dist/assets/vendor-opencode-client-ZeOZ4Efz.js +0 -23
- package/dist/assets/vendor-solid-js-9wmPZH9g.js +0 -1
- package/dist/assets/vendor-zod-Dzk5kdUU.js +0 -39
- package/server/lib/session-goal/DOCUMENTATION.md +0 -371
- package/server/lib/session-goal/capability.js +0 -57
- package/server/lib/session-goal/capability.test.js +0 -33
- package/server/lib/session-goal/objectives.js +0 -61
- package/server/lib/session-goal/routes.js +0 -274
- package/server/lib/session-goal/routes.test.js +0 -211
- package/server/lib/session-goal/runtime.js +0 -2452
- package/server/lib/session-goal/runtime.test.js +0 -2125
package/dist/index.html
CHANGED
|
@@ -560,7 +560,7 @@
|
|
|
560
560
|
opacity: 0.72;
|
|
561
561
|
}
|
|
562
562
|
</style>
|
|
563
|
-
<script type="module" crossorigin src="/assets/main-
|
|
563
|
+
<script type="module" crossorigin src="/assets/main-B_THXYMs.js"></script>
|
|
564
564
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
565
565
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
566
566
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
@@ -571,32 +571,32 @@
|
|
|
571
571
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-D1UX7HW2.js">
|
|
572
572
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-BQjbsJ43.js">
|
|
573
573
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-B43HCgwC.js">
|
|
574
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-
|
|
575
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
574
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
575
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-cQ47ywrT.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
578
|
-
<link rel="modulepreload" crossorigin href="/assets/useUIStore-
|
|
578
|
+
<link rel="modulepreload" crossorigin href="/assets/useUIStore-C6CE42oh.js">
|
|
579
579
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-D5d-V1vN.js">
|
|
580
580
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BWz0ose6.js">
|
|
581
581
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-CTcigFdj.js">
|
|
582
582
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
583
583
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
584
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
584
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-CWuLIq1J.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-C4SG3JZB.js">
|
|
586
586
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-BeXkd3o6.js">
|
|
587
587
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
588
588
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
589
589
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
590
590
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-UJjHUF2C.js">
|
|
591
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
592
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
591
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-B7vYwgBh.js">
|
|
592
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-rl9mZAlB.js">
|
|
593
593
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Cf1WxfeW.js">
|
|
594
594
|
<link rel="modulepreload" crossorigin href="/assets/platform-DFJEtBlo.js">
|
|
595
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
596
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
597
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
598
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
599
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
595
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DnZw0gLD.js">
|
|
596
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DERfot6h.js">
|
|
597
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BpsFKLGl.js">
|
|
598
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BBgkLVr_.js">
|
|
599
|
+
<link rel="stylesheet" crossorigin href="/assets/src-u-YDfCVw.css">
|
|
600
600
|
</head>
|
|
601
601
|
<body class="h-full bg-background text-foreground">
|
|
602
602
|
<!-- 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-DxZiTnAZ.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">
|
|
@@ -88,32 +88,32 @@
|
|
|
88
88
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-D1UX7HW2.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-BQjbsJ43.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-B43HCgwC.js">
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
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-C6CE42oh.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-D5d-V1vN.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BWz0ose6.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-CTcigFdj.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-CWuLIq1J.js">
|
|
102
102
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-C4SG3JZB.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-BeXkd3o6.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
105
105
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
106
106
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
107
107
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-UJjHUF2C.js">
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-B7vYwgBh.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-rl9mZAlB.js">
|
|
110
110
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Cf1WxfeW.js">
|
|
111
111
|
<link rel="modulepreload" crossorigin href="/assets/platform-DFJEtBlo.js">
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
116
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DnZw0gLD.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DERfot6h.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BpsFKLGl.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BBgkLVr_.js">
|
|
116
|
+
<link rel="stylesheet" crossorigin href="/assets/src-u-YDfCVw.css">
|
|
117
117
|
</head>
|
|
118
118
|
<body class="h-full bg-background text-foreground">
|
|
119
119
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,7 +64,7 @@
|
|
|
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-BJuATiaC.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">
|
|
@@ -75,32 +75,32 @@
|
|
|
75
75
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-D1UX7HW2.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-BQjbsJ43.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-B43HCgwC.js">
|
|
78
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
78
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
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-C6CE42oh.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-D5d-V1vN.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-query-core-BWz0ose6.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-CTcigFdj.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-CWuLIq1J.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-C4SG3JZB.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-BeXkd3o6.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
94
94
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-UJjHUF2C.js">
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-B7vYwgBh.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-rl9mZAlB.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-Cf1WxfeW.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/platform-DFJEtBlo.js">
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
103
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DnZw0gLD.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DERfot6h.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BpsFKLGl.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BBgkLVr_.js">
|
|
103
|
+
<link rel="stylesheet" crossorigin href="/assets/src-u-YDfCVw.css">
|
|
104
104
|
</head>
|
|
105
105
|
<body class="h-full bg-background text-foreground">
|
|
106
106
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -80,10 +80,6 @@ import { resolveTranscriptCacheDbPath } from './lib/transcript-cache/resolve-db-
|
|
|
80
80
|
import { createMessageQueueRuntime } from './lib/message-queue/runtime.js';
|
|
81
81
|
import { resolveMessageQueueDbPath } from './lib/message-queue/resolve-db-path.js';
|
|
82
82
|
import { createYuriEventBroadcaster } from './lib/opencode/feature-routes-runtime.js';
|
|
83
|
-
import {
|
|
84
|
-
createSessionGoalRuntime,
|
|
85
|
-
withGoalExecutionGeneration,
|
|
86
|
-
} from './lib/session-goal/runtime.js';
|
|
87
83
|
import { createSessionMetadataStore } from './lib/session-metadata/session-metadata-store.js';
|
|
88
84
|
import {
|
|
89
85
|
createHttpSessionRecordClient,
|
|
@@ -839,34 +835,6 @@ void ensureSessionMetadataReady().then((ok) => {
|
|
|
839
835
|
}
|
|
840
836
|
});
|
|
841
837
|
|
|
842
|
-
/**
|
|
843
|
-
* Goal write through the Host metadata store.
|
|
844
|
-
* Advances executionGeneration on pause/resume/condition changes so late audits
|
|
845
|
-
* cannot commit against a prior execution permit. Broadcasts only after commit.
|
|
846
|
-
*/
|
|
847
|
-
const persistSessionGoalToStore = async (sessionId, _directory, goal) => {
|
|
848
|
-
const result = await sessionMetadataStore.mutateSessionMetadata(sessionId, (current) => {
|
|
849
|
-
const previousGoal = current?.yuri?.goal && typeof current.yuri.goal === 'object'
|
|
850
|
-
? current.yuri.goal
|
|
851
|
-
: null;
|
|
852
|
-
const nextGoal = withGoalExecutionGeneration(previousGoal, goal);
|
|
853
|
-
return { ok: true, patch: { yuri: { goal: nextGoal } } };
|
|
854
|
-
});
|
|
855
|
-
if (!result?.committed) {
|
|
856
|
-
throw new Error(result?.reason || 'session goal persist was rejected');
|
|
857
|
-
}
|
|
858
|
-
const metadata = result.metadata;
|
|
859
|
-
try {
|
|
860
|
-
broadcastGlobalUiEvent({
|
|
861
|
-
type: 'yuri:session-metadata',
|
|
862
|
-
properties: { sessionID: sessionId, metadata },
|
|
863
|
-
});
|
|
864
|
-
} catch (error) {
|
|
865
|
-
console.warn('[session-metadata] broadcast failed:', error?.message ?? error);
|
|
866
|
-
}
|
|
867
|
-
return metadata;
|
|
868
|
-
};
|
|
869
|
-
|
|
870
838
|
/**
|
|
871
839
|
* Isolation / Host metadata write. Same store + broadcast seam as goal persist.
|
|
872
840
|
* Callers pass an RFC 7386 merge patch; the store returns the committed object.
|
|
@@ -922,78 +890,6 @@ const projectHostSessionPayload = (payload) => {
|
|
|
922
890
|
));
|
|
923
891
|
};
|
|
924
892
|
|
|
925
|
-
const sessionGoalRuntime = createSessionGoalRuntime({
|
|
926
|
-
buildOpenCodeUrl,
|
|
927
|
-
getOpenCodeAuthHeaders,
|
|
928
|
-
serverOpenCodeFetch,
|
|
929
|
-
getSmallModelService,
|
|
930
|
-
shouldKeepGoalActiveForQuestion: (sessionId) => (
|
|
931
|
-
questionAutoDelegateRuntime?.isAutoHandling(sessionId) === true
|
|
932
|
-
),
|
|
933
|
-
isQuestionBlockingGoal: (sessionId) => (
|
|
934
|
-
questionAutoDelegateRuntime?.isBlockingSession(sessionId) === true
|
|
935
|
-
),
|
|
936
|
-
onGoalPaused: (sessionId, directory) => (
|
|
937
|
-
questionAutoDelegateRuntime?.pauseForSessionTree?.(sessionId, directory)
|
|
938
|
-
),
|
|
939
|
-
readSessionMetadata: (sessionId) => sessionMetadataStore.get(sessionId),
|
|
940
|
-
// Conditional commit on the store's exclusive serial boundary (generation +
|
|
941
|
-
// status preconditions share the lock with persist). Broadcast-only on
|
|
942
|
-
// success — do not feed progress writes back into processPayload.
|
|
943
|
-
mutateSessionMetadata: async (sessionId, decide) => {
|
|
944
|
-
const result = await sessionMetadataStore.mutateSessionMetadata(sessionId, decide);
|
|
945
|
-
if (result?.committed) {
|
|
946
|
-
try {
|
|
947
|
-
broadcastGlobalUiEvent({
|
|
948
|
-
type: 'yuri:session-metadata',
|
|
949
|
-
properties: { sessionID: sessionId, metadata: result.metadata },
|
|
950
|
-
});
|
|
951
|
-
} catch (error) {
|
|
952
|
-
console.warn('[session-metadata] broadcast failed:', error?.message ?? error);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
return result;
|
|
956
|
-
},
|
|
957
|
-
persistSessionGoal: async (sessionId, directory, goal) => {
|
|
958
|
-
const metadata = await persistSessionGoalToStore(sessionId, directory, goal);
|
|
959
|
-
return metadata?.yuri?.goal ?? goal;
|
|
960
|
-
},
|
|
961
|
-
emitGoalNotification: async ({ sessionId, directory, status, goal }) => {
|
|
962
|
-
// The goal settle notification replaces the per-turn ready notifications
|
|
963
|
-
// (suppressed while the goal is active) — so it obeys the same toggle.
|
|
964
|
-
const settings = await readSettingsFromDisk();
|
|
965
|
-
if (settings.notifyOnCompletion === false) {
|
|
966
|
-
return;
|
|
967
|
-
}
|
|
968
|
-
const title = status === 'complete'
|
|
969
|
-
? 'Goal complete'
|
|
970
|
-
: (status === 'budgetLimited' ? 'Goal reached its token budget' : 'Goal blocked');
|
|
971
|
-
const detail = goal?.statusReason && goal.statusReason !== 'verified by audit' && goal.statusReason !== 'reported by agent'
|
|
972
|
-
? goal.statusReason
|
|
973
|
-
: (goal?.note || '');
|
|
974
|
-
const objective = typeof goal?.objective === 'string' ? goal.objective.slice(0, 140) : '';
|
|
975
|
-
const notificationPayload = {
|
|
976
|
-
title,
|
|
977
|
-
body: [objective, detail].filter(Boolean).join(' — ').slice(0, 240),
|
|
978
|
-
tag: `goal-${sessionId}`,
|
|
979
|
-
kind: 'goal',
|
|
980
|
-
sessionId,
|
|
981
|
-
directory,
|
|
982
|
-
};
|
|
983
|
-
const desktopNotificationDelivered = emitDesktopNotification(notificationPayload);
|
|
984
|
-
broadcastUiNotification(notificationPayload, { desktopNotificationDelivered });
|
|
985
|
-
void notificationTriggerRuntime.sendGoalSettlePush({
|
|
986
|
-
sessionId,
|
|
987
|
-
directory,
|
|
988
|
-
status,
|
|
989
|
-
title,
|
|
990
|
-
body: notificationPayload.body,
|
|
991
|
-
}).catch((error) => {
|
|
992
|
-
console.warn('[session-goal] push fanout failed:', error?.message || error);
|
|
993
|
-
});
|
|
994
|
-
},
|
|
995
|
-
});
|
|
996
|
-
|
|
997
893
|
const globalMessageStreamHub = createGlobalMessageStreamHub({
|
|
998
894
|
buildOpenCodeUrl,
|
|
999
895
|
getOpenCodeAuthHeaders,
|
|
@@ -1026,12 +922,6 @@ questionAutoDelegateRuntime = createQuestionAutoDelegateRuntime({
|
|
|
1026
922
|
readSettingsFromDiskMigrated,
|
|
1027
923
|
broadcastGlobalUiEvent,
|
|
1028
924
|
broadcastYuriEvent: broadcastQuestionAutoDelegateTip,
|
|
1029
|
-
onUserTakeover: ({ sessionID, directory }) => {
|
|
1030
|
-
// User pause / manual claim / feature disable → goal pause on root owner.
|
|
1031
|
-
void sessionGoalRuntime.pauseForQuestion?.(sessionID, directory)?.catch((error) => {
|
|
1032
|
-
console.warn('[question-auto-delegate] goal pause on takeover failed:', error?.message ?? error);
|
|
1033
|
-
});
|
|
1034
|
-
},
|
|
1035
925
|
});
|
|
1036
926
|
questionAutoDelegateRuntime.start();
|
|
1037
927
|
|
|
@@ -1048,10 +938,9 @@ const openCodeWatcherRuntime = createOpenCodeWatcherRuntime({
|
|
|
1048
938
|
},
|
|
1049
939
|
});
|
|
1050
940
|
|
|
1051
|
-
// Session-title
|
|
941
|
+
// Session-title subscribes to the hub directly: it needs the
|
|
1052
942
|
// envelope's directory to route their own OpenCode calls to the right instance.
|
|
1053
943
|
console.log('[session-title] listening for session events');
|
|
1054
|
-
console.log('[session-goal] listening for session events');
|
|
1055
944
|
globalMessageStreamHub.subscribeStatus((status) => {
|
|
1056
945
|
if (status.type === 'connect') sessionTitleRuntime.processPayload({ type: 'server.connected' });
|
|
1057
946
|
});
|
|
@@ -1063,7 +952,6 @@ globalMessageStreamHub.subscribeEvent((event) => {
|
|
|
1063
952
|
? event.directory
|
|
1064
953
|
: '';
|
|
1065
954
|
sessionTitleRuntime.processPayload(payload, directory);
|
|
1066
|
-
sessionGoalRuntime.processPayload(payload, directory);
|
|
1067
955
|
});
|
|
1068
956
|
|
|
1069
957
|
const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
|
@@ -1307,28 +1195,10 @@ const scheduledTasksRuntime = createScheduledTasksRuntime({
|
|
|
1307
1195
|
},
|
|
1308
1196
|
buildOpenCodeUrl,
|
|
1309
1197
|
getOpenCodeAuthHeaders,
|
|
1310
|
-
getSmallModelService,
|
|
1311
1198
|
waitForOpenCodeReady,
|
|
1312
1199
|
runHistoryStore: scheduledTaskRunHistoryStore,
|
|
1313
|
-
// Same Host store seam as session-goal / manual UI metadata writes.
|
|
1314
|
-
readSessionMetadata: (sessionId) => sessionMetadataStore.get(sessionId),
|
|
1315
1200
|
persistSessionMetadata: persistSessionMetadataToStore,
|
|
1316
1201
|
onSystemSessionPersisted: hideSystemSessionFromIndex,
|
|
1317
|
-
persistSessionGoal: persistSessionGoalToStore,
|
|
1318
|
-
// Arm the goal loop after first persist only — do not feed progress writes
|
|
1319
|
-
// back through processPayload (session-goal runtime already broadcasts those).
|
|
1320
|
-
onGoalPersisted: ({ sessionID, directory, metadata }) => {
|
|
1321
|
-
sessionGoalRuntime.processPayload({
|
|
1322
|
-
type: 'session.updated',
|
|
1323
|
-
properties: {
|
|
1324
|
-
info: {
|
|
1325
|
-
id: sessionID,
|
|
1326
|
-
directory: directory || '',
|
|
1327
|
-
metadata,
|
|
1328
|
-
},
|
|
1329
|
-
},
|
|
1330
|
-
}, directory || '');
|
|
1331
|
-
},
|
|
1332
1202
|
emitTaskRunEvent: (event) => {
|
|
1333
1203
|
for (const client of uiYuriEventClients) {
|
|
1334
1204
|
try {
|
|
@@ -1385,7 +1255,7 @@ const completeOpenCodeStartup = () => {
|
|
|
1385
1255
|
startHealthMonitoring();
|
|
1386
1256
|
}
|
|
1387
1257
|
// The global watcher used to start only for desktop notifications; session-title
|
|
1388
|
-
//
|
|
1258
|
+
// also rides its event hub, so it now starts unconditionally
|
|
1389
1259
|
// once OpenCode is up. Controlled retry when metadata is not yet ready.
|
|
1390
1260
|
const startWatcherWithRetry = (attempt = 0) => {
|
|
1391
1261
|
void ensureGlobalWatcherStarted().catch((error) => {
|
|
@@ -1430,7 +1300,6 @@ const gracefulShutdownRuntime = createGracefulShutdownRuntime({
|
|
|
1430
1300
|
syncToHmrState,
|
|
1431
1301
|
openCodeWatcherRuntime,
|
|
1432
1302
|
sessionTitleRuntime,
|
|
1433
|
-
sessionGoalRuntime,
|
|
1434
1303
|
questionAutoDelegateRuntime,
|
|
1435
1304
|
sessionRuntime,
|
|
1436
1305
|
getHealthCheckInterval: () => healthCheckInterval,
|
|
@@ -2051,26 +1920,14 @@ async function main(options = {}) {
|
|
|
2051
1920
|
return sessionArchiveServiceRef.archiveSession(...args);
|
|
2052
1921
|
},
|
|
2053
1922
|
},
|
|
2054
|
-
// Same store seam as sessionGoalRuntime / scheduledTasksRuntime.
|
|
2055
1923
|
readSessionMetadata: (sessionId) => sessionMetadataStore.get(sessionId),
|
|
2056
1924
|
persistSessionMetadata: persistSessionMetadataToStore,
|
|
2057
1925
|
onSystemSessionPersisted: hideSystemSessionFromIndex,
|
|
2058
|
-
persistSessionGoal: persistSessionGoalToStore,
|
|
2059
1926
|
onSessionMetadataWritten: ({ sessionID, directory, metadata }) => {
|
|
2060
1927
|
sessionTitleRuntime.processPayload({
|
|
2061
1928
|
type: 'yuri:session-metadata',
|
|
2062
1929
|
properties: { sessionID, directory, metadata },
|
|
2063
1930
|
}, directory || '');
|
|
2064
|
-
sessionGoalRuntime.processPayload({
|
|
2065
|
-
type: 'session.updated',
|
|
2066
|
-
properties: {
|
|
2067
|
-
info: {
|
|
2068
|
-
id: sessionID,
|
|
2069
|
-
directory: directory || '',
|
|
2070
|
-
metadata,
|
|
2071
|
-
},
|
|
2072
|
-
},
|
|
2073
|
-
}, directory || '');
|
|
2074
1931
|
},
|
|
2075
1932
|
getSmallModelService,
|
|
2076
1933
|
getOpenCodePort: () => openCodePort,
|
|
@@ -26,6 +26,47 @@ personal-WeChat and DingTalk implement extensions. Yuri remains authoritative fo
|
|
|
26
26
|
Bot permissions, durable receipts, output and lifecycle, not a second Chat bot engine.
|
|
27
27
|
See `channels/DOCUMENTATION.md` for enterprise configuration and SDK integration.
|
|
28
28
|
|
|
29
|
+
Published image output is shared by all four channels through `channel-output.js`.
|
|
30
|
+
The contact prompt teaches `` in public replies as the image
|
|
31
|
+
delivery interface: a real public HTTPS image URL or absolute Host file path,
|
|
32
|
+
with angle brackets for paths containing spaces. No image-send tool is required;
|
|
33
|
+
image Markdown belongs directly in the reply body, outside code fences or inline
|
|
34
|
+
code, so it renders rather than displaying a syntax example. Reading an image by
|
|
35
|
+
itself does not publish it. Existing source/size restrictions
|
|
36
|
+
and source-channel routing still apply.
|
|
37
|
+
It extracts actual Markdown images (including reference images) and image file
|
|
38
|
+
parts, not ordinary links, code examples or tool traces, preserving prose/image
|
|
39
|
+
order. `service.prepareChannelImage()` snapshots bytes into the existing private
|
|
40
|
+
contact-attachment store before the channel advances its feed. Stable upload IDs
|
|
41
|
+
are scoped to Bot, transcript generation, message and output position; replay
|
|
42
|
+
reuses the snapshot without rereading the original. The internal `channel-image.js`
|
|
43
|
+
loader accepts owned attachments, raster data URLs, canonical paths in the Bot cwd,
|
|
44
|
+
registered roots or OS temp directory, and public HTTPS images. Remote reads pin
|
|
45
|
+
validated DNS addresses, reject private/reserved addresses and redirects, never
|
|
46
|
+
forward Host credentials, and have a 20-second/20-MiB bound. SVG/HTML are rejected.
|
|
47
|
+
There are at most eight images and 50 MiB of image delivery per published message.
|
|
48
|
+
Outboxes persist opaque attachment descriptors, never image bytes or source paths;
|
|
49
|
+
sent rows clear them. Each image is a separate delivery with its own stable ID,
|
|
50
|
+
retry/uncertainty state and original recipient. Failed preparation produces a safe
|
|
51
|
+
text notice without dropping adjacent output. Reset, disconnect, transfer and
|
|
52
|
+
shutdown fence late preparation; adapters recheck authority after uploading and
|
|
53
|
+
before submitting the message. This does not recall already submitted messages.
|
|
54
|
+
All Host surfaces (web, Electron, hosted/native mobile) reuse this backend path;
|
|
55
|
+
standalone VS Code still has no Host-owned channel service.
|
|
56
|
+
Yuri's built-in IM is itself a source channel. `channelPage()` excludes replies
|
|
57
|
+
whose persisted `turnID` identifies this Bot's admitted user message without an
|
|
58
|
+
external channel receipt prefix. This covers streamed, final and error replies,
|
|
59
|
+
while keeping them in the Yuri transcript. The feed cursor still advances over
|
|
60
|
+
excluded rows. Routing uses the original admission, never the latest user message;
|
|
61
|
+
existing stored transcripts need no migration. External-channel turns retain their
|
|
62
|
+
receipt-owned routing, and source-less proactive turns such as scheduled-task
|
|
63
|
+
result reviews remain eligible for delivery to all bound channels.
|
|
64
|
+
Internal card parts (`session`, `assistant`, `schedule` and future card types) are
|
|
65
|
+
unsupported channel output and silently skipped by the shared projector. They are
|
|
66
|
+
not downgraded to titles, anchors or deeplinks, do not enter the outbox and do not
|
|
67
|
+
produce an unsupported/error notice or retry. The feed watermark still advances;
|
|
68
|
+
adjacent text/images continue normally. Cards remain in the Yuri transcript/UI.
|
|
69
|
+
|
|
29
70
|
Each saved Bot has a Host-owned, QR-authorized message channel configured in the final
|
|
30
71
|
**Message channels** settings group. It admits only the QR-confirmed owner through
|
|
31
72
|
the existing `send()` pipeline and reads committed public replies through the internal
|
|
@@ -96,6 +137,11 @@ not become list previews, unread counts, or LLM memory. If error persistence its
|
|
|
96
137
|
fails, the service emits a body-free warning and still settles activity and sends
|
|
97
138
|
live failure feedback; that failure cannot be recovered after reconnect.
|
|
98
139
|
Worker-card execution status remains part of the card's authoritative state.
|
|
140
|
+
Descriptive channel text such as TOON's "WeChat message data" or "Channel message
|
|
141
|
+
metadata" is not an imperative peer-message request. The missed-tool hint only
|
|
142
|
+
matches explicit English message/tell clauses, so a completed session assignment
|
|
143
|
+
is not retried or marked failed because of those labels. Channel delivery failures
|
|
144
|
+
remain in each channel's outbox and never rewrite a worker's execution status.
|
|
99
145
|
|
|
100
146
|
## Contact attachment chronology
|
|
101
147
|
|
|
@@ -466,7 +512,8 @@ and keep their existing error result handling.
|
|
|
466
512
|
- Public progress uses the harness-owned `notify_user` tool `{ text }` (max 2,000 characters), usually batched with the next call. Its text emits `done:true` bubbles when the response arrives, before the batch executes. Batched notes are dropped from execution and stored as the assistant message's public text (`contactPublicText`); a notes-only response executes and the loop continues. Text beside tool calls is model narration and stays private. Later rounds replay delivered notes to the model as `notify_user` calls.
|
|
467
513
|
- The model is prompted to send a progress message only when it adds information the user does not already have (a direction worth correcting, a meaningful finding, a blocker, or expected long work), then give a short final outcome. A message is not required before each tool call, and successful lookups need no separate confirmation. Public messages share the existing SSE, durable contact rows, and turn-global indices across web, desktop, VS Code, hosted mobile, and Capacitor. No timer narration, tool logs, progress widgets, or synthetic chat messages are added. Timing of model-authored milestones remains model policy; the transport guarantees immediate delivery once an explicit public record arrives.
|
|
468
514
|
- Completion notifications use the latest spoken message, keeping earlier progress out of the final notification body. Transcript persistence reconciles by stable bubble IDs and adds only remaining messages.
|
|
469
|
-
- Tool results remain model context for every tool. The outcome projector uses assistant-authored text only. Terminal operations retain the mutation stop gate
|
|
515
|
+
- Tool results remain model context for every tool. The outcome projector uses assistant-authored text only. Terminal operations retain the mutation stop gate. Successful interactive assign/watch gets a result-only Agent on the same provider/model with **only** `reference_resource`, followed by a final reply; no coding, loader or business mutation tool is available. Other terminal operations, failures and resets retain their tools-disabled summary. A failed/empty summary surfaces a turn error; a completed side effect stays committed and is never replayed by the result phase.
|
|
516
|
+
- Tools-disabled summaries project actual completed tool results into labeled, quoted user-role evidence (tool name, error flag and public text only), removing native call/result framing. Some providers reject historical native calls when their tool definitions are absent. The reference-only phase and ordinary Agent rounds retain native call/result association; no execution or permission fallback is introduced. Reset summaries still receive only the current user request and the successful reset result.
|
|
470
517
|
- Reset summaries receive only the successful reset tool result, excluding prior messages and attachments. The service retains one model-generated confirmation and discards pre-reset output for that turn. Failures emit recoverable error feedback outside assistant speech bubbles, retained until the next contact message update.
|
|
471
518
|
|
|
472
519
|
- Protocol correction never replays rejected assistant prose into model history: simulated User/Assistant turns and tool-result records are rejected as fabricated evidence. Corrections remain bounded and exhaustion is an error, not a completion.
|
|
@@ -482,23 +529,29 @@ and keep their existing error result handling.
|
|
|
482
529
|
|
|
483
530
|
- First-class contact parts reuse one slot: `cardType` `session` | `assistant` | `schedule`.
|
|
484
531
|
- Persist in `assistant_contact_message` / `assistant_contact_part`. Survive reload.
|
|
485
|
-
-
|
|
486
|
-
-
|
|
532
|
+
- `reference_resource` is an always-mounted **interactive assistant-only** tool. It takes `cardType: session` + `sessionID`, `assistant` + `assistantID`, or `schedule` + `projectID`/`taskID`. Exact IDs come from lookups, current creation/update results or existing references; the model cannot supply titles, directories, card payloads or URLs. Session references reuse authoritative resolution and registered-root checks, Bot references read live contacts, and task references load the exact registered project's current task configuration. Missing/deleted/forbidden/unavailable resources fail without fabricating a card.
|
|
533
|
+
- Session references also tolerate a redundant, well-formed `projectID` from lookup context. It is discarded before resolution and is never lookup authority or part of the session card identity; the real session directory and registered-project boundary still come only from the Host. Other resource IDs and card-content fields remain rejected for session references.
|
|
534
|
+
- Querying and resource mutation do **not** publish cards. `assign_session`, `watch_session`, `create_assistant`, `schedule_task` and `update_scheduled_task` return model-visible resource IDs and guidance to call `reference_resource`. Prompt policy encourages relevant cards after lookup/explanation and successful creation/update, unless unwanted; there is no forced auto-card fallback. Only successful explicit reference results contribute cards to the harness outcome.
|
|
535
|
+
- `reference_resource` awaits SQLite publication before returning public tool text `{ sent: true, card }` to the model. Persistence failure is an actual tool error with `sent:false`; a created resource stays valid and must not be recreated. The connected Host's ordinary contact snapshot/revision transport delivers the same persisted part to web, Electron, hosted mobile and Capacitor. This acknowledges publication in Yuri, not delivery to an external messaging channel; internal card parts retain the channel-output exclusion above. Standalone VS Code does not gain an assistant Host. No client DTO, HTTP route, tool registration in ordinary Sessions, or schema migration is added.
|
|
536
|
+
- Same-turn references to the same identity reuse the first successfully published card and return that snapshot. Failed publication does not claim a slot and can be retried. Cancellation and a removed turn/transcript fence late publication. Session references never create/rearm watches, prompt workers or change notification policy. Existing card history and completion receipts remain readable.
|
|
537
|
+
- Schedule references persist the authoritative schedule's optional `cron`, `date`, `times`, and `weekdays`, not just a `time`/first-time projection. The card parser and UI DTO retain these fields through JSON persistence and transport. Omitted legacy fields stay omitted; explicit null marks an inapplicable field on new cards. This is additive contact-part JSON, with no SQLite migration or task rewrite. Clients may recover legacy display details through the existing Assistant-scoped task mapping, matching `(projectID, taskID)`; failed/deleted task lookups do not erase stored card information.
|
|
538
|
+
- Cards are **assistant-emitted UI**, not user slash commands. The user never types `/card`. Interactive insertion uses `reference_resource`; the existing API `POST /:id/contact/cards` remains for harness/tests with its legacy session-watch admission behavior. Later project/worktree/PR, inbound pushes, and summon **must** reuse this card slot.
|
|
539
|
+
- `resource-reference.integration.test.js` runs the real Agent, service and SQLite with only model/upstream results replaced: lookup → read → explicit reference, create → reference, reference-only handoff result phase, complete schedule fields, persisted acknowledgements/restart, publication rollback/retry/deduplication, scope failures and no watch rearm. The project HTTP test additionally covers route admission → handoff → explicit reference. These are deterministic contract checks, not live-model decision quality or device UI/channel-delivery evidence.
|
|
487
540
|
|
|
488
541
|
**Assign work (this PR)**
|
|
489
542
|
|
|
490
543
|
- `assign_session` is an Yuri AgentTool on the contact harness. It creates or reuses a visible OpenCode/Yuri session on a **registered project path** (Settings projects / `getAllowedRoots()`), optionally an **existing** Chat worktree/branch via `getWorktrees`, then kicks the coding prompt into that session with `session.create` + `session.prompt` (same worker path as `POST /api/yuri/conversations`).
|
|
491
544
|
- That worker session owns substantive implementation. The contact owns communication and coordination, with direct pi tools for small, bounded tasks. Assign sessions are **not** archived Assistant bindings and must not use `assistant-workspaces`.
|
|
492
545
|
- **Reuse / continue existing session:** `assign_session` with `sessionID` + coding prompt continues that worker. Before prompt, the service resolves directory/project from **authoritative** session metadata (session index directory → `session.get` payload → registered project match). User-supplied `projectPath`/`directory` are lookup **hints only** and never override scope. Missing/unregistered/failed session lookup **fails closed** (not empty success). Prior worker model/config semantics stay: omit model args to follow the session model when still connected.
|
|
493
|
-
- **`watch_session`:** listen-only attach for an existing session (`sessionID` required). No `session.prompt`.
|
|
546
|
+
- **`watch_session`:** listen-only attach for an existing session (`sessionID` required). No `session.prompt`. Registers `assistant_contact_watch` directly and reuses `reportAssignedSession` / reconcile / resume, independently of whether a reference card is sent. Baseline watch status comes from live `session.get` (+ messages when needed) via `mapSessionToWatchStatus` so an already-terminal idle is **not** treated as a fresh complete transition (no false resume). In-flight baseline (`busy`/`question`) keeps the watch until real settle. A plain user `@session:id` (or JSON title/sessionID/directory) reference is **context only** — it does not auto-call `watch_session`; the model must hear an explicit listen/watch/monitor intent.
|
|
494
547
|
- **`stop_session`:** calls real OpenCode `session.interrupt` for `sessionID` after the same authoritative directory resolve. Returns the true abort result — transport/`not_found`/upstream errors stay errors (never claim stopped on failure). Abort is registered in a private per-session inflight map before `await abort` so concurrent SSE `complete`/`error` cannot schedule a `resume=true` continuation ahead of `resume=false`. On successful abort the service marks the watch/card `cancelled` even when upstream emits no idle/error event. Idle/error events still flow through the existing watch reporter when a watch exists.
|
|
495
548
|
- **Worker model selection:** optional tool args `providerID` / `modelID` / `model` resolve against the live connected OpenCode catalog (`loadConnectedCatalog` / `GET /provider` + `GET /config/providers`). Explicit selection must match uniquely — missing or ambiguous names fail closed (`model_not_found` / `model_ambiguous`) with **no silent fallback**. Omitting model args on a **new** worker keeps the contact assistant's default provider/model. **Reusing `sessionID` without an explicit model** follows that session's last model (`session.get` → `session.model` `{ providerID, id|modelID }`, else newest user/assistant `info.model`) when it is still an exact providerID+modelID match in the connected catalog (`source: 'session'`); missing session model, catalog miss, or lookup failure **degrades** to the assistant default (`source: 'assistant'`) and never fails assign once the session itself resolved. Selecting a worker model **never** mutates the contact assistant row.
|
|
496
549
|
- The connected model catalog is **not** injected into turns. The base tool `list_models({ query? })` (absent from read-only background reviews) loads it on demand; each call reloads the current instance's **Connected OpenCode models** block (exact providerID, modelID, providerName, name, acceptsImages), plus settings-backed favorite models in saved order and recent models newest first. Only connected catalog entries qualify as preference candidates; variants remain separate from model IDs. Catalog and preference read failures remain explicit unknown states, distinct from successful empty lists; either read can succeed independently. The tool projects only favoriteModels/recentModels from the strict settings reader; defaultModel/defaultVariant are used separately for initial contact creation, never arbitrary settings or credentials. No catalog is cached across turns or runtime switches. Informal `model` aliases normalize punctuation/spacing and require a unique catalog match; explicit `modelID` stays exact. Ambiguous aliases never silently prefer a favorite/provider. This server-owned context is shared by web, desktop, and mobile clients of that instance.
|
|
497
550
|
- **Current-turn attachments:** server-authoritative `userParts` file parts from this contact turn are forwarded into worker `session.prompt` parts by default (including “just open a session” intents). The model must not base64-encode or invent local paths. History images are **not** unbounded-forwarded. Image parts require a vision-capable catalog entry (`acceptsImages`); otherwise assign fails with `image_not_supported` before create. Sensitive file bodies are never logged.
|
|
498
551
|
- **Create-then-prompt failure:** if `session.create` succeeds and `session.prompt` fails, assign best-effort `session.delete`s the new worker so empty sessions are not left behind. Reused `sessionID` paths never delete on prompt failure.
|
|
499
|
-
- Successful `assign_session` and `watch_session` return `terminate: true` to stop the mutation loop. The harness then
|
|
552
|
+
- Successful `assign_session` and `watch_session` return `terminate: true` to stop the mutation loop. The harness then runs the reference-only result phase described above (tools-disabled for background turns). Prerequisite tools (`list_projects` / `list_sessions`) may still run before assign/watch/stop in the same turn; multi-operation user intents remain ordered **across turns** after a successful assign/watch.
|
|
500
553
|
- Same contact-turn assign gate (tools instance lifetime only, not cross-turn): identical args after success replay the cached success result (no second worker); different args after success, or parallel mismatched args, fail closed with a validation error. The idempotent key includes worker model selection and current-turn attachment scope. Failure clears the gate so a corrected retry may run. Parallel identical args share one in-flight promise.
|
|
501
|
-
-
|
|
554
|
+
- Successful assign/watch registers that worker in `assistant_contact_watch` before returning, not during card insertion. Assignment keeps its admitted message watermark even if no card is sent or publication fails. If post-admission watch storage fails, assignment remains successful with `watchError: watch_registration_failed`; the model must report unavailable automatic follow-up without recreating the worker. Watch registration and revision commit together. Cards are separately sent by `reference_resource`, and tool evidence is never written as assistant speech.
|
|
502
555
|
- Existing OpenCode SSE on the same `globalEventHub` as notifications (`session.idle`, `session.error`, `session.status`, `session.execution.*`, `question.asked`, `permission.asked`) updates **the same card** (`busy` → `complete` / `error` / `question` / `cancelled`). **No canned settle transcript bubbles** (`oc.settle.complete` / `error` / `question` are not written). On **complete, error, or cancelled (user interrupt)** when the watch status actually changed, the service schedules an async contact-lane **continuation** (`inContactTurnLane` + `runContactTurn`) per related assistant: no admitted user row (internal `userText` only), active contact turn (green dot / 3-dot), stable resume id `resume_${assistantID}_${sessionID}_${status}_${updatedAt}`, bounded last worker assistant text (~2000 chars; fetch failure still resumes with status only). Cancelled continuations include `reason: user_interrupted` so the contact can acknowledge the user's abort. The contact Agent can perform read-only lookups and summarize in the user's language, but cannot reassign or mutate a session during this notification — the user sees that Agent summary, not 「会话已完成/会话失败」. `question` updates the card only (worker waiting on the user). `stop_session` cancellation does not schedule this continuation. Session-goal settle (`emitGoalNotification`) uses the same reporter — not a second scheduler. Idle after `session.error` must not rewrite 失败 as 完成 (`changed=false` → no second resume). Same complete status re-reported is idempotent. The watch rows are read inside the `BEGIN IMMEDIATE` transition, so multiple Host processes sharing `assistants.sqlite` schedule at most one continuation per transition. The lock is SQLite's OS file lock, held only for that synchronous transaction (no awaits); a Host that exits mid-transaction releases it and its uncommitted write is discarded. Turn lanes and active-turn markers are process-local memory, so a dead Host never leaves a durable lock: whichever Host receives the next user send admits and runs it.
|
|
503
556
|
- **Shutdown interrupt (ticket 07):** official `session.execution.interrupted` reason is `user | shutdown | superseded | inactivity`. **`reason: shutdown` does not settle** the watch and does **not** schedule contact resume — upstream keeps the execution claim for restart recovery. The card stays `busy` until an authoritative terminal (`session.execution.succeeded` / `failed` / user interrupt / reconcile). `reason: user` settles `cancelled` + resume. Other non-shutdown interrupts settle `error` unless `MessageAbortedError`. No parallel recovery store — the existing watch row remains the owner.
|
|
504
557
|
- Restart or a missed `session.idle` cannot leave the watch stuck: boot and the existing 60s reconcile timer `listInFlightWatches` and poll OpenCode `session.get` / `message.list`. Idle or `time.completed` settles the same card (`busy` → 完成) and triggers the same contact continuation (no `oc.settle.complete` bubble). A missing session or message page remains unknown and keeps the watch in flight: another Host sharing the store may use a different OpenCode database, so 404 is not proof that the owning worker ended. Isolated HMR therefore also isolates Yuri state. `session.error` or last-assistant `info.error` settles 失败 + resume once; last-assistant `MessageAbortedError` settles `cancelled` + the interrupt notify once. Transport / get errors leave the watch in flight (failure is not empty success). One failed watch does not block unrelated watches. Reconcile reuses `reportAssignedSession`, so an error watch is never rewritten as complete. Tombstoned assistants skip resume.
|
|
@@ -508,7 +561,7 @@ and keep their existing error result handling.
|
|
|
508
561
|
- **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.
|
|
509
562
|
- **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`.
|
|
510
563
|
- **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.
|
|
511
|
-
- **Explicit rewatch:** successful `watch_session` / `assign_session`
|
|
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, scheduled-task reviews, and peer-message turns retain lookup-only tools. No background review gains resource publication, assignment, prompting, stop, file, shell, or settings mutation tools.
|
|
512
565
|
- `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.
|
|
513
566
|
- **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.
|
|
514
567
|
- **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).
|
|
@@ -540,10 +593,10 @@ and keep their existing error result handling.
|
|
|
540
593
|
|
|
541
594
|
Reply language follows the user's latest substantive message and conversation context, with explicit language requests taking precedence. Ambiguous messages and background follow-ups retain the conversation language. The built-in prompt and terminal-tool summary never select a response language from UI locale. Reset summaries receive the current user request as language context alongside the reset result, without restoring earlier history. Explicit `{{LANGUAGE}}` placeholders in user-authored `defaultPrompt` retain their locale substitution contract; the built-in prompt no longer uses that token.
|
|
542
595
|
|
|
543
|
-
- `create_assistant` calls the same in-process `createAssistant` (`name`, connected OpenCode `providerID`/`modelID`, `mode: 'continuous'`). It
|
|
544
|
-
- `schedule_task` calls in-process `projectConfigRuntime.upsertScheduledTask` with the same payload as `PUT /api/projects/:id/scheduled-tasks` (`name`, `schedule.kind/time/timezone`, `execution.prompt` + provider/model) on a registered project, then best-effort `scheduledTasksRuntime.syncProject`. It
|
|
596
|
+
- `create_assistant` calls the same in-process `createAssistant` (`name`, connected OpenCode `providerID`/`modelID`, `mode: 'continuous'`). It returns the new identity; `reference_resource` separately sends the `assistant` card that opens that contact.
|
|
597
|
+
- `schedule_task` calls in-process `projectConfigRuntime.upsertScheduledTask` with the same payload as `PUT /api/projects/:id/scheduled-tasks` (`name`, `schedule.kind/time/timezone`, `execution.prompt` + provider/model) on a registered project, then best-effort `scheduledTasksRuntime.syncProject`. It returns exact task/project IDs for a separate `reference_resource` call.
|
|
545
598
|
- `list_scheduled_tasks` lists registered projects' tasks with exact task/project IDs, schedule, model and a bounded prompt preview. Failed project reads remain explicit partial failures. Read-only background turns may list but cannot modify tasks.
|
|
546
|
-
- `update_scheduled_task` uses the existing project-config patch operation and scheduler sync, changing only supplied fields and validating explicit models against the connected catalog. It
|
|
599
|
+
- `update_scheduled_task` uses the existing project-config patch operation and scheduler sync, changing only supplied fields and validating explicit models against the connected catalog. It returns the task/project reference for a separate card call; it can edit tasks created outside the Assistant.
|
|
547
600
|
- Native calls use tool-name validation and shell-alias normalization. `shell`, `powershell`, `grep`, `glob`, `find` and `ls` may resolve to the existing `bash` tool only when it is available. Native call IDs survive normalization. Unknown tool corrections identify the rejected name and available tools, without executing a rejected prefix. The contact harness owns bounded correction; generic completion callers retain strict tool-name validation.
|
|
548
601
|
- Successful `schedule_task` also writes an assistants-owned mapping row in `assistants.sqlite` (`assistant_scheduled_task`: assistantID + projectID + taskID). Project-config execution strips unknown fields, so ownership stays out of the task payload. `GET /api/yuri/assistants/:id/scheduled-tasks` returns those mappings joined with live `listScheduledTasks` records when possible; failed project lookups keep the mapping with `task: null`.
|
|
549
602
|
- `CONTACT_SYSTEM_PROMPT` + `formatContactToolsPrompt` + `formatPiCodingPrompt` tell the model to call these from natural language (开新对话 / 找项目 / 现有对话 / 查看助手设定·默认提示词 / 改默认提示词·设置人设 / 建助理 / 建会话·继续会话 / 监听会话 / 停止会话 / 排定时任务 / 给 X 说一声). Argument schemas travel only in the native tool definitions. A reply without the tool call does nothing; never say 已创建 / 已发送 / 已停止 unless the tool returned. Tool results are sent as native tool-role messages with JSON `{ isError, content }`; assistant calls keep their arguments/IDs so multi-step turns keep call/result association. The harness replaces every `{{LANGUAGE}}` token — in the built-in prompt and in `defaultPrompt` — with the UI locale sent on the composer payload (`language` field, whitelisted locale code → display name). Background/settle turns recall the last locale seen for that assistant; unknown or missing locales resolve to `the user's interface language`, so the token never leaks into the prompt.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const CONTACT_CARD_TYPES = Object.freeze(['session', 'assistant', 'schedule']);
|
|
2
2
|
const CARD_TYPES = new Set(CONTACT_CARD_TYPES);
|
|
3
|
-
//
|
|
3
|
+
// Assistant tools explicitly publish these cards through reference_resource.
|
|
4
4
|
// project | worktree | watch MUST reuse this slot. Do not invent a second card system.
|
|
5
5
|
|
|
6
6
|
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|