@yuriai/web 0.3.6-beta.14 → 0.3.6-beta.16
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-5tMBB3OP.js → AgentAvatar-Cz7vWoUM.js} +1 -1
- package/dist/assets/{AgentSelector-Cb7GNCSr.js → AgentSelector-tguIbO8e.js} +1 -1
- package/dist/assets/{ArchivedSessionsDialog-8gBAWGWJ.js → ArchivedSessionsDialog-C0Vf38jt.js} +1 -1
- package/dist/assets/{AssistantConversationSurface-DBgTUUEt.js → AssistantConversationSurface-TNj9TKag.js} +3 -3
- package/dist/assets/{AssistantSessionCard-_yFsx4WB.js → AssistantSessionCard-BX_ck4KS.js} +2 -2
- package/dist/assets/{AssistantUnreadBadge-a2u_bBfi.js → AssistantUnreadBadge-DSjJfYrh.js} +1 -1
- package/dist/assets/{AssistantView-BxqHaArC.js → AssistantView-eAuI94K6.js} +1 -1
- package/dist/assets/{AssistantWorkingAvatar-DHZVN5kD.js → AssistantWorkingAvatar-OhfpjL1t.js} +1 -1
- package/dist/assets/{AssistantsSettingsPage-CCG2-SGj.js → AssistantsSettingsPage-X19bTIju.js} +1 -1
- package/dist/assets/{BinaryFileFallback-DyOwcZlP.js → BinaryFileFallback-DDWawtzt.js} +1 -1
- package/dist/assets/{BtwPanel-BhJA_qnp.js → BtwPanel-Dhn1iVrH.js} +2 -2
- package/dist/assets/BusyDots-q2aVrHbQ.js +4 -0
- package/dist/assets/{ChatContainer-vX0hPadC.js → ChatContainer-CYq3DRwu.js} +21 -21
- package/dist/assets/ChatView-CD7B735C.js +3 -0
- package/dist/assets/{DiagramView-XjJTNa7h.js → DiagramView-D8qMjsAQ.js} +1 -1
- package/dist/assets/{DiffView-B6_7v5dX.js → DiffView-BRUUP_UF.js} +1 -1
- package/dist/assets/{DiffViewToggle-as2OeoZV.js → DiffViewToggle-Bn4WLr8E.js} +1 -1
- package/dist/assets/{ErrorBoundary-6AeJc3yJ.js → ErrorBoundary-UqQdMytG.js} +1 -1
- package/dist/assets/{FadeInOnReveal-BKAakuxD.js → FadeInOnReveal-BV_4xYNR.js} +1 -1
- package/dist/assets/{GuiPluginMount-DlrUvFjg.js → GuiPluginMount-CEXVtLmV.js} +1 -1
- package/dist/assets/{GuiPluginPage-DsBH_Y2M.js → GuiPluginPage-BziZa4M0.js} +1 -1
- package/dist/assets/{GuiPluginSurface-BisC0s24.js → GuiPluginSurface-gxhtskj7.js} +1 -1
- package/dist/assets/{GuiPluginTitlebarItems-CraVxzKU.js → GuiPluginTitlebarItems-mIMh81nb.js} +1 -1
- package/dist/assets/{GuiPluginWindow-DjrDed9m.js → GuiPluginWindow-DvVG8u7w.js} +1 -1
- package/dist/assets/{Icon-zB0u-x9G.js → Icon-C6Duv_oe.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-COr72scf.js → ImageLoadingPlaceholder-BIQ6Y6SP.js} +1 -1
- package/dist/assets/{LoadingImage-DCyqFHPY.js → LoadingImage-Dk4wxhnT.js} +1 -1
- package/dist/assets/{MarkdownRenderer-YxMjOHQg.js → MarkdownRenderer-BY310t1T.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-FJ3saBi-.js → MarkdownRendererImpl-nAHoW0Z9.js} +3 -3
- package/dist/assets/{MarkstreamRendererImpl-69EMw8mz.js → MarkstreamRendererImpl-shwGZ7Tl.js} +1 -1
- package/dist/assets/{MobileAssistantSettingsPage-BoH-3iPc.js → MobileAssistantSettingsPage-DOJwDh_T.js} +1 -1
- package/dist/assets/{MobileAssistantTab-59nMj5dF.js → MobileAssistantTab-BAkvh3MP.js} +1 -1
- package/dist/assets/{MobileBtwPage-EwMOy6Vg.js → MobileBtwPage-BdPAeG7v.js} +1 -1
- package/dist/assets/{MobileChangesSurface-BfMWp6TX.js → MobileChangesSurface-DmlszV_t.js} +1 -1
- package/dist/assets/{MobileChatScreen-CZDiNi7M.js → MobileChatScreen-CEbQNMgn.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DKv1HfQX.js → MobileDetailNavigation-BUMzEYEL.js} +1 -1
- package/dist/assets/{MobileFilesSurface-BiK7LCem.js → MobileFilesSurface-DCQsIn2I.js} +2 -2
- package/dist/assets/{MobileHtmlNetworkBoundary-BXh_BJ93.js → MobileHtmlNetworkBoundary-DiuzUkq3.js} +2 -2
- package/dist/assets/{MobileOverlayPanel-Pr-vLaIF.js → MobileOverlayPanel-DhGG1USg.js} +1 -1
- package/dist/assets/{MobileResizableSheet-O2gv2sCB.js → MobileResizableSheet-BN5lO8_k.js} +1 -1
- package/dist/assets/{MobileSettingsTab-DadXop75.js → MobileSettingsTab-B4wkSo7K.js} +1 -1
- package/dist/assets/{MobileShareBridge-CaiscA4w.js → MobileShareBridge-DUHyEHab.js} +1 -1
- package/dist/assets/{MobileSurface-B_2aVFm1.js → MobileSurface-CuAPWI6D.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-T0zUz7Wl.js → MobileTabPageHeader-Bh1ILbqr.js} +1 -1
- package/dist/assets/{ModelLogo-C1Vv7gz6.js → ModelLogo-R0TXf5Pt.js} +1 -1
- package/dist/assets/{ModelSelector-BP_s_VhY.js → ModelSelector-D5pSGqN8.js} +1 -1
- package/dist/assets/{MultiRunWindow--tNVFKUJ.js → MultiRunWindow-DJb6RpVw.js} +1 -1
- package/dist/assets/{OnboardingScreen-DMdy73Dq.js → OnboardingScreen-CdHEr54c.js} +1 -1
- package/dist/assets/{OverlayScrollbar-n5T49w2e.js → OverlayScrollbar-CrwDy2Pt.js} +1 -1
- package/dist/assets/{PierreDiffViewer-i3OsvUKm.js → PierreDiffViewer-BYO9Wbwk.js} +1 -1
- package/dist/assets/{ProviderLogo-D-ldwq0G.js → ProviderLogo-C8aB3qlM.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-CNpcgVmv.js → RemoteAssistantSessionCard-C_hCy6FE.js} +1 -1
- package/dist/assets/{RemoteDesktopPanel-hTuLKJZb.js → RemoteDesktopPanel-Cj6G6AyD.js} +1 -1
- package/dist/assets/ScheduledTasksDialog-z2v4fwrE.js +3 -0
- package/dist/assets/{ScrollableOverlay-DAMUOn67.js → ScrollableOverlay-BrA__-l0.js} +1 -1
- package/dist/assets/{SettingsGroup-CwMJmhq2.js → SettingsGroup-DMAcPhM4.js} +1 -1
- package/dist/assets/{SettingsView-bYWNjHtA.js → SettingsView-BuGjKeb9.js} +10 -10
- package/dist/assets/{SettingsWindow-D0ZzAXW0.js → SettingsWindow-_sonrUby.js} +1 -1
- package/dist/assets/{SetupTourDialog-CgM5YonA.js → SetupTourDialog-Cf1Jm1Gl.js} +1 -1
- package/dist/assets/{SyncActions-Ct2yZTbg.js → SyncActions-BWHWdbi_.js} +1 -1
- package/dist/assets/{TerminalView-BU5w40RA.js → TerminalView-DN60v7to.js} +3 -3
- package/dist/assets/{TextSelectionMenu-a7yyDz5R.js → TextSelectionMenu-YlWMOZkS.js} +2 -2
- package/dist/assets/{ToolOutputDialog-CGYnrXVV.js → ToolOutputDialog-B388thfl.js} +2 -2
- package/dist/assets/{YuriLogo-Cexwa29m.js → YuriLogo-CdbCjzA8.js} +1 -1
- package/dist/assets/{YuriWordmark-Bn5KdqMC.js → YuriWordmark-rISEHjrd.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-Y7yhlQcv.js → assistant-attachment-cache-BsIYVOYw.js} +1 -1
- package/dist/assets/{assistantMessagePreview-BXNdMDW-.js → assistantMessagePreview-DJVWTOKl.js} +1 -1
- package/dist/assets/{assistantQueries-DkAmjFg7.js → assistantQueries-C_SpnqtF.js} +1 -1
- package/dist/assets/{auto-read-context-DLilPZMl.js → auto-read-context-BO5tE9k_.js} +1 -1
- package/dist/assets/{capgoAdapter-DaIrgBjp.js → capgoAdapter-qaeQqHpT.js} +1 -1
- package/dist/assets/{card-CXE0ffyH.js → card-t-tgqQ79.js} +1 -1
- package/dist/assets/{chatUpwardIntent-DRFjEP4t.js → chatUpwardIntent-BEntur0S.js} +1 -1
- package/dist/assets/{checkbox-hYuewn9u.js → checkbox-D-OIaMB8.js} +1 -1
- package/dist/assets/{client-QcYZg8_d.js → client-BuCd-T7s.js} +1 -1
- package/dist/assets/{collapsible-C4a0ndbm.js → collapsible-CCc6anWP.js} +1 -1
- package/dist/assets/{connection-hint-Ci6c4iij.js → connection-hint-DAQZ45pI.js} +1 -1
- package/dist/assets/{context-menu-D73tnkiI.js → context-menu-BhnOdTDq.js} +1 -1
- package/dist/assets/{desktopHosts-DFa3lf0i.js → desktopHosts-COI-czjF.js} +1 -1
- package/dist/assets/{desktopRelayRestore-CGq-Ylgq.js → desktopRelayRestore-BEPNc7qb.js} +1 -1
- package/dist/assets/device-TCHW5U2y.js +2 -0
- package/dist/assets/{diagram-B2X1oieg.js → diagram-sCh-Ausk.js} +1 -1
- package/dist/assets/{dialog-B2Po85oU.js → dialog-C9DNMP08.js} +1 -1
- package/dist/assets/{dropdown-menu-vW7wfT5z.js → dropdown-menu-CcQq6JDI.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-B73h0W0P.js → fileMentionTouchSelection-HhfJS8d1.js} +1 -1
- package/dist/assets/{fileReferenceActions-DEUhs_7h.js → fileReferenceActions-wN7mWY3w.js} +1 -1
- package/dist/assets/{gitApi-DG2Gj6gC.js → gitApi-BNkkLnOi.js} +1 -1
- package/dist/assets/{gitApiHttp-C8AU1uiY.js → gitApiHttp-CrPYe9Oc.js} +2 -2
- package/dist/assets/{githubAuthQueries-IJPWBo0B.js → githubAuthQueries-CTTiXZ9q.js} +1 -1
- package/dist/assets/{historyImportQueries-B3QBdaKo.js → historyImportQueries-B4DVAuxZ.js} +1 -1
- package/dist/assets/{host-DchPrZpw.js → host-BjnskVUP.js} +1 -1
- package/dist/assets/{i18n-WsU03nwB.js → i18n-CYty_Jft.js} +1 -1
- package/dist/assets/{icons-6sA6AOaU.js → icons-DlTcJ36Q.js} +1 -1
- package/dist/assets/{imageSource-B39pFDdo.js → imageSource-BquIRnWW.js} +1 -1
- package/dist/assets/{input-BpDiYSsP.js → input-DVzjAzTw.js} +1 -1
- package/dist/assets/{input-store-PqhVEhUI.js → input-store-BtvRZZcg.js} +1 -1
- package/dist/assets/insertionBoundaries-WYUnaIac.js +1 -0
- package/dist/assets/{kbd-Dd1lM8OM.js → kbd-DA0IyUcd.js} +1 -1
- package/dist/assets/main-BfuLSPdJ.js +169 -0
- package/dist/assets/{main-BtqqLSTt.js → main-BpAkYb0H.js} +2 -2
- package/dist/assets/{markdownHeightCache-BzWUzccz.js → markdownHeightCache-CcgRs1ER.js} +1 -1
- package/dist/assets/{mcpQueries-8frBxd65.js → mcpQueries-CCvxTdrj.js} +1 -1
- package/dist/assets/miniChat-D2l_XXQe.js +2 -0
- package/dist/assets/mobile-mVNRvGd5.js +2 -0
- package/dist/assets/{mobileBackNavigation-Ch0aK3t9.js → mobileBackNavigation-B8wJO_pZ.js} +1 -1
- package/dist/assets/{mobileConnections-Bay_JNn0.js → mobileConnections-Ckzqn3Y9.js} +2 -2
- package/dist/assets/{multirun-CQ2v1-nW.js → multirun-B34hqzTY.js} +1 -1
- package/dist/assets/{native-config-B8eHFnvv.js → native-config-CD8pMBkt.js} +1 -1
- package/dist/assets/{nativeComposerCover--wSR2Iru.js → nativeComposerCover-CEyD3731.js} +1 -1
- package/dist/assets/{navigation-33oih6q2.js → navigation-atykJu0I.js} +2 -2
- package/dist/assets/openRemoteProjectSession-B63pkBaj.js +1 -0
- package/dist/assets/openSessionFromDeepLink-Bz07xQfv.js +2 -0
- package/dist/assets/platform-B2ylz14u.js +1 -0
- package/dist/assets/{pluginPresentation-BqcbcLYL.js → pluginPresentation-4xMNGtKI.js} +2 -2
- package/dist/assets/{project-preview-CIkGbBPZ.js → project-preview-Dq--046z.js} +1 -1
- package/dist/assets/{projectActions-D84EVh3q.js → projectActions-B11KAI3f.js} +1 -1
- package/dist/assets/{prompt-attachment-upload-D1c308Ba.js → prompt-attachment-upload-m0vbcftI.js} +1 -1
- package/dist/assets/{pwa-JM_Ia4Qo.js → pwa-uLk3vYDP.js} +2 -2
- package/dist/assets/{queue-abort-optimistic-BspQeOrZ.js → queue-abort-optimistic-C_L5pmK0.js} +1 -1
- package/dist/assets/{quota-C7uYEfoX.js → quota-CNmk_bQD.js} +1 -1
- package/dist/assets/{reference-history-DuOv6xPy.js → reference-history-CN8H7cQY.js} +1 -1
- package/dist/assets/{remote-input-store-CquhCIoR.js → remote-input-store-CE88ZLsw.js} +1 -1
- package/dist/assets/{remoteProjectQueries-BunVM5PM.js → remoteProjectQueries-zO4jYbru.js} +1 -1
- package/dist/assets/{remoteSessionReference-brIKt6ea.js → remoteSessionReference-BvbDndSv.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-1iiZ6q0N.js → renderElectronMiniChatApp-BImqnwc-.js} +2 -2
- package/dist/assets/renderMobileApp-DjKpQ6id.js +17 -0
- package/dist/assets/{runtime-file-download-wMVtKk2v.js → runtime-file-download-CzZ_VAoB.js} +1 -1
- package/dist/assets/{runtime-file-resource-DKJJoOOc.js → runtime-file-resource-9kLrAtnQ.js} +1 -1
- package/dist/assets/{runtimeConfig-qjNoqcXT.js → runtimeConfig-Cs95Hj1_.js} +1 -1
- package/dist/assets/runtimeEndpointReset-BeO-ZC0f.js +4 -0
- package/dist/assets/{scheduledTaskNavigation-DpfZSGu8.js → scheduledTaskNavigation-r3g3DfXq.js} +1 -1
- package/dist/assets/{select-Ojd202kE.js → select-Cb6W8KRB.js} +1 -1
- package/dist/assets/sessionLookup-MXum2sR5.js +1 -0
- package/dist/assets/{sessionOwnership-Nqb7MQgW.js → sessionOwnership-CgeZg9fN.js} +1 -1
- package/dist/assets/{shortcuts-BOzfBNF8.js → shortcuts-5iHGo1f3.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-DlQjS9bw.js → sortable-tabs-strip-D5MuRWnZ.js} +1 -1
- package/dist/assets/{speechSettingsQueries-DzDLUBnb.js → speechSettingsQueries-D2CugjM1.js} +1 -1
- package/dist/assets/{switch-BN9zvb0m.js → switch-DLlbkkU5.js} +1 -1
- package/dist/assets/{terminalApi-D2ECmoAo.js → terminalApi-CsTh04jY.js} +1 -1
- package/dist/assets/{textarea-ChLN9tnA.js → textarea-Cg3Yz3Oc.js} +1 -1
- package/dist/assets/{timeFormat-D1hdmWbu.js → timeFormat-fIpRkrOb.js} +1 -1
- package/dist/assets/{tooltip-Cdsa-YWG.js → tooltip-Chqxbwjz.js} +1 -1
- package/dist/assets/{truncated-path-DjN9DJvh.js → truncated-path-DWUl2HQC.js} +1 -1
- package/dist/assets/{types-DHO20zYy.js → types-DfbaAnUB.js} +1 -1
- package/dist/assets/ui-lbbchWJP.js +13 -0
- package/dist/assets/useAppFontEffects-BDoatEWZ.js +7 -0
- package/dist/assets/{useAssistantUIStore-DEiMjSqf.js → useAssistantUIStore-BUWPTwNV.js} +1 -1
- package/dist/assets/{useDesktopWindowControlsLayout-OdYH5vsn.js → useDesktopWindowControlsLayout-C_VGQBG3.js} +1 -1
- package/dist/assets/{useDictation-DUR68U4T.js → useDictation-C81KyPa6.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DNVTRp-B.js → useEffectiveDirectory-Dqdl58J7.js} +1 -1
- package/dist/assets/{useFontPreferences-BY0TXvWI.js → useFontPreferences-DyMUXTQC.js} +1 -1
- package/dist/assets/{useGitStore-DsxzluvZ.js → useGitStore-kco1LBfw.js} +1 -1
- package/dist/assets/{useInlineCommentDraftStore-DU-yffqD.js → useInlineCommentDraftStore-DFr7FLv-.js} +1 -1
- package/dist/assets/useMcpConfigStore-C9SxNeU1.js +1 -0
- package/dist/assets/{useMobileSwipeActions-rPGl_HNn.js → useMobileSwipeActions-vvnhP5zs.js} +1 -1
- package/dist/assets/useMobileTranscriptSyncHint-DVm8zIWR.js +10 -0
- package/dist/assets/{useModelLists-xVEEc-e7.js → useModelLists-CU3ffp2-.js} +1 -1
- package/dist/assets/{useOpenCodeReadiness-C5D4297L.js → useOpenCodeReadiness-KpQk8Bm7.js} +1 -1
- package/dist/assets/{usePluginsStore-DEctn121.js → usePluginsStore-BJNtJkXv.js} +1 -1
- package/dist/assets/{useProjectGitActions-D7yZSor5.js → useProjectGitActions-DuzvQm-w.js} +1 -1
- package/dist/assets/{useProjectGitStore-DFz9Eb6v.js → useProjectGitStore-U9tDVHik.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-TALa4FqO.js → useProjectRuntimeAPIs-DJubGUM_.js} +1 -1
- package/dist/assets/{useQuotaStore-BqPJ1nzk.js → useQuotaStore-B4FEz0gR.js} +1 -1
- package/dist/assets/{useSessionBtwStore-DAQVlbuf.js → useSessionBtwStore-D5bVhQ1l.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-BpC1BNz_.js → useStreamingTextThrottle-DlgF3Cnn.js} +1 -1
- package/dist/assets/{useUIStore-P32bzAJc.js → useUIStore-68ZPpgYA.js} +1 -1
- package/dist/assets/{worktreeManager-D56glCi_.js → worktreeManager-BJCsjptu.js} +1 -1
- package/dist/assets/{worktreeSourceBranchPreference-CNtT0ymW.js → worktreeSourceBranchPreference-qDpG1uyC.js} +1 -1
- package/dist/index.html +15 -15
- package/dist/mini-chat.html +15 -15
- package/dist/mobile.html +1 -1
- package/package.json +1 -1
- package/server/index.js +1 -0
- package/server/lib/assistants/DOCUMENTATION.md +7 -3
- package/server/lib/assistants/builtin-skills.js +19 -3
- package/server/lib/assistants/builtin-skills.test.js +16 -0
- package/server/lib/assistants/harness.js +2 -1
- package/server/lib/assistants/routes.js +1 -0
- package/server/lib/assistants/service.js +6 -2
- package/server/lib/gui-customization/DOCUMENTATION.md +19 -7
- package/server/lib/gui-customization/projects-client.mjs +1 -1
- package/server/lib/gui-customization/projects.js +6 -6
- package/server/lib/gui-customization/projects.test.js +13 -2
- package/server/lib/gui-customization/remote-connections-client.mjs +1 -1
- package/server/lib/gui-customization/remote-connections.js +6 -6
- package/server/lib/gui-customization/session-skill.js +15 -3
- package/server/lib/gui-customization/skill/references/deep-links.md +6 -6
- package/server/lib/gui-customization/skill-caller.js +18 -0
- package/server/lib/opencode/feature-routes-runtime.js +20 -3
- package/dist/assets/BusyDots-B9Zv4OUg.js +0 -4
- package/dist/assets/ChatView-OJAZBsfN.js +0 -3
- package/dist/assets/ScheduledTasksDialog-dgU5OpBK.js +0 -3
- package/dist/assets/device-CtdJ8KBJ.js +0 -2
- package/dist/assets/insertionBoundaries-Cu6Djn8S.js +0 -1
- package/dist/assets/main-CdUAbE7p.js +0 -169
- package/dist/assets/miniChat-C7JCQrXA.js +0 -2
- package/dist/assets/mobile-CcIasitd.js +0 -2
- package/dist/assets/openRemoteProjectSession-B94TYao_.js +0 -1
- package/dist/assets/openSessionFromDeepLink-C9jS-EIM.js +0 -2
- package/dist/assets/platform-CNdx57HN.js +0 -1
- package/dist/assets/renderMobileApp-CdTenU5H.js +0 -17
- package/dist/assets/runtimeEndpointReset-DKchBECK.js +0 -4
- package/dist/assets/sessionLookup-D299jmfx.js +0 -1
- package/dist/assets/ui-CU6n15y3.js +0 -13
- package/dist/assets/useAppFontEffects-Bqt4cv2k.js +0 -7
- package/dist/assets/useMcpConfigStore-al7LZT72.js +0 -1
- package/dist/assets/useMobileTranscriptSyncHint-BVvgdcp4.js +0 -10
|
@@ -578,9 +578,13 @@ construction, no additional skill directories are scanned, and no skill/config
|
|
|
578
578
|
copy, tool registration or permission is created. Missing/failed OpenCode skill
|
|
579
579
|
reads retain the existing explicit tool errors. These pointers are absent from
|
|
580
580
|
read-only background reviews and do not change ordinary Session instructions.
|
|
581
|
-
The customization pointer
|
|
582
|
-
|
|
583
|
-
|
|
581
|
+
The customization pointer follows the OpenCode Session capability set: when the turn
|
|
582
|
+
has `bash` and `resolveCustomizationSkill(assistantID)` returns a binding, it names the
|
|
583
|
+
staged skill and the bound project and (with the Electron adapter) SSH/Relay helper
|
|
584
|
+
commands, so archive (`settle-session`), remote sessions, SSH and pairing work through
|
|
585
|
+
the same Host APIs. Otherwise SSH, config sync and Relay pairing stay unavailable,
|
|
586
|
+
without a filesystem, credential or internal-HTTP fallback. `service.hasAssistant`
|
|
587
|
+
backs the bridge's caller check. GUI authoring instructions do not authorize
|
|
584
588
|
installation; substantive implementation still belongs in a worker.
|
|
585
589
|
CLI authentication instructions, endpoint URLs and skill bodies are not duplicated
|
|
586
590
|
in the permanent prompt. For other connected skills, load `opencode.catalog`,
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const shippedCustomizationSkillPath = fileURLToPath(new URL('../gui-customization/skill/SKILL.md', import.meta.url));
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const CUSTOMIZATION_SCOPE = 'adding a directory as a project in Yuri, task/session archive or restore (归档/恢复; the task-view 「归档」 is settle-session), remote sessions, project/session resource ownership or yuri:// deep links, appearance, themes/CSS/layout, logos/Dock, GUI plugins, pages/tabs, widgets, file previews/exports, panels and settings, or SSH/config-sync/Relay pairing';
|
|
7
|
+
|
|
8
|
+
const customizationPointer = (tools, customizationSkill) => {
|
|
9
|
+
const names = new Set(tools.map((tool) => tool.name));
|
|
10
|
+
const bound = names.has('bash') && customizationSkill && typeof customizationSkill.file === 'string';
|
|
11
|
+
const skillPath = bound ? customizationSkill.file : shippedCustomizationSkillPath;
|
|
12
|
+
const load = `Load with read({"path":${JSON.stringify(skillPath)}}), then read only the matching references relative to ${JSON.stringify(path.dirname(skillPath))}.`;
|
|
13
|
+
const projects = bound && customizationSkill.projectsCommand
|
|
14
|
+
? `Project, task/session archive and remote-session operations run through this bound API helper (bash); run its describe command first, then use the commands it returns: ${customizationSkill.projectsCommand}`
|
|
15
|
+
: 'Project registration uses granted yuri.projects tools, not a session-bound helper.';
|
|
16
|
+
const remote = bound && customizationSkill.remoteCommand
|
|
17
|
+
? `SSH setup, configuration sync and Relay pairing run only through this bound helper (bash) after reading references/remote-connections.md: ${customizationSkill.remoteCommand}`
|
|
18
|
+
: 'This contact has no bound local desktop helper for SSH, configuration sync or Relay pairing; those operations are unavailable here.';
|
|
19
|
+
return `- yuri-customization: For ${CUSTOMIZATION_SCOPE}. ${load} ${projects} ${remote} Reading the skill does not create that authorization.`;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function formatAssistantBuiltinSkillsPrompt(tools, { customizationSkill = null } = {}) {
|
|
7
23
|
const names = new Set(tools.map((tool) => tool.name));
|
|
8
24
|
const skills = [];
|
|
9
25
|
if (names.has('read_opencode_skill')) {
|
|
10
26
|
skills.push('- opencode: For OpenCode itself: configuration, agents, skills, tools, permissions, MCP, providers, plugins, CLI, SDK/API and troubleshooting. Load load_tools({"domain":"opencode.catalog"}), then read_opencode_skill({"id":"opencode"}); continue with nextOffset when partial. Use the current connected catalog, not a copied skill body or a virtual built-in file path.');
|
|
11
27
|
}
|
|
12
28
|
if (names.has('read')) {
|
|
13
|
-
skills.push(
|
|
29
|
+
skills.push(customizationPointer(tools, customizationSkill));
|
|
14
30
|
}
|
|
15
31
|
return skills.length > 0 ? [
|
|
16
32
|
'Built-in skills (progressive instructions): load the matching skill before following its workflow. Reading instructions does not mount tools or grant permissions; use the actual contact tools, or assign substantive implementation to a worker with the relevant context.',
|
|
@@ -29,6 +29,22 @@ describe('assistant built-in skill pointers', () => {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
+
it('hands a contact the bound helpers only when it can run them', () => {
|
|
33
|
+
const customizationSkill = { file: '/data/session-skills/yuri-customization-abc/SKILL.md', projectsCommand: 'run projects describe', remoteCommand: 'run remote describe' };
|
|
34
|
+
const withBash = formatAssistantBuiltinSkillsPrompt([{ name: 'read' }, { name: 'bash' }], { customizationSkill });
|
|
35
|
+
expect(withBash).toContain('settle-session');
|
|
36
|
+
expect(withBash).toContain('read({"path":"/data/session-skills/yuri-customization-abc/SKILL.md"})');
|
|
37
|
+
expect(withBash).toContain('run projects describe');
|
|
38
|
+
expect(withBash).toContain('run remote describe');
|
|
39
|
+
expect(withBash).not.toContain('no bound local desktop helper');
|
|
40
|
+
const withoutBash = formatAssistantBuiltinSkillsPrompt([{ name: 'read' }], { customizationSkill });
|
|
41
|
+
expect(withoutBash).not.toContain('run projects describe');
|
|
42
|
+
expect(withoutBash).toContain('no bound local desktop helper');
|
|
43
|
+
const noRemote = formatAssistantBuiltinSkillsPrompt([{ name: 'read' }, { name: 'bash' }], { customizationSkill: { ...customizationSkill, remoteCommand: null } });
|
|
44
|
+
expect(noRemote).toContain('run projects describe');
|
|
45
|
+
expect(noRemote).toContain('no bound local desktop helper');
|
|
46
|
+
});
|
|
47
|
+
|
|
32
48
|
it('omits pointers whose readers were not granted', () => {
|
|
33
49
|
expect(formatAssistantBuiltinSkillsPrompt([])).toBe('');
|
|
34
50
|
const local = formatAssistantBuiltinSkillsPrompt([{ name: 'read' }]);
|
|
@@ -503,6 +503,7 @@ export async function runContactTurn({
|
|
|
503
503
|
AgentImpl = Agent,
|
|
504
504
|
signal = null,
|
|
505
505
|
readOnly = false,
|
|
506
|
+
customizationSkill = null,
|
|
506
507
|
allowWatchSession = false,
|
|
507
508
|
allowSilent = false,
|
|
508
509
|
}) {
|
|
@@ -539,7 +540,7 @@ export async function runContactTurn({
|
|
|
539
540
|
cwd: runtime?.cwd,
|
|
540
541
|
skillsPrompt: runtime?.skillsPrompt,
|
|
541
542
|
}),
|
|
542
|
-
readOnly ? '' : formatAssistantBuiltinSkillsPrompt([...codingTools, ...contactTools]),
|
|
543
|
+
readOnly ? '' : formatAssistantBuiltinSkillsPrompt([...codingTools, ...contactTools], { customizationSkill }),
|
|
543
544
|
assistant.defaultPrompt,
|
|
544
545
|
codingTools.length > 0 ? WORKSPACE_RESPONSE_PROTOCOL : '',
|
|
545
546
|
'Actual tool results arrive in tool-role messages; never manufacture them.',
|
|
@@ -38,6 +38,7 @@ export const registerAssistantRoutes = (app, dependencies) => {
|
|
|
38
38
|
listProjects: dependencies.listProjects,
|
|
39
39
|
remoteHostGateway: dependencies.remoteHostGateway,
|
|
40
40
|
registerProject: dependencies.registerProject,
|
|
41
|
+
resolveCustomizationSkill: dependencies.resolveCustomizationSkill,
|
|
41
42
|
readModelPreferences: dependencies.readModelPreferences,
|
|
42
43
|
listScheduledTasks: dependencies.listScheduledTasks,
|
|
43
44
|
sessionIndexService: dependencies.sessionIndexService,
|
|
@@ -258,7 +258,7 @@ const awaitWithDeadline = async (work, ms = CONTACT_CATALOG_DEADLINE_MS, code =
|
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
-
export const createAssistantsService = ({ dbPath, dataDir, buildOpenCodeUrl, getOpenCodeAuthHeaders, getServerId = async () => null, getAllowedRoots = () => [], listProjects = async () => [], registerProject = null, readModelPreferences = async () => null, listScheduledTasks = null, sessionIndexService = null, upsertScheduledTask = null, patchScheduledTask = null, syncScheduledTaskProject = null, globalEventHub = null, onRevisionTip = null, onContactTurnEvent = null, onContactTurnComplete = null, /** Host archive op: ({ sessionID, directory, archivedAt }) => Promise */ archiveSessionHost = null, /** Idempotent Host metadata drop after successful SDK delete */ forgetSessionHost = null, /** Host store write: (sessionId, patch) => Promise */ persistSessionMetadata = null, /** After Host isolation metadata is committed. */ onSystemSessionPersisted = null, clock = () => Date.now(), setIntervalFn = setInterval, clearIntervalFn = clearInterval, setImmediateFn = setImmediate, setTimeoutFn = setTimeout, clearTimeoutFn = clearTimeout, reconcileIntervalMs = 60_000, clientFactory, fetchImpl, remoteHostGateway = null, createChatCompletion = null, runContactTurn = defaultRunContactTurn, listWorktrees = defaultListWorktrees } = {}) => {
|
|
261
|
+
export const createAssistantsService = ({ dbPath, dataDir, buildOpenCodeUrl, getOpenCodeAuthHeaders, getServerId = async () => null, getAllowedRoots = () => [], listProjects = async () => [], registerProject = null, /** (assistantID) => Promise<{file, projectsCommand, remoteCommand}|null> */ resolveCustomizationSkill = null, readModelPreferences = async () => null, listScheduledTasks = null, sessionIndexService = null, upsertScheduledTask = null, patchScheduledTask = null, syncScheduledTaskProject = null, globalEventHub = null, onRevisionTip = null, onContactTurnEvent = null, onContactTurnComplete = null, /** Host archive op: ({ sessionID, directory, archivedAt }) => Promise */ archiveSessionHost = null, /** Idempotent Host metadata drop after successful SDK delete */ forgetSessionHost = null, /** Host store write: (sessionId, patch) => Promise */ persistSessionMetadata = null, /** After Host isolation metadata is committed. */ onSystemSessionPersisted = null, clock = () => Date.now(), setIntervalFn = setInterval, clearIntervalFn = clearInterval, setImmediateFn = setImmediate, setTimeoutFn = setTimeout, clearTimeoutFn = clearTimeout, reconcileIntervalMs = 60_000, clientFactory, fetchImpl, remoteHostGateway = null, createChatCompletion = null, runContactTurn = defaultRunContactTurn, listWorktrees = defaultListWorktrees } = {}) => {
|
|
262
262
|
const execution = createAssistantExecutionAccessor(remoteHostGateway);
|
|
263
263
|
const targetFields = () => execution.current() ? { target: execution.current().target } : {};
|
|
264
264
|
const scopedWork = (params, work) => execution.run(params, work);
|
|
@@ -3821,9 +3821,12 @@ export const createAssistantsService = ({ dbPath, dataDir, buildOpenCodeUrl, get
|
|
|
3821
3821
|
} : null,
|
|
3822
3822
|
}));
|
|
3823
3823
|
controller.signal.throwIfAborted();
|
|
3824
|
+
const customizationSkill = typeof resolveCustomizationSkill === 'function'
|
|
3825
|
+
? await Promise.resolve(resolveCustomizationSkill(row.assistant_id)).catch(() => null) : null;
|
|
3824
3826
|
const generated = await runContactTurn({
|
|
3825
3827
|
signal: controller.signal,
|
|
3826
3828
|
readOnly: false,
|
|
3829
|
+
customizationSkill,
|
|
3827
3830
|
assistant: assistantSnapshot,
|
|
3828
3831
|
history: executionHistory,
|
|
3829
3832
|
userText,
|
|
@@ -4363,7 +4366,8 @@ export const createAssistantsService = ({ dbPath, dataDir, buildOpenCodeUrl, get
|
|
|
4363
4366
|
assertGeneration();
|
|
4364
4367
|
return image;
|
|
4365
4368
|
};
|
|
4366
|
-
|
|
4369
|
+
const hasAssistant = (assistantID) => { const row = typeof assistantID === 'string' && assistantID ? assistant(assistantID) : null; return Boolean(row) && !row.tombstone_at; };
|
|
4370
|
+
return { hasAssistant, capability: async () => ({ supported: true, enabled: enabled(), revision: revision(), serverInstanceID: await getServerId(), sharingAvailable: false, archiveMetadataAvailable: typeof archiveSessionHost === 'function', sessionMetadataAvailable: false }), snapshot, channelPage, prepareChannelImage, ensureDefaultAssistant, createAssistant, updateAssistant, setEnabled: (input) => { if (!plainObject(input) || typeof input.enabled !== 'boolean' || input.expectedRevision !== revision()) fail('revision_conflict'); return { enabled: true, revision: revision() }; }, removeAssistant, ensure, createNew, compact, send, whenContactTurnSettled, abort, captureQueueDeliveryTarget, sendWithCapturedConfig, share, shareOperation, historicalMessages, contactMessages, clearContactMemory, resetContact, markContactRead, appendContactCard, deliverPeerMessage, listAssistantScheduledTasks, reportScheduledTaskResult, putAssistantContactAttachment, getAssistantContactAttachment, migrateContactAttachments, processEvent, reportAssignedSessionSettle: reportAssignedSession, reconcile, close: () => {
|
|
4367
4371
|
assignedCompletion.dispose();
|
|
4368
4372
|
remoteWatchReconciler.close();
|
|
4369
4373
|
execution.close();
|
|
@@ -22,11 +22,22 @@ navigation protocol. Existing instance discovery/binding does not imply support
|
|
|
22
22
|
identity-scoped session URLs; this skill update adds neither a self-identity helper
|
|
23
23
|
nor a new deep-link parameter.
|
|
24
24
|
|
|
25
|
-
Interactive Yuri contacts
|
|
26
|
-
the assistant-only pointer in `../assistants/builtin-skills.js
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
Interactive Yuri contacts consume this same skill, staged resources and helpers
|
|
26
|
+
through the assistant-only pointer in `../assistants/builtin-skills.js`, so a
|
|
27
|
+
contact and an OpenCode Session have the same capability set. The Host resolves
|
|
28
|
+
`createCustomizationSkillInstaller(...).resolve({ assistantID }, bindings)` per turn
|
|
29
|
+
(`feature-routes-runtime.js`): the pointer names the staged `SKILL.md` and the bound
|
|
30
|
+
`projects.mjs` / `remote-connections.mjs` describe commands, which the contact runs
|
|
31
|
+
with its pi `bash` tool. The remote helper is bound only when the Electron adapter is
|
|
32
|
+
present. Without `bash`, a resolved binding, a shared service or a readable
|
|
33
|
+
registration, the pointer falls back to the shipped file with no helper and the
|
|
34
|
+
SSH/config-sync/Relay branch stays unavailable. Read-only background reviews omit it.
|
|
35
|
+
|
|
36
|
+
Both bridge routes accept exactly one caller: `{sessionID}` (admission-bound Session
|
|
37
|
+
metadata) or `{assistantID}` (a live, non-tombstoned contact checked through
|
|
38
|
+
`hasAssistant`). `skill-caller.js` owns that parsing and binding check; a body with
|
|
39
|
+
both or neither is `invalid_input`. Loopback, no Origin and the shared-service
|
|
40
|
+
credential still gate every call.
|
|
30
41
|
|
|
31
42
|
References are organized by capability: project registration, window APIs, appearance, UI surfaces, plugin styles, global pages, work-status widgets, icons,
|
|
32
43
|
file parsing/previews, preview actions/exports, and package workflow. Host contracts
|
|
@@ -40,8 +51,9 @@ independently of Electron's remote-connections adapter. `projects-client.mjs` is
|
|
|
40
51
|
staged as `projects.mjs`; it and the remote helper share the staged
|
|
41
52
|
`session-skill-command.mjs` command formatter. Only bound helpers are staged, and
|
|
42
53
|
each resource combination has its own content fingerprint. Existing sessions keep
|
|
43
|
-
their immutable staged references until a new session is admitted. Contacts
|
|
44
|
-
their
|
|
54
|
+
their immutable staged references until a new session is admitted. Contacts keep
|
|
55
|
+
their granted `yuri.projects` `register_project` tool for the assign flow and also
|
|
56
|
+
reach every other operation through the same helper, bound to their `assistantID`.
|
|
45
57
|
|
|
46
58
|
`projects.js` owns `POST /api/yuri/session-skills/projects` (`describe`, `list`,
|
|
47
59
|
`add`, `task-sessions`, `session-state`, `settle-session`, `unsettle-session`, `archive-session`, `unarchive-session`, `remote-hosts`, `add-remote`, `remote-projects`, `sessions`, `read-session`, `create-session`, `prompt-session`). `projects-remote.js` uses the injected `remoteHostGateway` and its immutable task leases; discovery returns authenticated `{hubId,hostId,instanceId}` targets, and explicit targets never fall back to local. `remote-hosts` includes authorized machines with no associated project, reports per-machine failures and releases each probe. `add-remote` uses `gateway.registerProject`, shared with the UI: the target validates/canonicalizes and registers the directory before the Hub saves a deduplicated reference and broadcasts project-order invalidation. A Hub write failure leaves the remote project intact; retrying the same target/path completes association. Paths are never resolved on the Hub filesystem. Lease cleanup runs on every outcome. Remote SDK requests preserve generated request data through the lease; bounded message reads use the existing Host turn-page route. No remote bodies are persisted on Hub. Session creation/prompt require stable caller IDs for ambiguous-result inspection, not automatic replay. This capability neither uses nor grants the desktop SSH helper. The global gate and route require the existing loopback service credential,
|
|
@@ -28,7 +28,7 @@ async function main() {
|
|
|
28
28
|
const response = await fetch(new URL('/api/yuri/session-skills/projects', origin), {
|
|
29
29
|
method: 'POST', redirect: 'error', signal: AbortSignal.timeout(['create-session', 'prompt-session'].includes(operation) ? 305_000 : 30_000),
|
|
30
30
|
headers: { 'content-type': 'application/json', authorization: `Basic ${Buffer.from(`opencode:${registration.password}`).toString('base64')}` },
|
|
31
|
-
body: JSON.stringify({ sessionID: binding.sessionID, operation, input }),
|
|
31
|
+
body: JSON.stringify({ ...(binding.assistantID ? { assistantID: binding.assistantID } : { sessionID: binding.sessionID }), operation, input }),
|
|
32
32
|
});
|
|
33
33
|
const result = await response.json();
|
|
34
34
|
if (!response.ok) {
|
|
@@ -2,6 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { authorizeScheduledTaskSkillRequest } from '../scheduled-tasks/session-skill-contract.js';
|
|
3
3
|
import { remoteProjectOperations, validRemoteProjectInput, runRemoteProjectOperation } from './projects-remote.js';
|
|
4
4
|
import { lifecycleOperations, validLifecycleInput } from './projects-lifecycle.js';
|
|
5
|
+
import { isBoundSkillCaller, parseSkillCaller } from './skill-caller.js';
|
|
5
6
|
|
|
6
7
|
export const PROJECTS_SKILL_PATH = '/api/yuri/session-skills/projects';
|
|
7
8
|
|
|
@@ -18,17 +19,16 @@ const validInput = (operation, input) => {
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
/** Session-bound Host registration; the shared project registry owns persistence. */
|
|
21
|
-
export function registerProjectsSkill(app, { express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, createClient, registerProject, readSettingsFromDiskStrict, sanitizeProjects, remoteHostGateway, sessionLifecycle }) {
|
|
22
|
+
export function registerProjectsSkill(app, { express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, createClient, registerProject, readSettingsFromDiskStrict, sanitizeProjects, remoteHostGateway, sessionLifecycle, hasAssistant }) {
|
|
22
23
|
app.post(PROJECTS_SKILL_PATH, express.json({ limit: '16kb' }), async (req, res) => {
|
|
23
24
|
res.setHeader('Cache-Control', 'no-store');
|
|
24
25
|
if (!getIsSharedOpenCodeService() || !authorizeScheduledTaskSkillRequest(req, getOpenCodeAuthHeaders())) return res.status(403).json({ error: 'Forbidden' });
|
|
25
|
-
const {
|
|
26
|
-
|
|
26
|
+
const { operation, input = {} } = req.body ?? {};
|
|
27
|
+
const caller = parseSkillCaller(req.body);
|
|
28
|
+
if (!caller
|
|
27
29
|
|| !['describe', 'list', 'add', ...lifecycleOperations, ...remoteProjectOperations].includes(operation) || !validInput(operation, input)) return res.status(400).json({ code: 'invalid_input', error: 'Invalid project input' });
|
|
28
30
|
try {
|
|
29
|
-
|
|
30
|
-
const hostOrigin = `http://${req.socket.localAddress === '::1' ? '[::1]' : '127.0.0.1'}:${req.socket.localPort}`;
|
|
31
|
-
if (session.metadata?.yuri?.scheduledTaskSkill?.hostOrigin !== hostOrigin) return res.status(403).json({ error: 'Session is not bound to this Host' });
|
|
31
|
+
if (!await isBoundSkillCaller(req, caller, { createClient, hasAssistant })) return res.status(403).json({ error: 'Caller is not bound to this Host' });
|
|
32
32
|
if (operation === 'describe') return res.json({ supported: true, remoteSupported: Boolean(remoteHostGateway?.supported && remoteHostGateway?.acquireTask), lifecycleSupported: Boolean(sessionLifecycle), inputs: { add: '{path: existing absolute Host directory, label?: display name}', list: '{}',
|
|
33
33
|
'task-sessions': '{directory?: absolute bound-Host directory, cursor?: returned nextCursor} bounded Host index metadata, not full upstream history',
|
|
34
34
|
'session-state': '{sessionID} read Host archive authority and nullable task projection; not upstream existence or live UI state',
|
|
@@ -12,7 +12,7 @@ import { createProjectDirectoryRuntime } from '../opencode/project-directory-run
|
|
|
12
12
|
import { registerProjectsSkill, PROJECTS_SKILL_PATH } from './projects.js';
|
|
13
13
|
|
|
14
14
|
describe('session project registration API', () => {
|
|
15
|
-
let root, workspace, settingsPath, runtime, server, origin, getSession, binding, registerProject, shared, failWrites, tips, gateway;
|
|
15
|
+
let root, workspace, settingsPath, runtime, server, origin, getSession, binding, registerProject, shared, failWrites, tips, gateway, hasAssistant;
|
|
16
16
|
const auth = { Authorization: `Basic ${Buffer.from('opencode:fixture').toString('base64')}` };
|
|
17
17
|
beforeEach(async () => {
|
|
18
18
|
root = await fs.mkdtemp(path.join(os.tmpdir(), 'project-skill-'));
|
|
@@ -30,12 +30,13 @@ describe('session project registration API', () => {
|
|
|
30
30
|
const registry = createProjectRegistry({ persistSettings: runtime.persistSettings, validateDirectoryPath });
|
|
31
31
|
registerProject = vi.fn((input) => registry.register(input));
|
|
32
32
|
getSession = vi.fn(async () => ({ metadata: { yuri: { scheduledTaskSkill: { hostOrigin: binding } } } }));
|
|
33
|
+
hasAssistant = vi.fn(async (id) => id === 'ast_live');
|
|
33
34
|
const app = express();
|
|
34
35
|
gateway = { supported: true, acquireTask: vi.fn(), registerProject: vi.fn(), list: vi.fn(async () => ({ supported: true, hubId: 'hub', hosts: [], projects: [] })) };
|
|
35
36
|
registerProjectsSkill(app, { express, getIsSharedOpenCodeService: () => shared, getOpenCodeAuthHeaders: () => auth,
|
|
36
37
|
createClient: () => ({ session: { get: getSession } }), registerProject, readSettingsFromDiskStrict: runtime.readSettingsFromDiskStrict,
|
|
37
38
|
sanitizeProjects: normalization.sanitizeProjects,
|
|
38
|
-
remoteHostGateway: gateway,
|
|
39
|
+
remoteHostGateway: gateway, hasAssistant,
|
|
39
40
|
});
|
|
40
41
|
server = await new Promise((resolve) => { const s = app.listen(0, '127.0.0.1', () => resolve(s)); });
|
|
41
42
|
origin = `http://127.0.0.1:${server.address().port}`; binding = origin;
|
|
@@ -65,6 +66,16 @@ describe('session project registration API', () => {
|
|
|
65
66
|
expect(JSON.stringify({ added, listed })).not.toContain('private-settings');
|
|
66
67
|
});
|
|
67
68
|
|
|
69
|
+
it('admits a live Assistant contact as the caller, without any Session lookup', async () => {
|
|
70
|
+
const call = (body) => fetch(`${origin}${PROJECTS_SKILL_PATH}`, { method: 'POST', headers: { 'content-type': 'application/json', ...auth }, body: JSON.stringify(body) });
|
|
71
|
+
const ok = await call({ assistantID: 'ast_live', operation: 'list', input: {} });
|
|
72
|
+
expect(ok.status).toBe(200);
|
|
73
|
+
expect(getSession).not.toHaveBeenCalled();
|
|
74
|
+
expect((await call({ assistantID: 'ast_gone', operation: 'list', input: {} })).status).toBe(403);
|
|
75
|
+
expect((await call({ assistantID: 'ast_live', sessionID: 'ses_one', operation: 'list', input: {} })).status).toBe(400);
|
|
76
|
+
expect((await call({ operation: 'list', input: {} })).status).toBe(400);
|
|
77
|
+
});
|
|
78
|
+
|
|
68
79
|
it('rejects invalid input and nonexistent/file paths without changing saved state', async () => {
|
|
69
80
|
await fs.writeFile(settingsPath, JSON.stringify({ projects: [], secret: 'saved' }));
|
|
70
81
|
const before = await fs.readFile(settingsPath, 'utf8');
|
|
@@ -26,7 +26,7 @@ async function main() {
|
|
|
26
26
|
const response = await fetch(new URL('/api/yuri/session-skills/remote-connections', origin), {
|
|
27
27
|
method: 'POST', redirect: 'error', signal: AbortSignal.timeout(operation === 'pair' ? 250_000 : 30_000),
|
|
28
28
|
headers: { 'content-type': 'application/json', authorization: `Basic ${Buffer.from(`opencode:${registration.password}`).toString('base64')}` },
|
|
29
|
-
body: JSON.stringify({ sessionID: binding.sessionID, operation, input }),
|
|
29
|
+
body: JSON.stringify({ ...(binding.assistantID ? { assistantID: binding.assistantID } : { sessionID: binding.sessionID }), operation, input }),
|
|
30
30
|
});
|
|
31
31
|
const result = await response.json();
|
|
32
32
|
if (!response.ok) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { authorizeScheduledTaskSkillRequest } from '../scheduled-tasks/session-skill-contract.js';
|
|
2
|
+
import { isBoundSkillCaller, parseSkillCaller } from './skill-caller.js';
|
|
2
3
|
|
|
3
4
|
export const REMOTE_CONNECTIONS_SKILL_PATH = '/api/yuri/session-skills/remote-connections';
|
|
4
5
|
|
|
@@ -18,17 +19,16 @@ const validInput = (operation, input) => {
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
/** Loopback + service credential + admitted-session binding, never browser/native IPC. */
|
|
21
|
-
export function registerRemoteConnectionsSkill(app, { express, adapter, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, createClient }) {
|
|
22
|
+
export function registerRemoteConnectionsSkill(app, { express, adapter, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, createClient, hasAssistant }) {
|
|
22
23
|
app.post(REMOTE_CONNECTIONS_SKILL_PATH, express.json({ limit: '16kb' }), async (req, res) => {
|
|
23
24
|
res.setHeader('Cache-Control', 'no-store');
|
|
24
25
|
if (!getIsSharedOpenCodeService() || !authorizeScheduledTaskSkillRequest(req, getOpenCodeAuthHeaders())) return res.status(403).json({ error: 'Forbidden' });
|
|
25
26
|
if (!adapter) return res.status(501).json({ code: 'remote_connections_unsupported', error: 'Requires the local desktop Host' });
|
|
26
|
-
const {
|
|
27
|
-
|
|
27
|
+
const { operation, input = {} } = req.body ?? {};
|
|
28
|
+
const caller = parseSkillCaller(req.body);
|
|
29
|
+
if (!caller || !['describe', 'list', 'setup', 'pair'].includes(operation) || !validInput(operation, input)) return res.status(400).json({ code: 'invalid_input', error: 'Invalid connection input' });
|
|
28
30
|
try {
|
|
29
|
-
|
|
30
|
-
const hostOrigin = `http://${req.socket.localAddress === '::1' ? '[::1]' : '127.0.0.1'}:${req.socket.localPort}`;
|
|
31
|
-
if (session.metadata?.yuri?.scheduledTaskSkill?.hostOrigin !== hostOrigin) return res.status(403).json({ error: 'Session is not bound to this Host' });
|
|
31
|
+
if (!await isBoundSkillCaller(req, caller, { createClient, hasAssistant })) return res.status(403).json({ error: 'Caller is not bound to this Host' });
|
|
32
32
|
if (operation === 'describe') return res.json({ supported: true,
|
|
33
33
|
inputs: { setup: '{sshCommand, nickname?} or {id}', pair: '{id?, relayUrl?, label?}; omitted id means this local desktop', list: '{}' },
|
|
34
34
|
installation: 'New Linux SSH connections use the matching self-contained release (x64/arm64, glibc 2.36+), without system Node/npm/Python/compiler. Existing saved installation choices and macOS keep their package-manager path.',
|
|
@@ -29,14 +29,26 @@ export function createCustomizationSkillInstaller({ yuriDataDir }) {
|
|
|
29
29
|
})().catch((error) => { resources.delete(key); throw error; }));
|
|
30
30
|
return resources.get(key);
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
/** Stage the resource set and format the bound helper commands for one caller (`{sessionID}` or `{assistantID}`). */
|
|
33
|
+
const resolve = async (caller, { remoteBinding, projectBinding } = {}) => {
|
|
33
34
|
const file = await prepare(Boolean(remoteBinding), Boolean(projectBinding));
|
|
34
|
-
const
|
|
35
|
-
|
|
35
|
+
const encode = (binding) => Buffer.from(JSON.stringify({ ...binding, ...caller })).toString('base64url');
|
|
36
|
+
return {
|
|
37
|
+
file,
|
|
38
|
+
projectsCommand: projectBinding ? sessionSkillCommand(process.execPath, path.join(path.dirname(file), 'projects.mjs'), encode(projectBinding), 'describe') : null,
|
|
39
|
+
remoteCommand: remoteBinding ? remoteConnectionsCommand(process.execPath, path.join(path.dirname(file), 'remote-connections.mjs'), encode(remoteBinding), 'describe') : null,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const install = async (client, sessionID, { remoteBinding, projectBinding } = {}) => {
|
|
43
|
+
const { file, projectsCommand, remoteCommand } = await resolve({ sessionID }, { remoteBinding, projectBinding });
|
|
44
|
+
const projects = projectsCommand ? ` For local/remote project registration, task/session archive and restore, discovering authorized remote machines, or reading/creating/continuing remote sessions, read references/projects.md and run the bound project API helper.\nBound project helper: ${projectsCommand}\n` : ' No bound project helper is provided; project registration, task/session archive and remote project/session access are unavailable through this session skill.';
|
|
45
|
+
const remote = remoteCommand ? ` For SSH setup/config sync or Relay pairing, use only this bound helper after reading references/remote-connections.md. Bound local desktop helper: ${remoteCommand}` : ' No bound SSH/Relay command is provided: these operations are unavailable in this session. Report that limit and stop this branch; use native Settings or a new supported local desktop session. A script or another capability\'s binding does not enable it. There is no credential/filesystem fallback for this capability.';
|
|
36
46
|
await client.session.instructions.entry.put({ sessionID, key: 'yuri.customization',
|
|
37
47
|
value: `Yuri customization: for adding a directory as a project in Yuri (local or remote), task/session archive or restore (归档/恢复), remote sessions, project/session resource ownership or yuri:// deep links, SSH connections, configuration sync, Relay pairing, appearance (themes, CSS/layout, Logo, macOS Dock), work-status widgets, global pages/tabs, custom file parsing/previews, preview exports, or GUI panels/commands/settings, read ${JSON.stringify(file)} first. Use the matching reference and apply changes only when requested.${projects}${remote}`,
|
|
38
48
|
});
|
|
39
49
|
};
|
|
50
|
+
install.resolve = resolve;
|
|
51
|
+
return install;
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
/** Managed local servers share the resource filesystem; external servers do not. */
|
|
@@ -30,14 +30,14 @@ Never generate `yuri://connect?...` links yourself. They carry pairing credentia
|
|
|
30
30
|
|
|
31
31
|
`sessionID` is the OpenCode session id (`ses_...`). `directory` is the absolute path of the project on the machine where the session runs. Always include it when you know it.
|
|
32
32
|
|
|
33
|
-
Desktop Yuri resolves the link
|
|
33
|
+
Desktop Yuri resolves the link on the receiving computer:
|
|
34
34
|
|
|
35
|
-
1.
|
|
36
|
-
2. Otherwise `directory` must belong to exactly one Remote Project already connected in that Yuri; Yuri then opens the session through that project.
|
|
37
|
-
3. In every other case Yuri shows a
|
|
35
|
+
1. Each open Yuri window checks the session id against its own connection's session index. If exactly one connection has it, that window opens it. This includes windows connected to other machines.
|
|
36
|
+
2. Otherwise the local window tries its own index, then `directory` must belong to exactly one Remote Project already connected in that Yuri; Yuri then opens the session through that project.
|
|
37
|
+
3. In every other case Yuri shows a notice and opens nothing. It never guesses a machine, and never connects one automatically.
|
|
38
38
|
|
|
39
|
-
A remote link
|
|
39
|
+
Step 1 depends on what the recipient has open, which the generating Host cannot observe. Older desktop versions skip it. A remote link therefore either needs an open window connected to the owning machine, or the owning machine's project associated in the receiving Yuri using the target machine's own path. After a local-index miss, equal owning paths on different connected machines are ambiguous and will not open. A unique directory match selects the remote route; it does not confirm the session exists or that its content can load. Mobile does not perform this Remote Project lookup; its session links use the connected runtime's session navigation.
|
|
40
40
|
|
|
41
41
|
## Verification
|
|
42
42
|
|
|
43
|
-
Report the link text, which
|
|
43
|
+
Report the link text, which receiving-side route could resolve it (an open window connected to the owning machine, the local index or a connected Remote Project), and the known limits above. Facts checked on the generating Host do not confirm which route the recipient will use. Do not run `open "yuri://..."` to verify unless the user asks, because that moves their running Yuri window.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const validID = (value) => typeof value === 'string' && value.length > 0 && value.length <= 256;
|
|
2
|
+
|
|
3
|
+
/** A bridge caller is exactly one admitted Session or one live Assistant contact. */
|
|
4
|
+
export const parseSkillCaller = (body) => {
|
|
5
|
+
const { sessionID, assistantID } = body ?? {};
|
|
6
|
+
if (validID(sessionID) && assistantID === undefined) return { kind: 'session', id: sessionID };
|
|
7
|
+
if (validID(assistantID) && sessionID === undefined) return { kind: 'assistant', id: assistantID };
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const hostOriginOf = (req) => `http://${req.socket.localAddress === '::1' ? '[::1]' : '127.0.0.1'}:${req.socket.localPort}`;
|
|
12
|
+
|
|
13
|
+
/** Loopback and service credential are checked by the route; this binds the caller to this Host. */
|
|
14
|
+
export const isBoundSkillCaller = async (req, caller, { createClient, hasAssistant }) => {
|
|
15
|
+
if (caller.kind === 'assistant') return Boolean(await hasAssistant?.(caller.id));
|
|
16
|
+
const session = await createClient().session.get({ sessionID: caller.id });
|
|
17
|
+
return session.metadata?.yuri?.scheduledTaskSkill?.hostOrigin === hostOriginOf(req);
|
|
18
|
+
};
|
|
@@ -23,7 +23,8 @@ import { registerProjectIconRoutes } from './project-icon-routes.js';
|
|
|
23
23
|
import { registerScheduledTaskRoutes } from '../scheduled-tasks/routes.js';
|
|
24
24
|
import { registerScheduledTaskToolRoute } from '../scheduled-tasks/managed-tool-route.js';
|
|
25
25
|
import { registerScheduledTaskSessionSkill } from '../scheduled-tasks/session-skill.js';
|
|
26
|
-
import { registerCustomizationSessionSkill } from '../gui-customization/session-skill.js';
|
|
26
|
+
import { registerCustomizationSessionSkill, createCustomizationSkillInstaller } from '../gui-customization/session-skill.js';
|
|
27
|
+
import { readSharedServiceRegistration, resolveSharedServiceRegistrationPath } from './shared-service.js';
|
|
27
28
|
import { registerConversationRoutes } from '../conversations/routes.js';
|
|
28
29
|
import { registerHistoryImportRoutes } from '../history-import/routes.js';
|
|
29
30
|
import { registerSessionTurnPageRoutes } from '../session-turn-pages/routes.js';
|
|
@@ -135,6 +136,7 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
135
136
|
getIsExternalOpenCode = () => false,
|
|
136
137
|
getIsSharedOpenCodeService = () => false,
|
|
137
138
|
remoteConnectionsAdapter = null,
|
|
139
|
+
getHostPort = () => null,
|
|
138
140
|
forceResolvedOpenCodeBinary = null,
|
|
139
141
|
upgradeOpenCodeCli = null,
|
|
140
142
|
restartOpenCode = null,
|
|
@@ -264,8 +266,22 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
264
266
|
scheduledTaskRouter,
|
|
265
267
|
remoteConnectionsAdapter,
|
|
266
268
|
});
|
|
269
|
+
const hasAssistant = (assistantID) => assistantRoutesRuntime?.service?.hasAssistant(assistantID) ?? false;
|
|
270
|
+
// Contacts run on this Host, so they get the same staged helpers as admitted Sessions, bound to their own ID.
|
|
271
|
+
const customizationSkill = createCustomizationSkillInstaller({ yuriDataDir });
|
|
272
|
+
const resolveAssistantCustomizationSkill = async (assistantID) => {
|
|
273
|
+
const port = getHostPort();
|
|
274
|
+
if (!getIsSharedOpenCodeService() || !port) return null;
|
|
275
|
+
const registrationFile = resolveSharedServiceRegistrationPath();
|
|
276
|
+
const upstreamOrigin = new URL(buildOpenCodeUrl('/', '')).origin;
|
|
277
|
+
const registration = await readSharedServiceRegistration({ file: registrationFile });
|
|
278
|
+
if (!registration?.password || registration.origin !== upstreamOrigin
|
|
279
|
+
|| getOpenCodeAuthHeaders().Authorization !== `Basic ${Buffer.from(`opencode:${registration.password}`).toString('base64')}`) return null;
|
|
280
|
+
const binding = { hostOrigin: `http://127.0.0.1:${port}`, upstreamOrigin, registrationFile };
|
|
281
|
+
return customizationSkill.resolve({ assistantID }, { projectBinding: binding, ...(remoteConnectionsAdapter ? { remoteBinding: binding } : {}) });
|
|
282
|
+
};
|
|
267
283
|
registerRemoteConnectionsSkill(app, {
|
|
268
|
-
express, adapter: remoteConnectionsAdapter, getIsSharedOpenCodeService, getOpenCodeAuthHeaders,
|
|
284
|
+
express, adapter: remoteConnectionsAdapter, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, hasAssistant,
|
|
269
285
|
createClient: () => makeOpenCodeV2Client({ baseUrl: buildOpenCodeUrl('/', ''), authHeaders: getOpenCodeAuthHeaders(), getRuntimeContract }),
|
|
270
286
|
});
|
|
271
287
|
registerCustomizationSessionSkill(app, {
|
|
@@ -310,7 +326,7 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
310
326
|
const projectRegistry = createProjectRegistry({ persistSettings, validateDirectoryPath });
|
|
311
327
|
registerProjectsSkill(app, {
|
|
312
328
|
remoteHostGateway: routeDependencies.remoteHostGateway,
|
|
313
|
-
express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders,
|
|
329
|
+
express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, hasAssistant,
|
|
314
330
|
createClient: () => makeOpenCodeV2Client({ baseUrl: buildOpenCodeUrl('/', ''), authHeaders: getOpenCodeAuthHeaders(), getRuntimeContract }),
|
|
315
331
|
registerProject: (input) => projectRegistry.register(input), readSettingsFromDiskStrict, sanitizeProjects,
|
|
316
332
|
sessionLifecycle: createProjectSessionLifecycle({
|
|
@@ -354,6 +370,7 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
354
370
|
getServerId,
|
|
355
371
|
getAllowedRoots: () => assistantAllowedRoots,
|
|
356
372
|
registerProject: registerAssistantProject,
|
|
373
|
+
resolveCustomizationSkill: resolveAssistantCustomizationSkill,
|
|
357
374
|
listProjects: async () => {
|
|
358
375
|
const settings = await readSettingsFromDiskMigrated();
|
|
359
376
|
return sanitizeProjects(settings?.projects ?? [])
|