@yuriai/web 0.2.28 → 0.2.29-beta.11

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.
Files changed (291) hide show
  1. package/README.md +3 -1
  2. package/dist/assets/AgentAvatar-CR6dX_XT.js +1 -0
  3. package/dist/assets/AssistantContactStatus-B0bsfDtC.js +3 -0
  4. package/dist/assets/{AssistantUnreadBadge-DqThZdCe.js → AssistantUnreadBadge-D2z3wH6e.js} +1 -1
  5. package/dist/assets/{AssistantView-DPUDCXoY.js → AssistantView-1I_CxjRT.js} +1 -1
  6. package/dist/assets/{DiagramView-CHVLoYrV.js → DiagramView-CDnuxs05.js} +1 -1
  7. package/dist/assets/{FadeInOnReveal-Cj3JXYvE.js → FadeInOnReveal-CuOJu25b.js} +1 -1
  8. package/dist/assets/{GuiPluginSurface-CBZYeKHb.js → GuiPluginSurface-Fz1jDjmD.js} +1 -1
  9. package/dist/assets/{GuiPluginWindow-_Z5wycnH.js → GuiPluginWindow-CIVNyw4s.js} +1 -1
  10. package/dist/assets/Icon-BQczEnxm.js +1 -0
  11. package/dist/assets/{ImageLoadingPlaceholder-DjLaKB4o.js → ImageLoadingPlaceholder-KksxJaKp.js} +1 -1
  12. package/dist/assets/LoadingImage-Ch5MyA20.js +1 -0
  13. package/dist/assets/MarkdownRenderer-2h3s-QAX.js +2 -0
  14. package/dist/assets/{MarkdownRendererImpl-_plqOlsV.js → MarkdownRendererImpl-D-6DekL9.js} +3 -3
  15. package/dist/assets/MarkstreamRendererImpl-HnrHSasB.js +3 -0
  16. package/dist/assets/{MobileDetailNavigation-SeT764Ps.js → MobileDetailNavigation-D-Jwj-Fz.js} +1 -1
  17. package/dist/assets/{MobileResizableSheet-BY1-oo_E.js → MobileResizableSheet-Bk3z4g6T.js} +1 -1
  18. package/dist/assets/{MobileShareBridge-Dw8gLtJD.js → MobileShareBridge-BjNcovRh.js} +2 -2
  19. package/dist/assets/MobileTabPageHeader-o3h0Die1.js +2 -0
  20. package/dist/assets/MultiRunWindow-BHY_fvEe.js +1 -0
  21. package/dist/assets/{OnboardingScreen-CGqabMbp.js → OnboardingScreen-CgQGvlEs.js} +1 -1
  22. package/dist/assets/{OverlayScrollbar-AGSWQKg-.js → OverlayScrollbar-C9Ac564a.js} +1 -1
  23. package/dist/assets/SettingsView-BlOWs55G.js +29 -0
  24. package/dist/assets/SettingsWindow-EosRcZmc.js +1 -0
  25. package/dist/assets/SetupTourDialog-CUzqT2sw.css +1 -0
  26. package/dist/assets/SetupTourDialog-_DdUf4Np.js +1 -0
  27. package/dist/assets/{TerminalView-OHqpkHzz.js → TerminalView-BrTVmvyd.js} +3 -3
  28. package/dist/assets/ToolOutputDialog-DVVOJVDJ.js +10 -0
  29. package/dist/assets/VoiceSettings-C0HSdVvS.css +1 -0
  30. package/dist/assets/VoiceSettings-UNCCasqF.js +2 -0
  31. package/dist/assets/YuriLogo-CpccdHvS.js +1 -0
  32. package/dist/assets/YuriWordmark-hZ6K7Smk.js +1 -0
  33. package/dist/assets/{appThemeRegistry-9j-rCSlE.js → appThemeRegistry-B8qob2l9.js} +1 -1
  34. package/dist/assets/appearance--vFosLNi.js +1 -0
  35. package/dist/assets/{assistant-attachment-cache-B_qRvy-k.js → assistant-attachment-cache-oatc8F4t.js} +1 -1
  36. package/dist/assets/{button-Bjh2BSXh.js → button-Cjciq1yh.js} +1 -1
  37. package/dist/assets/{capgoAdapter-DERfot6h.js → capgoAdapter-YgVOiKZO.js} +1 -1
  38. package/dist/assets/collapsible-BzCn4-sd.js +1 -0
  39. package/dist/assets/context-menu-BIjCIXOg.js +1 -0
  40. package/dist/assets/desktopRelayRestore-C7pjf6fE.js +1 -0
  41. package/dist/assets/{device-BcRP6Tjd.js → device-DN1GigI_.js} +1 -1
  42. package/dist/assets/{diagram-CXVm2vzI.js → diagram--zTR0vWJ.js} +1 -1
  43. package/dist/assets/dialog-rVkj8VgE.js +1 -0
  44. package/dist/assets/dropdown-menu.styles-BDla58Rm.js +1 -0
  45. package/dist/assets/es-B8dNq0Lv.js +15 -0
  46. package/dist/assets/{fileMentionTouchSelection-B9NbPN9D.js → fileMentionTouchSelection-CmdNi_d0.js} +2 -2
  47. package/dist/assets/{fileQueries-BeXkd3o6.js → fileQueries-C2Rs6TPz.js} +1 -1
  48. package/dist/assets/{fileReferenceActions-CrIAce3K.js → fileReferenceActions-CvDFcgBH.js} +1 -1
  49. package/dist/assets/{fr-CIGqV46N.js → fr-DbzWoYOD.js} +4 -4
  50. package/dist/assets/{gitApi-CY3D5CF0.js → gitApi-CEtJm-Si.js} +3 -3
  51. package/dist/assets/{gitApiHttp-B7vYwgBh.js → gitApiHttp-Ddik7PM_.js} +4 -4
  52. package/dist/assets/host-D776RHTx.js +1 -0
  53. package/dist/assets/image-loading-DKQOYtti.js +1 -0
  54. package/dist/assets/input-GVRUiwuQ.js +1 -0
  55. package/dist/assets/insertionBoundaries-DQcca8Jd.js +1 -0
  56. package/dist/assets/{ja-DAhnTq6V.js → ja-BGk5BIrz.js} +4 -4
  57. package/dist/assets/{ko-FbMgNKcI.js → ko-Broo5A8H.js} +4 -4
  58. package/dist/assets/magpie-BuRvkGVQ.svg +1 -0
  59. package/dist/assets/main-BY3PGnZf.js +169 -0
  60. package/dist/assets/main-CMMAJcu3.js +2 -0
  61. package/dist/assets/{markdownHeightCache-DVWGXtAX.js → markdownHeightCache-C7UOJdkN.js} +1 -1
  62. package/dist/assets/{markdownTheme-hpURsgju.js → markdownTheme-CHNl6tUv.js} +1 -1
  63. package/dist/assets/{mcpQueries-CdOYmUdO.js → mcpQueries-Cb3fyXbV.js} +1 -1
  64. package/dist/assets/miniChat-Dez8HIZj.js +2 -0
  65. package/dist/assets/mobile-CE0hClMx.js +2 -0
  66. package/dist/assets/{mobileBackNavigation-CgZndzFA.js → mobileBackNavigation-HtKkSk0m.js} +1 -1
  67. package/dist/assets/multirun-CIbNS1L_.js +3 -0
  68. package/dist/assets/native-DsqzO52u.js +1 -0
  69. package/dist/assets/{native-config-BpsFKLGl.js → native-config-D-sxhX53.js} +1 -1
  70. package/dist/assets/persistence-D-rnhgr4.js +3 -0
  71. package/dist/assets/{pl-DzX0cbiQ.js → pl-not4wEra.js} +4 -4
  72. package/dist/assets/projectMeta-DMn_yra8.js +1 -0
  73. package/dist/assets/pt-BR-3OzFQDGv.js +15 -0
  74. package/dist/assets/pwa-CnptYkbA.js +2 -0
  75. package/dist/assets/{queryRuntime-CTcigFdj.js → queryRuntime-2dx7jbt9.js} +1 -1
  76. package/dist/assets/{queue-abort-optimistic-DCLBpirg.js → queue-abort-optimistic-CShE2znR.js} +1 -1
  77. package/dist/assets/{react-DRe85o5s.js → react-Bwr5-XPi.js} +1 -1
  78. package/dist/assets/readiness-gqLkYnM4.js +1 -0
  79. package/dist/assets/renderElectronMiniChatApp-CY9Z1Vhr.js +2 -0
  80. package/dist/assets/renderMobileApp-BCwgH2Gn.js +28 -0
  81. package/dist/assets/{runtime-file-download-Cf1WxfeW.js → runtime-file-download-D6bwc3Kj.js} +1 -1
  82. package/dist/assets/{runtime-file-resource-UJjHUF2C.js → runtime-file-resource-BP4P52ry.js} +1 -1
  83. package/dist/assets/{runtimeConfig-BBgkLVr_.js → runtimeConfig-BjAB7T92.js} +1 -1
  84. package/dist/assets/runtimeEndpointReset-b_8lxjHW.js +149 -0
  85. package/dist/assets/scheduledTaskNavigation-Bp5rGr3m.js +1 -0
  86. package/dist/assets/select-DeP9bukP.js +1 -0
  87. package/dist/assets/sessionLookup-CvwAHpsq.js +1 -0
  88. package/dist/assets/sortable-tabs-strip-BloEQRck.js +1 -0
  89. package/dist/assets/speechSettingsQueries-B-JHilmU.js +3 -0
  90. package/dist/assets/src-EZMbcCtg.css +2 -0
  91. package/dist/assets/{store-DVfZQktm.js → store-CKIMMlXR.js} +5 -4
  92. package/dist/assets/{terminalApi-rl9mZAlB.js → terminalApi-ChZhb60_.js} +1 -1
  93. package/dist/assets/{textarea-C6VQ7dHH.js → textarea-B4mWtnN5.js} +1 -1
  94. package/dist/assets/theme-validation-BGYdrOu7.js +1 -0
  95. package/dist/assets/themes-BgDJcxRc.js +1 -0
  96. package/dist/assets/tooltip-BuZ86ipm.js +1 -0
  97. package/dist/assets/{touch-gestures-K2_ZOkKW.js → touch-gestures-CErgaXZ7.js} +1 -1
  98. package/dist/assets/tour-Db44qwfs.js +1 -0
  99. package/dist/assets/types-B5Nt6TGt.js +2 -0
  100. package/dist/assets/uk-DyZ2SwUJ.js +15 -0
  101. package/dist/assets/{useAppFontEffects-CEgDiZHu.js → useAppFontEffects-CN6GxBsA.js} +43 -43
  102. package/dist/assets/{useAssistantUIStore-CfaQV3ID.js → useAssistantUIStore-BI_dAUjx.js} +1 -1
  103. package/dist/assets/useDesktopWindowControlsLayout-DtGw4mOb.js +1 -0
  104. package/dist/assets/{dropdown-menu.styles-M78xpvb2.js → useDictation-CwX05CAo.js} +1 -1
  105. package/dist/assets/{useEffectiveDirectory-BOYMJ6k7.js → useEffectiveDirectory-BcjGq1gO.js} +1 -1
  106. package/dist/assets/{useFontPreferences-DeqW9nRx.js → useFontPreferences-EsJ4FlIp.js} +1 -1
  107. package/dist/assets/useMobileNavigationStore-CIldW1SJ.js +17 -0
  108. package/dist/assets/usePluginsStore-CBQx059k.js +1 -0
  109. package/dist/assets/{useThemeSystem-CGF5jnIh.js → useThemeSystem-CNzUUkFn.js} +1 -1
  110. package/dist/assets/useUIStore-CoWJ3ROq.js +1 -0
  111. package/dist/assets/{useWorkerHighlightedLines-EcJThS4x.js → useWorkerHighlightedLines-jLLdysNE.js} +1 -1
  112. package/dist/assets/vendor-base-ui-CzHs0bHY.js +1 -0
  113. package/dist/assets/{vendor-cmdk-C3oBVL9X.js → vendor-cmdk-C_tivUtr.js} +1 -1
  114. package/dist/assets/vendor-codemirror-autocomplete-C0FrlFqZ.js +12 -0
  115. package/dist/assets/vendor-codemirror-commands-5saeUOVY.js +1 -0
  116. package/dist/assets/vendor-codemirror-lang-angular-Cm7vBE3E.js +23 -0
  117. package/dist/assets/vendor-codemirror-lang-cpp-BjixvwC2.js +1 -0
  118. package/dist/assets/vendor-codemirror-lang-go-DFb2d_8t.js +11 -0
  119. package/dist/assets/vendor-codemirror-lang-java-CHitPigf.js +1 -0
  120. package/dist/assets/vendor-codemirror-lang-jinja-B8yrwpok.js +1 -0
  121. package/dist/assets/{vendor-codemirror-lang-json-mLulNbwB.js → vendor-codemirror-lang-json-DowyFczU.js} +1 -1
  122. package/dist/assets/{vendor-codemirror-lang-less-CNvptX3P.js → vendor-codemirror-lang-less-B1_0-sTl.js} +1 -1
  123. package/dist/assets/vendor-codemirror-lang-liquid-FIsA7YFN.js +1 -0
  124. package/dist/assets/vendor-codemirror-lang-markdown-npWBZIoE.js +6 -0
  125. package/dist/assets/vendor-codemirror-lang-php-wyEc0fdz.js +1 -0
  126. package/dist/assets/vendor-codemirror-lang-python-OPRdU26g.js +9 -0
  127. package/dist/assets/{vendor-codemirror-lang-rust-CtafR0gt.js → vendor-codemirror-lang-rust-DgovszuH.js} +1 -1
  128. package/dist/assets/vendor-codemirror-lang-sass-BdU-i07o.js +1 -0
  129. package/dist/assets/{vendor-codemirror-lang-sql-C6q09UUZ.js → vendor-codemirror-lang-sql-DUutq98l.js} +2 -2
  130. package/dist/assets/{vendor-codemirror-lang-vue-DIB78UsR.js → vendor-codemirror-lang-vue-CuRNbe8H.js} +1 -1
  131. package/dist/assets/{vendor-codemirror-lang-wast-C_JVdOCF.js → vendor-codemirror-lang-wast-CGFAOCoB.js} +1 -1
  132. package/dist/assets/vendor-codemirror-lang-xml-CMKBqGXF.js +1 -0
  133. package/dist/assets/{vendor-codemirror-lang-yaml-BO0hIfQM.js → vendor-codemirror-lang-yaml-CH9a1QiY.js} +1 -1
  134. package/dist/assets/{vendor-codemirror-language-data-Ctd4WxgW.js → vendor-codemirror-language-data-B3pLWvv-.js} +2 -2
  135. package/dist/assets/vendor-codemirror-search-hZY-L2l8.js +2 -0
  136. package/dist/assets/{vendor-dnd-kit-accessibility-DxpFzZhi.js → vendor-dnd-kit-accessibility-BOtnpZt5.js} +1 -1
  137. package/dist/assets/{vendor-dnd-kit-core-B3g3zWQd.js → vendor-dnd-kit-core-DK4OoOTr.js} +1 -1
  138. package/dist/assets/{vendor-dnd-kit-sortable-BKewx0Py.js → vendor-dnd-kit-sortable-Cv69eQm1.js} +1 -1
  139. package/dist/assets/{vendor-framer-motion-C1twy-GF.js → vendor-framer-motion-DDMKlXiP.js} +1 -1
  140. package/dist/assets/vendor-lodash-es-BS45jPoZ.js +1 -0
  141. package/dist/assets/{vendor-markstream-react-BlbOg72y.js → vendor-markstream-react-DfLaSG3W.js} +3 -3
  142. package/dist/assets/vendor-motion-C9oiAdx-.js +1 -0
  143. package/dist/assets/{vendor-pierre-diffs-Bj9Nqn6w.js → vendor-pierre-diffs-BFiZ3IhI.js} +2 -2
  144. package/dist/assets/{vendor-react-D5d-V1vN.js → vendor-react-DlzBev0S.js} +1 -1
  145. package/dist/assets/{vendor-react-drawio-C-iPmmED.js → vendor-react-drawio-Dyg1-39Q.js} +1 -1
  146. package/dist/assets/vendor-reactuses-core-DWo5Wn6R.js +1 -0
  147. package/dist/assets/{vendor-replit-codemirror-vim-DCdAdxvE.js → vendor-replit-codemirror-vim-BmQmU1lR.js} +6 -6
  148. package/dist/assets/{vendor-sonner-r2EJnfoo.js → vendor-sonner-BEHGipm5.js} +1 -1
  149. package/dist/assets/{vendor-stream-diffs-BnLmeqg2.js → vendor-stream-diffs-wcQxoPZk.js} +2 -2
  150. package/dist/assets/vendor-tanstack-query-core-Y_YoRHtC.js +1 -0
  151. package/dist/assets/vendor-tanstack-react-query-B-Wpqq5J.js +1 -0
  152. package/dist/assets/{vendor-tanstack-react-virtual-BeZn51tF.js → vendor-tanstack-react-virtual-DSFNK3qc.js} +1 -1
  153. package/dist/assets/{vendor-zustand-B43HCgwC.js → vendor-zustand-vDaAPGfl.js} +1 -1
  154. package/dist/assets/zh-CN-aNIWxYun.js +15 -0
  155. package/dist/assets/zh-TW-B1IdCz5g.js +15 -0
  156. package/dist/index.html +20 -20
  157. package/dist/mini-chat.html +20 -20
  158. package/dist/mobile.html +20 -20
  159. package/package.json +5 -3
  160. package/server/lib/assistants/DOCUMENTATION.md +1 -1
  161. package/server/lib/assistants/contact-tools.js +1 -1
  162. package/server/lib/assistants/harness.js +3 -3
  163. package/server/lib/client-auth/pairing.js +4 -1
  164. package/server/lib/client-auth/pairing.test.js +41 -0
  165. package/server/lib/client-auth/remote-clients.js +6 -2
  166. package/server/lib/client-auth/remote-clients.test.js +42 -0
  167. package/server/lib/config-sync/DOCUMENTATION.md +1 -0
  168. package/server/lib/config-sync/config-sync.test.js +22 -0
  169. package/server/lib/config-sync/constants.js +0 -3
  170. package/server/lib/gui-customization/DOCUMENTATION.md +56 -0
  171. package/server/lib/gui-customization/session-skill.js +58 -0
  172. package/server/lib/gui-customization/session-skill.test.js +53 -0
  173. package/server/lib/gui-customization/skill/SKILL.md +38 -0
  174. package/server/lib/gui-customization/skill/references/appearance.md +79 -0
  175. package/server/lib/gui-customization/skill/references/file-previews.md +113 -0
  176. package/server/lib/gui-customization/skill/references/global-pages.md +81 -0
  177. package/server/lib/gui-customization/skill/references/gui-api.md +37 -0
  178. package/server/lib/gui-customization/skill/references/preview-exports.md +74 -0
  179. package/server/lib/gui-customization/skill/references/ui-surfaces.md +228 -0
  180. package/server/lib/gui-customization/skill/references/workflow.md +80 -0
  181. package/server/lib/llm/DOCUMENTATION.md +14 -1
  182. package/server/lib/llm/bridge-plugin.bundle.js +13 -1136
  183. package/server/lib/llm/bridge-plugin.js +4 -4
  184. package/server/lib/llm/bridge-plugin.test.js +31 -4
  185. package/server/lib/opencode/DOCUMENTATION.md +82 -1
  186. package/server/lib/opencode/config-entity-routes.js +2 -4
  187. package/server/lib/opencode/config-entity-routes.test.js +16 -13
  188. package/server/lib/opencode/core-routes.js +5 -2
  189. package/server/lib/opencode/core-routes.test.js +14 -4
  190. package/server/lib/opencode/custom-provider-models.d.ts +2 -0
  191. package/server/lib/opencode/custom-provider-models.js +71 -0
  192. package/server/lib/opencode/custom-provider-models.test.js +90 -0
  193. package/server/lib/opencode/custom-provider.d.ts +2 -0
  194. package/server/lib/opencode/custom-provider.js +107 -0
  195. package/server/lib/opencode/custom-provider.test.js +211 -0
  196. package/server/lib/opencode/feature-routes-runtime.js +5 -0
  197. package/server/lib/opencode/npm-registry.js +9 -2
  198. package/server/lib/opencode/npm-registry.test.js +22 -1
  199. package/server/lib/opencode/plugin-routes.js +1 -0
  200. package/server/lib/opencode/provider-catalog.js +14 -0
  201. package/server/lib/opencode/provider-catalog.test.js +15 -0
  202. package/server/lib/opencode/provider-configuration.test.js +64 -0
  203. package/server/lib/opencode/provider-model-config.d.ts +1 -0
  204. package/server/lib/opencode/provider-model-config.js +39 -0
  205. package/server/lib/opencode/provider-model-config.test.js +69 -0
  206. package/server/lib/opencode/provider-sources.d.ts +10 -0
  207. package/server/lib/opencode/provider-sources.js +52 -0
  208. package/server/lib/opencode/provider-sources.test.js +73 -0
  209. package/server/lib/opencode/providers.d.ts +5 -0
  210. package/server/lib/opencode/providers.js +28 -0
  211. package/server/lib/opencode/routes.js +50 -1
  212. package/server/lib/opencode/settings-helpers.js +0 -3
  213. package/server/lib/opencode/settings-helpers.test.js +8 -0
  214. package/server/lib/opencode/static-routes-runtime.js +5 -3
  215. package/server/lib/opencode/static-routes-runtime.test.js +23 -10
  216. package/server/lib/remote-desktop/DOCUMENTATION.md +10 -2
  217. package/server/lib/remote-desktop/runtime.js +3 -2
  218. package/server/lib/remote-desktop/runtime.test.js +20 -0
  219. package/server/lib/scheduled-tasks/session-skill.js +3 -0
  220. package/server/lib/scheduled-tasks/session-skill.test.js +4 -2
  221. package/server/lib/ui-auth/DOCUMENTATION.md +2 -0
  222. package/shared/custom-provider-protocol.d.ts +4 -0
  223. package/shared/custom-provider-protocol.js +32 -0
  224. package/dist/assets/AgentAvatar-BybF1ayP.js +0 -1
  225. package/dist/assets/AssistantContactStatus-BwpxTn0d.js +0 -3
  226. package/dist/assets/Icon-CeRMtJa8.js +0 -1
  227. package/dist/assets/LoadingImage-DG3otL5V.js +0 -1
  228. package/dist/assets/MarkdownRenderer-C8rv6z7p.js +0 -2
  229. package/dist/assets/MarkstreamRendererImpl-bs8HZ4Ra.js +0 -3
  230. package/dist/assets/MobileTabPageHeader-EsrOCLyg.js +0 -2
  231. package/dist/assets/MultiRunWindow-C-Qw_g7N.js +0 -1
  232. package/dist/assets/SettingsView-BLfFnnnX.js +0 -29
  233. package/dist/assets/SettingsView-BRIvklfP.css +0 -1
  234. package/dist/assets/SettingsWindow-lyYO8Byy.js +0 -1
  235. package/dist/assets/ToolOutputDialog-DU4Pb1s0.js +0 -10
  236. package/dist/assets/YuriLogo-Bb6yHagP.js +0 -1
  237. package/dist/assets/collapsible-BEAHoxNi.js +0 -1
  238. package/dist/assets/context-menu-BxLcot-3.js +0 -1
  239. package/dist/assets/desktopRelayRestore-D1UX7HW2.js +0 -1
  240. package/dist/assets/dialog-nshKUSE5.js +0 -1
  241. package/dist/assets/es-N9ZkQwG9.js +0 -15
  242. package/dist/assets/host-CnVx34Dh.js +0 -1
  243. package/dist/assets/image-loading-D6kOgU4w.js +0 -1
  244. package/dist/assets/input-3Re4pmHm.js +0 -1
  245. package/dist/assets/insertionBoundaries-DK7XYF8d.js +0 -1
  246. package/dist/assets/main-B_THXYMs.js +0 -2
  247. package/dist/assets/main-CpcudEZb.js +0 -169
  248. package/dist/assets/miniChat-DxZiTnAZ.js +0 -2
  249. package/dist/assets/mobile-BJuATiaC.js +0 -2
  250. package/dist/assets/multirun-BlaYsQi2.js +0 -3
  251. package/dist/assets/native-BYMhr-xH.js +0 -1
  252. package/dist/assets/persistence-CWuLIq1J.js +0 -3
  253. package/dist/assets/projectMeta-CnXHTolN.js +0 -1
  254. package/dist/assets/pt-BR-C5yvwyDK.js +0 -15
  255. package/dist/assets/readiness-U16Qor79.js +0 -1
  256. package/dist/assets/renderElectronMiniChatApp-n-nhgy1V.js +0 -2
  257. package/dist/assets/renderMobileApp-DBj_7RlD.js +0 -28
  258. package/dist/assets/runtimeEndpointReset-BvSQVFfx.js +0 -149
  259. package/dist/assets/scheduledTaskNavigation-EomDNVu2.js +0 -1
  260. package/dist/assets/sessionLookup-C_CCp7MJ.js +0 -1
  261. package/dist/assets/sortable-tabs-strip-p16Pn6Zz.js +0 -1
  262. package/dist/assets/speechSettingsQueries-CBSEAKyj.js +0 -4
  263. package/dist/assets/src-u-YDfCVw.css +0 -2
  264. package/dist/assets/tooltip-Dnc6GA-X.js +0 -1
  265. package/dist/assets/types-DnZw0gLD.js +0 -2
  266. package/dist/assets/uk-zbDcUpBy.js +0 -15
  267. package/dist/assets/useDesktopWindowControlsLayout-B2o4IFmd.js +0 -1
  268. package/dist/assets/useMobileNavigationStore-DlvrZQ49.js +0 -17
  269. package/dist/assets/useUIStore-C6CE42oh.js +0 -1
  270. package/dist/assets/vendor-base-ui-BQjbsJ43.js +0 -1
  271. package/dist/assets/vendor-codemirror-autocomplete-7c2L_4dM.js +0 -12
  272. package/dist/assets/vendor-codemirror-commands-B8KrBQ9B.js +0 -1
  273. package/dist/assets/vendor-codemirror-lang-angular-DXOgWEVj.js +0 -23
  274. package/dist/assets/vendor-codemirror-lang-cpp-Dh8C3xqP.js +0 -1
  275. package/dist/assets/vendor-codemirror-lang-go-BXAJ1_dh.js +0 -11
  276. package/dist/assets/vendor-codemirror-lang-java-DAyCHRhk.js +0 -1
  277. package/dist/assets/vendor-codemirror-lang-jinja-0TICrMfO.js +0 -1
  278. package/dist/assets/vendor-codemirror-lang-liquid-8g5seytq.js +0 -1
  279. package/dist/assets/vendor-codemirror-lang-markdown-CV1IO6Qs.js +0 -6
  280. package/dist/assets/vendor-codemirror-lang-php-xP7rf28_.js +0 -1
  281. package/dist/assets/vendor-codemirror-lang-python-YM2WVLHF.js +0 -9
  282. package/dist/assets/vendor-codemirror-lang-sass-B4iav_Ps.js +0 -1
  283. package/dist/assets/vendor-codemirror-lang-xml-DIuzY_d4.js +0 -1
  284. package/dist/assets/vendor-codemirror-search-DiPwvA-6.js +0 -2
  285. package/dist/assets/vendor-lodash-es-DfLbG5Af.js +0 -1
  286. package/dist/assets/vendor-motion-BmLx2V78.js +0 -1
  287. package/dist/assets/vendor-reactuses-core-BcebBLwF.js +0 -1
  288. package/dist/assets/vendor-tanstack-query-core-BWz0ose6.js +0 -1
  289. package/dist/assets/vendor-tanstack-react-query-C4SG3JZB.js +0 -1
  290. package/dist/assets/zh-CN-BHRJ7CF3.js +0 -15
  291. package/dist/assets/zh-TW-BFI_YFd-.js +0 -15
