ompchamber 1.2.0 → 2.0.0

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 (223) hide show
  1. package/README.md +131 -147
  2. package/dist/client/index.html +4 -2
  3. package/dist/client/static/css/index.5f630421b7.css +2 -0
  4. package/dist/client/static/js/77.0d81c74cf0.js +139 -0
  5. package/dist/client/static/js/async/1k.973e8e21fc.js +2 -0
  6. package/dist/client/static/js/async/{3y.3186ecdd63.js → 3y.3530b824ad.js} +6 -6
  7. package/dist/client/static/js/async/{q.b453193538.js → 4m.928a1dde85.js} +10 -10
  8. package/dist/client/static/js/async/66.5dfa29f957.js +93 -0
  9. package/dist/client/static/js/async/7g.a7814350c3.js +1 -0
  10. package/dist/client/static/js/async/ar.9303e5f2e8.js +2 -0
  11. package/dist/client/static/js/async/{cx.9c8268d542.js → cx.3cb0242a3a.js} +1 -1
  12. package/dist/client/static/js/async/e.93214d622b.js +79 -0
  13. package/dist/client/static/js/async/g.74ff36419f.js +2 -0
  14. package/dist/client/static/js/async/{m.2e1ea3db9e.js.LICENSE.txt → g.74ff36419f.js.LICENSE.txt} +5 -0
  15. package/dist/client/static/js/async/h1.393f066d09.js +1 -0
  16. package/dist/client/static/js/async/jl.874d352278.js +1 -0
  17. package/dist/client/static/js/async/{k.d16cd09ae7.js → k.3210286401.js} +1 -1
  18. package/dist/client/static/js/async/{m.2e1ea3db9e.js → m.eb2e6752e2.js} +3 -3
  19. package/dist/client/static/js/async/m.eb2e6752e2.js.LICENSE.txt +11 -0
  20. package/dist/client/static/js/async/mt.0352e976d8.js +1 -0
  21. package/dist/client/static/js/async/{oc.eb22093f05.js → oc.b73042e8bd.js} +1 -1
  22. package/dist/client/static/js/async/{og.53f068804c.js → og.8eb577893a.js} +1 -1
  23. package/dist/client/static/js/async/px.fc6877924b.js +1 -0
  24. package/dist/client/static/js/async/q.33d6779f98.js +21 -0
  25. package/dist/client/static/js/async/{q5.88b50ffa95.js → q5.97dc1481b6.js} +1 -1
  26. package/dist/client/static/js/async/s.0f395cdda5.js +94 -0
  27. package/dist/client/static/js/async/{tr.2a0d2b7600.js → tr.e878658140.js} +1 -1
  28. package/dist/client/static/js/async/vt.42416b707d.js +1 -0
  29. package/dist/client/static/js/async/x1.da8687159b.js +90 -0
  30. package/dist/client/static/js/async/xe.da8dcc2015.js +2 -0
  31. package/dist/client/static/js/async/xe.da8dcc2015.js.LICENSE.txt +11 -0
  32. package/dist/client/static/js/async/{xn.6360379f71.js → xn.6510c0abe2.js} +2 -2
  33. package/dist/client/static/js/async/yg.35bebd6d0c.js +149 -0
  34. package/dist/client/static/js/async/yv.d99d829136.js +1 -0
  35. package/dist/client/static/js/index.c05535dbde.js +38 -0
  36. package/package.json +3 -3
  37. package/src/client/components/common/ComposerTextarea.tsx +9 -1
  38. package/src/client/components/common/MarkdownRenderer.tsx +50 -12
  39. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +9 -3
  40. package/src/client/components/settings/Modal.tsx +11 -2
  41. package/src/client/components/settings/categories/AppearanceSettings.tsx +7 -30
  42. package/src/client/components/settings/categories/ProviderSettings.tsx +2 -0
  43. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +61 -0
  44. package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +80 -0
  45. package/src/client/components/settings/categories/chat-settings/TitleSection.tsx +1 -1
  46. package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +43 -6
  47. package/src/client/components/settings/categories/provider-settings/ModelConfigModal.tsx +54 -54
  48. package/src/client/components/workspace/SearchPanel.tsx +16 -3
  49. package/src/client/components/workspace/btw-panel/AskCard.tsx +11 -6
  50. package/src/client/components/workspace/btw-panel/Messages.tsx +105 -51
  51. package/src/client/components/workspace/btw-panel/index.tsx +129 -45
  52. package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +30 -14
  53. package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +10 -1
  54. package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +8 -2
  55. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +27 -16
  56. package/src/client/components/workspace/chat-timeline/MessageList.tsx +11 -0
  57. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +8 -0
  58. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +12 -1
  59. package/src/client/components/workspace/chat-timeline/index.tsx +7 -2
  60. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +42 -15
  61. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +13 -1
  62. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +13 -4
  63. package/src/client/components/workspace/editor/index.tsx +11 -2
  64. package/src/client/components/workspace/file-explorer/GitRepoDropdown.tsx +15 -41
  65. package/src/client/components/workspace/file-explorer/index.tsx +86 -16
  66. package/src/client/components/workspace/git-panel/index.tsx +60 -78
  67. package/src/client/components/workspace/terminal-panel/Header.tsx +16 -1
  68. package/src/client/components/workspace/terminal-panel/RealtimeXtermView.tsx +5 -5
  69. package/src/client/components/workspace/terminal-panel/index.tsx +6 -2
  70. package/src/client/components/workspace/terminal-panel/mount.ts +2 -2
  71. package/src/client/data/theme/terminal.ts +50 -52
  72. package/src/client/hooks/chat/btw/index.ts +139 -18
  73. package/src/client/hooks/chat/btw/intercept.ts +8 -8
  74. package/src/client/hooks/chat/btw/mode.ts +111 -16
  75. package/src/client/hooks/chat/composer/index.ts +10 -4
  76. package/src/client/hooks/chat/timeline/access-mode.ts +41 -0
  77. package/src/client/hooks/chat/timeline/ask-frames.test.ts +87 -0
  78. package/src/client/hooks/chat/timeline/ask-frames.ts +20 -1
  79. package/src/client/hooks/chat/timeline/auto-scroll.ts +13 -4
  80. package/src/client/hooks/chat/timeline/index.ts +8 -20
  81. package/src/client/hooks/chat/timeline/queue.ts +66 -9
  82. package/src/client/hooks/chat/timeline/scroll.test.ts +260 -0
  83. package/src/client/hooks/chat/timeline/scroll.ts +93 -20
  84. package/src/client/hooks/chat/timeline/session-load.ts +7 -1
  85. package/src/client/hooks/chat/timeline/session-pagination.test.ts +167 -0
  86. package/src/client/hooks/chat/timeline/session-pagination.ts +37 -11
  87. package/src/client/hooks/settings/providers.ts +34 -3
  88. package/src/client/hooks/ui/open-file.ts +7 -1
  89. package/src/client/hooks/ui/theme.ts +82 -57
  90. package/src/client/hooks/workspace/file-tabs.ts +5 -1
  91. package/src/client/hooks/workspace/repo-scope/index.ts +119 -0
  92. package/src/client/hooks/workspace/repo-scope/store.test.ts +161 -0
  93. package/src/client/hooks/workspace/repo-scope/store.ts +201 -0
  94. package/src/client/hooks/workspace/search-stream.ts +24 -5
  95. package/src/client/main.tsx +6 -0
  96. package/src/client/tailwind.css +19 -56
  97. package/src/server/lib/btw/child.server.ts +41 -0
  98. package/src/server/lib/btw/lifecycle.server.ts +254 -0
  99. package/src/server/lib/btw/prompt.ts +13 -5
  100. package/src/server/lib/btw/registry.server.ts +13 -4
  101. package/src/server/lib/btw/runtime.server.ts +149 -156
  102. package/src/server/lib/btw/schema.server.ts +27 -0
  103. package/src/server/lib/btw/service.server.ts +106 -5
  104. package/src/server/lib/btw/store.server.ts +57 -6
  105. package/src/server/lib/db/schema.ts +4 -0
  106. package/src/server/lib/db/settings-store.test.ts +65 -0
  107. package/src/server/lib/db/settings-store.ts +25 -0
  108. package/src/server/lib/fs/atomic-write.ts +42 -4
  109. package/src/server/lib/fs/config-lock.ts +74 -0
  110. package/src/server/lib/fs/git-ignore.ts +55 -5
  111. package/src/server/lib/fs/ripgrep.ts +119 -0
  112. package/src/server/lib/lifecycle/identity.ts +10 -64
  113. package/src/server/lib/lifecycle/proc/darwin.ts +238 -0
  114. package/src/server/lib/lifecycle/proc/index.ts +38 -0
  115. package/src/server/lib/lifecycle/proc/linux.ts +80 -0
  116. package/src/server/lib/lifecycle/proc/ps.ts +86 -0
  117. package/src/server/lib/lifecycle/proc/types.ts +33 -0
  118. package/src/server/lib/lifecycle/proc/win32.ts +53 -0
  119. package/src/server/lib/models/provider-registry.server.ts +2 -2
  120. package/src/server/lib/models/registry.server.ts +1 -1
  121. package/src/server/lib/omp/config/behavior.ts +17 -17
  122. package/src/server/lib/omp/config/disabled-providers.ts +84 -35
  123. package/src/server/lib/omp/config/document.ts +128 -0
  124. package/src/server/lib/omp/config/extensions.ts +11 -10
  125. package/src/server/lib/omp/config/mcp.ts +4 -57
  126. package/src/server/lib/omp/config/model-overrides.ts +123 -0
  127. package/src/server/lib/omp/config/models-config.ts +92 -0
  128. package/src/server/lib/omp/config/models-validation.ts +159 -0
  129. package/src/server/lib/omp/config/path-scoped.ts +74 -0
  130. package/src/server/lib/omp/config/providers.ts +241 -211
  131. package/src/server/lib/omp/config/roles.ts +6 -14
  132. package/src/server/lib/omp/core/auth-credentials.ts +1 -1
  133. package/src/server/lib/omp/rpc/frame-fold.test.ts +124 -0
  134. package/src/server/lib/omp/rpc/frame-fold.ts +43 -24
  135. package/src/server/lib/omp/rpc/lifecycle.test.ts +41 -0
  136. package/src/server/lib/omp/rpc/manager.ts +21 -21
  137. package/src/server/lib/omp/rpc/pending-ui-dialogs.ts +11 -7
  138. package/src/server/lib/omp/rpc/session-commands.ts +17 -29
  139. package/src/server/lib/omp/rpc/session-registry.ts +5 -66
  140. package/src/server/lib/omp/rpc/web-state.ts +0 -6
  141. package/src/server/lib/omp/session/auto-title.server.test.ts +109 -11
  142. package/src/server/lib/omp/session/auto-title.server.ts +95 -20
  143. package/src/server/lib/omp/session/sidebar-data.server.ts +11 -6
  144. package/src/server/lib/queue/delivery-dispatch.server.test.ts +162 -0
  145. package/src/server/lib/queue/delivery-harness.ts +88 -0
  146. package/src/server/lib/queue/delivery.server.test.ts +78 -149
  147. package/src/server/lib/queue/delivery.server.ts +105 -13
  148. package/src/server/lib/queue/store.server.ts +30 -5
  149. package/src/server/lib/terminal/foreground.test.ts +164 -0
  150. package/src/server/lib/terminal/foreground.ts +34 -6
  151. package/src/server/lib/terminal/history.ts +8 -7
  152. package/src/server/plugins/compress.ts +33 -5
  153. package/src/server/plugins/ssr.ts +14 -7
  154. package/src/server/routes/btw/topics.ts +89 -2
  155. package/src/server/routes/fs/git.ts +5 -6
  156. package/src/server/routes/fs/search.ts +17 -26
  157. package/src/server/routes/sessions/queue.ts +17 -4
  158. package/src/server/routes/settings/index.ts +2 -0
  159. package/src/server/routes/settings/model-override.ts +69 -0
  160. package/src/server/routes/settings/provider-models.ts +35 -12
  161. package/src/server/routes/settings/providers.ts +31 -1
  162. package/src/server/routes/settings/root.ts +8 -3
  163. package/src/shared/lib/chat/btw/client.ts +34 -0
  164. package/src/shared/lib/chat/timeline/tool-phrases.ts +7 -0
  165. package/src/shared/lib/code/shiki-themes.ts +9 -5
  166. package/src/shared/lib/fs/file-tree.ts +17 -12
  167. package/src/shared/lib/markdown/autolink.test.ts +32 -0
  168. package/src/shared/lib/markdown/autolink.ts +50 -0
  169. package/src/shared/lib/markdown/document-urls.test.ts +68 -0
  170. package/src/shared/lib/markdown/document-urls.ts +118 -0
  171. package/src/shared/lib/markdown/marked.ts +27 -15
  172. package/src/shared/lib/markdown/mermaid.ts +2 -2
  173. package/src/shared/lib/models/catalog.ts +1 -1
  174. package/src/shared/lib/omp/session/schema-migrations.ts +30 -0
  175. package/src/shared/lib/omp/session/stream-state.server.test.ts +54 -0
  176. package/src/shared/lib/omp/session/stream-state.server.ts +70 -21
  177. package/src/shared/lib/settings/client.ts +10 -4
  178. package/src/shared/lib/settings/diff.test.ts +31 -0
  179. package/src/shared/lib/settings/diff.ts +37 -0
  180. package/src/shared/lib/theme/catalog.test.ts +168 -0
  181. package/src/shared/lib/theme/catalog.ts +98 -0
  182. package/src/shared/lib/theme/color.ts +88 -0
  183. package/src/shared/lib/theme/css.ts +70 -0
  184. package/src/shared/lib/theme/palettes/chamber.ts +61 -0
  185. package/src/shared/lib/theme/palettes/dark.ts +313 -0
  186. package/src/shared/lib/theme/palettes/light.ts +313 -0
  187. package/src/shared/types/btw.ts +83 -4
  188. package/src/shared/types/index.ts +1 -0
  189. package/src/shared/types/settings/provider.ts +8 -1
  190. package/src/shared/types/settings/state.ts +10 -4
  191. package/src/shared/types/theme.ts +48 -0
  192. package/dist/client/static/css/index.b938f4a693.css +0 -2
  193. package/dist/client/static/js/77.8022a800b5.js +0 -139
  194. package/dist/client/static/js/async/1k.a411fe5b43.js +0 -2
  195. package/dist/client/static/js/async/66.86544ad741.js +0 -93
  196. package/dist/client/static/js/async/7g.db82aca7ba.js +0 -1
  197. package/dist/client/static/js/async/ar.ad5c8822a8.js +0 -2
  198. package/dist/client/static/js/async/e.6443e739a2.js +0 -79
  199. package/dist/client/static/js/async/g.ee41bfed7f.js +0 -2
  200. package/dist/client/static/js/async/h1.d7091cef78.js +0 -1
  201. package/dist/client/static/js/async/jl.4911fa3383.js +0 -1
  202. package/dist/client/static/js/async/mt.853be2b5aa.js +0 -1
  203. package/dist/client/static/js/async/ot.84c71b308f.js +0 -2
  204. package/dist/client/static/js/async/px.783b6f91f2.js +0 -1
  205. package/dist/client/static/js/async/q8.7f1b48e9cd.js +0 -21
  206. package/dist/client/static/js/async/q8.7f1b48e9cd.js.LICENSE.txt +0 -6
  207. package/dist/client/static/js/async/s.aad2ecebc6.js +0 -94
  208. package/dist/client/static/js/async/vt.20406a5604.js +0 -1
  209. package/dist/client/static/js/async/x1.fe8af17016.js +0 -90
  210. package/dist/client/static/js/async/xn.6360379f71.js.LICENSE.txt +0 -6
  211. package/dist/client/static/js/async/yg.5a94e1fc8a.js +0 -149
  212. package/dist/client/static/js/async/yv.2fa22f009a.js +0 -1
  213. package/dist/client/static/js/index.57b39ffa7f.js +0 -34
  214. package/src/client/components/workspace/btw-panel/Composer.tsx +0 -181
  215. package/src/client/components/workspace/btw-panel/attachments.ts +0 -80
  216. /package/dist/client/static/js/{77.8022a800b5.js.LICENSE.txt → 77.0d81c74cf0.js.LICENSE.txt} +0 -0
  217. /package/dist/client/static/js/async/{g.ee41bfed7f.js.LICENSE.txt → 1k.973e8e21fc.js.LICENSE.txt} +0 -0
  218. /package/dist/client/static/js/async/{3y.3186ecdd63.js.LICENSE.txt → 3y.3530b824ad.js.LICENSE.txt} +0 -0
  219. /package/dist/client/static/js/async/{ot.84c71b308f.js.LICENSE.txt → 4m.928a1dde85.js.LICENSE.txt} +0 -0
  220. /package/dist/client/static/js/async/{q.b453193538.js.LICENSE.txt → ar.9303e5f2e8.js.LICENSE.txt} +0 -0
  221. /package/dist/client/static/js/async/{1k.a411fe5b43.js.LICENSE.txt → q.33d6779f98.js.LICENSE.txt} +0 -0
  222. /package/dist/client/static/js/async/{ar.ad5c8822a8.js.LICENSE.txt → xn.6510c0abe2.js.LICENSE.txt} +0 -0
  223. /package/dist/client/static/js/{index.57b39ffa7f.js.LICENSE.txt → index.c05535dbde.js.LICENSE.txt} +0 -0
