@yuriai/web 0.2.31 → 0.2.32-beta.10

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 (201) hide show
  1. package/README.md +19 -0
  2. package/dist/assets/{AgentAvatar-DLAQkFQe.js → AgentAvatar-DLzcNrQ0.js} +1 -1
  3. package/dist/assets/AssistantContactStatus-Bf1yg0yx.js +3 -0
  4. package/dist/assets/{AssistantUnreadBadge-BynxNQMk.js → AssistantUnreadBadge-BUFyxUrT.js} +1 -1
  5. package/dist/assets/{AssistantView-CDZyA9ft.js → AssistantView-CELFybSr.js} +1 -1
  6. package/dist/assets/{DiagramView-DdVFGHQQ.js → DiagramView-DV4P3-Wg.js} +1 -1
  7. package/dist/assets/{FadeInOnReveal-C9a7XnAh.js → FadeInOnReveal-BRrU2ivL.js} +1 -1
  8. package/dist/assets/{GuiPluginSurface-v8r-Hex5.js → GuiPluginSurface-NOHaJGy2.js} +1 -1
  9. package/dist/assets/{GuiPluginWindow-Ba1HfrjQ.js → GuiPluginWindow-BykPaQeY.js} +1 -1
  10. package/dist/assets/Icon-OJf0qBKf.js +1 -0
  11. package/dist/assets/{ImageLoadingPlaceholder-Dcy5lc7F.js → ImageLoadingPlaceholder-DlQbo9CM.js} +1 -1
  12. package/dist/assets/{LoadingImage-BxjJ_Xyj.js → LoadingImage-sZ5omN5L.js} +1 -1
  13. package/dist/assets/MarkdownRenderer-BFR9FWQL.js +2 -0
  14. package/dist/assets/MarkdownRendererImpl-iZFUMI3M.js +10 -0
  15. package/dist/assets/{MarkstreamRendererImpl-EpBnVy9J.css → MarkstreamRendererImpl-C6aiJnjl.css} +1 -1
  16. package/dist/assets/MarkstreamRendererImpl-DjC_Y4LS.js +3 -0
  17. package/dist/assets/{MobileDetailNavigation-o54juFXD.js → MobileDetailNavigation-BOZpHdI2.js} +1 -1
  18. package/dist/assets/{MobileResizableSheet-sV9XR-0k.js → MobileResizableSheet-DuAi_epR.js} +1 -1
  19. package/dist/assets/{MobileShareBridge-oqBZ_f6M.js → MobileShareBridge-D1DrqLWf.js} +1 -1
  20. package/dist/assets/MobileTabPageHeader-BT9gWugr.js +2 -0
  21. package/dist/assets/{MultiRunWindow-7W_86vL6.js → MultiRunWindow-C0GYNaUU.js} +1 -1
  22. package/dist/assets/{OnboardingScreen-CnkijSLE.js → OnboardingScreen-CqsI0632.js} +1 -1
  23. package/dist/assets/{OverlayScrollbar-CCtBTJQj.js → OverlayScrollbar-CZD1yU06.js} +1 -1
  24. package/dist/assets/SettingsView-BYO8LY5A.js +29 -0
  25. package/dist/assets/{SettingsWindow-C0HiNvXh.js → SettingsWindow-CM0Ph9WD.js} +1 -1
  26. package/dist/assets/SetupTourDialog-BYlSBPKZ.js +1 -0
  27. package/dist/assets/SetupTourDialog-DrL_4ODI.css +1 -0
  28. package/dist/assets/{TerminalView-y36H_fIe.js → TerminalView-DnyEAShU.js} +1 -1
  29. package/dist/assets/{ToolOutputDialog-BfjBeqGS.js → ToolOutputDialog-BWONfWze.js} +1 -1
  30. package/dist/assets/{VoiceSettings-BONwzGgR.js → VoiceSettings-Ru_0ySgM.js} +2 -2
  31. package/dist/assets/{YuriLogo-BA5FWp-g.js → YuriLogo-CMUoGUHc.js} +1 -1
  32. package/dist/assets/YuriWordmark-DHYo0FlR.js +1 -0
  33. package/dist/assets/{appThemeRegistry-BsLMp3bc.js → appThemeRegistry-BMlAlm0m.js} +1 -1
  34. package/dist/assets/{button-CBjOhOI0.js → button-C-gRcs_2.js} +1 -1
  35. package/dist/assets/{capgoAdapter-DjlyVxy_.js → capgoAdapter-GdNfjwXs.js} +1 -1
  36. package/dist/assets/checkbox-BrJBzET8.js +1 -0
  37. package/dist/assets/{collapsible-B0j5IQ0T.js → collapsible-B7esGYLd.js} +1 -1
  38. package/dist/assets/{context-menu-C4e_bpls.js → context-menu-DWn1nSZC.js} +1 -1
  39. package/dist/assets/desktopHosts-BLU1tGSX.js +1 -0
  40. package/dist/assets/{desktopRelayRestore-AE3_TnQz.js → desktopRelayRestore-2BIIs8mZ.js} +1 -1
  41. package/dist/assets/{diagram-WPmk0Qh6.js → diagram-Bnra5_6g.js} +1 -1
  42. package/dist/assets/{dialog-Dx3IT7dQ.js → dialog-3UseH0hM.js} +1 -1
  43. package/dist/assets/{es-JU--16Gd.js → es-J7a_sZ1u.js} +2 -2
  44. package/dist/assets/{fileMentionTouchSelection-Bizsisaj.js → fileMentionTouchSelection-ByaQJcTS.js} +1 -1
  45. package/dist/assets/{fr-BUZcRuMk.js → fr-BYxUMKWp.js} +2 -2
  46. package/dist/assets/{gitApi-CNgEj6X5.js → gitApi-BdwvoQFb.js} +1 -1
  47. package/dist/assets/historyImportQueries-C8VK9R5_.js +1 -0
  48. package/dist/assets/host-z9PU8q1e.js +1 -0
  49. package/dist/assets/{input-CEJGM-TS.js → input-CmLlZdeD.js} +1 -1
  50. package/dist/assets/insertionBoundaries-BpQ6nLjP.js +1 -0
  51. package/dist/assets/{ja-BwtVLTXD.js → ja-DCdBiJmD.js} +2 -2
  52. package/dist/assets/{ko--sLsRFpA.js → ko-D-Nb_RJY.js} +2 -2
  53. package/dist/assets/main-Dosy2jXg.js +2 -0
  54. package/dist/assets/main-oBh-dk5-.js +169 -0
  55. package/dist/assets/{markdownHeightCache-D6iSNJG2.js → markdownHeightCache-xNkQdlqi.js} +1 -1
  56. package/dist/assets/{mcpQueries-DVSsZeuk.js → mcpQueries-C8zsTQqJ.js} +1 -1
  57. package/dist/assets/miniChat-CI8ryDGT.js +2 -0
  58. package/dist/assets/mobile-e_mTK3dh.js +2 -0
  59. package/dist/assets/{mobileBackNavigation-Dmbf0kw1.js → mobileBackNavigation-sB7c0Pi4.js} +1 -1
  60. package/dist/assets/multirun-DbmgWrsY.js +3 -0
  61. package/dist/assets/{native-config-BaRHaY4y.js → native-config-C_mwkFzh.js} +1 -1
  62. package/dist/assets/{pl-C4_4J5yA.js → pl-AmU4w3aM.js} +2 -2
  63. package/dist/assets/{projectMeta-rrpZdm8D.js → projectMeta-1iUbVl_M.js} +1 -1
  64. package/dist/assets/{pt-BR-DvNC5K1q.js → pt-BR-BI4ft-Fj.js} +2 -2
  65. package/dist/assets/pwa-BdUAGhLt.js +2 -0
  66. package/dist/assets/{queue-abort-optimistic-CSkERbr4.js → queue-abort-optimistic-BwDsaym5.js} +1 -1
  67. package/dist/assets/react-a6PrrNTm.js +1 -0
  68. package/dist/assets/{readiness-BnO7IaZV.js → readiness-D2N0DtZF.js} +1 -1
  69. package/dist/assets/{renderElectronMiniChatApp-Bq3iNKtr.js → renderElectronMiniChatApp-DV0cNt_O.js} +2 -2
  70. package/dist/assets/{renderMobileApp-DiNeMgwp.js → renderMobileApp-b7--jT5z.js} +7 -7
  71. package/dist/assets/{runtimeConfig-BHOiBANF.js → runtimeConfig-DxmJLWUO.js} +1 -1
  72. package/dist/assets/runtimeEndpointReset-jYAYa3Rh.js +149 -0
  73. package/dist/assets/{select-bKMw5JE8.js → select-J8r9SxHt.js} +1 -1
  74. package/dist/assets/sessionLookup-CUQqj2N4.js +1 -0
  75. package/dist/assets/{sortable-tabs-strip-3sKiA7T1.js → sortable-tabs-strip-CiP6RIQa.js} +1 -1
  76. package/dist/assets/{speechSettingsQueries-BDDxw8LP.js → speechSettingsQueries-B3ziGQvb.js} +1 -1
  77. package/dist/assets/src-GtPQ8f4o.css +2 -0
  78. package/dist/assets/{store-X3lU0obe.js → store-OjrIiXCx.js} +5 -5
  79. package/dist/assets/{textarea-EsaDD051.js → textarea-BHgcxJdC.js} +1 -1
  80. package/dist/assets/{tooltip-LLDL5nIZ.js → tooltip-Degmpxnd.js} +1 -1
  81. package/dist/assets/tour-DDI0Zg7l.js +1 -0
  82. package/dist/assets/types-QETHY-S7.js +2 -0
  83. package/dist/assets/{uk-Dvj0JjiC.js → uk-CbdByxxj.js} +2 -2
  84. package/dist/assets/{useAppFontEffects-wIWWE59b.js → useAppFontEffects-LADr3Zl1.js} +53 -53
  85. package/dist/assets/useDesktopWindowControlsLayout-BVNnRHtc.js +1 -0
  86. package/dist/assets/{useDictation-DlEHSN6P.js → useDictation-DFVJpRbm.js} +1 -1
  87. package/dist/assets/{useEffectiveDirectory-DzqpWUC3.js → useEffectiveDirectory-8tqfGdV5.js} +1 -1
  88. package/dist/assets/{useMobileNavigationStore-BWLhXqci.js → useMobileNavigationStore-CLUFv-TZ.js} +13 -13
  89. package/dist/assets/usePluginsStore-B_SIDwsK.js +1 -0
  90. package/dist/assets/useStreamingTextThrottle-VhgGU_te.js +1 -0
  91. package/dist/assets/{useWorkerHighlightedLines-DMS69wKa.js → useWorkerHighlightedLines-jlxakDGs.js} +1 -1
  92. package/dist/assets/{vendor-markstream-react-DfLaSG3W.js → vendor-markstream-react-6zxyQLCD.js} +1 -1
  93. package/dist/assets/{zh-CN-2Y6u8t24.js → zh-CN-ufEVDbXp.js} +2 -2
  94. package/dist/assets/{zh-TW-Z5wVv4Fb.js → zh-TW-DTBlZ4YC.js} +2 -2
  95. package/dist/index.html +8 -8
  96. package/dist/mini-chat.html +8 -8
  97. package/dist/mobile.html +8 -8
  98. package/package.json +1 -1
  99. package/server/index.js +3 -0
  100. package/server/lib/client-auth/pairing.js +2 -0
  101. package/server/lib/client-auth/pairing.test.js +29 -0
  102. package/server/lib/config-sync/DOCUMENTATION.md +8 -4
  103. package/server/lib/config-sync/index.js +1 -1
  104. package/server/lib/config-sync/magpie-auth.js +10 -4
  105. package/server/lib/config-sync/magpie-auth.test.js +4 -0
  106. package/server/lib/config-sync/magpie.js +28 -22
  107. package/server/lib/config-sync/magpie.test.js +127 -2
  108. package/server/lib/config-sync/plugins.js +44 -0
  109. package/server/lib/config-sync/plugins.test.js +64 -0
  110. package/server/lib/config-sync/tar.js +61 -1
  111. package/server/lib/content-search/DOCUMENTATION.md +9 -0
  112. package/server/lib/content-search/routes.js +18 -1
  113. package/server/lib/content-search/routes.test.js +21 -0
  114. package/server/lib/content-search/runtime.js +7 -3
  115. package/server/lib/content-search/runtime.test.js +26 -0
  116. package/server/lib/gui-customization/DOCUMENTATION.md +21 -1
  117. package/server/lib/gui-customization/session-skill.js +2 -2
  118. package/server/lib/gui-customization/session-skill.test.js +3 -1
  119. package/server/lib/gui-customization/skill/SKILL.md +5 -1
  120. package/server/lib/gui-customization/skill/references/global-pages.md +1 -1
  121. package/server/lib/gui-customization/skill/references/gui-api.md +4 -1
  122. package/server/lib/gui-customization/skill/references/icons.md +134 -0
  123. package/server/lib/gui-customization/skill/references/plugin-styles.md +112 -0
  124. package/server/lib/gui-customization/skill/references/ui-surfaces.md +2 -0
  125. package/server/lib/gui-customization/skill/references/work-status.md +110 -0
  126. package/server/lib/history-import/AGENT_CONNECT_LICENSE +21 -0
  127. package/server/lib/history-import/DOCUMENTATION.md +223 -0
  128. package/server/lib/history-import/dev-proxy.integration.test.js +56 -0
  129. package/server/lib/history-import/events.js +322 -0
  130. package/server/lib/history-import/events.test.js +110 -0
  131. package/server/lib/history-import/installations.js +39 -0
  132. package/server/lib/history-import/installations.test.js +24 -0
  133. package/server/lib/history-import/native.js +49 -0
  134. package/server/lib/history-import/native.test.js +42 -0
  135. package/server/lib/history-import/routes.js +48 -0
  136. package/server/lib/history-import/routes.test.js +55 -0
  137. package/server/lib/history-import/service.js +374 -0
  138. package/server/lib/history-import/service.test.js +538 -0
  139. package/server/lib/history-import/settings.js +146 -0
  140. package/server/lib/history-import/settings.test.js +88 -0
  141. package/server/lib/history-import/sources.js +184 -0
  142. package/server/lib/history-import/sources.test.js +190 -0
  143. package/server/lib/history-import/sqlite.js +187 -0
  144. package/server/lib/history-import/store.js +58 -0
  145. package/server/lib/history-import/store.test.js +84 -0
  146. package/server/lib/history-import/targets.js +24 -0
  147. package/server/lib/host-update/DOCUMENTATION.md +6 -0
  148. package/server/lib/host-update/routes.test.js +1 -1
  149. package/server/lib/notifications/native-stream.relay.test.js +1 -0
  150. package/server/lib/opencode/DOCUMENTATION.md +14 -0
  151. package/server/lib/opencode/core-routes.js +1 -0
  152. package/server/lib/opencode/feature-routes-runtime.js +11 -1
  153. package/server/lib/opencode/plugin-routes.test.js +1 -0
  154. package/server/lib/opencode/plugins.js +1 -1
  155. package/server/lib/opencode/plugins.test.js +3 -2
  156. package/server/lib/opencode/proxy.js +29 -4
  157. package/server/lib/opencode/proxy.test.js +85 -1
  158. package/server/lib/opencode/server-utils-runtime.js +2 -0
  159. package/server/lib/opencode/settings-runtime.js +8 -6
  160. package/server/lib/opencode/settings-runtime.test.js +44 -0
  161. package/server/lib/opencode/yuri-routes.js +1 -1
  162. package/server/lib/relay/DOCUMENTATION.md +1 -1
  163. package/server/lib/relay/host-client.js +3 -1
  164. package/server/lib/relay/host-client.test.js +1 -0
  165. package/server/lib/relay/reasoning-projection.e2e.test.ts +1 -0
  166. package/server/lib/relay/relay-server.e2e.test.ts +32 -17
  167. package/server/lib/relay/service.js +2 -0
  168. package/server/lib/relay/tunnel-host.js +26 -1
  169. package/server/lib/relay/tunnel-host.test.js +27 -3
  170. package/server/lib/remote-desktop/runtime.test.js +2 -2
  171. package/server/lib/ui-auth/DOCUMENTATION.md +3 -0
  172. package/server/lib/ui-auth/ui-auth.js +27 -0
  173. package/server/lib/ui-auth/ui-auth.test.js +42 -1
  174. package/server/plugin-gui-proxy.test.js +1 -1
  175. package/dist/assets/AssistantContactStatus-DZGGspw4.js +0 -3
  176. package/dist/assets/Icon-Bh3TaKoN.js +0 -1
  177. package/dist/assets/MarkdownRenderer-CS6Pia5D.js +0 -2
  178. package/dist/assets/MarkdownRendererImpl-Bdwe3qUr.js +0 -10
  179. package/dist/assets/MarkstreamRendererImpl-CCQj9IkL.js +0 -3
  180. package/dist/assets/MobileTabPageHeader-CptcDWNS.js +0 -2
  181. package/dist/assets/SettingsView-CkJpYIMe.js +0 -29
  182. package/dist/assets/SetupTourDialog-BcEbaEO3.js +0 -1
  183. package/dist/assets/SetupTourDialog-CUzqT2sw.css +0 -1
  184. package/dist/assets/YuriWordmark-Cr1vkcue.js +0 -1
  185. package/dist/assets/desktopHosts-CMglnUdS.js +0 -1
  186. package/dist/assets/host-CBfSyi4l.js +0 -1
  187. package/dist/assets/insertionBoundaries-CgYf6gys.js +0 -1
  188. package/dist/assets/main-B8FcBwPM.js +0 -169
  189. package/dist/assets/main-DrqtyqDc.js +0 -2
  190. package/dist/assets/miniChat-CgeCl4RY.js +0 -2
  191. package/dist/assets/mobile-DAhJKHUq.js +0 -2
  192. package/dist/assets/multirun-BbWnHeaY.js +0 -3
  193. package/dist/assets/pwa-Dm_DJEr9.js +0 -2
  194. package/dist/assets/react-Bwr5-XPi.js +0 -1
  195. package/dist/assets/runtimeEndpointReset-DGxT24oE.js +0 -149
  196. package/dist/assets/sessionLookup-DGNxfDsP.js +0 -1
  197. package/dist/assets/src-PTWgTO6W.css +0 -2
  198. package/dist/assets/tour-Db44qwfs.js +0 -1
  199. package/dist/assets/types-Cl7nTpsb.js +0 -2
  200. package/dist/assets/useDesktopWindowControlsLayout-CdUr9mCZ.js +0 -1
  201. package/dist/assets/usePluginsStore-aZl0WTK8.js +0 -1