@@ -2,8 +2,8 @@ import { Cause, Context, Effect, Stream } from 'effect';
2
2
  import { createHash } from 'node:crypto';
3
3
  import { HttpClientRequest, HttpClientResponse } from 'effect/http';
4
4
  import { AIClient, LLM, LLMRequest, LanguageModel, HttpOptions, Message, Media } from '@opencode/ai/effect';
5
- import { ModelResolver } from '@opencode/core/model-resolver';
6
- import { PluginHooks } from '@opencode/core/plugin/hooks';
5
+ import { Service as ModelResolverService } from '@opencode/core/model-resolver';
6
+ import { Service as PluginHooksService } from '@opencode/core/plugin/hooks';
7
7
  import { LlmBridge, LLM_BRIDGE_VERSION } from './bridge-contract.js';
8
8
 
9
9
  const sensitiveBodyKeys = ['messages', 'input', 'system', 'instructions', 'tools', 'tool_choice'];
@@ -38,8 +38,8 @@ const toMessage = (message) => {
38
38
 
39
39
  // RPC effects run in the external service's Location context. Never build a parallel runtime.
40
40
  const hostRuntime = Effect.context().pipe(Effect.flatMap(context => {
41
- const resolver = Context.getOption(context, ModelResolver.Service);
42
- const hooks = Context.getOption(context, PluginHooks.Service);
41
+ const resolver = Context.getOption(context, ModelResolverService);
42
+ const hooks = Context.getOption(context, PluginHooksService);
43
43
  return resolver._tag === 'Some' && typeof resolver.value.resolve === 'function'
44
44
  && hooks._tag === 'Some' && typeof hooks.value.trigger === 'function'
45
45
  ? Effect.succeed({ resolver: resolver.value, hooks: hooks.value })
@@ -1,15 +1,35 @@
1
1
  import http from 'node:http';
2
- import { afterEach, describe, expect, it, vi } from 'vitest';
2
+ import { execFileSync } from 'node:child_process';
3
+ import { copyFile, mkdtemp, rm } from 'node:fs/promises';
4
+ import os from 'node:os';
5
+ import path from 'node:path';
6
+ import { fileURLToPath, pathToFileURL } from 'node:url';
7
+ import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
3
8
  import { Effect } from 'effect';
4
9
  import { ModelResolver } from '@opencode/core/model-resolver';
5
10
  import { PluginHooks } from '@opencode/core/plugin/hooks';
6
11
  import * as compatible from '@opencode/ai/providers/openai-compatible';
7
- import bridge, { generateBridgeResponse } from './bridge-plugin.js';
12
+ import sourceBridge, { generateBridgeResponse as sourceGenerate } from './bridge-plugin.js';
8
13
 
9
14
  const servers = [];
15
+ let bundled;
16
+ let bundleDirectory;
17
+ beforeAll(async () => {
18
+ const directory = path.dirname(fileURLToPath(import.meta.url));
19
+ execFileSync('bun', ['run', 'build:llm-bridge'], {
20
+ cwd: path.resolve(directory, '../../..'), stdio: 'pipe',
21
+ });
22
+ bundleDirectory = await mkdtemp(path.join(os.tmpdir(), 'yuri-bridge-test-'));
23
+ const target = path.join(bundleDirectory, 'bridge.mjs');
24
+ await copyFile(path.join(directory, 'bridge-plugin.bundle.js'), target);
25
+ // The plugin must also load in the external Bun service without Yuri's node_modules.
26
+ execFileSync('bun', ['-e', `await import(${JSON.stringify(pathToFileURL(target).href)})`], { cwd: bundleDirectory, stdio: 'pipe' });
27
+ bundled = await import(/* @vite-ignore */ pathToFileURL(target).href);
28
+ });
29
+ afterAll(async () => { if (bundleDirectory) await rm(bundleDirectory, { recursive: true, force: true }); });
10
30
  afterEach(async () => { for (const server of servers.splice(0)) { server.closeAllConnections(); await new Promise(resolve => server.close(resolve)); } });
11
31
 
12
- async function fixture(reply) {
32
+ async function createFixture(reply, generateBridgeResponse) {
13
33
  const requests = [];
14
34
  const headers = [];
15
35
  const server = http.createServer(async (req, res) => {
@@ -39,7 +59,14 @@ async function fixture(reply) {
39
59
  return { input, requests, headers, model, credential, resolve, trigger, run, runEffect };
40
60
  }
41
61
 
42
- describe('external runtime provider bridge', () => {
62
+ describe.each(['source', 'prebundled'])('external runtime provider bridge (%s)', (mode) => {
63
+ let bridge;
64
+ let generateBridgeResponse;
65
+ beforeAll(() => {
66
+ bridge = mode === 'source' ? sourceBridge : bundled.default;
67
+ generateBridgeResponse = mode === 'source' ? sourceGenerate : bundled.generateBridgeResponse;
68
+ });
69
+ const fixture = reply => createFixture(reply, generateBridgeResponse);
43
70
  it('sends only caller context and returns measured usage through the host resolver', async () => {
44
71
  const { input, requests, resolve, trigger, run } = await fixture({ role: 'assistant', content: 'summary' });
45
72
  expect(await run(input)).toMatchObject({ text: 'summary', toolCalls: [], usage: { inputTokens: 100, outputTokens: 10, cacheReadInputTokens: 80 } });
@@ -58,6 +58,7 @@ encoding, not removed V1 endpoints.
58
58
  - `packages/web/server/lib/opencode/shutdown-runtime.js`: graceful shutdown orchestration runtime for watcher/session/terminal/process/server teardown.
59
59
  - `packages/web/server/lib/opencode/server-startup-runtime.js`: server listen/startup flow and process/signal handler orchestration runtime.
60
60
  - `packages/web/server/lib/opencode/static-routes-runtime.js`: static asset/SPA fallback route registration and manifest route wiring. The SPA fallback sends `index.html` relative to `root`, so deep links keep working when the install lives under a dot directory.
61
+ - Canonical `/plugins/<pluginId>/<pageId>` routes are application documents even when either encoded identity contains an asset-like suffix such as `.js`, `.json` or `.png`. Static files still resolve first; missing assets outside that exact two-identity route retain 404 responses. API-only mode uses its existing headless response for the same plugin routes.
61
62
  - The API-only dark fallback and both server/client PWA manifest defaults use the Cursor surface (`#1a1a1a`) and primary (`#4c9df3`).
62
63
  - `packages/web/server/lib/opencode/feature-routes-runtime.js`: feature route composition runtime for dynamic import-backed config/skill/provider route registration.
63
64
  - `packages/web/server/lib/conversations/`: combined create-session-and-prompt orchestration (Yuri-owned, registered before generic proxy).
@@ -82,6 +83,13 @@ encoding, not removed V1 endpoints.
82
83
  - `packages/web/server/lib/opencode/proxy.js`: OpenCode API/SSE forwarding and readiness-gate route registration.
83
84
  - `npm-registry.js`: plugin package lookup used by `GET /api/config/plugins/registry`. It asks the user's own `npm view` first (run in the project directory, so scope registries, auth tokens and mirrors from `.npmrc` apply as they do for `npm install`) and falls back to a direct request to the public registry only when the CLI is unavailable; a CLI 404 is final. Results are cached per name and directory. The latest release's top-level package.json `icon` is returned as `icon` only when it is an `https://` URL or `data:image/` URI of at most ~1.5 MB; nested icon fields are not read or used as fallbacks.
84
85
  - `plugin-icon.js` owns the shared icon sanitizer and optional local package metadata read for Web/Electron/mobile and VS Code. Registry `path-ok` includes the nearest package manifest's top-level `icon` for directories or built entry files. Search stops at the first manifest, root or 32 parents; malformed, unreadable or >2 MiB manifests omit artwork without changing path status. No server-side image fetch occurs. Settings → Plugins renders package artwork directly; GUI sidebar/titlebar entries use official `IconName` without package-image substitution.
86
+
87
+ Registry callers can opt into `details=true` for the latest developer-provided
88
+ `description` and package `readme`. npm CLI and HTTP lookups retain these fields
89
+ (bounded to 4,096 and 131,072 characters); ordinary version-check responses omit
90
+ them. The three-step setup tour uses the same authenticated batch route and icon
91
+ sanitizer, never a separate browser registry client. README Markdown is untrusted
92
+ display content, not instructions executed by the host.
85
93
  - `plugin-gui-response.js`: shared Web/Electron/VS Code code-only revision response owner for exact `GET /api/plugin/gui?id=…` (one nonempty id). The installed GUI client alias is official `@opencode/client@2.2.0`: HTTP returns `{ location, data: { code, revision, options } }`. Every call still reads the complete current upstream response through the existing auth/readiness/abort boundary; there is no Host bundle cache.
86
94
  - Request `X-Yuri-Gui-Revision: <lowercase SHA-256 hex of UTF-8 revision>` opts into code reuse. This header and HTTP condition/range headers are stripped before upstream so Yuri always requests a complete representation. Other query and request headers retain proxy semantics.
87
95
  - A valid upstream 200 JSON bundle (`code` string, nonempty `revision` string, `options` object) receives `X-Yuri-Gui-Revision` and `Cache-Control: private, no-store`. Matching tokens additionally receive `X-Yuri-Gui-Code: cached` and only `data.code` becomes `''`; current `options`, `revision`, location and other fields remain. Unmatched/ordinary calls preserve original body bytes. No 304 or Yuri ETag is generated. Upstream failure statuses/bodies remain failures; malformed successful bodies remain unchanged without a revision receipt.
@@ -124,6 +132,71 @@ unrelated new SDK resources must not invalidate these host integration seams.
124
132
  - `listSkillSupportingFiles(skillDir)`, `readSkillSupportingFile(skillDir, relativePath)`, `writeSkillSupportingFile(skillDir, relativePath, content)`, `deleteSkillSupportingFile(skillDir, relativePath)`: Skill supporting file management.
125
133
 
126
134
  ## Public exports (routes.js)
135
+ `GET /api/config/providers/sources` batches the running service's provider,
136
+ configuration-document and integration-connection metadata through
137
+ `provider-sources.js`. It returns only source paths/scopes, origin and credential
138
+ existence/method (`api`, `oauth`, `external`). It never reads or serializes raw
139
+ credentials, provider settings or headers. Missing/malformed authoritative reads
140
+ fail with 502. File-backed, pathless-document and runtime-injected origins remain
141
+ distinct; there is no authoritative provider-to-plugin mapping in the current API.
142
+
143
+ `DELETE /api/provider/:id/auth?scope=config` removes both `provider[id]` and
144
+ `providers[id]` from every physical document visible to the selected location,
145
+ deduplicating paths. It uses the shared atomic JSONC writer, preserves unrelated
146
+ configuration/comments, and requests no reload. These file mutations share the
147
+ existing co-located config-file boundary. Across files the operation is not a
148
+ transaction: failures may leave some files already updated; retry finishes the
149
+ remaining occurrences. Credential deletion is a separate official API step owned
150
+ by the UI mutation. Runtime/plugin registrations without independent configuration
151
+ cannot be removed by this file operation (`removed: false`).
152
+
153
+ Model capabilities project native image input modalities. Reasoning uses explicit
154
+ boolean/`reasoning.supported` first, otherwise actual reasoning-enabled variant
155
+ settings; variant payloads remain stripped from the response. Attachment support
156
+ alone does not imply image input.
157
+
158
+ Custom-provider endpoints are registered before the generic proxy:
159
+
160
+ - `PUT /api/config/providers/model`: `provider-model-config.js` updates a saved
161
+ model's name, context/output limits, tools and image input. It writes the highest
162
+ physical provider source, or the normal custom/global target for runtime models.
163
+ The provider/model IDs stay fixed; credentials, routing, variants, other limits,
164
+ non-image modalities and unrelated config/comments are preserved. Cleared limits
165
+ remove only that document's overrides, allowing inherited defaults. Payloads are
166
+ validated before the atomic write; failed writes retain the original file. Only
167
+ IDs are returned. Web/Electron/mobile and the VS Code bridge use the same owner.
168
+
169
+ - `POST /api/config/providers/custom`: `custom-provider.js` validates native V2
170
+ schema/package/URL/model fields and targets the explicit
171
+ `OPENCODE_CONFIG` file or highest-precedence global JSONC/JSON document. It never
172
+ copies a merged project snapshot. The existing atomic writer preserves unrelated
173
+ fields, JSONC comments and backups. Parse failures do not replace the original.
174
+ Keys are created through the trusted official OpenCode credential client; a failed
175
+ file write removes only the new credential. Failed cleanup is explicitly reported
176
+ as `PROVIDER_CLEANUP_FAILED`. Secret-bearing upstream errors are sanitized, and the
177
+ response contains only `{ providerId }`. OpenCode watches the file; no lifecycle
178
+ restart is needed. New clients omit `providerId`: the host derives it from the
179
+ normalized lowercase Provider Name, joins separators with hyphens, preserves
180
+ Unicode letters/numbers, and uses `custom-provider` for punctuation-only names.
181
+ Numeric suffixes avoid physical-config, runtime-provider, integration and in-flight
182
+ collisions. Reservation occurs before credential writes, including concurrent
183
+ same-name creates. Older clients' explicit `custom-*` IDs remain supported and
184
+ reject duplicates. Existing saved IDs are never renamed.
185
+ - `POST /api/config/providers/custom/models`: `custom-provider-models.js` discovers
186
+ a draft inventory without persistence. OpenAI Chat/Responses use Bearer auth;
187
+ Anthropic uses `x-api-key`/`anthropic-version`; Gemini uses `x-goog-api-key`, never
188
+ a query-string key. Anthropic/Gemini pagination must complete, under a 15s total
189
+ deadline, 20-page/5,000-model bounds and 2 MiB per-page bound. Failed later pages
190
+ remain failures, not partial or empty success. Redirects are refused; explicit
191
+ HTTP(S) local endpoints are supported. Requests abort on client response closure.
192
+ Only IDs, names and supported supplied token limits leave the host.
193
+
194
+ `packages/web/shared/custom-provider-protocol.js` holds browser-safe package metadata
195
+ and Cherry-compatible address completion shared with the UI; `shared/` is included in
196
+ the published Web package. It has no Node imports. VS Code invokes these same helpers;
197
+ its already-dispatched discovery may finish within the deadline after a webview wait
198
+ is cancelled, but obsolete results do not update the draft.
199
+
127
200
  - `registerOpenCodeRoutes(app, dependencies)`: Registers OpenCode-owned HTTP routes and internal module runtime:
128
201
  - `GET /api/config/settings`: returns the full formatted settings response. `?bootstrap=true` remains a safe bootstrap alias that returns schema version `1` and a bounded allowlist for bootstrap clients: default model/variant/agent, worktree/git/file-preview preferences, Zen model, message transport, STT settings, and response-style settings. The bootstrap projection omits credentials and accepts HTTP(S) STT URLs without URL credentials.
129
202
  - `GET /api/config/settings/bootstrap`: returns the schema version `1` bootstrap allowlist. UI clients use this dedicated endpoint so older hosts return HTTP 404; this prevents an older server that ignores the `bootstrap` query parameter from returning the full settings response.
@@ -273,6 +346,14 @@ auth for other routes. See `scheduled-tasks/DOCUMENTATION.md` for ownership,
273
346
  preflight, rollback and runtime coverage. The old managed-child bridge remains
274
347
  separate.
275
348
 
349
+ The same shared-service admission also installs the short `yuri.customization`
350
+ instruction. Managed local session creation installs it through the following
351
+ customization admission route. It points at a shipped, content-fingerprinted skill
352
+ with GUI API, theme/branding, global tab (Runmark), file parser/preview (Eficy),
353
+ export and package workflow references. No global config or existing session is
354
+ changed; external servers receive no unverified local-file pointer. See
355
+ `../gui-customization/DOCUMENTATION.md` for runtime and rollback boundaries.
356
+
276
357
  ## Public exports (env-config.js)
277
358
  - `resolveOpenCodeEnvConfig(options?)`: resolves and validates OpenCode host/port/hostname environment configuration.
278
359
  - `OPENCODE_HOST` still requires an explicit port; HTTP `:80` and HTTPS `:443` retain their effective port even when URL normalization removes it. Host precedence, IPv6 and path/query/hash validation are unchanged.
@@ -402,7 +483,7 @@ Unrelated upstream failures are not retried.
402
483
  - Provider catalog responses include only provider `id`, `name`, and safe models. Safe models include `id`, `name`, fixed text/audio/image/video/pdf capability modalities, bounded cost/limit fields, `release_date`, and variant names with `{}` values. v2 `ModelInfo.variants` is an array of `{ id, settings?, headers?, body? }`; projection keeps ids in array order as empty-object keys and drops request payloads. v2 `capabilities.tools` maps to `toolcall`, and `input`/`output` modality name arrays map to boolean maps. v2 `cost` tier arrays keep the untiered base price. Identifiers are bounded to 512 characters, display names to 1024, release dates to 64, numeric values to absolute 1e9, and catalog collections to 200 providers, 500 models per provider, and 100 defaults or variants. Provider credentials/configuration and unallowlisted model fields stay server-side. Malformed catalog roots and SDK error envelopes return HTTP 502. `partial: true` is structural only: provider/model/default truncation, dropped providers/models/defaults, or truncated variant dictionaries. Soft allowlist stripping of optional metadata (unknown modalities, non-boolean capability flags, out-of-range cost/limit numbers, empty/null/invalid `release_date`, invalid variant ids) keeps valid models and must not set `partial: true`, or UI refresh retains a stale complete snapshot after OpenCode provider updates. The same input shapes are accepted by the VS Code projector and `packages/ui/src/lib/configCatalogParser.ts`.
403
484
  - Agents: `/api/config/agents/:name` and `/api/config/agents/:name/config`. A `native` create or update writes only the fields in that object into the selected user or project markdown file. `scope` chooses the file. `confirmDrop` removes fields the current format cannot represent; every other field already in the file stays unchanged.
404
485
  - Commands: batched metadata via `POST /api/config/commands/metadata`; `{ catalog: true }` returns the compact autocomplete catalog without templates, plus CRUD at `/api/config/commands/:name`
405
- - Global raw configs: `GET /api/config/global` always offers OpenCode and discovers existing plugin targets; `GET/PUT /api/config/global/:target` reads and writes `opencode`, `oh-my-opencode-slim`, and `oh-my-openagent` JSON or JSONC files. Missing OpenCode configuration returns an editable schema template without writing to disk; the first save creates `opencode.jsonc` (or the explicit `OPENCODE_CONFIG` path). Existing JSON/JSONC precedence and comments are preserved.
486
+ - Global raw config: `GET /api/config/global` only offers OpenCode; `GET/PUT /api/config/global/opencode` reads and writes its JSON or JSONC file. Plugin-specific targets are not supported, even if their files exist. Missing OpenCode configuration returns an editable schema template without writing to disk; the first save creates `opencode.jsonc` (or the explicit `OPENCODE_CONFIG` path). Existing JSON/JSONC precedence and comments are preserved. The shared editor has no target tab bar; saves rely on OpenCode's config watcher rather than a manual restart dialog.
406
487
  - MCP servers: `/api/config/mcp` and `/api/config/mcp/:name`
407
488
 
408
489
  ### Catalog / Yuri-owned API change checklist
@@ -112,8 +112,6 @@ const loadProviderCatalogUpstream = async (client, location, wait) => {
112
112
  const MAX_GLOBAL_CONFIG_SIZE = 2 * 1024 * 1024;
113
113
  const GLOBAL_CONFIG_FILES = {
114
114
  opencode: ['opencode.jsonc', 'opencode.json'],
115
- 'oh-my-opencode-slim': ['oh-my-opencode-slim.json', 'oh-my-opencode-slim.jsonc'],
116
- 'oh-my-openagent': ['oh-my-openagent.json', 'oh-my-openagent.jsonc'],
117
115
  };
118
116
 
119
117
  const truncateDescription = (value, maximum = 160) => {
@@ -313,8 +311,8 @@ export const registerConfigEntityRoutes = (app, dependencies) => {
313
311
  target: req.params.target,
314
312
  fileName: target.fileName,
315
313
  content,
316
- requiresManualRestart: req.params.target !== 'opencode',
317
- application: req.params.target === 'opencode' ? 'watch' : 'manual',
314
+ requiresManualRestart: false,
315
+ application: 'watch',
318
316
  });
319
317
  } catch (error) {
320
318
  console.error('Failed to write global configuration:', error);
@@ -312,6 +312,7 @@ describe('provider catalog route', () => {
312
312
  const response = await request(app).get('/api/config/catalog/providers').expect(200);
313
313
  expect(response.body.providers[0].models['gpt-5.4'].variants).toEqual({ low: {}, high: {} });
314
314
  expect(response.body.providers[0].models['gpt-5.4'].capabilities).toEqual({
315
+ reasoning: true,
315
316
  toolcall: true,
316
317
  input: { text: true, image: true },
317
318
  output: { text: true },
@@ -518,21 +519,16 @@ describe('global raw configuration routes', () => {
518
519
  }
519
520
  });
520
521
 
521
- it('reads and validates the configured OpenCode and oh-my-opencode files', async () => {
522
+ it('reads and validates the configured OpenCode file', async () => {
522
523
  const app = express();
523
524
  app.use(express.json());
524
525
  const configDirectory = await fs.mkdtemp(path.join(os.tmpdir(), 'yuri-global-config-'));
525
526
  await fs.writeFile(path.join(configDirectory, 'opencode.jsonc'), `{
526
527
  "$schema": "https://opencode.ai/config.json",
527
528
  "model": "imate/deepseek-v4-pro",
528
- "plugin": ["oh-my-opencode-slim"],
529
+ "plugins": ["example-plugin"],
529
530
  // Existing comments must round-trip unchanged.
530
531
  }`, 'utf8');
531
- await fs.writeFile(path.join(configDirectory, 'oh-my-opencode-slim.json'), JSON.stringify({
532
- scoringEngineVersion: 'v2',
533
- disabled_agents: ['observer'],
534
- agents: { fixer: { model: ['openai/gpt-5.6-terra'] } },
535
- }, null, 2), 'utf8');
536
532
 
537
533
  registerConfigEntityRoutes(app, createDependencies(vi.fn(), configDirectory));
538
534
 
@@ -543,9 +539,6 @@ describe('global raw configuration routes', () => {
543
539
  content: expect.stringContaining('// Existing comments must round-trip unchanged.'),
544
540
  });
545
541
 
546
- const slim = await request(app).get('/api/config/global/oh-my-opencode-slim').expect(200);
547
- expect(slim.body.content).toContain('"disabled_agents"');
548
-
549
542
  const invalid = await request(app)
550
543
  .put('/api/config/global/opencode')
551
544
  .send({ content: '{ "model": }' })
@@ -557,18 +550,23 @@ describe('global raw configuration routes', () => {
557
550
  .send({ content: '{\n "model": "imate/deepseek-v4-pro",\n // preserved JSONC syntax\n}' })
558
551
  .expect(200);
559
552
  expect(saved.body.content).toContain('// preserved JSONC syntax');
553
+ expect(saved.body).toMatchObject({ requiresManualRestart: false, application: 'watch' });
560
554
  expect(await fs.readFile(path.join(configDirectory, 'opencode.jsonc'), 'utf8')).toBe(saved.body.content);
561
555
 
562
556
  await fs.rm(configDirectory, { recursive: true, force: true });
563
557
  });
564
558
 
565
- it('discovers only existing targets and edits the winning global JSONC document', async () => {
559
+ it('ignores plugin-specific targets and edits the winning global JSONC document', async () => {
566
560
  const app = express();
567
561
  app.use(express.json());
568
562
  const configDirectory = await fs.mkdtemp(path.join(os.tmpdir(), 'yuri-global-config-'));
569
563
  await fs.writeFile(path.join(configDirectory, 'opencode.json'), '{ "model": "json-model" }', 'utf8');
570
564
  await fs.writeFile(path.join(configDirectory, 'opencode.jsonc'), '{ "model": "jsonc-model" }', 'utf8');
571
- await fs.writeFile(path.join(configDirectory, 'oh-my-openagent.jsonc'), '{\n // JSONC configuration\n}', 'utf8');
565
+ const pluginTargets = ['oh-my-opencode', 'oh-my-opencode-slim', 'oh-my-openagent'];
566
+ const pluginContent = '{\n // JSONC configuration\n}';
567
+ for (const target of pluginTargets) {
568
+ await fs.writeFile(path.join(configDirectory, `${target}.jsonc`), pluginContent, 'utf8');
569
+ }
572
570
 
573
571
  registerConfigEntityRoutes(app, createDependencies(vi.fn(), configDirectory));
574
572
 
@@ -576,10 +574,15 @@ describe('global raw configuration routes', () => {
576
574
  expect(available.body).toEqual({
577
575
  targets: [
578
576
  { target: 'opencode', fileName: 'opencode.jsonc' },
579
- { target: 'oh-my-openagent', fileName: 'oh-my-openagent.jsonc' },
580
577
  ],
581
578
  });
582
579
 
580
+ for (const target of pluginTargets) {
581
+ await request(app).get(`/api/config/global/${target}`).expect(404);
582
+ await request(app).put(`/api/config/global/${target}`).send({ content: '{}' }).expect(404);
583
+ expect(await fs.readFile(path.join(configDirectory, `${target}.jsonc`), 'utf8')).toBe(pluginContent);
584
+ }
585
+
583
586
  const openCode = await request(app).get('/api/config/global/opencode').expect(200);
584
587
  expect(openCode.body).toMatchObject({ fileName: 'opencode.jsonc', content: '{ "model": "jsonc-model" }' });
585
588
 
@@ -911,12 +911,13 @@ export const registerAuthAndAccessRoutes = (app, dependencies) => {
911
911
  includeDirect: req.body?.includeDirect !== false,
912
912
  relayUrl: requestedRelayUrl,
913
913
  });
914
- const usesRelay = candidates.some((candidate) => candidate.type === 'relay');
914
+ const relayCandidate = candidates.find((candidate) => candidate.type === 'relay');
915
915
  const result = await clientPairingRuntime.createPairingSession({
916
916
  label: req.body?.label,
917
917
  allowedClientKinds: req.body?.allowedClientKinds,
918
918
  createdByClientId: clientIdFromAuthContext(authContext),
919
- usesRelay,
919
+ usesRelay: Boolean(relayCandidate),
920
+ relayUrl: relayCandidate?.relayUrl ?? null,
920
921
  });
921
922
  void reconcileRelay();
922
923
  res.setHeader('Cache-Control', 'no-store');
@@ -1195,6 +1196,8 @@ export const registerCommonRequestMiddleware = (app, dependencies) => {
1195
1196
  // Binary attachment uploads stream as the request body. Parsing JSON here
1196
1197
  // would buffer the entire payload and block the relay tunnel / corrupt bytes.
1197
1198
  next();
1199
+ } else if (req.path.startsWith('/api/config/providers/')) {
1200
+ express.json({ limit: '1mb' })(req, res, next);
1198
1201
  } else if (req.path.startsWith('/api/yuri/message-queue')) {
1199
1202
  express.json({ limit: req.method === 'POST' && req.path === '/api/yuri/message-queue/items' ? MESSAGE_QUEUE_ADMISSION_HTTP_MAX_BYTES : '1mb' })(req, res, next);
1200
1203
  } else if (
@@ -334,12 +334,12 @@ describe('core-routes', () => {
334
334
  it('should parse JSON bodies for global config routes', async () => {
335
335
  const app = express();
336
336
  registerCommonRequestMiddleware(app, { express });
337
- app.put('/api/config/global/oh-my-opencode-slim', (req, res) => {
337
+ app.put('/api/config/global/opencode', (req, res) => {
338
338
  res.json({ body: req.body });
339
339
  });
340
340
 
341
341
  const response = await request(app)
342
- .put('/api/config/global/oh-my-opencode-slim')
342
+ .put('/api/config/global/opencode')
343
343
  .send({ content: '{\n "preset": "openai"\n}' })
344
344
  .expect(200);
345
345
 
@@ -777,6 +777,7 @@ describe('core-routes', () => {
777
777
  allowedClientKinds: ['mobile'],
778
778
  createdByClientId: null,
779
779
  usesRelay: false,
780
+ relayUrl: null,
780
781
  });
781
782
  });
782
783
 
@@ -802,7 +803,7 @@ describe('core-routes', () => {
802
803
  hostEncPubJwk: { kty: 'EC', crv: 'P-256', x: 'aaa', y: 'bbb' },
803
804
  priority: 30,
804
805
  };
805
- const { app } = createPairingRouteApp({ getRelayPairingCandidate: vi.fn(async () => relayCandidate) });
806
+ const { app, dependencies } = createPairingRouteApp({ getRelayPairingCandidate: vi.fn(async () => relayCandidate) });
806
807
 
807
808
  const response = await request(app)
808
809
  .post('/api/client-auth/pairing/sessions')
@@ -814,6 +815,10 @@ describe('core-routes', () => {
814
815
  { type: 'lan', url: 'http://runtime.example', priority: 10 },
815
816
  relayCandidate,
816
817
  ]);
818
+ expect(dependencies.clientPairingRuntime.createPairingSession).toHaveBeenCalledWith(expect.objectContaining({
819
+ usesRelay: true,
820
+ relayUrl: relayCandidate.relayUrl,
821
+ }));
817
822
  });
818
823
 
819
824
  it('passes a custom Relay endpoint into relay-only pairing and returns that endpoint in the candidate', async () => {
@@ -824,7 +829,7 @@ describe('core-routes', () => {
824
829
  hostEncPubJwk: { kty: 'EC', crv: 'P-256', x: 'aaa', y: 'bbb' },
825
830
  priority: 30,
826
831
  }));
827
- const { app } = createPairingRouteApp({ getRelayPairingCandidate });
832
+ const { app, dependencies } = createPairingRouteApp({ getRelayPairingCandidate });
828
833
 
829
834
  const response = await request(app)
830
835
  .post('/api/client-auth/pairing/sessions')
@@ -843,6 +848,10 @@ describe('core-routes', () => {
843
848
  expect(response.body.server.candidates).toEqual([
844
849
  expect.objectContaining({ type: 'relay', relayUrl: 'wss://relay.example/custom' }),
845
850
  ]);
851
+ expect(dependencies.clientPairingRuntime.createPairingSession).toHaveBeenCalledWith(expect.objectContaining({
852
+ usesRelay: true,
853
+ relayUrl: 'wss://relay.example/custom',
854
+ }));
846
855
  });
847
856
 
848
857
  it('rejects an invalid custom Relay endpoint before creating a pairing session', async () => {
@@ -961,6 +970,7 @@ describe('core-routes', () => {
961
970
  allowedClientKinds: undefined,
962
971
  createdByClientId: 'remote-desktop-1',
963
972
  usesRelay: true,
973
+ relayUrl: 'wss://relay.example/ws',
964
974
  });
965
975
  expect(response.body.server.candidates).toEqual([
966
976
  { type: 'lan', url: 'http://runtime.example', priority: 10 },
@@ -0,0 +1,2 @@
1
+ export type DiscoveredProviderModel = { id: string; name: string; context?: number; output?: number };
2
+ export function discoverCustomProviderModels(input: unknown, options?: { signal?: AbortSignal; fetchImpl?: typeof fetch }): Promise<{ models: DiscoveredProviderModel[] }>;
@@ -0,0 +1,71 @@
1
+ import { customProviderProtocols } from '../../../shared/custom-provider-protocol.js';
2
+
3
+ const fail = () => Object.assign(new Error('Unable to discover provider models'), { status: 502 });
4
+ const positive = (value) => Number.isSafeInteger(value) && value > 0 ? value : undefined;
5
+
6
+ /** Draft discovery has no persistence and never returns upstream bodies or credentials. */
7
+ export async function discoverCustomProviderModels(input, { signal, fetchImpl = fetch } = {}) {
8
+ if (!input || !customProviderProtocols.some((protocol) => protocol.package === input.package)
9
+ || typeof input.baseURL !== 'string' || (input.apiKey !== undefined && typeof input.apiKey !== 'string')) throw fail();
10
+ let base;
11
+ try {
12
+ base = new URL(input.baseURL);
13
+ if (!['http:', 'https:'].includes(base.protocol) || base.username || base.password || base.search || base.hash || input.baseURL.includes('\\')) throw fail();
14
+ } catch { throw fail(); }
15
+ const google = input.package === '@opencode/ai/providers/google';
16
+ const anthropic = input.package === '@opencode/ai/providers/anthropic-compatible';
17
+ const headers = { Accept: 'application/json' };
18
+ const key = input.apiKey?.trim();
19
+ if (google && key) headers['x-goog-api-key'] = key;
20
+ else if (anthropic) {
21
+ headers['anthropic-version'] = '2023-06-01';
22
+ if (key) headers['x-api-key'] = key;
23
+ } else if (key) headers.Authorization = `Bearer ${key}`;
24
+ const deadline = AbortSignal.timeout(15000);
25
+ const abort = signal ? AbortSignal.any([signal, deadline]) : deadline;
26
+ const models = new Map();
27
+ const cursors = new Set();
28
+ let cursor;
29
+ try {
30
+ for (let page = 0; page < 20; page++) {
31
+ const url = new URL(`${input.baseURL.replace(/\/+$/, '')}/models`);
32
+ if (google) { url.searchParams.set('pageSize', '1000'); if (cursor) url.searchParams.set('pageToken', cursor); }
33
+ if (anthropic) { url.searchParams.set('limit', '1000'); if (cursor) url.searchParams.set('after_id', cursor); }
34
+ const response = await fetchImpl(url, { headers, signal: abort, redirect: 'error', cache: 'no-store' });
35
+ if (!response.ok) { await response.body?.cancel(); throw fail(); }
36
+ const reader = response.body?.getReader();
37
+ if (!reader) throw fail();
38
+ const chunks = [];
39
+ let bytes = 0;
40
+ try {
41
+ while (true) {
42
+ const chunk = await reader.read();
43
+ if (chunk.done) break;
44
+ bytes += chunk.value.byteLength;
45
+ if (bytes > 2 * 1024 * 1024) throw fail();
46
+ chunks.push(chunk.value);
47
+ }
48
+ } finally { await reader.cancel(); }
49
+ const payload = JSON.parse(Buffer.concat(chunks).toString('utf8'));
50
+ const entries = google ? payload.models : payload.data;
51
+ if (!Array.isArray(entries)) throw fail();
52
+ for (const item of entries) {
53
+ if (!item || typeof item !== 'object') continue;
54
+ if (google && Array.isArray(item.supportedGenerationMethods) && !item.supportedGenerationMethods.includes('generateContent')) continue;
55
+ const id = google && typeof item.name === 'string' ? item.name.replace(/^models\//, '') : item.id;
56
+ if (typeof id !== 'string' || !id.trim() || /[\s#]/.test(id)) continue;
57
+ const name = item.displayName || item.display_name || item.name;
58
+ models.set(id, { id, name: typeof name === 'string' ? name : id,
59
+ ...(positive(item.inputTokenLimit) ? { context: item.inputTokenLimit } : {}),
60
+ ...(positive(item.outputTokenLimit) ? { output: item.outputTokenLimit } : {}) });
61
+ if (models.size > 5000) throw fail();
62
+ }
63
+ cursor = google ? payload.nextPageToken : anthropic && payload.has_more ? payload.last_id : undefined;
64
+ if (anthropic && payload.has_more && !cursor) throw fail();
65
+ if (!cursor) return { models: [...models.values()] };
66
+ if (typeof cursor !== 'string' || cursors.has(cursor)) throw fail();
67
+ cursors.add(cursor);
68
+ }
69
+ throw fail();
70
+ } catch { throw fail(); }
71
+ }
@@ -0,0 +1,90 @@
1
+ import { describe, expect, it, vi } from 'vitest';
2
+ import { resolveCustomProviderURL } from '../../../shared/custom-provider-protocol.js';
3
+ import { discoverCustomProviderModels } from './custom-provider-models.js';
4
+
5
+ const chat = '@opencode/ai/providers/openai-compatible';
6
+ const responses = `${chat}/responses`;
7
+ const anthropic = '@opencode/ai/providers/anthropic-compatible';
8
+ const google = '@opencode/ai/providers/google';
9
+ const listing = (pkg = chat) => ({ package: pkg, baseURL: 'https://api.example.com/v1', apiKey: 'fixture-key' });
10
+ const json = (value) => new Response(JSON.stringify(value), { headers: { 'Content-Type': 'application/json' } });
11
+
12
+ describe('Cherry-compatible URL completion with native OpenCode endpoints', () => {
13
+ it.each([
14
+ ['https://api.example.com', chat, 'https://api.example.com/v1/chat/completions'],
15
+ ['https://api.example.com/', chat, 'https://api.example.com/v1/chat/completions'],
16
+ ['https://api.example.com/v2/', responses, 'https://api.example.com/v2/responses'],
17
+ ['https://api.example.com/gateway#', chat, 'https://api.example.com/gateway/chat/completions'],
18
+ ['https://api.example.com/custom/messages#', anthropic, 'https://api.example.com/custom/messages'],
19
+ ['https://api.example.com/custom/responses#', responses, 'https://api.example.com/custom/responses'],
20
+ ['https://api.example.com', anthropic, 'https://api.example.com/v1/messages'],
21
+ ['https://api.example.com', google, 'https://api.example.com/v1beta/models/coder:streamGenerateContent?alt=sse'],
22
+ ['https://api.example.com/v1beta/', google, 'https://api.example.com/v1beta/models/coder:streamGenerateContent?alt=sse'],
23
+ ['https://api.example.com/v1/proxy', chat, 'https://api.example.com/v1/proxy/chat/completions'],
24
+ ])('%s → %s uses exactly the displayed request path', (value, pkg, expected) => {
25
+ const result = resolveCustomProviderURL(value, pkg, 'coder');
26
+ expect(result?.requestURL).toBe(expected);
27
+ expect(result?.modelsURL).toBe(`${result?.baseURL}/models`);
28
+ expect(result?.baseURL).not.toContain('#');
29
+ });
30
+ it.each(['', 'wrong', 'file:///local', 'https://user:pass@example.com', 'https://api.example.com?key=hidden', 'https://api.example.com#fragment', 'https:\\example.com'])('rejects invalid/credential-bearing address %s', (value) => {
31
+ expect(resolveCustomProviderURL(value, chat)).toBeNull();
32
+ });
33
+ });
34
+
35
+ describe('draft model discovery', () => {
36
+ it.each([chat, responses])('uses Bearer for %s and returns safe unique model IDs', async (pkg) => {
37
+ const fetchImpl = vi.fn().mockResolvedValue(json({ data: [{ id: 'coder', secret: 'never-return' }, { id: 'coder' }, { id: 'vendor/code', name: 'Code' }] }));
38
+ expect(await discoverCustomProviderModels(listing(pkg), { fetchImpl })).toEqual({ models: [{ id: 'coder', name: 'coder' }, { id: 'vendor/code', name: 'Code' }] });
39
+ const [url, options] = fetchImpl.mock.calls[0];
40
+ expect(url.toString()).toBe('https://api.example.com/v1/models');
41
+ expect(options.headers.Authorization).toBe('Bearer fixture-key'); expect(options.redirect).toBe('error');
42
+ expect(url.toString()).not.toContain('fixture-key');
43
+ });
44
+ it('paginates Anthropic with native authentication and does not accept an incomplete inventory', async () => {
45
+ const fetchImpl = vi.fn()
46
+ .mockResolvedValueOnce(json({ data: [{ id: 'claude', display_name: 'Claude' }], has_more: true, last_id: 'claude' }))
47
+ .mockResolvedValueOnce(json({ data: [{ id: 'claude-next' }], has_more: false }));
48
+ const result = await discoverCustomProviderModels(listing(anthropic), { fetchImpl });
49
+ expect(result.models.map((model) => model.id)).toEqual(['claude', 'claude-next']);
50
+ expect(fetchImpl.mock.calls[0][1].headers).toMatchObject({ 'x-api-key': 'fixture-key', 'anthropic-version': '2023-06-01' });
51
+ expect(fetchImpl.mock.calls[1][0].searchParams.get('after_id')).toBe('claude');
52
+ });
53
+ it('paginates Gemini, strips models/ and keeps only content-generating models with supplied limits', async () => {
54
+ const fetchImpl = vi.fn()
55
+ .mockResolvedValueOnce(json({ models: [{ name: 'models/gemini', displayName: 'Gemini', supportedGenerationMethods: ['generateContent'], inputTokenLimit: 32768, outputTokenLimit: 8192 }, { name: 'models/embedding', supportedGenerationMethods: ['embedContent'] }], nextPageToken: 'second' }))
56
+ .mockResolvedValueOnce(json({ models: [{ name: 'models/gemini-next', supportedGenerationMethods: ['generateContent'] }] }));
57
+ const request = { ...listing(google), baseURL: 'https://api.example.com/v1beta' };
58
+ expect(await discoverCustomProviderModels(request, { fetchImpl })).toEqual({ models: [
59
+ { id: 'gemini', name: 'Gemini', context: 32768, output: 8192 }, { id: 'gemini-next', name: 'models/gemini-next' },
60
+ ] });
61
+ expect(fetchImpl.mock.calls[0][1].headers['x-goog-api-key']).toBe('fixture-key');
62
+ expect(fetchImpl.mock.calls[1][0].searchParams.get('pageToken')).toBe('second');
63
+ });
64
+ it('allows keyless local services without an authorization header', async () => {
65
+ const fetchImpl = vi.fn().mockResolvedValue(json({ data: [] }));
66
+ expect(await discoverCustomProviderModels({ package: chat, baseURL: 'http://127.0.0.1:1234/v1' }, { fetchImpl })).toEqual({ models: [] });
67
+ expect(fetchImpl.mock.calls[0][1].headers.Authorization).toBeUndefined();
68
+ });
69
+ it.each([new Response('fixture-key private body', { status: 401 }), json({ error: 'fixture-key' })])('rejects failed or malformed responses without exposing upstream text', async (response) => {
70
+ const fetchImpl = vi.fn().mockResolvedValue(response);
71
+ await expect(discoverCustomProviderModels(listing(), { fetchImpl })).rejects.toThrow('Unable to discover provider models');
72
+ });
73
+ it('rejects a failed second page instead of returning partial success', async () => {
74
+ const fetchImpl = vi.fn().mockResolvedValueOnce(json({ data: [{ id: 'first' }], has_more: true, last_id: 'first' }))
75
+ .mockResolvedValueOnce(new Response('failed', { status: 500 }));
76
+ await expect(discoverCustomProviderModels(listing(anthropic), { fetchImpl })).rejects.toThrow();
77
+ });
78
+ it('rejects repeated pagination cursors', async () => {
79
+ const fetchImpl = vi.fn().mockImplementation(async () => json({ models: [{ name: 'models/coder' }], nextPageToken: 'repeated' }));
80
+ await expect(discoverCustomProviderModels(listing(google), { fetchImpl })).rejects.toThrow();
81
+ expect(fetchImpl).toHaveBeenCalledTimes(2);
82
+ });
83
+ it('propagates cancellation to the actual model endpoint', async () => {
84
+ const controller = new AbortController();
85
+ const fetchImpl = vi.fn(async (_url, { signal }) => {
86
+ controller.abort(); expect(signal.aborted).toBe(true); throw new Error('aborted');
87
+ });
88
+ await expect(discoverCustomProviderModels(listing(), { signal: controller.signal, fetchImpl })).rejects.toThrow();
89
+ });
90
+ });
@@ -0,0 +1,2 @@
1
+ import type { OpenCodeClient } from '@opencode/client';
2
+ export function createCustomProvider(input: unknown, directory?: string, client?: Pick<OpenCodeClient, 'credential' | 'provider' | 'integration'>): Promise<{ providerId: string }>;