@@ -0,0 +1,313 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ /**
7
+ * Light palettes ported verbatim from OpenChamber
8
+ * (packages/ui/src/lib/theme/themes/*.json, MIT, commit 5e6675b). Only the
9
+ * values the chamber consumes are carried: surface.background -> canvas,
10
+ * surface.elevated -> paper, surface.foreground -> ink, status.* -> signal
11
+ * colors, primary.base -> accent. Field order is the swatch order.
12
+ *
13
+ * Generated data — re-port rather than hand-editing a color here.
14
+ */
15
+
16
+ import type { ThemePalette } from '@/shared/types/theme';
17
+
18
+ export const LIGHT_PALETTES = [
19
+ {
20
+ id: 'aura-light',
21
+ name: 'Aura',
22
+ family: 'aura',
23
+ variant: 'light',
24
+ canvas: '#F5F0FF',
25
+ paper: '#f1ebfb',
26
+ ink: '#2D2640',
27
+ error: '#D94F4F',
28
+ success: '#40BF7A',
29
+ info: '#5BB8D9',
30
+ warning: '#D9A24A',
31
+ meta: '#A277FF',
32
+ },
33
+ {
34
+ id: 'ayu-light',
35
+ name: 'Ayu',
36
+ family: 'ayu',
37
+ variant: 'light',
38
+ canvas: '#FDFAF4',
39
+ paper: '#faf6ed',
40
+ ink: '#394049',
41
+ error: '#E6656A',
42
+ success: '#5FB978',
43
+ info: '#2F9BCE',
44
+ warning: '#EA9F41',
45
+ meta: '#4AA8C8',
46
+ },
47
+ {
48
+ id: 'carbonfox-light',
49
+ name: 'Carbonfox',
50
+ family: 'carbonfox',
51
+ variant: 'light',
52
+ canvas: '#FFFFFF',
53
+ paper: '#f4f4f7',
54
+ ink: '#161616',
55
+ error: '#DA1E28',
56
+ success: '#198038',
57
+ info: '#0043CE',
58
+ warning: '#F1C21B',
59
+ meta: '#0072C3',
60
+ },
61
+ {
62
+ id: 'catppuccin-light',
63
+ name: 'Catppuccin',
64
+ family: 'catppuccin',
65
+ variant: 'light',
66
+ canvas: '#fff6f4',
67
+ paper: '#fbefea',
68
+ ink: '#2e314a',
69
+ error: '#D20F39',
70
+ success: '#40A02B',
71
+ info: '#04A5E5',
72
+ warning: '#DF8E1D',
73
+ meta: '#7287FD',
74
+ },
75
+ {
76
+ id: 'dracula-light',
77
+ name: 'Dracula',
78
+ family: 'dracula',
79
+ variant: 'light',
80
+ canvas: '#F8F8F2',
81
+ paper: '#eeeee5',
82
+ ink: '#1F1F2F',
83
+ error: '#D9536F',
84
+ success: '#2FBF71',
85
+ info: '#1D7FC5',
86
+ warning: '#F7A14D',
87
+ meta: '#7C6BF5',
88
+ },
89
+ {
90
+ id: 'fields-of-the-shire-light',
91
+ name: 'Fields of the Shire',
92
+ family: 'fields-of-the-shire',
93
+ variant: 'light',
94
+ canvas: '#f9f5eb',
95
+ paper: '#fcf9f0',
96
+ ink: '#1a1612',
97
+ error: '#a24d3f',
98
+ success: '#4a6030',
99
+ info: '#3d4f5a',
100
+ warning: '#8c5520',
101
+ meta: '#4a6030',
102
+ },
103
+ {
104
+ id: 'flexoki-light',
105
+ name: 'Flexoki',
106
+ family: 'flexoki',
107
+ variant: 'light',
108
+ canvas: '#fffdf4',
109
+ paper: '#fbfaf2',
110
+ ink: '#100F0F',
111
+ error: '#AF3029',
112
+ success: '#66800B',
113
+ info: '#205EA6',
114
+ warning: '#BC5215',
115
+ meta: '#BC5215',
116
+ },
117
+ {
118
+ id: 'gruvbox-light',
119
+ name: 'Gruvbox',
120
+ family: 'gruvbox',
121
+ variant: 'light',
122
+ canvas: '#f8f1d5',
123
+ paper: '#efebcd',
124
+ ink: '#3C3836',
125
+ error: '#9D0006',
126
+ success: '#79740E',
127
+ info: '#8F3F71',
128
+ warning: '#B57614',
129
+ meta: '#076678',
130
+ },
131
+ {
132
+ id: 'jetbrains-light',
133
+ name: 'JetBrains',
134
+ family: 'jetbrains',
135
+ variant: 'light',
136
+ canvas: '#FFF',
137
+ paper: '#FFFFFF',
138
+ ink: '#000000',
139
+ error: '#CE0606',
140
+ success: '#077D18',
141
+ info: '#389FD6',
142
+ warning: '#F49810',
143
+ meta: '#195ce3',
144
+ },
145
+ {
146
+ id: 'kanagawa-light',
147
+ name: 'Kanagawa',
148
+ family: 'kanagawa',
149
+ variant: 'light',
150
+ canvas: '#f6f3d6',
151
+ paper: '#eae4bf',
152
+ ink: '#545464',
153
+ error: '#E82424',
154
+ success: '#6F894E',
155
+ info: '#4D699B',
156
+ warning: '#DE9800',
157
+ meta: '#4D699B',
158
+ },
159
+ {
160
+ id: 'mono-light',
161
+ name: 'Mono',
162
+ family: 'mono',
163
+ variant: 'light',
164
+ canvas: '#FFFFFF',
165
+ paper: '#FAFAFA',
166
+ ink: '#1A1A1A',
167
+ error: '#999999',
168
+ success: '#1A1A1A',
169
+ info: '#595959',
170
+ warning: '#666666',
171
+ meta: '#000000',
172
+ },
173
+ {
174
+ id: 'mono-plus-light',
175
+ name: 'Mono Plus',
176
+ family: 'mono-plus',
177
+ variant: 'light',
178
+ canvas: '#FFFFFF',
179
+ paper: '#FAFAFA',
180
+ ink: '#1A1A1A',
181
+ error: '#8a5a5a',
182
+ success: '#5a7a5a',
183
+ info: '#5a6a8a',
184
+ warning: '#8a7a5a',
185
+ meta: '#4a6a9e',
186
+ },
187
+ {
188
+ id: 'monokai-light',
189
+ name: 'Monokai',
190
+ family: 'monokai',
191
+ variant: 'light',
192
+ canvas: '#FDF8EC',
193
+ paper: '#FBF5E8',
194
+ ink: '#292318',
195
+ error: '#E54B4B',
196
+ success: '#4FB54B',
197
+ info: '#2D9AD7',
198
+ warning: '#F1A948',
199
+ meta: '#BF7BFF',
200
+ },
201
+ {
202
+ id: 'nightowl-light',
203
+ name: 'Night Owl',
204
+ family: 'night-owl',
205
+ variant: 'light',
206
+ canvas: '#FBFBFB',
207
+ paper: '#FFFFFF',
208
+ ink: '#403F53',
209
+ error: '#DE3D3B',
210
+ success: '#2AA298',
211
+ info: '#4876D6',
212
+ warning: '#C96765',
213
+ meta: '#4876D6',
214
+ },
215
+ {
216
+ id: 'nord-light',
217
+ name: 'Nord',
218
+ family: 'nord',
219
+ variant: 'light',
220
+ canvas: '#ECEFF4',
221
+ paper: '#e7ebf5',
222
+ ink: '#2E3440',
223
+ error: '#BF616A',
224
+ success: '#8FBCBB',
225
+ info: '#81A1C1',
226
+ warning: '#D08770',
227
+ meta: '#5E81AC',
228
+ },
229
+ {
230
+ id: 'onedarkpro-light',
231
+ name: 'One Dark Pro',
232
+ family: 'one-dark-pro',
233
+ variant: 'light',
234
+ canvas: '#F5F6F8',
235
+ paper: '#f0f5fa',
236
+ ink: '#2B303B',
237
+ error: '#E06C75',
238
+ success: '#4FA66D',
239
+ info: '#61AFEF',
240
+ warning: '#D19A66',
241
+ meta: '#528BFF',
242
+ },
243
+ {
244
+ id: 'openchamber-light',
245
+ name: 'OpenChamber',
246
+ family: 'openchamber',
247
+ variant: 'light',
248
+ canvas: '#fdfcfa',
249
+ paper: '#f8f7f5',
250
+ ink: '#393a34',
251
+ error: '#b7493f',
252
+ success: '#5f8d3d',
253
+ info: '#2d72c4',
254
+ warning: '#8d6c15',
255
+ meta: '#b35017',
256
+ },
257
+ {
258
+ id: 'solarized-light',
259
+ name: 'Solarized',
260
+ family: 'solarized',
261
+ variant: 'light',
262
+ canvas: '#FDF6E3',
263
+ paper: '#FAF3DC',
264
+ ink: '#586E75',
265
+ error: '#DC322F',
266
+ success: '#859900',
267
+ info: '#2AA198',
268
+ warning: '#B58900',
269
+ meta: '#268BD2',
270
+ },
271
+ {
272
+ id: 'tokyonight-light',
273
+ name: 'Tokyonight',
274
+ family: 'tokyonight',
275
+ variant: 'light',
276
+ canvas: '#E1E2E7',
277
+ paper: '#dee0ee',
278
+ ink: '#273153',
279
+ error: '#C94060',
280
+ success: '#587539',
281
+ info: '#007197',
282
+ warning: '#8C6C3E',
283
+ meta: '#2E7DE9',
284
+ },
285
+ {
286
+ id: 'vesper-light',
287
+ name: 'Vesper',
288
+ family: 'vesper',
289
+ variant: 'light',
290
+ canvas: '#FFFFFF',
291
+ paper: '#f6f5f5',
292
+ ink: '#101010',
293
+ error: '#d46868',
294
+ success: '#109b76',
295
+ info: '#62bced',
296
+ warning: '#cb7f40',
297
+ meta: '#a06535',
298
+ },
299
+ {
300
+ id: 'vitesse-light-light',
301
+ name: 'Vitesse Light',
302
+ family: 'vitesse',
303
+ variant: 'light',
304
+ canvas: '#ffffff',
305
+ paper: '#f7f7f7',
306
+ ink: '#2c2c28',
307
+ error: '#ab5959',
308
+ success: '#1e754f',
309
+ info: '#296aa3',
310
+ warning: '#a65e2b',
311
+ meta: '#1c6b48',
312
+ },
313
+ ] as const satisfies readonly ThemePalette[];
@@ -9,15 +9,22 @@
9
9
  * A BTW topic is an independent question plus its explicit follow-ups, run