@@ -0,0 +1,112 @@
1
+ # Styling plugin-owned content
2
+
3
+ Use this reference when rendering a plugin page, panel, preview or settings view. Yuri provides theme CSS variables in the host document; the plugin owns its markup, CSS, layout and interactions. The React shell supplies the mount container and the existing GUI host mounts Solid/DOM content inside it. There is no Yuri GUI component library or implemented `ctx.ui` to import.
4
+
5
+ ## Using the host styles
6
+
7
+ 1. Put a plugin-specific class or data attribute on the content root and scope the plugin's CSS beneath it. Register that CSS with official `Style` so disabling the plugin removes it.
8
+ 2. Use the variables below for colors and typography; let same-document CSS inheritance follow theme changes. Keep inline content transparent when its host already owns the background.
9
+ 3. Choose icons from [icons](icons.md). Entry contribution names and SVG symbols inside content have different naming rules.
10
+ 4. Verify the mounted view in light/dark mode, narrow width, keyboard focus and disabled/selected states. These references guide appearance; they do not constrain the plugin's business UI or supply its interaction behavior.
11
+
12
+ CSS colors are complete values: `color: var(--foreground)`, not `hsl(var(--foreground))`. Variables resolve at the consuming element, including local surface overrides. Prefer CSS over reading root styles into JavaScript snapshots; a snapshot does not follow theme changes by itself. Plugin bundles are not scanned by Yuri's Tailwind build, so arbitrary utility classes in a plugin are not guaranteed to exist. Write the needed CSS explicitly.
13
+
14
+ ## Global color variables
15
+
16
+ The theme generator publishes these in the host document. Use the name whose meaning matches the element rather than selecting a color by how it looks in one theme.
17
+
18
+ | Purpose | Variables |
19
+ | --- | --- |
20
+ | Canvas and ordinary text | `--background`, `--foreground` |
21
+ | Muted surface and secondary text | `--muted`, `--muted-foreground` |
22
+ | Raised content | `--card`, `--card-foreground` |
23
+ | Popover content | `--popover`, `--popover-foreground` |
24
+ | Secondary surface | `--secondary`, `--secondary-foreground` |
25
+ | Subtle surface | `--accent`, `--accent-foreground` |
26
+ | Borders and focus ring | `--border`, `--input`, `--ring`; `--input` is a border color, not an input fill |
27
+ | Theme accent | `--primary`, `--primary-foreground`; use for links/emphasis, not the default button fill |
28
+ | Destructive feedback | `--destructive`, `--destructive-foreground` |
29
+ | Semantic surfaces | `--surface-background`, `--surface-foreground`, `--surface-muted`, `--surface-muted-foreground`, `--surface-elevated`, `--surface-elevated-foreground`, `--surface-subtle`, `--surface-overlay` |
30
+ | Hover and pressed | `--interactive-hover`, `--interactive-active`; apply to interactive elements |
31
+ | Selected item | `--interactive-selection`, `--interactive-selection-foreground` |
32
+ | Interactive borders | `--interactive-border`, `--interactive-border-hover`, `--interactive-border-focus` |
33
+ | Focus and cursor | `--interactive-focus`, `--interactive-focus-ring`, `--interactive-cursor` |
34
+ | Accent variants | `--primary-base`, `--primary-hover`, `--primary-active`, `--primary-muted`, `--primary-emphasis` |
35
+ | Status | `--status-error`, `--status-warning`, `--status-success`, `--status-info`; each also has `-foreground`, `-background` and `-border` variants |
36
+ | Sidebar | `--sidebar`, `--sidebar-foreground`, `--sidebar-primary`, `--sidebar-primary-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, `--sidebar-ring` |
37
+ | Loading indicator | `--loading-spinner`, `--loading-spinner-track` |
38
+ | Charts | `--chart-1` through `--chart-5` have base styles; further numbered colors depend on the theme's series |
39
+ | Pull-request state | `--pr-open`, `--pr-draft`, `--pr-blocked`, `--pr-merged`, `--pr-closed` |
40
+ | Code | `--syntax-background`, `--syntax-foreground`, `--syntax-comment`, `--syntax-keyword`, `--syntax-string`, `--syntax-number`, `--syntax-function`, `--syntax-variable`, `--syntax-type`, `--syntax-operator` |
41
+
42
+ Semantic variables and short aliases are emitted separately. Reading either is supported; overriding one does not automatically rewrite the other. For changing Yuri itself, use the [cascade and surface map](ui-surfaces.md#token-map-and-cascade), rather than overriding global tokens as part of an ordinary plugin view.
43
+
44
+ ## Text, geometry and controls
45
+
46
+ | Purpose | Variables / behavior |
47
+ | --- | --- |
48
+ | Font families | `--font-sans`, `--font-mono`; use `font: inherit` for controls that should follow their surrounding text |
49
+ | Font weight | `--ui-regular-font-weight` |
50
+ | Semantic text sizes | `--text-ui-header`, `--text-ui-label`, `--text-meta`, `--text-micro`, `--text-markdown`, `--text-code`; names describe roles, not a guaranteed size ordering |
51
+ | Button typography | `--ui-button-line-height`, `--ui-button-letter-spacing`, `--ui-button-font-weight` |
52
+ | Caption typography | `--ui-caption-line-height`, `--ui-caption-letter-spacing`, `--ui-caption-font-weight` |
53
+ | Base radius | `--radius` |
54
+ | Radius scale | Design-system names `--radius-none`, `--radius-sm`, `--radius-md`, `--radius-lg`, `--radius-xl`, `--radius-full` are declared in Tailwind's theme; use a fallback such as `var(--radius-lg, var(--radius))` if a build does not retain a variable |
55
+ | Spacing density | `--padding-scale` is unitless; e.g. `gap: calc(0.5rem * var(--padding-scale, 1))` |
56
+ | Physical scale | `--dpt` is a length, `--dpt-n` a unitless factor; desktop defaults are `1px` / `1`. `--padding-scale` already includes the physical factor |
57
+ | Form dimensions | `--form-control-height`, `--form-control-radius` |
58
+ | Form colors | `--form-control-background`, `--form-control-border` |
59
+ | Form typography | `--form-control-font-size`, `--form-control-line-height`, `--form-helper-font-size`, `--form-helper-line-height` |
60
+ | Form dividers | `--form-surface-border`, `--form-row-divider` |
61
+ | Optional theme config | `--font-heading`, `--transition-fast`, `--transition-normal`, `--transition-slow` exist when supplied by the theme; provide a fallback |
62
+
63
+ Form tokens can be overridden by Settings ancestors. Settings-only `--yuri-settings-*` variables and popup-specific materials are described in [UI surfaces](ui-surfaces.md); they are not universally available to a plugin mounted elsewhere. Host mobile CSS also applies its minimum touch sizes to ordinary buttons in plugin content.
64
+
65
+ ## Small CSS example
66
+
67
+ This is plugin-owned CSS, not a component or a registration of a new extension point. Register it with `ctx.add(Style, css)` and put `class="studio-view"` on the plugin root. Its child markup can be authored with Solid or DOM APIs.
68
+
69
+ ```css
70
+ .studio-view {
71
+ min-width: 0;
72
+ color: var(--foreground);
73
+ font-family: var(--font-sans, system-ui, sans-serif);
74
+ font-size: var(--text-ui-label);
75
+ font-weight: var(--ui-regular-font-weight, 400);
76
+ }
77
+ .studio-view .studio-row {
78
+ display: flex;
79
+ align-items: center;
80
+ min-width: 0;
81
+ gap: calc(0.5rem * var(--padding-scale, 1));
82
+ }
83
+ .studio-view .studio-detail { color: var(--muted-foreground); }
84
+ .studio-view .studio-success { color: var(--status-success); }
85
+ .studio-view .studio-action {
86
+ font: inherit;
87
+ color: var(--foreground);
88
+ background: var(--surface-muted);
89
+ border: 0;
90
+ border-radius: var(--radius-lg, var(--radius));
91
+ padding: 0.375rem 0.625rem;
92
+ }
93
+ .studio-view .studio-action:hover:not(:disabled) {
94
+ background: color-mix(in srgb, var(--foreground) 6%, var(--surface-muted));
95
+ }
96
+ .studio-view .studio-action:active:not(:disabled) {
97
+ background: color-mix(in srgb, var(--foreground) 12%, var(--surface-muted));
98
+ }
99
+ .studio-view .studio-action:focus-visible {
100
+ outline: 2px solid var(--interactive-focus-ring) !important;
101
+ outline-offset: 2px;
102
+ }
103
+ .studio-view .studio-action:disabled { opacity: 0.5; }
104
+ ```
105
+
106
+ The example uses Yuri's neutral solid action colors. Quiet row actions can use transparent rest / `--interactive-hover` / `--interactive-active`; selected rows use the selection pair. The scoped focus rule is important because host base styles reset non-input focus outlines with `!important`. Use native `button` semantics for actions and keep any additional behavior in the plugin.
107
+
108
+ ## Document boundaries
109
+
110
+ Same-document Solid/DOM content inherits these variables without a React-to-Solid component bridge or theme polling. An iframe has a separate document and does not inherit them or the host's SVG symbols; apply its own theming mechanism when using one. CSS and icon guidance do not create new GUI capabilities.
111
+
112
+ Source owners: `packages/ui/src/lib/theme/cssGenerator.ts`, `packages/ui/src/styles/design-system.css`, `packages/ui/src/styles/typography.css`, `packages/ui/src/components/ui/button.tsx`. Check the matching Yuri version when a variable is unavailable.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Read this for changes to existing Yuri blocks: backgrounds, sidebar, header, chat, composer, preview, Settings or overlays. For contribution schemas and activation, use [appearance](appearance.md). This map travels with Yuri so plugin authors can start without a source checkout or unpacking the application.
4
4
 
5
+ For styling a plugin's own content, start with [CSS variables and styling](plugin-styles.md) and [icons](icons.md). The map below describes existing host surfaces rather than reusable UI components.
6
+
5
7
  ## Fast path
6
8
 
7
9
  1. Locate the requested block in the table below. Prefer a theme contribution for coordinated colors, or a scoped `Style` rule for one block's material/geometry.
@@ -0,0 +1,110 @@
1
+ # Work-status widgets
2
+
3
+ `Registry.define('yuri.work-status')` contributes plugin-owned Solid/DOM content below Changes and above Todos in the conversation's work-status column. It uses the same GUI package, plugin context and Solid renderer as panels/pages. This is a Yuri supplemental registry, not the upstream `Slot` registry.
4
+
5
+ ## Registration and layout
6
+
7
+ ```ts
8
+ interface WorkStatusContribution {
9
+ readonly id: string
10
+ readonly order?: number
11
+ render(props: WorkStatusProps): import('solid-js').JSX.Element
12
+ }
13
+ ```
14
+
15
+ Register with official `ctx.add`. An accessor returning `undefined` withdraws the widget. IDs are non-empty strings up to 128 characters, unique within this plugin's work-status contributions. `order` defaults to zero and must be finite. Widgets sort by ascending order, then the server's global plugin inventory order, then registration order within that plugin. Keep the render function stable when updating only order or visibility.
16
+
17
+ Content has natural height and shares the column's scrolling. An empty contribution creates no visible placeholder. There is no host title, card or component toolkit. Use [plugin styles](plugin-styles.md) and [icons](icons.md) to follow the surrounding appearance; the plugin owns its markup and interactions. Inline column width is currently 196px; the popup is 264px including its padding. Fit the available container rather than hardcoding a page width.
18
+
19
+ Web desktop and Electron render the widgets in both inline and popup modes, including when connected to a remote/Relay Host. Mobile, Capacitor and VS Code currently have no work-status column and do not mount these contributions. Registration itself remains valid. The slot follows the column's visibility setting and adds no native permissions or startup loading gate.
20
+
21
+ ## Injected information
22
+
23
+ `render` runs once per mount. Read reactive properties inside Solid computations instead of destructuring their initial values.
24
+
25
+ | Property | Shape and source |
26
+ | --- | --- |
27
+ | `session` | Official `MountedSession` reference for **this displayed conversation**, or `undefined` before a draft has a session/directory. Yuri supports `id`, `key`, `directory`, `server`, `tab`, `pending`, `visit`, `location` on this reference; unsupported SDK members reject as elsewhere. |
28
+ | `directory` | Actual displayed working directory, or `null` while unresolved. Never replaced with another selected project's directory. |
29
+ | `runtimeId` | Current host transport identity. Treat as opaque scope information, not a URL or durable cross-transport key. |
30
+ | `project` | Reactive `{ id?: string, name: string, directory: string } \| null`. Same project/worktree resolution as the built-in rows; a directory fallback can have no project ID. |
31
+ | `worktree` | Reactive `{ name: string, directory: string } \| null`. Explicit attached/discovered worktree, when known. |
32
+ | `git` | Reactive read-only summary described below, shared with the built-in Git rows. |
33
+ | `placement` | Reactive `'inline' \| 'popover'`. |
34
+ | `active` | `true` while mounted; changes to `false` before disposal. |
35
+ | `signal` | This mount's `AbortSignal`. Aborts on hiding, scope change, withdrawal, plugin replacement/disable/failure or host disposal. |
36
+
37
+ Git summary fields:
38
+
39
+ ```ts
40
+ interface GitSummary {
41
+ readonly state: 'unknown' | 'not-repository' | 'ready'
42
+ readonly loading: boolean
43
+ readonly branch: string | null
44
+ readonly changedFiles: number | null
45
+ readonly additions: number | null
46
+ readonly deletions: number | null
47
+ }
48
+ ```
49
+
50
+ `unknown` includes unresolved and pending-worktree data. Missing totals are `null`, not zero; a light Git snapshot can have a branch/file count but no line totals. `not-repository` comes from the shared repository check. `ready` describes the last available snapshot, not a successful request on every render. The existing Git store preserves its last snapshot after refresh failure and does not publish error details here; `loading` describes its foreground status load, not silent background requests. The slot adds no Git polling, file-content reads or message-history subscriptions.
51
+
52
+ Theme, locale, plugin options and authenticated client remain on `usePlugin()` / setup `ctx`. `ctx.sessions.current()` still describes the window's primary selection; use the injected session for widget-scoped requests. Existing navigation APIs retain their support boundaries: for example, file navigation for an explicitly different session can be rejected. Do not silently retarget it to the primary conversation.
53
+
54
+ ## Lifecycle and updates
55
+
56
+ Changing project/Git metadata or placement updates the existing Solid view; unrelated session/layout/stream updates do not rebuild the widget catalog or remount its DOM. Changing the displayed session ID, directory or host creates a new mount and aborts the previous one. Multiple visible instances have independent props and signals.
57
+
58
+ Use `onCleanup` for listeners and timers, or bind DOM listeners/requests to `props.signal`. Ignore completed asynchronous work after that signal aborts. Registration and rendering exceptions use the existing plugin failure path: affected content disappears, diagnostics remain in plugin settings, and unrelated plugins stay usable. Arbitrary plugin JavaScript still runs on the window's main thread; keep expensive work out of setup/render and stop view-owned work on cleanup.
59
+
60
+ ## Complete direct-CJS example
61
+
62
+ Use the package layout in [workflow](workflow.md). This example displays the owning project and branch using inherited colors and a host SVG symbol. It needs no component imports or compilation.
63
+
64
+ ```js
65
+ const { Plugin, Registry, Style } = require('@opencode/plugin/gui')
66
+ const { createEffect } = require('solid-js')
67
+ const WorkStatus = Registry.define('yuri.work-status')
68
+
69
+ module.exports = Plugin.define({
70
+ setup(ctx) {
71
+ ctx.add(Style, `
72
+ .workspace-widget {
73
+ display: flex; align-items: center; min-width: 0;
74
+ gap: calc(0.5rem * var(--padding-scale, 1)); padding: 0.375rem 0.5rem;
75
+ font-family: var(--font-sans, system-ui, sans-serif);
76
+ font-size: var(--text-ui-label); color: var(--muted-foreground);
77
+ }
78
+ .workspace-widget span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
79
+ `)
80
+ ctx.add(WorkStatus, {
81
+ id: 'workspace', order: 10,
82
+ render(props) {
83
+ const row = document.createElement('div')
84
+ row.className = 'workspace-widget'
85
+ const ns = 'http://www.w3.org/2000/svg'
86
+ const icon = document.createElementNS(ns, 'svg')
87
+ icon.setAttribute('viewBox', '0 0 24 24')
88
+ icon.setAttribute('width', '14')
89
+ icon.setAttribute('height', '14')
90
+ icon.setAttribute('aria-hidden', 'true')
91
+ icon.style.cssText = 'flex-shrink:0; --yuri-icon-stroke:2'
92
+ const use = document.createElementNS(ns, 'use')
93
+ use.setAttribute('href', '#yuri-git-branch')
94
+ icon.append(use)
95
+ const label = document.createElement('span')
96
+ row.append(icon, label)
97
+ createEffect(() => {
98
+ const name = props.project?.name || props.directory || ''
99
+ const branch = props.git.branch
100
+ label.textContent = branch ? `${name} · ${branch}` : name
101
+ row.title = props.directory || ''
102
+ })
103
+ return row
104
+ },
105
+ })
106
+ },
107
+ })
108
+ ```
109
+
110
+ Verify the widget under Changes, live field updates without resetting its local inputs, inline/popup width, session and host switches, and cleanup on hiding/disable/reload. Check that slow work observes the mount signal and that failed widgets leave other entries intact.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 1naruto-1
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,223 @@
1
+ # Cross-agent history import
2
+
3
+ This Host-owned module reads source histories and project instruction text,
4
+ normalizes them, and writes new conversations through official OpenCode
5
+ `session.import`. It does not write OpenCode databases or run historical prompts.
6
+ Agent Connect reader/normalization adaptations use fixed commit
7
+ `42287c14a8fd381bc7ef7a96076a5cba5b4d75f6`; its MIT notice is in
8
+ `AGENT_CONNECT_LICENSE`. No Agent Connect process or new dependency is installed.
9
+
10
+ ## Ownership and routes
11
+
12
+ - `sources.js`: default/custom Host roots, bounded traversal, JSONL/Zstandard,
13
+ source identities and revision fingerprints.
14
+ - `native.js`: current OpenCode instance metadata inventory and bounded message
15
+ excerpts; existing sessions are attached in place, never copied.
16
+ - `installations.js`: connected-Host executable/application detection, without
17
+ launching agents. Scan returns per-source `true`, `false` (not detected), or
18
+ `null` (unknown); leftover history directories are not installation evidence.
19
+ Installation status never filters readable histories or authorizes writes.
20
+ - `sqlite.js`: Cursor editor KV and CLI protobuf/blob readers, using private
21
+ DB+WAL snapshots. Original databases and SHM are never opened by SQLite.
22
+ - `events.js`: active transcript normalization and native transfer projection.
23
+ - `settings.js`: project-only rule/skill plans, conflicts, fingerprints, backups
24
+ and JSONC-preserving writes through the existing config owner.
25
+ - `service.js`: scan/preview lifetimes, explicit confirmation, parent ordering,
26
+ idempotency, cancellation and independent-item failures.
27
+ - `store.js`: SQLite job/receipt persistence; no transcript or rule content.
28
+ - `targets.js`: read-only canonical destination resolution, then confirmed missing-directory creation and revalidation.
29
+ - `routes.js`: authenticated, no-store HTTP boundary registered before the proxy.
30
+
31
+ POST `scan`, `imported`, `preview`, `start`, `resume`, `dismiss`, `cancel` and GET `job`, `jobs` live under
32
+ `/api/yuri/history-import/`. The existing Host UI/client gate authenticates them;
33
+ URL-token authentication is not accepted here. Plans and jobs additionally belong
34
+ to the authenticated client/owner and upstream runtime identity. Start requires
35
+ `confirm: true`; the same plan returns the same job on retry. Scans/plans expire
36
+ after 30 minutes and are bounded to eight retained entries each. A Host serializes
37
+ imports; closing the UI does not cancel confirmed work. Cancellation is
38
+ cooperative between items, not a rollback of already committed data.
39
+
40
+ Web, Electron, hosted mobile and Capacitor read files on the **connected Host**,
41
+ never on the browser/phone. There is no upload flow. Standalone VS Code returns
42
+ 501 `history_import_unsupported` instead of forwarding these routes to OpenCode.
43
+ The setup tour sends `start({ sources, directory, confirm: true })` on “Next”.
44
+ It immediately accepts a Host-owned job; full discovery, per-item validation and
45
+ fingerprint-bound planning run in the background, without another confirmation page.
46
+ Source jobs import conversations only (`settings: false`), including retries of
47
+ saved source intent. They never inspect/copy/activate project rules, SKILL.md or
48
+ other configuration. Existing previously imported settings are not removed.
49
+ Project registration remains necessary to expose imported sessions. The explicit
50
+ preview/`planID` API retains opt-in settings migration with keep-both/replace
51
+ decisions, separate from the tour/source flow. Closing a client does not cancel either flow.
52
+ `progress` describes `scanning`, `validating` or `importing` with phase-local
53
+ `completed`/`total`; zero total means unknown, not 0% progress. The receipt total
54
+ is finalized after planning, including scan/validation failures. An additive SQLite
55
+ column migration persists progress. Restart marks unfinished jobs interrupted;
56
+ it does not replay executable plans. Internal scans/plans are released after each
57
+ background job. Failed items do not block unrelated projects.
58
+
59
+ `jobs` returns all unfinished jobs for the authenticated owner/runtime, oldest
60
+ first, using summary counts (including failures) without transcript/receipt bodies.
61
+ Both `completed` and `partial` are finished states and excluded from `jobs`;
62
+ existing persisted partial jobs need no migration. Their receipts remain available
63
+ through `job`, `resumable` is false, and `resume` returns them unchanged without
64
+ clearing receipts or starting another attempt. A user may explicitly start a new
65
+ conversation-only import; deterministic session IDs still avoid duplicates.
66
+ New source jobs durably retain only their source IDs and fallback destination in a
67
+ private SQLite `request` column; responses expose only `resumable`. `resume` needs
68
+ `{ id, confirm: true }`, reuses the same job ID, and merges duplicate active retries.
69
+ Another active import rejects with `import_busy`. A transaction resets only that
70
+ job's attempt receipts/progress, never imported sessions, project registrations or
71
+ source files. Discovery/validation is repeated; deterministic revision IDs and
72
+ authoritative provenance readback skip committed sessions. Index callbacks and
73
+ project registration are retried independently. Source retries do not include
74
+ settings. This is an idempotent retry, not a byte/file-offset resume.
75
+ Continue always uses the stored original source intent; the resume payload cannot
76
+ replace it with new sources or destinations. Legacy/explicit-plan jobs without
77
+ stored intent return `resume_request_missing` without resetting receipts or
78
+ starting a new import. The popup reports this limitation, never asks for a new
79
+ selection or silently selects all sources. Missing historical selections, merge
80
+ decisions and replace decisions cannot be reconstructed from result receipts.
81
+ After a failed Continue attempt the popup changes that import row's action to
82
+ Remove. `dismiss({ id })` durably marks only the authenticated owner/runtime's
83
+ inactive job as dismissed, excluding it from `jobs` and latest `job` results.
84
+ Running jobs reject dismissal with `import_busy`. Receipts and imported
85
+ conversations/projects/files remain untouched; repeated dismissal is idempotent.
86
+ Explicit historical job reads retain the receipt, but dismissed jobs cannot resume.
87
+
88
+ Discovery accepts optional `limitPerSource` (integer 1–10). This is a fast,
89
+ non-exhaustive sample: traversal/reads stop when that source reaches the limit,
90
+ including across roots, and Cursor editor bounds its composer-header SQL query.
91
+ With `includeCounts: true`, metadata traversal continues, but remaining transcript
92
+ bodies are not parsed. Candidate files are counted once per physical path;
93
+ Cursor editor combines `COUNT(*)` with bounded sample reads in the same private
94
+ snapshot, or reads only the count when enough examples were found elsewhere.
95
+ Counts are `{ value, approximate }` per source: positive values are estimates,
96
+ since duplicates/empty/malformed histories were not validated. Metadata-read or
97
+ traversal failure returns `value: null`, not a misleading partial/zero success.
98
+ The enumeration remains bounded to 20,000 entries; original DBs stay untouched.
99
+ Sample order is not a claim of catalog-wide recency.
100
+ Scan responses expose `sampled`; plans reject sampled scans with `incomplete_scan`.
101
+ The tour asks for five examples and metadata counts per tool, then scans selected tools fully only
102
+ on “Next”, preserving full-history import rather than importing just examples.
103
+ Scan summaries include a whitespace-normalized excerpt of up to 180 characters
104
+ from assistant text (falling back to user text), never tool records or reasoning.
105
+ OpenCode inventory pages official `session.list` metadata (100 per page, at most
106
+ 5,000 sessions, 10-second request budget). A complete inventory gives an exact
107
+ count; failed/incomplete inventory gives an unknown count, while readable samples
108
+ remain visible. Only sampled OpenCode sessions request message projection (one
109
+ 10-message page per example); full registration jobs never read message bodies.
110
+ This source is the connected instance, not an alternate database or export file.
111
+ Combined native/external discoveries retain the existing 5,000-session bound;
112
+ overflow is reported per omitted source without discarding readable retained
113
+ sessions. As before, this is a bounded import, not an unbounded catalog migration.
114
+
115
+ `imported({ scanID, directory })` is a separate read-only badge query for sampled
116
+ scans only. The scan retains already-computed source revisions, never rereads
117
+ transcript bodies for badges. It uses the same deterministic IDs/provenance as
118
+ separate imports, canonical destinations and parent revisions, with at most four
119
+ concurrent `session.get` calls, 50 examples and a shared five-second timeout.
120
+ Exact existing targets report `imported`; authoritative 404 reports `available`;
121
+ query failure, conflicts or a parent outside the sample report `unknown`, never
122
+ an invented unimported state. Badges are conservative, not catalog-wide totals.
123
+ Checks retain owner/runtime fencing and do not trust persisted receipts alone.
124
+
125
+ ## Supported sources and conversion
126
+
127
+ | Source | Reader behavior |
128
+ | --- | --- |
129
+ | Claude Code | projects JSONL, active UUID parent chain, compaction/snips, parallel assistant tool fragments and subagents |
130
+ | Codex | sessions and archived_sessions JSONL, paired event/response user tracks, rollbacks, tool call/output pairs |
131
+ | Cursor | agent-transcripts JSONL; editor state.vscdb composer/bubble KV; CLI chats store.db meta, ordered protobuf message references and archives |
132
+ | DeepSeek Harness | session JSONL or concatenated Zstandard frames, latest physical generation, versions 0–4, sequenced surface replacement and tool/result pairing |
133
+ | OpenCode | current instance official session inventory; “Next” registers original projects and refreshes existing session index entries without `session.import` |
134
+
135
+ Known defaults respect the source-specific HOME/config environment overrides.
136
+ Explicit roots must be absolute Host paths. Sources remain untouched; unreadable
137
+ files are reported independently, not interpreted as an authoritative empty scan.
138
+ Symlink entries are skipped, and project rule/destination symlinks fail closed.
139
+ JSONL is capped at 64 MiB decompressed, 8 MiB per line and 100,000 records;
140
+ traversal at 20,000 entries and 5,000 sessions. SQLite snapshots are capped at
141
+ 1 GiB. Missing Zstandard support is an explicit per-source error, not a Host
142
+ startup failure. Discovery deduplicates source identity across scan entry paths
143
+ and active/archive copies, preferring the more recently modified file.
144
+
145
+ This is not lossless native-runtime migration: tools/results become inert text,
146
+ reasoning remains reasoning text, and only available user inline image bytes are
147
+ retained. Missing/local-file attachments, runtime state, provider replay data,
148
+ permissions and historical usage are not reconstructed. Imported metadata marks
149
+ usage unknown; schema-required counters are zero, not recovered usage evidence.
150
+
151
+ ## Merge, revisions and retry
152
+
153
+ Destination paths must be absolute and resolve through canonical existing ancestors.
154
+ Preview/validation never creates a directory. Confirmed execution creates missing
155
+ project directories and checks their canonical identity again, then uses the shared
156
+ project registry before importing a session. Registration failure prevents session
157
+ and settings writes for that project. Created directories/projects are not removed
158
+ on later failure, to preserve concurrent user work. Multiple source paths
159
+ may map to one destination project. Separate imports preserve selected parent/
160
+ child relationships with parents imported first. An unselected parent produces
161
+ an explicit detached-child warning. Parent failure blocks that subtree only.
162
+ Child target IDs incorporate the selected parent's revision ID.
163
+ Impossible self-parent metadata is normalized to a detached root with a
164
+ `parent_detached` warning; transcript contents are retained. Other parent cycles
165
+ fail their own entries with `invalid_parent_graph`, and descendants report
166
+ `parent_failed`; independent conversations continue. Parent ordering is iterative
167
+ and linear rather than recursive. Explicit merges flatten selected source
168
+ histories and do not depend on their original parent graph.
169
+ OpenCode entries retain their original IDs and locations. They cannot be merged
170
+ or redirected to another project; missing/deleted locations or sessions fail
171
+ independently. Registration/index failures remain retryable without copies.
172
+ Their existing project configuration is already native and is not rewritten.
173
+
174
+ Conversation merge is explicit, requires one destination and follows the scan
175
+ list/selection order. It creates a new session, removes only an exactly matching
176
+ shared prefix, inserts source boundary markers, and preserves repeated genuine
177
+ messages. It never appends to or overwrites existing OpenCode conversations.
178
+
179
+ Target IDs encode source installation/session identities, normalized revision,
180
+ destination, mode and parent revision. Exact repeat imports verify authoritative
181
+ metadata and skip; changed source content creates a new revision. Lost write
182
+ responses recover only through an exact authoritative read, never merely a 409.
183
+ Every successful import is read back through `session.get` and checked against
184
+ the expected ID, provenance and destination; a write acknowledgment alone is not
185
+ success. The session index receives that verified record. Index failure is
186
+ reported separately and retryable without duplicating the conversation.
187
+ Full receipts are durable; polled status returns
188
+ at most 80 recent/failed results plus the total completed count.
189
+
190
+ ## Project settings
191
+
192
+ Selected histories identify source project roots. Root CLAUDE.md/AGENTS.md,
193
+ source rule folders, .cursorrules, and Markdown skill definitions are eligible.
194
+ Native in-place root instructions are skipped. Other unconditional rules go to
195
+ `.opencode/imported-rules/` and are added to effective instructions through the
196
+ existing JSONC config owner, preserving inherited instructions and comments.
197
+ Rules with `globs`, `paths` or `alwaysApply` metadata remain archived, not globally
198
+ enabled. Skills copy **SKILL.md only** to namespaced directories under
199
+ `.opencode/skills/`; supporting scripts and resources are not copied, so such
200
+ skills may need manual repair. This limit is disclosed before confirmation.
201
+ Global credentials, provider/auth settings, hooks, permissions, MCP and plugins
202
+ are excluded.
203
+ For source-based background jobs, settings planning failures (including symlinked
204
+ rule/skill roots) are recorded once per source project/destination as failed
205
+ settings items, without excluding readable conversations from that project. No
206
+ unsafe settings are read through symlinks or written. Explicit settings previews
207
+ still reject unsafe paths so callers can resolve them before confirming.
208
+
209
+ Conflicts default to keep existing; explicit keep-both uses a separate path;
210
+ replace backs up existing content first. Preview binds source/target/config
211
+ fingerprints. Changed data fails instead of silently overwriting. Failed config
212
+ activation compensates only the unchanged rule file written by this operation;
213
+ concurrent user edits are retained. Plans permit at most 200 rule/skill files,
214
+ 512 KiB each and 4 MiB total. Partial failures leave unrelated successes valid;
215
+ re-preview and retry, rather than restarting a persisted executable plan.
216
+
217
+ ## Verification
218
+
219
+ Focused Vitest tests cover format normalization, official transfer schema,
220
+ SQLite source immutability, repeat/lost-response imports, source changes,
221
+ ownership, runtime fencing, parent failures, merge, cancellation, receipts,
222
+ JSONC merging, conflict policies and unsafe paths. Real OpenCode smoke validation
223
+ must use synthetic sources and isolated HOME/XDG roots, never user histories.
@@ -0,0 +1,56 @@
1
+ import fs from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import http from 'node:http';
5
+ import { once } from 'node:events';
6
+ import express from 'express';
7
+ import { createServer } from 'vite';
8
+ import { expect, test } from 'vitest';
9
+ import createConfig from '../../../vite.config.ts';
10
+ import { createHistoryImportService } from './service.js';
11
+ import { createImportStore } from './store.js';
12
+ import { registerHistoryImportRoutes } from './routes.js';
13
+ import { digest } from './events.js';
14
+
15
+ test('real development proxy preserves browser origin for resume and durable task dismissal', async () => {
16
+ const directory = await fs.mkdtemp(path.join(os.tmpdir(), 'yuri-import-proxy-'));
17
+ const store = createImportStore(path.join(directory, 'receipts.sqlite'));
18
+ store.create('interrupted', 'owner', digest('fixture'), 357);
19
+ store.append('interrupted', 0, { key: 'saved', status: 'imported', sessionID: 'existing' });
20
+ store.finish('interrupted', 'interrupted');
21
+ const service = createHistoryImportService({ store, getRuntimeIdentity: () => 'fixture', createClient: () => { throw new Error('must not touch imported content'); } });
22
+ const backend = express();
23
+ registerHistoryImportRoutes(backend, { express, service, uiAuthController: { resolveAuthContext: async () => ({ type: 'session' }) } });
24
+ const api = http.createServer(backend); const ui = http.createServer();
25
+ let vite;
26
+ try {
27
+ api.listen(0, '127.0.0.1'); await once(api, 'listening');
28
+ const config = createConfig({ command: 'serve', mode: 'development' });
29
+ vite = await createServer({ configFile: false, root: directory, cacheDir: path.join(directory, '.vite'), appType: 'custom', logLevel: 'silent',
30
+ optimizeDeps: { noDiscovery: true, include: [] },
31
+ server: { middlewareMode: { server: ui }, hmr: false,
32
+ proxy: { '/api': { ...config.server.proxy['/api'], target: `http://127.0.0.1:${api.address().port}` } },
33
+ },
34
+ });
35
+ ui.on('request', vite.middlewares); ui.listen(0, '127.0.0.1'); await once(ui, 'listening');
36
+ const origin = `http://127.0.0.1:${ui.address().port}`;
37
+ const call = (route, body, requestOrigin = origin) => fetch(`${origin}/api/yuri/history-import/${route}`, {
38
+ method: 'POST', headers: { 'Content-Type': 'application/json', Origin: requestOrigin, 'Sec-Fetch-Site': 'same-origin' }, body: JSON.stringify(body),
39
+ });
40
+ const resume = await call('resume', { id: 'interrupted', confirm: true });
41
+ expect({ status: resume.status, body: await resume.json() }).toEqual({ status: 400, body: { code: 'resume_request_missing' } });
42
+ const forbidden = await call('dismiss', { id: 'interrupted' }, 'https://attacker.example');
43
+ expect(forbidden.status).toBe(403);
44
+ const dismiss = await call('dismiss', { id: 'interrupted' });
45
+ expect({ status: dismiss.status, body: await dismiss.json() }).toEqual({ status: 200, body: { id: 'interrupted' } });
46
+ expect(await (await fetch(`${origin}/api/yuri/history-import/jobs`)).json()).toEqual([]);
47
+ expect(service.status('interrupted', 'owner')).toMatchObject({ dismissed: true, completed: 1, results: [{ sessionID: 'existing' }] });
48
+ } finally {
49
+ await vite?.close();
50
+ for (const server of [ui, api]) {
51
+ server.closeAllConnections();
52
+ if (server.listening) await new Promise(resolve => server.close(resolve));
53
+ }
54
+ await service.close(); await fs.rm(directory, { recursive: true, force: true });
55
+ }
56
+ });