@yuriai/web 0.2.27-beta.3 → 0.2.27-beta.8
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 +17 -0
- package/dist/assets/{AgentAvatar-kIN4sZMz.js → AgentAvatar-BJ42lGZD.js} +1 -1
- package/dist/assets/AssistantContactStatus-dtkObamV.js +3 -0
- package/dist/assets/AssistantUnreadBadge-QwhBfXpC.js +1 -0
- package/dist/assets/AssistantView-D7ryIKL0.js +1 -0
- package/dist/assets/{DiagramView-DK0iXm9b.js → DiagramView-ERrGEBDp.js} +1 -1
- package/dist/assets/{FadeInOnReveal-BJA9Za3T.js → FadeInOnReveal-Bu2GvaM9.js} +1 -1
- package/dist/assets/GuiPluginSurface-MzQgEZNr.js +1 -0
- package/dist/assets/{GuiPluginWindow-l4FYY6S-.js → GuiPluginWindow-DZMmlQzx.js} +1 -1
- package/dist/assets/Icon-Dj4CCqCP.js +1 -0
- package/dist/assets/{ImageLoadingPlaceholder-DCWssLJG.js → ImageLoadingPlaceholder-BnFXgUuO.js} +1 -1
- package/dist/assets/{LoadingImage-C_Hryaqe.js → LoadingImage-PBnivDKv.js} +1 -1
- package/dist/assets/{MarkdownRenderer-Y6uQXIFH.js → MarkdownRenderer-BajF4gUU.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-qKp1tQrP.js → MarkdownRendererImpl-CfyXL4rg.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-B_JTod0h.js → MarkstreamRendererImpl-BGadklK1.js} +1 -1
- package/dist/assets/MobileDetailNavigation-DqajQdB4.js +1 -0
- package/dist/assets/{MobileResizableSheet-F1zSUD1S.js → MobileResizableSheet-BvdUgwA3.js} +1 -1
- package/dist/assets/{MobileShareBridge-F70fkIfS.js → MobileShareBridge-3oPoYnry.js} +2 -2
- package/dist/assets/MobileTabPageHeader-B6cRyIRH.js +2 -0
- package/dist/assets/{MultiRunWindow-D8m6R_4x.js → MultiRunWindow-yhs0Ih5_.js} +1 -1
- package/dist/assets/{OnboardingScreen-BAsPVV_W.js → OnboardingScreen-Bi1VWFQC.js} +1 -1
- package/dist/assets/{OverlayScrollbar-wiRM4AGj.js → OverlayScrollbar-BBDwGvGO.js} +1 -1
- package/dist/assets/{SettingsView-izzjIckv.js → SettingsView-BSf-SJUA.js} +15 -15
- package/dist/assets/{SettingsWindow-CSuHDq_c.js → SettingsWindow-BvSXVMTm.js} +1 -1
- package/dist/assets/TerminalView-DhL01N7e.js +8 -0
- package/dist/assets/{ToolOutputDialog-DJs9w1_J.js → ToolOutputDialog-C8lnH4Ky.js} +1 -1
- package/dist/assets/{YuriLogo-aBS6wlYU.js → YuriLogo-D8asj1CS.js} +1 -1
- package/dist/assets/{appThemeRegistry-BY5rY9-W.js → appThemeRegistry-C-maYSdv.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-B9iHLlm2.js → assistant-attachment-cache-B_qRvy-k.js} +1 -1
- package/dist/assets/{button-Dt6Ygbc7.js → button-vXOdzd8x.js} +1 -1
- package/dist/assets/{capgoAdapter-MQ1qpf60.js → capgoAdapter-DJ_h2x5D.js} +1 -1
- package/dist/assets/{collapsible-Dm7OHk7m.js → collapsible-DwDQs3Wa.js} +1 -1
- package/dist/assets/context-menu-BabBujQ-.js +1 -0
- package/dist/assets/{desktopRelayRestore-CoLLVJw8.js → desktopRelayRestore-D1UX7HW2.js} +1 -1
- package/dist/assets/{diagram-DWZaG3_v.js → diagram-HwgrQxY5.js} +1 -1
- package/dist/assets/{dialog-CjQeHVOc.js → dialog-Dnf626tb.js} +1 -1
- package/dist/assets/dropdown-menu.styles-CBc_a-Nv.js +1 -0
- package/dist/assets/es-BQkO-Odr.js +15 -0
- package/dist/assets/feishu-Ct1ZxlzQ.svg +6 -0
- package/dist/assets/{fileMentionTouchSelection-D7QtVxjI.js → fileMentionTouchSelection-CKPnEetl.js} +1 -1
- package/dist/assets/{fileQueries-5a1jkme2.js → fileQueries-BeXkd3o6.js} +1 -1
- package/dist/assets/{fileReferenceActions-BAoEu4z8.js → fileReferenceActions-g7KZLi_G.js} +1 -1
- package/dist/assets/fr-C852roK5.js +13 -0
- package/dist/assets/gitApi-CVq5oKCd.js +370 -0
- package/dist/assets/gitApiHttp-BYOIbYIh.js +7 -0
- package/dist/assets/{gui-9enrif_1.js → gui-M_Rbwkyu.js} +1 -1
- package/dist/assets/host-BW3FEJdU.js +1 -0
- package/dist/assets/{image-loading-Dq1g_wpm.js → image-loading-D5UhMj7Z.js} +1 -1
- package/dist/assets/{input-Dq4usRDa.js → input-BtM712b1.js} +1 -1
- package/dist/assets/insertionBoundaries-Dx3WAY6i.js +1 -0
- package/dist/assets/ja-BqC39qK6.js +15 -0
- package/dist/assets/ko-BMaChAWh.js +15 -0
- package/dist/assets/main-9uP2z1qT.js +2 -0
- package/dist/assets/main-Mey7bCWf.js +169 -0
- package/dist/assets/{markdownHeightCache-C1u0bWDL.js → markdownHeightCache-Bf8iisO4.js} +1 -1
- package/dist/assets/{mcpQueries-D2IxTr4k.js → mcpQueries-DpXqegX5.js} +1 -1
- package/dist/assets/miniChat-DqZvVkme.js +2 -0
- package/dist/assets/mobile-DXAWjYcN.js +2 -0
- package/dist/assets/{mobileBackNavigation-vpCg1S7j.js → mobileBackNavigation-DZcI7aZg.js} +1 -1
- package/dist/assets/{multirun-DT-dFXud.js → multirun-hzspPepd.js} +1 -1
- package/dist/assets/{native-De1DIkLZ.js → native-H7K64Ulc.js} +1 -1
- package/dist/assets/{native-config-ncdoz9Wl.js → native-config-CddZtLQ1.js} +1 -1
- package/dist/assets/{persistence-JyLTFv27.js → persistence-BT8045Ue.js} +1 -1
- package/dist/assets/pl-Ubs8p28T.js +15 -0
- package/dist/assets/projectMeta-CEf0QPmD.js +1 -0
- package/dist/assets/pt-BR-8rAOjJrs.js +15 -0
- package/dist/assets/{queryRuntime-Dkpnq3Z1.js → queryRuntime-CTcigFdj.js} +1 -1
- package/dist/assets/react-DRe85o5s.js +1 -0
- package/dist/assets/readiness-Dyr7314z.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-DoOq8Cuo.js +2 -0
- package/dist/assets/renderMobileApp-TTxtOb8b.js +28 -0
- package/dist/assets/runtime-fetch-D0YWp3FJ.js +1 -0
- package/dist/assets/{runtime-file-download-CcNIVp7u.js → runtime-file-download-Cf1WxfeW.js} +1 -1
- package/dist/assets/{runtime-file-resource-6np6lzoV.js → runtime-file-resource-UJjHUF2C.js} +1 -1
- package/dist/assets/runtimeConfig-B8VHHNxj.js +2 -0
- package/dist/assets/runtimeEndpointReset-BC6XWntz.js +149 -0
- package/dist/assets/scheduledTaskNavigation-Zm87Nydi.js +1 -0
- package/dist/assets/sessionLookup-De53jDwM.js +1 -0
- package/dist/assets/sortable-tabs-strip-D4pVoodN.js +1 -0
- package/dist/assets/speechSettingsQueries-RlCLMBtr.js +4 -0
- package/dist/assets/src-lE4uqaHS.css +2 -0
- package/dist/assets/store-ME7oHni1.js +15 -0
- package/dist/assets/{terminalApi-B5o8UqWA.js → terminalApi-BSaclMDJ.js} +1 -1
- package/dist/assets/{textarea-vtIQM2iP.js → textarea-B98rsLs7.js} +1 -1
- package/dist/assets/{tooltip-BpG2mxrT.js → tooltip-B9810jbK.js} +1 -1
- package/dist/assets/{types-CNTgeeM1.js → types-DFf9vd1b.js} +1 -1
- package/dist/assets/{uk-B_JwElWz.js → uk-LzwzUApL.js} +4 -4
- package/dist/assets/{useAppFontEffects-BguV1Hfa.js → useAppFontEffects-D2C1sBYM.js} +59 -57
- package/dist/assets/{useAssistantUIStore-C9FPlYQz.js → useAssistantUIStore-TUN_ycy5.js} +1 -1
- package/dist/assets/useDesktopWindowControlsLayout-BjKaHN0x.js +1 -0
- package/dist/assets/{useEffectiveDirectory-Ci6Z13kj.js → useEffectiveDirectory-TEvyiQSC.js} +1 -1
- package/dist/assets/{useFontPreferences-DMiP_Yy-.js → useFontPreferences-BlhlCJCX.js} +1 -1
- package/dist/assets/useMobileNavigationStore-DTvJV9s-.js +23 -0
- package/dist/assets/useUIStore-DRx6OgCp.js +1 -0
- package/dist/assets/{useWorkerHighlightedLines-HKhuYGSj.js → useWorkerHighlightedLines-D093jNsH.js} +1 -1
- package/dist/assets/{vendor-codemirror-search-ZqtrPLjU.js → vendor-codemirror-search-DiPwvA-6.js} +2 -2
- package/dist/assets/vendor-opencode-client-ZeOZ4Efz.js +23 -0
- package/dist/assets/{vendor-opencode-plugin-Bw7Q6Nv9.js → vendor-opencode-plugin-BBOP6WNx.js} +1 -1
- package/dist/assets/{vendor-replit-codemirror-vim-DDj0dSVY.js → vendor-replit-codemirror-vim-DCdAdxvE.js} +3 -3
- package/dist/assets/{vendor-solid-js-0T254UHG.js → vendor-solid-js-9wmPZH9g.js} +1 -1
- package/dist/assets/zh-CN-D-FVCeks.js +15 -0
- package/dist/assets/zh-TW-B9iH_NXL.js +15 -0
- package/dist/index.html +17 -17
- package/dist/mini-chat.html +17 -17
- package/dist/mobile.html +17 -17
- package/package.json +8 -3
- package/server/lib/assistants/DOCUMENTATION.md +33 -1
- package/server/lib/assistants/channels/DOCUMENTATION.md +291 -0
- package/server/lib/assistants/channels/PROTOCOLS.md +228 -0
- package/server/lib/assistants/channels/dingtalk-chat-adapter.js +633 -0
- package/server/lib/assistants/channels/dingtalk-chat-adapter.test.js +415 -0
- package/server/lib/assistants/channels/integration.test.js +44 -0
- package/server/lib/assistants/channels/routes.js +47 -0
- package/server/lib/assistants/channels/routes.test.js +105 -0
- package/server/lib/assistants/channels/runtime.js +867 -0
- package/server/lib/assistants/channels/runtime.test.js +723 -0
- package/server/lib/assistants/channels/sdk-adapters.js +371 -0
- package/server/lib/assistants/channels/sdk-adapters.test.js +367 -0
- package/server/lib/assistants/channels/store.js +246 -0
- package/server/lib/assistants/channels/store.test.js +286 -0
- package/server/lib/assistants/channels/transport.js +41 -0
- package/server/lib/assistants/channels/transport.test.js +23 -0
- package/server/lib/assistants/channels/wecom-chat-adapter.js +689 -0
- package/server/lib/assistants/channels/wecom-chat-adapter.test.js +109 -0
- package/server/lib/assistants/contracts.js +1 -0
- package/server/lib/assistants/message-channel-origin.js +7 -0
- package/server/lib/assistants/routes.js +14 -1
- package/server/lib/assistants/service.js +23 -7
- package/server/lib/assistants/service.test.js +151 -0
- package/server/lib/assistants/weixin/DOCUMENTATION.md +147 -8
- package/server/lib/assistants/weixin/api.js +2 -0
- package/server/lib/assistants/weixin/chat-adapter.js +107 -0
- package/server/lib/assistants/weixin/chat-adapter.test.js +62 -0
- package/server/lib/assistants/weixin/inbound.js +147 -0
- package/server/lib/assistants/weixin/inbound.test.js +121 -0
- package/server/lib/assistants/weixin/media.js +79 -0
- package/server/lib/assistants/weixin/media.test.js +66 -0
- package/server/lib/assistants/weixin/routes.js +4 -3
- package/server/lib/assistants/weixin/routes.test.js +30 -0
- package/server/lib/assistants/weixin/runtime.js +157 -66
- package/server/lib/assistants/weixin/runtime.test.js +372 -6
- package/server/lib/assistants/weixin/store.js +20 -3
- package/server/lib/assistants/weixin/store.test.js +72 -0
- package/server/lib/assistants/weixin/toon.js +49 -0
- package/server/lib/assistants/weixin/toon.test.js +25 -0
- package/server/lib/github/DOCUMENTATION.md +9 -8
- package/server/lib/llm/bridge-plugin.bundle.js +188 -188
- package/server/lib/opencode/DOCUMENTATION.md +2 -1
- package/server/lib/opencode/npm-registry.js +7 -21
- package/server/lib/opencode/npm-registry.test.js +36 -5
- package/server/lib/opencode/plugin-icon.d.ts +2 -0
- package/server/lib/opencode/plugin-icon.js +43 -0
- package/server/lib/opencode/plugin-icon.test.js +41 -0
- package/server/lib/opencode/plugin-routes.js +3 -1
- package/server/lib/opencode/plugin-routes.test.js +13 -0
- package/dist/assets/AssistantView-C2KQZ6a4.js +0 -3
- package/dist/assets/GuiPluginSurface-Dz2CdSUA.js +0 -1
- package/dist/assets/Icon-BP1sfnHn.js +0 -1
- package/dist/assets/MobileDetailNavigation-B3rUx5Ve.js +0 -1
- package/dist/assets/MobileTabPageHeader-0esgB2TO.js +0 -2
- package/dist/assets/TerminalView-BtM5-BVx.js +0 -8
- package/dist/assets/dropdown-menu.styles-PdxueXzN.js +0 -1
- package/dist/assets/es-BjI1GHJ5.js +0 -15
- package/dist/assets/fr-Bs7ndHkb.js +0 -13
- package/dist/assets/gitApi-BxQmH8Wg.js +0 -10
- package/dist/assets/gitApiHttp-DHrRqnYh.js +0 -7
- package/dist/assets/host-D1EpSUMR.js +0 -1
- package/dist/assets/insertionBoundaries-CKQL85zy.js +0 -1
- package/dist/assets/ja-DkdV26EW.js +0 -15
- package/dist/assets/ko-B0qoC5da.js +0 -15
- package/dist/assets/main-CNwFqQQd.js +0 -2
- package/dist/assets/main-DPhcXanT.js +0 -169
- package/dist/assets/miniChat-CF2vb25D.js +0 -2
- package/dist/assets/mobile-C24qSj44.js +0 -2
- package/dist/assets/pl-D27Y_GBs.js +0 -15
- package/dist/assets/projectMeta-CG8NLahh.js +0 -1
- package/dist/assets/pt-BR-DbocEu4b.js +0 -15
- package/dist/assets/react-CURmDhtB.js +0 -1
- package/dist/assets/readiness-DSJs_3v4.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-ChZCxxH6.js +0 -2
- package/dist/assets/renderMobileApp-CRv3Il6P.js +0 -28
- package/dist/assets/runtime-fetch-D4ja813o.js +0 -1
- package/dist/assets/runtimeConfig-CZrflo-r.js +0 -2
- package/dist/assets/runtimeEndpointReset-Cx3RE97b.js +0 -149
- package/dist/assets/scheduledTaskNavigation-rhgnZaaj.js +0 -1
- package/dist/assets/sessionChangeSummary-CVUA1AFw.js +0 -1
- package/dist/assets/sessionLookup-C3_vQwLe.js +0 -1
- package/dist/assets/sortable-tabs-strip-C1QmKFdb.js +0 -1
- package/dist/assets/speechSettingsQueries-BSQ-2JTv.js +0 -4
- package/dist/assets/src-NKCZI3Lg.css +0 -2
- package/dist/assets/store-DvN2L3vf.js +0 -15
- package/dist/assets/useDesktopWindowControlsLayout-CwgkVw9f.js +0 -1
- package/dist/assets/useMobileNavigationStore-TCj7ZnhV.js +0 -418
- package/dist/assets/useUIStore-DI7va1HH.js +0 -1
- package/dist/assets/vendor-opencode-client-UL_TecvQ.js +0 -12
- package/dist/assets/zh-CN-DhFFdHQu.js +0 -15
- package/dist/assets/zh-TW-BvehppXO.js +0 -15
- /package/dist/assets/{sessionChangeSummary-8C8nv-EP.css → sessionLookup-8C8nv-EP.css} +0 -0
package/dist/index.html
CHANGED
|
@@ -560,43 +560,43 @@
|
|
|
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-9uP2z1qT.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">
|
|
567
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-
|
|
567
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
568
568
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
569
569
|
<link rel="modulepreload" crossorigin href="/assets/desktop-JwYqThiw.js">
|
|
570
570
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CB0CTcMg.js">
|
|
571
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
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
574
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
575
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
575
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-ZeOZ4Efz.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-DRx6OgCp.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
|
-
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-
|
|
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-BT8045Ue.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-C4SG3JZB.js">
|
|
586
|
-
<link rel="modulepreload" crossorigin href="/assets/fileQueries-
|
|
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
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
591
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
592
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
593
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
590
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-UJjHUF2C.js">
|
|
591
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BYOIbYIh.js">
|
|
592
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BSaclMDJ.js">
|
|
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-DFf9vd1b.js">
|
|
596
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DJ_h2x5D.js">
|
|
597
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CddZtLQ1.js">
|
|
598
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-B8VHHNxj.js">
|
|
599
|
+
<link rel="stylesheet" crossorigin href="/assets/src-lE4uqaHS.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,43 +77,43 @@
|
|
|
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-DqZvVkme.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
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/desktop-JwYqThiw.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CB0CTcMg.js">
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
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
91
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-ZeOZ4Efz.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-DRx6OgCp.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
|
-
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-
|
|
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-BT8045Ue.js">
|
|
102
102
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-C4SG3JZB.js">
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/fileQueries-
|
|
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
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-UJjHUF2C.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BYOIbYIh.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BSaclMDJ.js">
|
|
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-DFf9vd1b.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DJ_h2x5D.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CddZtLQ1.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-B8VHHNxj.js">
|
|
116
|
+
<link rel="stylesheet" crossorigin href="/assets/src-lE4uqaHS.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,43 +64,43 @@
|
|
|
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-DXAWjYcN.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
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
73
73
|
<link rel="modulepreload" crossorigin href="/assets/desktop-JwYqThiw.js">
|
|
74
74
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CB0CTcMg.js">
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
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
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
79
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-ZeOZ4Efz.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-DRx6OgCp.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
|
-
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-
|
|
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-BT8045Ue.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-C4SG3JZB.js">
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/fileQueries-
|
|
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
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-UJjHUF2C.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BYOIbYIh.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BSaclMDJ.js">
|
|
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-DFf9vd1b.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DJ_h2x5D.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CddZtLQ1.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-B8VHHNxj.js">
|
|
103
|
+
<link rel="stylesheet" crossorigin href="/assets/src-lE4uqaHS.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuriai/web",
|
|
3
|
-
"version": "0.2.27-beta.
|
|
3
|
+
"version": "0.2.27-beta.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./server/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"dev": "bun run build:watch",
|
|
16
|
-
"dev:server": "bun run build:llm-bridge && node ../../scripts/ensure-node-better-sqlite3.mjs && node server/index.js --port ${YURI_PORT:-3001}",
|
|
17
|
-
"dev:server:watch": "bun run build:llm-bridge && nodemon --exitcrash --watch server --ext js --exec \"node ../../scripts/ensure-node-better-sqlite3.mjs && node server/index.js --port ${YURI_PORT:-3001}\"",
|
|
16
|
+
"dev:server": "bun run build:llm-bridge && node ../../scripts/ensure-node-better-sqlite3.mjs && cross-env NODE_ENV=development node server/index.js --port ${YURI_PORT:-3001}",
|
|
17
|
+
"dev:server:watch": "bun run build:llm-bridge && nodemon --exitcrash --watch server --ext js --exec \"node ../../scripts/ensure-node-better-sqlite3.mjs && cross-env NODE_ENV=development node server/index.js --port ${YURI_PORT:-3001}\"",
|
|
18
18
|
"build": "bun run build:llm-bridge && vite build",
|
|
19
19
|
"build:llm-bridge": "bun scripts/build-llm-bridge.mjs",
|
|
20
20
|
"prepack": "bun run build:llm-bridge",
|
|
@@ -25,8 +25,11 @@
|
|
|
25
25
|
"start": "node bin/cli.js serve"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@wecom/aibot-node-sdk": "1.0.7",
|
|
28
29
|
"@clack/prompts": "^1.1.0",
|
|
29
30
|
"@earendil-works/pi-agent-core": "0.84.4",
|
|
31
|
+
"@larksuite/channel": "0.7.1",
|
|
32
|
+
"@larksuite/vercel-chat-adapter": "0.3.0",
|
|
30
33
|
"@octokit/rest": "^22.0.1",
|
|
31
34
|
"@opencode/ai": "2.2.1",
|
|
32
35
|
"@opencode/client": "^2.0.23",
|
|
@@ -36,8 +39,10 @@
|
|
|
36
39
|
"adm-zip": "^0.5.16",
|
|
37
40
|
"better-sqlite3": "^12.10.0",
|
|
38
41
|
"bun-pty": "^0.4.5",
|
|
42
|
+
"chat": "4.44.0",
|
|
39
43
|
"compression": "^1.8.1",
|
|
40
44
|
"cron-parser": "^4.9.0",
|
|
45
|
+
"dingtalk-stream": "2.1.5",
|
|
41
46
|
"effect": "4.0.1",
|
|
42
47
|
"express": "^5.1.0",
|
|
43
48
|
"http-proxy-middleware": "^3.0.5",
|
|
@@ -1,14 +1,46 @@
|
|
|
1
1
|
# Assistants Module
|
|
2
2
|
|
|
3
|
+
## Contact pins
|
|
4
|
+
|
|
5
|
+
Schema v15 adds nullable `assistant_v2.pinned_at`; existing contacts start unpinned.
|
|
6
|
+
The ordinary revision-checked Assistant PATCH accepts `pinned: boolean` and returns
|
|
7
|
+
`pinnedAt: number | null` in every Assistant DTO/snapshot. The Host chooses the time;
|
|
8
|
+
repeated pinning and unrelated settings edits preserve it, and unpinning clears it.
|
|
9
|
+
Only one live Bot may be pinned per Host. Pinning another Bot atomically clears
|
|
10
|
+
the previous pin and revises both contacts. Schema v16 keeps the most recently
|
|
11
|
+
pinned live contact from v15 (source order breaks ties), clears the others without
|
|
12
|
+
changing unread/history, and installs a partial unique index to enforce the limit.
|
|
13
|
+
Normalization, the index and schema-version update commit together; failure can retry.
|
|
14
|
+
Writes and domain revision changes use the existing transaction, so failed replacement
|
|
15
|
+
preserves the previous pin and all revisions. Pins do not create/reset sessions, alter catalog/share-default
|
|
16
|
+
order, or change avatar/transcript/read state. Tombstoned contacts never appear in
|
|
17
|
+
the pinned list. Existing snapshot events distribute confirmed changes to clients.
|
|
18
|
+
|
|
3
19
|
## WeChat message channel
|
|
4
20
|
|
|
5
|
-
|
|
21
|
+
Message channel configuration is shared: WeChat, WeCom, Feishu and DingTalk use
|
|
22
|
+
four colored entries in a 2×2 grid at the bottom of each saved Bot's settings,
|
|
23
|
+
with configuration mounted only inside its dialog. Platform messaging follows
|
|
24
|
+
Chat SDK's Adapter interface: vendor/community adapters are reused where suitable;
|
|
25
|
+
personal-WeChat and DingTalk implement extensions. Yuri remains authoritative for
|
|
26
|
+
Bot permissions, durable receipts, output and lifecycle, not a second Chat bot engine.
|
|
27
|
+
See `channels/DOCUMENTATION.md` for enterprise configuration and SDK integration.
|
|
28
|
+
|
|
29
|
+
Each saved Bot has a Host-owned, QR-authorized message channel configured in the final
|
|
6
30
|
**Message channels** settings group. It admits only the QR-confirmed owner through
|
|
7
31
|
the existing `send()` pipeline and reads committed public replies through the internal
|
|
8
32
|
`channelPage()` feed. Bindings, private credentials, durable receipts/outbox and
|
|
9
33
|
process leases are owned by `weixin/`, not ordinary Session delivery or UI state.
|
|
34
|
+
Rich input reuses contact attachments for images/files and untranscribed audio/video;
|
|
35
|
+
platform voice transcripts and bounded unknown share fields reach the model as
|
|
36
|
+
user content, with structured metadata encoded as TOON. Receiving an article link
|
|
37
|
+
does not imply that its body was fetched. See the channel documentation for limits.
|
|
10
38
|
See `weixin/DOCUMENTATION.md` for authorization, shared-context/output semantics,
|
|
11
39
|
restart ambiguity, local disconnect and the explicit platform-verification limits.
|
|
40
|
+
An existing local WeChat connection can be moved to an unbound Bot only through
|
|
41
|
+
explicit revision-checked confirmation; the source stops syncing, receipt IDs and
|
|
42
|
+
platform cursor survive, and histories/queued replies are not migrated. Repeated
|
|
43
|
+
scanning does not create independent WeChat entries for the same user.
|
|
12
44
|
|
|
13
45
|
## New-contact greeting
|
|
14
46
|
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# Enterprise message channels
|
|
2
|
+
|
|
3
|
+
Host-owned long-connection channel framework for enterprise platforms. It connects
|
|
4
|
+
one platform account to one existing Yuri Bot and reuses the Bot's normal contact
|
|
5
|
+
pipeline, tools and permissions. WeCom, Feishu and DingTalk wire behavior lives in
|
|
6
|
+
injected Chat SDK bridges (`sdk-adapters.js` and `dingtalk-chat-adapter.js`);
|
|
7
|
+
`runtime.js` and `store.js` own durable
|
|
8
|
+
storage, authorization, lifecycle and delivery semantics.
|
|
9
|
+
|
|
10
|
+
No public webhook, OAuth callback or platform protocol route is exposed here.
|
|
11
|
+
The shared runtime never constructs platform payloads, signs requests, refreshes
|
|
12
|
+
tokens or decides how a platform acknowledges a message. Those belong to the
|
|
13
|
+
adapter seam so a shared SDK can replace adapter internals without changing this
|
|
14
|
+
module.
|
|
15
|
+
|
|
16
|
+
## Chat adapter boundary
|
|
17
|
+
|
|
18
|
+
Platform implementations are supplied by the Host from a shared Chat SDK bridge.
|
|
19
|
+
Each `adapters[provider]` consumes a Chat SDK adapter internally;
|
|
20
|
+
the bridge is responsible for its dependency, protocol framing and reconnect
|
|
21
|
+
plumbing. This framework only sees `connect`/`send` and never imports the SDK,
|
|
22
|
+
registers SDK routes, or adds per-platform tables, queues or clocks.
|
|
23
|
+
|
|
24
|
+
Feishu reuses its existing Chat Adapter; WeCom and DingTalk implement the Chat SDK
|
|
25
|
+
Adapter interface over their official connection SDKs. The WeChat Bot
|
|
26
|
+
Adapter lives in `../weixin/chat-adapter.js` and is consumed by its existing
|
|
27
|
+
personal-channel runtime. Its QR authorization, typing, media behavior and private
|
|
28
|
+
database remain there. No second Chat state, lock or history engine is started.
|
|
29
|
+
SDK versions, ACK/ready evidence and platform limitations live in `PROTOCOLS.md`.
|
|
30
|
+
|
|
31
|
+
The seam is deliberately narrow so an SDK upgrade changes only the bridge:
|
|
32
|
+
|
|
33
|
+
- the framework owns Bot ownership, optional sender authorization, durable dedup,
|
|
34
|
+
bounded queues, transcript generation, lease and lifecycle;
|
|
35
|
+
- the adapter owns wire authentication, heartbeats, receipts, platform payloads
|
|
36
|
+
and target validation;
|
|
37
|
+
- both share one `{ connect, send }` contract and one `onMessage` receipt promise.
|
|
38
|
+
|
|
39
|
+
## Module map
|
|
40
|
+
|
|
41
|
+
- `store.js`: private SQLite binding, durable inbound receipts, ordered outbound
|
|
42
|
+
deliveries, routing targets and the process-owner lease.
|
|
43
|
+
- `runtime.js`: enablement policy, connect lifecycle, optional sender restriction,
|
|
44
|
+
bounded metadata projection, output reconciliation, dedup, retry/ambiguity and
|
|
45
|
+
shutdown.
|
|
46
|
+
- `routes.js`: authenticated settings/mutation routes behind the Host gate.
|
|
47
|
+
- `sdk-adapters.js`: vendor Chat Adapter bridges and provider registry.
|
|
48
|
+
- `dingtalk-chat-adapter.js`: Chat Adapter extension using the official Stream SDK.
|
|
49
|
+
- `wecom-chat-adapter.js`: Chat Adapter extension using the official WeCom SDK,
|
|
50
|
+
including platform-acknowledged sends rather than fire-and-forget writes.
|
|
51
|
+
- `transport.js`: bounded HTTP helpers for adapter-owned platform API calls;
|
|
52
|
+
platform sockets and protocol framing remain SDK-owned.
|
|
53
|
+
- `../weixin/toon.js`: reused JSON-only TOON encoder. Channel metadata does not
|
|
54
|
+
copy or fork it.
|
|
55
|
+
|
|
56
|
+
`service.channelPage()` is the internal bounded, ascending public-output seam. It
|
|
57
|
+
validates the Bot, uses the contact-store generation and returns only assistant
|
|
58
|
+
rows. It does not expose credentials or replace the contact execution engine.
|
|
59
|
+
|
|
60
|
+
## Runtime API
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
createAssistantChannelsRuntime({
|
|
64
|
+
directory, service, adapters, refreshAllowedRoots, env, clock, intervalMs,
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- `status(assistantID, provider)` — sync read; validates the Bot first.
|
|
69
|
+
- `save(assistantID, provider, input)` — save configuration and connect.
|
|
70
|
+
- `transfer(assistantID, provider, input)` — explicitly move a local binding using
|
|
71
|
+
`{ sourceAssistantID, revision }`, without returning or re-entering its secret.
|
|
72
|
+
- `retry(assistantID, provider)` — explicit reconnect only.
|
|
73
|
+
- `disconnect(assistantID, provider)` — delete local configuration and queues.
|
|
74
|
+
- `forget(assistantID)` — delete every provider for a deleted Bot.
|
|
75
|
+
- `onTurnEvent(event)` — receipt completion from contact turn events.
|
|
76
|
+
- `close()` — drain channel work, release the lease and close SQLite.
|
|
77
|
+
|
|
78
|
+
`registerAssistantChannelRoutes(app, runtime)` registers:
|
|
79
|
+
|
|
80
|
+
| Method | Path | Behavior |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| GET | `/api/yuri/assistants/:assistantID/channels/:provider` | status |
|
|
83
|
+
| PUT | same | save + connect |
|
|
84
|
+
| POST | same `/retry` | reconnect without resending unknown output |
|
|
85
|
+
| POST | same `/transfer` | confirmed local rebind with source revision check |
|
|
86
|
+
| DELETE | same | disconnect |
|
|
87
|
+
|
|
88
|
+
Save input is `{ clientID, clientSecret?, ownerID?, language? }`. An omitted or empty
|
|
89
|
+
`ownerID` uses the platform's access scope without an additional Yuri sender filter;
|
|
90
|
+
a non-empty value restricts the channel to that private sender. The first save
|
|
91
|
+
requires `clientSecret`; an update with the same `clientID` and an empty or omitted
|
|
92
|
+
secret keeps the stored one. A new `clientID` requires a new secret.
|
|
93
|
+
Responses are `Cache-Control: no-store` and contain only safe error codes — no
|
|
94
|
+
upstream bodies, secrets or routing targets.
|
|
95
|
+
|
|
96
|
+
Status shape:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"provider": "wecom",
|
|
101
|
+
"status": "disabled|disconnected|connecting|connected|reconnecting|error",
|
|
102
|
+
"error": null,
|
|
103
|
+
"configured": true,
|
|
104
|
+
"clientID": "…",
|
|
105
|
+
"ownerID": "…",
|
|
106
|
+
"hasSecret": true,
|
|
107
|
+
"transport": "websocket"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`clientID`, `ownerID` and `hasSecret` appear only when configured. The secret
|
|
112
|
+
itself never appears in any DTO, error, transcript, model context or log.
|
|
113
|
+
Unconfigured Bots may also receive `transferSources`: safe source Bot IDs, names,
|
|
114
|
+
client IDs and binding revisions for this provider. The UI uses the same move
|
|
115
|
+
button, warning and confirmation text as WeChat. It offers matching accounts
|
|
116
|
+
instead of telling users to manually unlink the other Bot first.
|
|
117
|
+
|
|
118
|
+
Transfer drains and stops the source lane under source/destination mutation locks,
|
|
119
|
+
then atomically moves credentials and rotates the epoch. It starts at the target
|
|
120
|
+
Bot's current transcript tip, preserves receipt IDs against replay, and discards
|
|
121
|
+
the old Bot's pending input and queued replies. Chat history and already-started
|
|
122
|
+
tasks are not moved or cancelled. Stale revisions, an occupied destination or
|
|
123
|
+
failed writes preserve the original binding and resume its receiver. Other
|
|
124
|
+
providers/accounts are untouched. The host lease still prevents taking a binding
|
|
125
|
+
from another process; this operation only moves a binding in this Host's store.
|
|
126
|
+
|
|
127
|
+
## Enablement policy
|
|
128
|
+
|
|
129
|
+
Before opening storage or creating a timer, the runtime resolves policy from its
|
|
130
|
+
environment. `NODE_ENV=development` or `YURI_ELECTRON_DEV=1/true` disables channels
|
|
131
|
+
by default. Only an explicit `YURI_CHANNELS_ENABLED=1/true` opts in; `0/false` or
|
|
132
|
+
an unrecognized non-empty value disables them in every environment. Production
|
|
133
|
+
defaults remain enabled.
|
|
134
|
+
|
|
135
|
+
A disabled runtime does not open/create SQLite, acquire a lease, poll, send or
|
|
136
|
+
mutate bindings. Status returns `disabled`; save, retry and disconnect fail with
|
|
137
|
+
`channel_disabled` (403). `forget` and `close` are no-ops, so development cannot
|
|
138
|
+
erase production channel credentials or delete their bindings.
|
|
139
|
+
|
|
140
|
+
## Adapter contract
|
|
141
|
+
|
|
142
|
+
Adapters are injected by provider key and must implement exactly:
|
|
143
|
+
|
|
144
|
+
```js
|
|
145
|
+
{
|
|
146
|
+
connect({ config, signal, onReady, onMessage, onError }): Promise<void>,
|
|
147
|
+
send({ config, target, text, id, signal }): Promise<void>,
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- `config` is `{ clientID, clientSecret, ownerID, language }`.
|
|
152
|
+
- `connect` resolves or rejects only when that connection ends. It calls
|
|
153
|
+
`onReady()` after authentication and `onError(error)` for asynchronous transport
|
|
154
|
+
failures. Errors carry a safe `code`; `ambiguous` marks an indeterminate send.
|
|
155
|
+
The framework sends only while the latest connection reported `onReady`; a
|
|
156
|
+
transport error or connection end immediately closes that output lane.
|
|
157
|
+
- `onMessage(message)` must return a Promise that the adapter awaits before
|
|
158
|
+
acknowledging the platform. It persists a durable receipt; it does not wait for
|
|
159
|
+
model execution. A missing or overlong stable `id` is never admitted.
|
|
160
|
+
- Inbound shape:
|
|
161
|
+
`{ id, senderID, chatType: 'private'|'group', text, metadata?, target? }`.
|
|
162
|
+
- `send` receives the current config, the private `target` snapshot and a stable
|
|
163
|
+
delivery `id`. The adapter re-validates `target`; the framework never follows a
|
|
164
|
+
user-controlled URL. An abort after submission must reject with `ambiguous: true`
|
|
165
|
+
so the row becomes `unknown` instead of being retried.
|
|
166
|
+
- Adapters must honor `signal`; shutdown and disconnect abort platform I/O.
|
|
167
|
+
|
|
168
|
+
## Authorization and persistence
|
|
169
|
+
|
|
170
|
+
Only platform-delivered `private` messages with a valid sender identity may execute
|
|
171
|
+
tools. A saved non-empty `ownerID` adds an exact sender restriction. With an empty
|
|
172
|
+
ID, administrators must control access through the platform's Bot/application
|
|
173
|
+
availability and permissions. Group messages and messages without a valid sender
|
|
174
|
+
or stable platform ID are ignored. Receiving a message never saves an owner binding.
|
|
175
|
+
All allowed users share this Bot's existing context; this is not per-user isolation.
|
|
176
|
+
|
|
177
|
+
Account IDs, owner IDs and secrets are never truncated. An overlong value is a
|
|
178
|
+
`validation_error`; a changed `clientID` must supply its own secret rather than
|
|
179
|
+
silently reusing the previous account's credential. Changing the owner or account
|
|
180
|
+
starts the new binding at the current transcript tip, so replies produced while
|
|
181
|
+
the previous owner was disconnected are never leaked to the new destination. A
|
|
182
|
+
same-identity save keeps the existing watermark and durable receipts.
|
|
183
|
+
|
|
184
|
+
Bindings live under `<yuriDataDir>/channels/channel.sqlite`. The directory is 0700
|
|
185
|
+
and the database 0600, with SQLite secure-delete enabled. Secrets are **not
|
|
186
|
+
encrypted at rest**; the host OS user must protect the data directory and backups
|
|
187
|
+
(on Windows, OS ACLs remain necessary). The same `provider + clientID` maps to at
|
|
188
|
+
most one Bot in the data directory; a second Bot receives `account_in_use` (409).
|
|
189
|
+
Different enterprise accounts can bind different Bots, including multiple accounts
|
|
190
|
+
of the same provider. The personal-WeChat single-entry/rebind restriction belongs
|
|
191
|
+
only to `../weixin/` and never limits these enterprise bindings.
|
|
192
|
+
|
|
193
|
+
`target` is platform routing metadata (for example a reply handle or session
|
|
194
|
+
webhook). It is persisted only in this private database and per outbox row. It is
|
|
195
|
+
never added to model context, transcript text or HTTP DTOs. The framework replies
|
|
196
|
+
to the configured owner destination, or, without a binding, to the latest accepted
|
|
197
|
+
private sender. The runtime derives `target.userID` from the authenticated platform
|
|
198
|
+
sender, overriding any supplied routing field; queued output keeps its destination
|
|
199
|
+
snapshot. There is no push destination before the first accepted private message,
|
|
200
|
+
and earlier public output is not backfilled when a recipient first appears.
|
|
201
|
+
|
|
202
|
+
Inbound `metadata` is projected before storage: credential-shaped keys, media/file
|
|
203
|
+
references, URLs and raw event envelopes are dropped or replaced, nesting and
|
|
204
|
+
total size are bounded, and the result is encoded as TOON in an ordinary text part
|
|
205
|
+
labelled external content. This is a conservative projection, not proof that a
|
|
206
|
+
linked article or media body was read. Text is capped at 20,000 characters.
|
|
207
|
+
Internal `platform` and `chatType` labels are omitted from content metadata.
|
|
208
|
+
Ordinary text with only these labels remains one original text part, with no
|
|
209
|
+
TOON appendix; actual media/transcription descriptors retain their content hints.
|
|
210
|
+
|
|
211
|
+
## Shared three-provider state
|
|
212
|
+
|
|
213
|
+
One `channel` row exists per `(assistantID, provider)`. The three enterprise
|
|
214
|
+
providers share the same SQLite file, receipt table, outbox table and process
|
|
215
|
+
lease; there is no per-platform queue, worker, database or reconnect loop. Each
|
|
216
|
+
account still has one receiver and one serial input/output lane, so providers
|
|
217
|
+
cannot consume each other's queue or block each other's replies. Deleting a Bot
|
|
218
|
+
removes all three rows, receipts and deliveries in one transaction.
|
|
219
|
+
|
|
220
|
+
## Delivery semantics
|
|
221
|
+
|
|
222
|
+
- **Durability:** the receipt, private routing target and deduplicated stable ID
|
|
223
|
+
commit before `onMessage` resolves. IDs are namespaced by provider, client account
|
|
224
|
+
and owner, so platform replays and restarts cannot re-execute admitted tools.
|
|
225
|
+
- **Backpressure:** pending plus admitted receipts cap at 100; each pass admits at
|
|
226
|
+
most 20. Adapters may treat `backlog_full` as retryable and must not acknowledge.
|
|
227
|
+
A platform replay whose stable ID already has a durable receipt is acknowledged
|
|
228
|
+
without a new slot, even when the backlog is full.
|
|
229
|
+
- **Isolation:** each account has one receiver, one serial inbound worker and one
|
|
230
|
+
serial outbound scheduler. A slow Bot cannot block another account.
|
|
231
|
+
- **Output source:** all public assistant replies, including App-initiated and
|
|
232
|
+
background replies, come from `channelPage`. Binding starts at the current
|
|
233
|
+
contact tip, so previous history/greetings are not sent. Internal settle markers
|
|
234
|
+
are omitted; failures use a safe generic message.
|
|
235
|
+
All channels attached to the same Bot share its contact context, but replies
|
|
236
|
+
go only to the channel that admitted the original input. Its persisted contact
|
|
237
|
+
`turnID` is the reserved `channel:*`/`weixin:*` receipt ID, and exact receipt
|
|
238
|
+
ownership by binding epoch gates delivery; another channel never broadcasts it.
|
|
239
|
+
Only App/background turns without a channel origin are proactively pushed to
|
|
240
|
+
all eligible bound platforms. Selection never uses the latest conversation turn.
|
|
241
|
+
Each enterprise receipt keeps its own private reply target, so a later sender
|
|
242
|
+
cannot redirect an earlier reply. The inbox target column is added in place for
|
|
243
|
+
existing databases; legacy receipts without a target and without a fixed owner
|
|
244
|
+
are not guessed from the latest sender. The feed watermark still advances over
|
|
245
|
+
filtered replies. Channels are not separate conversation contexts.
|
|
246
|
+
- **Generation:** a transcript wipe changes `channelPage().generation`. Queued
|
|
247
|
+
output from the previous generation is deleted, and late async work is fenced by
|
|
248
|
+
epoch, lease and generation.
|
|
249
|
+
- **Unknown delivery:** a crash or abort during `sending`, or an ambiguous adapter
|
|
250
|
+
error, marks the row `unknown`. It is never automatically resent and status
|
|
251
|
+
reports `delivery_unknown`. `retry` only reconnects and does not clear it.
|
|
252
|
+
Definitively failed rows may be retried explicitly. The outbox is strictly
|
|
253
|
+
ordered: an `unknown` or `blocked` head is never bypassed, so later replies wait
|
|
254
|
+
until the owner disconnects and configures the channel again (or a blocked row
|
|
255
|
+
is explicitly retried). Saving the same account/owner preserves unknown rows;
|
|
256
|
+
disconnecting discards that channel's queued replies as well as its credentials.
|
|
257
|
+
- **Reconnect:** connection failures retry with 1–30 second capped exponential
|
|
258
|
+
backoff. Authentication failure and SDK `connection_replaced` become a sticky
|
|
259
|
+
`error` until an explicit save or retry, so bad credentials or mutual-kick loops
|
|
260
|
+
cannot hot-loop. Output is only attempted after `onReady`; a send failure never
|
|
261
|
+
marks the lane connected. While sticky, new inbound receipts are not admitted
|
|
262
|
+
and already durable but unadmitted work waits for an explicit reconnect.
|
|
263
|
+
- **Save and concurrency:** a save drains admitted inbound work and aborts the old
|
|
264
|
+
receiver under a per-channel mutation lock. Owner/account changes revalidate the
|
|
265
|
+
binding epoch after the wait; a conflict or failed write resumes the previous
|
|
266
|
+
receiver instead of stranding it. `retry` and `disconnect` share the same lock
|
|
267
|
+
and revalidate the epoch after draining.
|
|
268
|
+
- **Disconnect:** deletes local credentials, receipts and queued replies. It does
|
|
269
|
+
not cancel already admitted contact work; late output is fenced and discarded.
|
|
270
|
+
- **Bot deletion:** `forget(assistantID)` removes every provider's local binding
|
|
271
|
+
and queues for that Bot.
|
|
272
|
+
- **Shutdown:** `close()` stops new work, aborts platform I/O, awaits all tracked
|
|
273
|
+
channel operations, releases the process lease and only then closes SQLite. The
|
|
274
|
+
owning Host must close channels before `service.close()`.
|
|
275
|
+
- **Lease:** one process sharing the data directory owns channels for 60 seconds,
|
|
276
|
+
renewed each tick (default 2 seconds). Another enabled process cannot steal a
|
|
277
|
+
live account and responds `channel_in_use` until the lease expires.
|
|
278
|
+
|
|
279
|
+
## Not in this layer
|
|
280
|
+
|
|
281
|
+
Live typing/presence, platform media download, template cards, interactive
|
|
282
|
+
callbacks and per-provider protocol routing are intentionally absent. Those belong
|
|
283
|
+
to adapters or a shared SDK. This layer also does not promise server-side
|
|
284
|
+
exactly-once delivery or platform token revocation.
|
|
285
|
+
|
|
286
|
+
## Validation
|
|
287
|
+
|
|
288
|
+
Focused Vitest suite: `bunx vitest run --project @yuriai/web packages/web/server/lib/assistants/channels`.
|
|
289
|
+
It uses real SQLite and the real assistant service for the end-to-end
|
|
290
|
+
channel → Bot → durable reply path. Adapter wire tests live with their adapters and
|
|
291
|
+
do not prove real-account permissions, quotas or mobile rendering.
|