10
10
  * against the parent session's context but never appended to its transcript —
11
11
  * the same contract omp's own `/btw` implements in the TUI. The server is the
12
- * source of truth for a session's topics; the panel renders the state it is
13
- * sent and streams answer text through `btw_delta` frames.
12
+ * source of truth for a session's topics: each turn's conversation arrives as
13
+ * `btw_message` frames in the chat's own `ChatMessageData` shape, and the
14
+ * running turn is also carried in `BtwState.live` so a client attaching
15
+ * mid-turn renders the answer already produced.
14
16
  */
15
17
 
18
+ import type { ApprovalMode } from '@/shared/lib/omp/config/access-mode';
19
+ import type { ChatMessageData } from '@/shared/types/chat';
20
+ import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
21
+
16
22
  /** Lifecycle of one question/answer pair inside a topic. */
17
23
  export type BtwTurnStatus = 'running' | 'complete' | 'cancelled' | 'failed' | 'interrupted';
18
24
 
19
25
  /** Model a topic's side conversation runs on — the parent session's model,
20
- * captured when the topic was created (omp's `/btw` uses the active model). */
26
+ * captured when the topic was created (omp's `/btw` uses the active model),
27
+ * then re-targeted by the panel's own model dropdown. */
21
28
  export interface BtwModel {
22
29
  provider: string;
23
30
  id: string;
@@ -29,7 +36,18 @@ export interface BtwModel {
29
36
  export interface BtwTurn {
30
37
  index: number;
31
38
  question: string;
39
+ /** Plain-text answer, kept as the turn's cheap summary (history labels,
40
+ * promotion titles). The rendered conversation is `messages`. */
32
41
  answer: string;
42
+ /**
43
+ * The turn's conversation, in the SAME shape the chat timeline renders
44
+ * (`ChatMessageData`): assistant segments with their thinking, tool calls,
45
+ * usage and errors. Produced by the shared `toChatMessage` mapper, so a side
46
+ * question renders through the chat's own `MessageList` and cannot drift from
47
+ * it — a tool the side child runs is visible here exactly as it would be in
48
+ * the chat.
49
+ */
50
+ messages: ChatMessageData[];
33
51
  status: BtwTurnStatus;
34
52
  createdAt: number;
35
53
  updatedAt: number;
@@ -44,22 +62,83 @@ export interface BtwTopic {
44
62
  createdAt: number;
45
63
  updatedAt: number;
46
64
  model?: BtwModel;
65
+ /**
66
+ * Thinking level the side child runs at, or undefined for omp's own default.
67
+ * The panel's thinking dropdown writes it, and a change is applied with
68
+ * `set_thinking_level` on the live child.
69
+ */
70
+ thinkingLevel?: string;
71
+ /**
72
+ * Tool-approval mode the side child was SPAWNED with. omp exposes no RPC for
73
+ * this, so a change destroys and respawns an idle child — the same reconcile
74
+ * the chat session does (`reconcileSpawnApprovalMode`).
75
+ */
76
+ approvalMode?: ApprovalMode;
47
77
  /** Set once the topic was promoted into the chat as a session of its own. */
48
78
  promotedSessionId?: string;
49
79
  turns: BtwTurn[];
50
80
  }
51
81
 
82
+ /**
83
+ * The turn streaming right now, as the server has accumulated it.
84
+ *
85
+ * Part of the state rather than only a stream of frames: a client that attaches
86
+ * mid-turn (a reload, a second tab) would otherwise receive a `btw_state` whose
87
+ * running turn still has no persisted messages and would show an empty answer
88
+ * while the child streams on. Same reasoning as `dialogs` — the request never
89
+ * comes again, so the state has to carry it.
90
+ */
91
+ export interface BtwLiveTurn {
92
+ topicId: string;
93
+ turnIndex: number;
94
+ /** Chat-shaped conversation so far (thinking, tool calls, prose). */
95
+ messages: ChatMessageData[];
96
+ /** Activity phrase for the panel's indicator; '' before the child reports one. */
97
+ activity: string;
98
+ }
99
+
52
100
  /** A session's whole BTW view. */
53
101
  export interface BtwState {
54
102
  topics: BtwTopic[];
55
103
  /** Topic with a question in flight; at most one per session, because a
56
104
  * session runs one side conversation at a time. */
57
105
  runningTopicId: string | null;
106
+ /** The running turn's live conversation, or null when nothing is in flight. */
107
+ live: BtwLiveTurn | null;
108
+ /**
109
+ * Dialogs a side child is blocked on right now, oldest first. Part of the
110
+ * state rather than its own frame so a reload (or a fresh panel) replays the
111
+ * modal a child is waiting on — omp never re-delivers the request, so a lost
112
+ * one leaves the turn blocked with nothing to answer.
113
+ */
114
+ dialogs: BtwDialog[];
115
+ }
116
+
117
+ /**
118
+ * A dialog the side child is blocked on. The panel renders it with the chat's
119
+ * own `ExtensionDialog`; unlike the chat there is no tool card to host an `ask`
120
+ * inline, so every answerable request is a modal.
121
+ */
122
+ export interface BtwDialog {
123
+ topicId: string;
124
+ request: ExtensionUiDialogRequest;
58
125
  }
59
126
 
60
127
  /** Server → client frames on `/api/btw/:sessionId/*` (WS and SSE alike). */
61
128
  export type BtwFrame =
62
129
  | { type: 'connected'; sessionId: string }
63
130
  | { type: 'btw_state'; state: BtwState }
64
- | { type: 'btw_delta'; topicId: string; turnIndex: number; text: string }
131
+ /**
132
+ * One assistant segment of a turn, in the chat's own `ChatMessageData` shape.
133
+ * The client upserts it into `turn.messages` BY `message.id` — the same
134
+ * semantics the chat stream's `onMessageUpdate` uses, because omp emits one
135
+ * frame per segment carrying that segment's full accumulated content.
136
+ */
137
+ | { type: 'btw_message'; topicId: string; turnIndex: number; message: ChatMessageData }
138
+ /**
139
+ * The activity phrase for the panel's indicator, derived from the side
140
+ * child's own frames (`describeAssistantPhase` / `describeToolActivity`) —
141
+ * never from the chat's, whose run is a different process.
142
+ */
143
+ | { type: 'btw_activity'; topicId: string; verb: string }
65
144
  | { type: 'btw_error'; topicId: string | null; message: string };
@@ -1,4 +1,5 @@
1
1
  export * from '@/shared/types/workspace';
2
+ export * from '@/shared/types/theme';
2
3
  export * from '@/shared/types/fs';
3
4
  export * from '@/shared/types/git';
4
5
  export * from '@/shared/types/chat';
@@ -9,10 +9,17 @@ export interface ProviderModel {
9
9
  /** USD per 1M tokens (unit of measure not obvious from the name alone). */
10
10
  priceInput?: number;
11
11
  priceOutput?: number;
12
+ /** Cache read/write rates, from the models.dev catalog only. */
13
+ priceCacheRead?: number;
14
+ priceCacheWrite?: number;
12
15
  temperature?: number;
13
16
  maxTokens?: number;
14
17
  topP?: number;
15
- reasoningEffort?: 'low' | 'medium' | 'high';
18
+ /**
19
+ * Default reasoning effort written to models.yml `modelOverrides`. Mirrors
20
+ * omp's `EffortSchema` vocabulary.
21
+ */
22
+ reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
16
23
  }
17
24
 
18
25
  export interface ProviderItem {
@@ -1,3 +1,5 @@
1
+ import type { ThemeId } from '@/shared/lib/theme/catalog';
2
+
1
3
  /** Wire protocol for the live agent event stream (chat timeline). */
2
4
  export type StreamTransport = 'websocket' | 'sse';
3
5
 
@@ -35,15 +37,19 @@ export interface SettingsState {
35
37
  showUpdateNotifications: boolean;
36
38
  agentControlTool: boolean;
37
39
  ompChamberWebTool: boolean;
38
- theme: 'paper' | 'contrast' | 'noir' | 'one-dark-pro-soft';
40
+ /** Palette id from the theme catalog (`shared/lib/theme/catalog.ts`). Typed
41
+ * as the catalog's own id union, so a theme dropped from it breaks the build
42
+ * here rather than rendering unstyled at runtime. */
43
+ theme: ThemeId;
39
44
  fontSize: 'compact' | 'standard' | 'comfort';
40
45
  editorFont: string;
41
46
  streamResponses: boolean;
42
47
  streamTransport: StreamTransport;
43
- /** Generate a session title from the first settled run. omp suppresses its
48
+ /** Generate a session title from the first run. omp suppresses its
44
49
  * own auto-titling under `--mode rpc-ui` (PI_NO_TITLE), so without this a
45
- * chamber session keeps its `New Session - <timestamp>` placeholder. A
46
- * user-set name is never overwritten. */
50
+ * chamber session keeps its `New Session - <timestamp>` placeholder. Asked
51
+ * once when the first user message settles, retried once at that run's end;
52
+ * a later run never re-titles it — and a user-set name is never overwritten. */
47
53
  autoSessionTitle: boolean;
48
54
  expandedThinking: boolean;
49
55
  detailedToolCalls: boolean;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ /** Which side of the light/dark split a palette sits on. Drives the
7
+ * `data-theme-variant` attribute, Shiki's dual-theme selector and mermaid. */
8
+ export type ThemeVariant = 'light' | 'dark';
9
+
10
+ /**
11
+ * One theme's chamber-facing colors.
12
+ *
13
+ * Deliberately a flat record of the eight values the chamber actually paints
14
+ * with — OpenChamber's theme files carry ~90 tokens across surfaces, syntax,
15
+ * markdown and tools; carrying all of them would be dead weight here, since the
16
+ * chamber derives everything else from these with `color-mix`.
17
+ */
18
+ export interface ThemePalette {
19
+ /** Stable key written to `app_settings.omp_chamber_settings.theme`. */
20
+ id: string;
21
+ /** Display name, shared by a family's light and dark entries. */
22
+ name: string;
23
+ /** kebab-case family key, for pairing the two variants. */
24
+ family: string;
25
+ variant: ThemeVariant;
26
+ /** App ground behind panels — `--theme-canvas`. */
27
+ canvas: string;
28
+ /** Raised surfaces: cards, sidebars, panels — `--theme-paper`. */
29
+ paper: string;
30
+ /** Foreground text and borders — `--theme-ink`. */
31
+ ink: string;
32
+ /** Failures — `--theme-error`. */
33
+ error: string;
34
+ /** Success states — `--theme-success`. */
35
+ success: string;
36
+ /** Informational states — `--theme-info`. */
37
+ info: string;
38
+ /** Warnings and attention — `--theme-warning`. */
39
+ warning: string;
40
+ /** Accent: renames, merges, badges — `--theme-meta`. */
41
+ meta: string;
42
+ }
43
+
44
+ /** A palette slot rendered as one chip on the appearance card. */
45
+ export interface ThemeSwatch {
46
+ key: 'canvas' | 'paper' | 'ink' | 'error' | 'success' | 'info' | 'warning' | 'meta';
47
+ label: string;
48
+ }