@kabmo-labs/kabmo 0.18.0 → 0.19.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 (191) hide show
  1. package/README.md +10 -7
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/index.js +475 -474
  4. package/dist/client/static/js/{index-tc09dtca.js → index-fcee4c13.js} +766 -765
  5. package/dist/client/static/js/index-sxdw908m.css +1 -0
  6. package/marketplace/plugins/command-runner/package.json +3 -2
  7. package/marketplace/plugins/git-forge/package.json +3 -2
  8. package/marketplace/plugins/session-info/package.json +3 -2
  9. package/marketplace/plugins/stats/package.json +3 -2
  10. package/package.json +3 -1
  11. package/src/client/components/auth/login-screen/index.tsx +2 -1
  12. package/src/client/components/common/ComposerPicker.tsx +1 -1
  13. package/src/client/components/common/FolderPicker.tsx +2 -2
  14. package/src/client/components/common/Modal.tsx +2 -2
  15. package/src/client/components/common/PWAInstallButton.tsx +2 -2
  16. package/src/client/components/common/ViewportSelector.tsx +1 -1
  17. package/src/client/components/common/anchored-menu/index.tsx +5 -1
  18. package/src/client/components/common/batch-selection/SelectionCheckbox.tsx +2 -1
  19. package/src/client/components/common/brand-wordmark/index.test.tsx +13 -2
  20. package/src/client/components/common/brand-wordmark/index.tsx +13 -2
  21. package/src/client/components/common/checkbox/style.test.ts +139 -0
  22. package/src/client/components/common/checkbox/style.ts +51 -0
  23. package/src/client/components/common/context-usage-button/index.tsx +2 -2
  24. package/src/client/components/common/file-icon/index.tsx +23 -9
  25. package/src/client/components/common/header-controls/MoreMenu.tsx +1 -1
  26. package/src/client/components/common/markdown-review/ReviewPopover.tsx +1 -1
  27. package/src/client/components/common/panel-mark/index.tsx +97 -0
  28. package/src/client/components/common/provider-icon/glyphs.test.ts +1 -1
  29. package/src/client/components/common/provider-icon/index.test.ts +14 -0
  30. package/src/client/components/common/provider-icon/index.tsx +4 -0
  31. package/src/client/components/common/provider-icon/resolve.test.ts +8 -7
  32. package/src/client/components/common/provider-icon/resolve.ts +16 -3
  33. package/src/client/components/common/session-actions-menu/index.tsx +1 -1
  34. package/src/client/components/common/toolbar-row/index.tsx +1 -1
  35. package/src/client/components/layout/ActivityBar.tsx +22 -3
  36. package/src/client/components/layout/LeftDock.tsx +9 -2
  37. package/src/client/components/layout/PanelVisibilityMenu.tsx +1 -1
  38. package/src/client/components/layout/WindowAura.tsx +27 -0
  39. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +1 -1
  40. package/src/client/components/layout/desktop-layout/TopNavbar.tsx +2 -2
  41. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +11 -2
  42. package/src/client/components/layout/desktop-layout/index.tsx +3 -1
  43. package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +3 -3
  44. package/src/client/components/layout/session-sidebar/Header.tsx +1 -1
  45. package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
  46. package/src/client/components/layout/session-sidebar/Toolbar.tsx +1 -1
  47. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +2 -2
  48. package/src/client/components/layout/session-sidebar/modern/ActionRow.tsx +1 -1
  49. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +13 -5
  50. package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +2 -2
  51. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +2 -1
  52. package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +2 -2
  53. package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
  54. package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
  55. package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +1 -1
  56. package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +1 -1
  57. package/src/client/components/mobile/panel-chips.tsx +10 -2
  58. package/src/client/components/settings/Modal.tsx +4 -4
  59. package/src/client/components/settings/ProjectSelectorDropdown.tsx +2 -2
  60. package/src/client/components/settings/apply-side-effects.test.ts +30 -0
  61. package/src/client/components/settings/apply-side-effects.ts +14 -0
  62. package/src/client/components/settings/categories/AppearanceSettings.tsx +6 -0
  63. package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +2 -1
  64. package/src/client/components/settings/categories/appearance-settings/EditorTypingSection.tsx +2 -1
  65. package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +144 -0
  66. package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.test.tsx +120 -0
  67. package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +180 -0
  68. package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +2 -1
  69. package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +2 -2
  70. package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +1 -1
  71. package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +1 -1
  72. package/src/client/components/settings/categories/panel-plugins/BuiltinList.tsx +21 -3
  73. package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +1 -1
  74. package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +51 -2
  75. package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +43 -10
  76. package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +2 -1
  77. package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +2 -1
  78. package/src/client/components/settings/categories/project-settings/ModelDropdown.tsx +1 -1
  79. package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -1
  80. package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +2 -2
  81. package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +3 -2
  82. package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +2 -2
  83. package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +3 -2
  84. package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +2 -1
  85. package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +1 -1
  86. package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
  87. package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +2 -2
  88. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +3 -3
  89. package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +2 -2
  90. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +1 -1
  91. package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +4 -3
  92. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +1 -1
  93. package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +1 -1
  94. package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +2 -2
  95. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -1
  96. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +1 -1
  97. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +2 -6
  98. package/src/client/components/workspace/context-panel/CostBreakdownPopover.tsx +1 -1
  99. package/src/client/components/workspace/diff-panel/index.tsx +2 -2
  100. package/src/client/components/workspace/editor/PluginRail.tsx +1 -1
  101. package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +2 -2
  102. package/src/client/components/workspace/editor/TabContextMenu.tsx +1 -1
  103. package/src/client/components/workspace/editor/Tabs.tsx +1 -1
  104. package/src/client/components/workspace/file-explorer/ContextMenu.tsx +1 -1
  105. package/src/client/components/workspace/file-explorer/Modals.tsx +10 -10
  106. package/src/client/components/workspace/file-explorer/RootMenu.tsx +1 -1
  107. package/src/client/components/workspace/git-panel/BranchToolbar.test.tsx +130 -0
  108. package/src/client/components/workspace/git-panel/BranchToolbar.tsx +21 -11
  109. package/src/client/components/workspace/git-panel/CommitBox.tsx +2 -1
  110. package/src/client/components/workspace/git-panel/Modals.tsx +2 -2
  111. package/src/client/components/workspace/git-panel/StashSection.tsx +2 -1
  112. package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -1
  113. package/src/client/components/workspace/git-panel/branch-modal/RenameDialog.tsx +2 -1
  114. package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -2
  115. package/src/client/components/workspace/git-panel/index.tsx +7 -0
  116. package/src/client/components/workspace/model-dropdown/Panel.tsx +1 -1
  117. package/src/client/components/workspace/model-dropdown/SpecsTooltip.tsx +1 -1
  118. package/src/client/components/workspace/plugin-panel/catalog.tsx +7 -0
  119. package/src/client/components/workspace/plugin-panel/resolve.tsx +4 -0
  120. package/src/client/components/workspace/search-panel/Body.tsx +1 -1
  121. package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +1 -1
  122. package/src/client/glass.css +785 -0
  123. package/src/client/glass.test.ts +346 -0
  124. package/src/client/hooks/ui/glass-support.ts +57 -0
  125. package/src/client/hooks/ui/icon-style.ts +59 -0
  126. package/src/client/hooks/ui/stuck-header.test.ts +188 -0
  127. package/src/client/hooks/ui/stuck-header.ts +91 -0
  128. package/src/client/hooks/ui/style-attributes.test.ts +120 -0
  129. package/src/client/hooks/ui/surface-style.ts +56 -0
  130. package/src/client/hooks/workspace/panel-hues.ts +23 -0
  131. package/src/client/main.tsx +10 -0
  132. package/src/client/tailwind.css +264 -11
  133. package/src/server/lib/assets/shell-attributes.server.ts +80 -0
  134. package/src/server/lib/assets/shell-attributes.test.ts +86 -0
  135. package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +1 -0
  136. package/src/server/lib/omp/rpc/frame-fold-signals.test.ts +2 -30
  137. package/src/server/lib/omp/rpc/frame-fold.test.ts +55 -0
  138. package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
  139. package/src/server/lib/omp/rpc/manager.ts +2 -2
  140. package/src/server/lib/omp/rpc/process-helpers.ts +11 -0
  141. package/src/server/lib/omp/rpc/process.test.ts +106 -0
  142. package/src/server/lib/omp/rpc/process.ts +28 -4
  143. package/src/server/lib/omp/rpc/run-settle.server.ts +12 -0
  144. package/src/server/lib/omp/rpc/run-settle.test.ts +22 -0
  145. package/src/server/lib/omp/rpc/session-command-guards.ts +5 -0
  146. package/src/server/lib/omp/rpc/session-commands.test.ts +9 -1
  147. package/src/server/lib/omp/rpc/session-commands.ts +11 -0
  148. package/src/server/lib/omp/rpc/terminal-settle.ts +29 -7
  149. package/src/server/lib/panels/bundled-catalog.server.ts +1 -0
  150. package/src/server/lib/panels/manifest.test.ts +20 -0
  151. package/src/server/lib/panels/manifest.ts +12 -0
  152. package/src/server/lib/panels/scan.server.ts +4 -0
  153. package/src/server/lib/queue/delivery-dispatch.server.test.ts +48 -0
  154. package/src/server/lib/queue/delivery-harness.ts +8 -4
  155. package/src/server/lib/queue/delivery.server.test.ts +29 -0
  156. package/src/server/lib/queue/delivery.server.ts +39 -0
  157. package/src/server/lib/queue/store.server.test.ts +22 -2
  158. package/src/server/lib/queue/store.server.ts +33 -11
  159. package/src/server/plugins/ssr.ts +22 -5
  160. package/src/shared/lib/icons/file-brand-color.ts +38 -0
  161. package/src/shared/lib/icons/icon-paint-css.test.ts +234 -0
  162. package/src/shared/lib/icons/icon-paint-css.ts +284 -0
  163. package/src/shared/lib/icons/icon-paint-panel.ts +100 -0
  164. package/src/shared/lib/icons/tint-hues.generated.ts +230 -0
  165. package/src/shared/lib/icons/tint.test.ts +273 -0
  166. package/src/shared/lib/icons/tint.ts +219 -0
  167. package/src/shared/lib/models/provider/brand-color.test.ts +116 -0
  168. package/src/shared/lib/models/provider/brand-color.ts +103 -0
  169. package/src/shared/lib/omp/rpc/frame.test.ts +65 -0
  170. package/src/shared/lib/omp/rpc/frame.ts +58 -3
  171. package/src/shared/lib/settings/defaults.ts +4 -0
  172. package/src/shared/lib/theme/catalog.test.ts +5 -4
  173. package/src/shared/lib/theme/catalog.ts +18 -3
  174. package/src/shared/lib/theme/glass-support.test.ts +38 -0
  175. package/src/shared/lib/theme/glass-support.ts +73 -0
  176. package/src/shared/lib/theme/icon-style.test.ts +74 -0
  177. package/src/shared/lib/theme/icon-style.ts +90 -0
  178. package/src/shared/lib/theme/legibility.ts +91 -0
  179. package/src/shared/lib/theme/palettes/dark-extended.ts +152 -0
  180. package/src/shared/lib/theme/palettes/light-extended.ts +157 -0
  181. package/src/shared/lib/theme/surface-style.test.ts +68 -0
  182. package/src/shared/lib/theme/surface-style.ts +91 -0
  183. package/src/shared/lib/theme/theme.test.ts +11 -7
  184. package/src/shared/lib/workspace/panel-hues.test.ts +68 -0
  185. package/src/shared/lib/workspace/panel-hues.ts +57 -0
  186. package/src/shared/types/panels-registry.ts +6 -0
  187. package/src/shared/types/panels.ts +14 -0
  188. package/src/shared/types/settings/state.ts +26 -0
  189. package/src/test-support/fake-omp-frames.ts +163 -0
  190. package/dist/client/static/js/index-hp75vsv9.css +0 -1
  191. /package/src/{client/components/common/file-icon/brand-paths.ts → shared/lib/icons/file-brand-paths.ts} +0 -0
@@ -0,0 +1,219 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The colour every FUNCTIONAL glyph is painted in, in `color` mode.
8
+ *
9
+ * Lucide draws each icon as a stroke in `currentColor`, so "full colour" for a
10
+ * functional glyph can only mean a TINT — there is no second artwork to swap in.
11
+ * Two rules decide which tint, and they answer different questions:
12
+ *
13
+ * - **A signal icon means something, so it takes the palette's signal colour**
14
+ * ({@link ICON_TINTS}): a trash can is destructive, a check is a confirmation,
15
+ * a clock is waiting, an info dot is information. Those colours already exist
16
+ * in every palette, and a themed `--theme-error` follows the user's theme the
17
+ * way a literal red cannot.
18
+ * - **Every other icon gets its OWN hue** ({@link ICON_HUES}, generated). One
19
+ * shared accent for the remaining two hundred glyphs is the failure mode this
20
+ * avoids: a mode that colours a dozen icons and leaves the rest identical is
21
+ * not "full colour", it is one colour. The hue comes from a stable hash of the
22
+ * name, quantised to a 36-step wheel, so two neighbouring icons differ without
23
+ * the table being 250 hand-picked decisions.
24
+ *
25
+ * Both are DEFAULT paint, never an override: the stylesheet wraps every selector
26
+ * in `:where()`, so a `text-*` class a caller wrote on the element still wins
27
+ * (see `icon-paint-css.ts`).
28
+ *
29
+ * Keys are the names the code IMPORTS (`Trash2`), not the emitted class, so a
30
+ * row is checkable against the call site it describes; {@link lucideClassName}
31
+ * is the single translation to `lucide-trash-2`.
32
+ */
33
+
34
+ import { ICON_HUES } from '@/shared/lib/icons/tint-hues.generated';
35
+
36
+ export type IconTintRole = 'error' | 'success' | 'warning' | 'info';
37
+
38
+ /** The CSS value each role paints. Tokens only — never a hex. */
39
+ export const ICON_TINT_TOKENS: Readonly<Record<IconTintRole, string>> = {
40
+ error: 'var(--theme-error)',
41
+ success: 'var(--theme-success)',
42
+ warning: 'var(--theme-warning)',
43
+ info: 'var(--theme-info)',
44
+ };
45
+
46
+ /**
47
+ * Saturation and lightness the generated hues are painted with, per variant.
48
+ *
49
+ * These two pairs are the whole legibility budget: measured against every light
50
+ * palette, `60% 30%` keeps its worst hue at 3.46:1 (the floor is 3:1 for a
51
+ * graphic) even on `tokyonight-light`'s `#dee0ee` paper, and `65% 70%` keeps the
52
+ * worst dark hue at 4.07:1 on `jetbrains-dark`'s `#2B2D30`. A lighter light
53
+ * value (34%) drops two hues below the floor, which is why it is not "prettier".
54
+ */
55
+ export const ICON_HUE_PAINT = {
56
+ light: { saturation: 60, lightness: 30 },
57
+ dark: { saturation: 65, lightness: 70 },
58
+ } as const;
59
+
60
+ /** The hue an icon with no row keeps — a neutral blue, never a sixth signal. */
61
+ export const DEFAULT_ICON_HUE = 210;
62
+
63
+ /** One hue as a paintable `hsl()`. The single place the numbers become CSS. */
64
+ export function iconHueColor(hue: number, variant: 'light' | 'dark'): string {
65
+ const { saturation, lightness } = ICON_HUE_PAINT[variant];
66
+ return `hsl(${hue} ${saturation}% ${lightness}%)`;
67
+ }
68
+
69
+ /** The paint rule's value: the hue left to the custom property the class sets. */
70
+ export function iconHuePaint(variant: 'light' | 'dark'): string {
71
+ const { saturation, lightness } = ICON_HUE_PAINT[variant];
72
+ return `hsl(var(--icon-hue, ${DEFAULT_ICON_HUE}) ${saturation}% ${lightness}%)`;
73
+ }
74
+
75
+ /** Glyph name → the signal it stands for. Everything else gets a generated hue. */
76
+ export const ICON_TINTS: Readonly<Record<string, IconTintRole>> = {
77
+ // Failures, destructive actions, and things that are broken.
78
+ AlertCircle: 'error',
79
+ AlertTriangle: 'error',
80
+ Ban: 'error',
81
+ Bug: 'error',
82
+ BugOff: 'error',
83
+ CircleAlert: 'error',
84
+ CircleSlash: 'error',
85
+ FileWarning: 'error',
86
+ FileX: 'error',
87
+ OctagonAlert: 'error',
88
+ OctagonX: 'error',
89
+ PackageX: 'error',
90
+ ShieldAlert: 'error',
91
+ Trash2: 'error',
92
+ XCircle: 'error',
93
+
94
+ // Confirmations and healthy state.
95
+ Check: 'success',
96
+ CheckCheck: 'success',
97
+ CheckCircle2: 'success',
98
+ CheckSquare: 'success',
99
+ PackageCheck: 'success',
100
+ ShieldCheck: 'success',
101
+
102
+ // A file whose VIEWER is the point: the hue is what tells a reader at a
103
+ // glance that the document opens as something other than source text. These
104
+ // carried fixed hexes before the mode existed, which made them the only icons
105
+ // that ignored it.
106
+ Braces: 'warning',
107
+ FileArchive: 'warning',
108
+ FileSpreadsheet: 'success',
109
+ FileType: 'warning',
110
+
111
+ // Attention: something is pending, scheduled or in flight.
112
+ Bell: 'warning',
113
+ Calendar: 'warning',
114
+ CalendarRange: 'warning',
115
+ Clock: 'warning',
116
+ Clock3: 'warning',
117
+ Hourglass: 'warning',
118
+
119
+ // Information, help and reading.
120
+ BookOpen: 'info',
121
+ CircleQuestionMark: 'info',
122
+ Compass: 'info',
123
+ HelpCircle: 'info',
124
+ Info: 'info',
125
+ };
126
+
127
+ /**
128
+ * `Trash2` -> `trash-2`: the class Lucide emits for that component.
129
+ *
130
+ * Lucide names the class from the icon's own canonical name and adds one per
131
+ * alias, so a legacy import name (`Trash2`, `AlertTriangle`) still matches its
132
+ * own class — which is why this conversion is enough and the table can stay in
133
+ * the vocabulary of the call sites.
134
+ */
135
+ export function kebabIconName(name: string): string {
136
+ return name
137
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
138
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
139
+ .replace(/([a-zA-Z])([0-9])/g, '$1-$2')
140
+ .toLowerCase();
141
+ }
142
+
143
+ /** The class Lucide puts on the `<svg>` for an imported icon name. */
144
+ export function lucideClassName(name: string): string {
145
+ return `lucide-${kebabIconName(name)}`;
146
+ }
147
+
148
+ /** The signal role for an imported icon name, or `null` when it has none. */
149
+ export function iconTintRole(name: string): IconTintRole | null {
150
+ return ICON_TINTS[name] ?? null;
151
+ }
152
+
153
+ /** The generated hue for an imported icon name. */
154
+ export function iconHue(name: string): number {
155
+ return ICON_HUES[name] ?? DEFAULT_ICON_HUE;
156
+ }
157
+
158
+ /** The wheel the hashes land on: 36 hues, 10° apart. */
159
+ export const HUE_STEPS = 36;
160
+
161
+ /**
162
+ * The hue of anything that is not in the generated table — a plugin's mark.
163
+ *
164
+ * Plugin names arrive at RUNTIME, so they cannot be baked into a table: the
165
+ * manifest is read from disk and a marketplace install adds rows no build could
166
+ * have seen. The hue is therefore computed here, with the SAME function that
167
+ * produced every generated row (`scripts/icon-tints.mjs`, asserted equal in
168
+ * `tint.test.ts`), so a plugin's colour sits on the same wheel as the glyphs
169
+ * around it instead of inventing a second palette.
170
+ *
171
+ * FNV-1a, 36 steps of 10°: stable across runs and platforms, which a colour for
172
+ * stored data has to be.
173
+ */
174
+ export function hashHue(name: string): number {
175
+ let hash = 2166136261 >>> 0;
176
+ for (const char of name) {
177
+ hash ^= char.codePointAt(0) ?? 0;
178
+ hash = Math.imul(hash, 16777619) >>> 0;
179
+ }
180
+ return (hash % HUE_STEPS) * (360 / HUE_STEPS);
181
+ }
182
+
183
+ /**
184
+ * One hue per PANEL, with collisions resolved.
185
+ *
186
+ * A rail draws ~14 marks and the wheel has 36 slots, so a plain hash collides
187
+ * about nine times in ten (birthday bound) — measured on the right rail: three
188
+ * of its fourteen icons landed on the same blue, which is the opposite of "each
189
+ * icon has its own colour". Panels are a KNOWN, stable set per rail, so the
190
+ * collision can be resolved deterministically: sort the ids, take each hash, and
191
+ * probe forward 10° at a time until the slot is free. Sorting makes the answer
192
+ * independent of the catalog's order, so reordering a rail never recolours it.
193
+ *
194
+ * A plugin and a built-in compete in the same space on purpose: they sit in one
195
+ * bar, and two neighbours in the same hue is the defect this avoids.
196
+ */
197
+ export function assignPanelHues(ids: readonly string[]): Map<string, number> {
198
+ const hues = new Map<string, number>();
199
+ const taken = new Set<number>();
200
+ for (const id of [...ids].sort()) {
201
+ let hue = hashHue(id);
202
+ for (let step = 0; step < HUE_STEPS && taken.has(hue); step += 1) {
203
+ hue = (hue + 360 / HUE_STEPS) % 360;
204
+ }
205
+ taken.add(hue);
206
+ hues.set(id, hue);
207
+ }
208
+ return hues;
209
+ }
210
+
211
+ /** Signal rows, as `{ className, role }`, for the stylesheet generator. */
212
+ export const ICON_TINT_ROWS: ReadonlyArray<{ className: string; role: IconTintRole }> = Object.entries(
213
+ ICON_TINTS,
214
+ ).map(([name, role]) => ({ className: lucideClassName(name), role }));
215
+
216
+ /** Generated-hue rows, as `{ className, hue }`, for the stylesheet generator. */
217
+ export const ICON_HUE_ROWS: ReadonlyArray<{ className: string; hue: number }> = Object.entries(ICON_HUES).map(
218
+ ([name, hue]) => ({ className: lucideClassName(name), hue }),
219
+ );
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The brand-colour table's promises: nothing in it is illegible on any palette
8
+ * this build ships, and every row names a glyph that can actually be drawn.
9
+ *
10
+ * Contrast is recomputed from `THEMES`, not from one hardcoded surface — the
11
+ * worst light paper is `tokyonight-light`'s `#dee0ee` and the worst dark one
12
+ * `jetbrains-dark`'s `#2B2D30`, and neither is guessable from the shipped
13
+ * default palette.
14
+ */
15
+
16
+ import { describe, expect, test } from 'bun:test';
17
+ import { BRAND_COLORS, brandColorFor } from '@/shared/lib/models/provider/brand-color';
18
+ import { PROVIDER_GLYPHS } from '@/client/components/common/provider-icon/glyphs';
19
+ import { THEMES } from '@/shared/lib/theme/catalog';
20
+ import {
21
+ BRAND_CONTRAST_FLOOR,
22
+ contrastRatio,
23
+ isNearMonochrome,
24
+ legiblePair,
25
+ worstSurfaceContrast,
26
+ } from '@/shared/lib/theme/legibility';
27
+
28
+ const rows = Object.entries(BRAND_COLORS);
29
+ const HEX = /^#[0-9a-f]{6}$/i;
30
+
31
+ describe('the brand colours', () => {
32
+ test('there are rows to check', () => {
33
+ expect(rows.length).toBeGreaterThan(20);
34
+ });
35
+
36
+ test('every light value clears the floor on EVERY light palette', () => {
37
+ for (const [name, entry] of rows) {
38
+ expect(worstSurfaceContrast(entry.light, 'light'), `${name} light ${entry.light}`).toBeGreaterThanOrEqual(
39
+ BRAND_CONTRAST_FLOOR,
40
+ );
41
+ }
42
+ });
43
+
44
+ test('every dark value clears the floor on EVERY dark palette', () => {
45
+ for (const [name, entry] of rows) {
46
+ if (entry.dark === null) continue;
47
+ expect(worstSurfaceContrast(entry.dark, 'dark'), `${name} dark ${entry.dark}`).toBeGreaterThanOrEqual(
48
+ BRAND_CONTRAST_FLOOR,
49
+ );
50
+ }
51
+ });
52
+
53
+ test('the shipped values are the ones the shared rule derives', () => {
54
+ // One algorithm, not a hand-typed pair: a row that disagreed with
55
+ // `legiblePair` would be a second convention for the same job.
56
+ for (const [name, entry] of rows) {
57
+ expect(entry, name).toEqual({ base: entry.base, ...legiblePair(entry.base) });
58
+ }
59
+ });
60
+
61
+ test('a monochrome brand has no dark value, a chromatic one always does', () => {
62
+ for (const [name, entry] of rows) {
63
+ expect(entry.dark === null, `${name} (${entry.base})`).toBe(isNearMonochrome(entry.base));
64
+ }
65
+ });
66
+
67
+ test('every value is a 6-digit colour', () => {
68
+ for (const [name, entry] of rows) {
69
+ expect(entry.base, name).toMatch(HEX);
70
+ expect(entry.light, name).toMatch(HEX);
71
+ if (entry.dark !== null) expect(entry.dark, name).toMatch(HEX);
72
+ }
73
+ });
74
+
75
+ test('every row names a glyph this build can actually draw', () => {
76
+ for (const name of Object.keys(BRAND_COLORS)) {
77
+ expect(PROVIDER_GLYPHS[name], `${name} has no glyph`).toBeDefined();
78
+ }
79
+ });
80
+
81
+ test('a light value is the brand hex or a darker mix of it, never another hue', () => {
82
+ for (const [name, entry] of rows) {
83
+ if (entry.light === entry.base) continue;
84
+ // Mixed toward black: the light value is never brighter than the base.
85
+ expect(contrastRatio(entry.light, '#ffffff'), name).toBeGreaterThanOrEqual(
86
+ contrastRatio(entry.base, '#ffffff'),
87
+ );
88
+ }
89
+ });
90
+ });
91
+
92
+ describe('brandColorFor', () => {
93
+ test('answers the derived pair for each variant', () => {
94
+ // Pinned: these two numbers are what the shared rule produces for Claude,
95
+ // so a change in the mixer shows up here rather than in a screenshot.
96
+ expect(brandColorFor('claude', 'light')).toBe('#b8654a');
97
+ expect(brandColorFor('claude', 'dark')).toBe('#D97757');
98
+ });
99
+
100
+ test('a monochrome brand answers null on dark, which the caller paints in ink', () => {
101
+ expect(brandColorFor('openai', 'light')).toBeNull();
102
+ expect(brandColorFor('cursor', 'dark')).toBeNull();
103
+ });
104
+
105
+ test('a provider with no row keeps the ink in both modes', () => {
106
+ expect(brandColorFor('my-private-gateway', 'light')).toBeNull();
107
+ expect(brandColorFor(null, 'dark')).toBeNull();
108
+ });
109
+ });
110
+
111
+ describe('the palette the rule measures against', () => {
112
+ test('both variants are represented, so a worst case cannot be vacuous', () => {
113
+ expect(THEMES.some((theme) => theme.variant === 'light')).toBe(true);
114
+ expect(THEMES.some((theme) => theme.variant === 'dark')).toBe(true);
115
+ });
116
+ });
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The brand colour of every provider mark Kabmo can draw in colour.
8
+ *
9
+ * **The table holds the brand's OWN hex, and nothing else.** The two values that
10
+ * get painted are derived by {@link legiblePair}, against the palettes this
11
+ * build actually ships, so there is no hand-maintained pair to drift from the
12
+ * rule: measured, `claude`'s `#D97757` reads 2.38:1 on `tokyonight-light`'s
13
+ * paper (`#dee0ee`) and 4.42:1 on `jetbrains-dark`'s (`#2B2D30`), so one hex
14
+ * cannot be legible on both halves and a second value has to exist — but it is
15
+ * computed, not typed.
16
+ *
17
+ * **A near-monochrome brand has no dark value** (`dark: null`): `#000000` mixed
18
+ * toward white lands on grey, which is indistinguishable from the ink it was
19
+ * meant to replace while claiming to be a brand colour. Those brands are drawn
20
+ * in the theme's ink instead — the same answer the reference implementation
21
+ * gives with `filter: invert()`.
22
+ *
23
+ * **Sources.** `simple-icons`' hex for the brand that owns the glyph, matched
24
+ * through its alias list because the slug and Kabmo's glyph name differ
25
+ * (`mistralai`/`mistral`, `googlegemini`/`gemini`, `x`/`xai`). A glyph with no
26
+ * row — 38 of the 73 in `provider-icon/glyphs.ts` — publishes no colour, and
27
+ * keeps the palette ink in both modes. That is the honest half of the feature:
28
+ * `color` means "brand colour where one exists", never "every mark is
29
+ * chromatic".
30
+ *
31
+ * These are third-party trademarks, used here to identify the provider each one
32
+ * belongs to. They are not covered by this project's licence.
33
+ */
34
+
35
+ import { legiblePair } from '@/shared/lib/theme/legibility';
36
+
37
+ /** The brand's own hex, per glyph name in `provider-icon/glyphs.ts`. */
38
+ const BRAND_BASES: Readonly<Record<string, string>> = {
39
+ alibaba: '#FF6A00',
40
+ anthropic: '#191919',
41
+ apple: '#000000',
42
+ baidu: '#2932E1',
43
+ claude: '#D97757',
44
+ cline: '#18181B',
45
+ cloudflare: '#F38020',
46
+ cursor: '#000000',
47
+ deepseek: '#5786FE',
48
+ gemini: '#8E75B2',
49
+ geminicli: '#8E75B2',
50
+ githubcopilot: '#000000',
51
+ gitlab: '#FC6D26',
52
+ google: '#4285F4',
53
+ huggingface: '#FFD21E',
54
+ kagi: '#FFB319',
55
+ kimi: '#000000',
56
+ lmstudio: '#000000',
57
+ meta: '#0467DF',
58
+ metaai: '#9844FF',
59
+ minimax: '#E73562',
60
+ mistral: '#FA520F',
61
+ moonshot: '#000000',
62
+ nvidia: '#76B900',
63
+ ollama: '#000000',
64
+ opencode: '#000000',
65
+ openrouter: '#94A3B8',
66
+ perplexity: '#1FB8CD',
67
+ qwen: '#6950EF',
68
+ stencil: '#5530FF',
69
+ vercel: '#000000',
70
+ vertexai: '#4285F4',
71
+ vllm: '#30A2FF',
72
+ xai: '#000000',
73
+ xiaomi: '#FF6900',
74
+ };
75
+
76
+ export interface BrandColor {
77
+ /** The brand's own hex, as published. Provenance and documentation. */
78
+ base: string;
79
+ /** Legible on every light palette; `null` means "use the theme ink". */
80
+ light: string;
81
+ /** Legible on every dark palette; `null` means "use the theme ink". */
82
+ dark: string | null;
83
+ }
84
+
85
+ /** Every row, with its two painted values derived from `base`. */
86
+ export const BRAND_COLORS: Readonly<Record<string, BrandColor>> = Object.fromEntries(
87
+ Object.entries(BRAND_BASES).map(([name, base]) => [name, { base, ...legiblePair(base) }]),
88
+ );
89
+
90
+ /**
91
+ * The colour a mark is painted in for one variant, or `null` when it should
92
+ * keep the surrounding ink.
93
+ *
94
+ * `null` covers both "no brand colour published" and "the brand is black", so a
95
+ * caller never has to distinguish them: the answer to "what paints this mark"
96
+ * is either a hex or the ink.
97
+ */
98
+ export function brandColorFor(name: string | null | undefined, variant: 'light' | 'dark'): string | null {
99
+ if (!name) return null;
100
+ const entry = BRAND_COLORS[name];
101
+ if (!entry) return null;
102
+ return variant === 'dark' ? entry.dark : entry.light;
103
+ }
@@ -240,3 +240,68 @@ describe('RpcFrameDecoder — sequence bookkeeping', () => {
240
240
  expect(decoder.push({ type: 'ready' })).toEqual({ type: 'ready' });
241
241
  });
242
242
  });
243
+
244
+ describe('RpcFrameDecoder — ceilings advertised in ready', () => {
245
+ test('a smaller reassembly ceiling rejects a chunk above it', () => {
246
+ const decoder = new RpcFrameDecoder();
247
+ decoder.setLimits({ maxReassembledFrameBytes: 2 * 1024 * 1024 });
248
+ expect(() =>
249
+ decoder.push(chunk({ byteLength: 3 * 1024 * 1024, data: new Uint8Array(1024).fill(65).toBase64() })),
250
+ ).toThrow('invalid RPC chunk metadata');
251
+ });
252
+
253
+ test('a smaller reassembly ceiling caps how many slices one sequence may claim', () => {
254
+ const decoder = new RpcFrameDecoder();
255
+ decoder.setLimits({ maxReassembledFrameBytes: 2 * 1024 * 1024 });
256
+ // 2 MiB / 256 KiB = 8 slices; a ninth cannot exist under that ceiling.
257
+ expect(() =>
258
+ decoder.push(chunk({ count: 9, byteLength: 2 * 1024 * 1024, data: new Uint8Array(1024).fill(65).toBase64() })),
259
+ ).toThrow('invalid RPC chunk metadata');
260
+ });
261
+
262
+ test('a larger frame ceiling makes a formerly chunk-worthy frame too small to chunk', () => {
263
+ const decoder = new RpcFrameDecoder();
264
+ decoder.setLimits({ maxFrameBytes: 4 * 1024 * 1024 });
265
+ expect(() =>
266
+ decoder.push(chunk({ byteLength: 2 * 1024 * 1024, data: new Uint8Array(1024).fill(65).toBase64() })),
267
+ ).toThrow('invalid RPC chunk metadata');
268
+ });
269
+
270
+ test('a zero, negative, fractional or non-numeric ceiling keeps the previous value', () => {
271
+ const decoder = new RpcFrameDecoder();
272
+ decoder.setLimits({ maxFrameBytes: 0, maxReassembledFrameBytes: -1 });
273
+ decoder.setLimits({ maxFrameBytes: Number.NaN, maxReassembledFrameBytes: '8192' });
274
+ decoder.setLimits({ maxFrameBytes: 1.5, maxReassembledFrameBytes: null });
275
+ // Defaults still in force: below 1 MiB is not chunk-worthy, at 1 MiB is.
276
+ expect(() => decoder.push(chunk({ byteLength: MAX_RPC_FRAME_BYTES - 1 }))).toThrow('invalid RPC chunk metadata');
277
+ expect(decoder.push(chunk({ data: new Uint8Array(1024).fill(65).toBase64() }))).toBeUndefined();
278
+ });
279
+ });
280
+
281
+ describe('RpcFrameDecoder — resync after a damaged sequence', () => {
282
+ test('swallows the damaged tail and resumes at the next ordinary frame', () => {
283
+ const decoder = new RpcFrameDecoder();
284
+ expect(decoder.push(chunk({ count: 3, data: new Uint8Array(1024).fill(65).toBase64() }))).toBeUndefined();
285
+ // What `process.ts` does when `push` throws: abandon the sequence, keep the session.
286
+ decoder.resync();
287
+ expect(decoder.push(chunk({ count: 3, index: 2, data: new Uint8Array(1024).fill(65).toBase64() }))).toBeUndefined();
288
+ expect(decoder.push({ type: 'ready' })).toEqual({ type: 'ready' });
289
+ });
290
+
291
+ test('resumes at a new sequence that starts over at index 0', () => {
292
+ const decoder = new RpcFrameDecoder();
293
+ decoder.resync();
294
+ const frame = frameOfBytes(MAX_RPC_FRAME_BYTES + 5_000);
295
+ const records = chunkSequence(frame, 'after-resync');
296
+ for (const record of records.slice(0, -1)) expect(decoder.push(record)).toBeUndefined();
297
+ expect(decoder.push(records.at(-1))).toEqual(frame);
298
+ });
299
+
300
+ test('a malformed frame that is not a chunk still throws', () => {
301
+ // Recovery is scoped to a damaged CHUNK sequence; a line that is not an
302
+ // object at all remains a protocol fault the caller must see.
303
+ const decoder = new RpcFrameDecoder();
304
+ expect(() => decoder.push(42)).toThrow('RPC frame must be an object');
305
+ expect(() => decoder.push({ noType: 1 })).toThrow('RPC frame must be an object');
306
+ });
307
+ });
@@ -84,22 +84,77 @@ function concatChunks(chunks: Uint8Array[], byteLength: number): Uint8Array {
84
84
  return merged;
85
85
  }
86
86
 
87
+ export interface RpcTransportLimits {
88
+ /** Largest physical stdout line, newline included. */
89
+ maxFrameBytes: number;
90
+ /** Largest logical frame the server will reassemble from chunks. */
91
+ maxReassembledBytes: number;
92
+ }
93
+
94
+ /** The documented defaults, used until a `ready` frame says otherwise. */
95
+ const DEFAULT_LIMITS: RpcTransportLimits = {
96
+ maxFrameBytes: MAX_RPC_FRAME_BYTES,
97
+ maxReassembledBytes: MAX_RPC_REASSEMBLED_BYTES,
98
+ };
99
+
87
100
  /** Decodes complete logical frames from parsed JSONL records. */
88
101
  export class RpcFrameDecoder {
89
102
  private pending: PendingChunks | undefined;
103
+ /** Set by `resync()`: swallow chunk records until a sequence starts over. */
104
+ private discarding = false;
105
+ private limits: RpcTransportLimits = { ...DEFAULT_LIMITS };
106
+
107
+ /**
108
+ * Adopt the ceilings the server advertised in `ready`.
109
+ *
110
+ * They are the server's own transport contract and may change without a
111
+ * protocol bump, so the decoder validates chunks against the advertised
112
+ * values rather than against the constants this module was compiled with.
113
+ */
114
+ setLimits(advertised: { maxFrameBytes?: unknown; maxReassembledFrameBytes?: unknown }): void {
115
+ const frameBytes = advertised.maxFrameBytes;
116
+ const reassembledBytes = advertised.maxReassembledFrameBytes;
117
+ this.limits = {
118
+ maxFrameBytes: isSafeInteger(frameBytes) && frameBytes > 0 ? frameBytes : this.limits.maxFrameBytes,
119
+ maxReassembledBytes:
120
+ isSafeInteger(reassembledBytes) && reassembledBytes > 0 ? reassembledBytes : this.limits.maxReassembledBytes,
121
+ };
122
+ }
123
+
124
+ /**
125
+ * Drop a damaged chunk sequence and keep reading.
126
+ *
127
+ * Chunk sequences are written without interruption, so the next ordinary
128
+ * frame — or the next sequence's `index: 0` — marks the end of the damage.
129
+ * The logical frame that was in flight is LOST: the caller reports that to
130
+ * the operator instead of killing the child, because a whole session (its
131
+ * LSP children, its prewarm slot) is not a fair price for one event.
132
+ */
133
+ resync(): void {
134
+ this.pending = undefined;
135
+ this.discarding = true;
136
+ }
90
137
 
91
138
  push(value: unknown): RpcFrameRecord | undefined {
92
139
  if (!isRecord(value) || value.type !== 'rpc_chunk') {
93
- if (this.pending) throw new Error('RPC chunk sequence interrupted');
140
+ if (this.pending && !this.discarding) throw new Error('RPC chunk sequence interrupted');
141
+ this.pending = undefined;
142
+ this.discarding = false;
94
143
  if (!isRecord(value) || typeof value.type !== 'string') throw new Error('RPC frame must be an object');
95
144
  return value as RpcFrameRecord;
96
145
  }
146
+ // Mid-resync: ignore the tail of the damaged sequence. `index: 0` proves a
147
+ // new sequence started, so normal handling resumes with it.
148
+ if (this.discarding && value.index !== 0) return undefined;
149
+ this.discarding = false;
150
+
97
151
  const { chunkId, index, count, byteLength } = value;
152
+ const { maxFrameBytes, maxReassembledBytes } = this.limits;
98
153
  if (
99
154
  typeof chunkId !== 'string' || chunkId.length === 0 || chunkId.length > 128 ||
100
155
  !isSafeInteger(index) || !isSafeInteger(count) || !isSafeInteger(byteLength) ||
101
- index < 0 || count < 2 || count > Math.ceil(MAX_RPC_REASSEMBLED_BYTES / RPC_CHUNK_PAYLOAD_BYTES) ||
102
- index >= count || byteLength < MAX_RPC_FRAME_BYTES || byteLength > MAX_RPC_REASSEMBLED_BYTES
156
+ index < 0 || count < 2 || count > Math.ceil(maxReassembledBytes / RPC_CHUNK_PAYLOAD_BYTES) ||
157
+ index >= count || byteLength < maxFrameBytes || byteLength > maxReassembledBytes
103
158
  ) throw new Error('invalid RPC chunk metadata');
104
159
 
105
160
  const bytes = decodeBase64(value.data);
@@ -24,6 +24,8 @@ import { DEFAULT_CHAT_WIDTH_MODE } from '@/shared/lib/chat/timeline/width-mode';
24
24
  import { DEFAULT_TOOL_RENDER_MODE } from '@/shared/lib/chat/timeline/tool-render-mode';
25
25
  import { DEFAULT_SIDEBAR_STYLE } from '@/shared/lib/workspace/sidebar-style';
26
26
  import { DEFAULT_COMPOSER_STYLE } from '@/shared/lib/chat/composer/style';
27
+ import { DEFAULT_SURFACE_STYLE } from '@/shared/lib/theme/surface-style';
28
+ import { DEFAULT_ICON_STYLE } from '@/shared/lib/theme/icon-style';
27
29
  import { EDITOR_DEFAULT_FONT_FAMILY } from '@/shared/lib/code/editor/typography';
28
30
  import { EDITOR_DEFAULT_THEME_ID } from '@/shared/lib/code/editor/themes';
29
31
 
@@ -41,6 +43,8 @@ export const DEFAULT_SETTINGS = {
41
43
  toolRenderStyle: DEFAULT_TOOL_RENDER_MODE,
42
44
  sidebarStyle: DEFAULT_SIDEBAR_STYLE,
43
45
  composerStyle: DEFAULT_COMPOSER_STYLE,
46
+ surfaceStyle: DEFAULT_SURFACE_STYLE,
47
+ iconStyle: DEFAULT_ICON_STYLE,
44
48
  followUpBehavior: 'queue',
45
49
  keybindingSend: 'Enter',
46
50
  keybindingNewLine: 'Shift + Enter',
@@ -30,10 +30,11 @@ const COLOR_VALUE = /^(#[0-9a-f]{3}|#[0-9a-f]{6}|#[0-9a-f]{8})$/i;
30
30
 
31
31
  describe('theme catalog', () => {
32
32
  test('ships Kabmo palettes plus every ported variant', () => {
33
- expect(THEMES.length).toBe(45);
34
- // 21 ported light + paper/contrast; 21 ported dark + one-dark-pro-soft.
35
- expect(THEMES.filter((t) => t.variant === 'light').length).toBe(23);
36
- expect(THEMES.filter((t) => t.variant === 'dark').length).toBe(22);
33
+ expect(THEMES.length).toBe(63);
34
+ // 21 ported light (upstream snapshot) + 9 newer light + paper/contrast;
35
+ // 21 ported dark + 9 newer dark + one-dark-pro-soft.
36
+ expect(THEMES.filter((t) => t.variant === 'light').length).toBe(32);
37
+ expect(THEMES.filter((t) => t.variant === 'dark').length).toBe(31);
37
38
  });
38
39
 
39
40
  test('ids are unique and each palette carries a paintable color for every slot', () => {
@@ -17,7 +17,9 @@
17
17
  import type { ThemePalette, ThemeSwatch } from '@/shared/types/theme';
18
18
  import { KABMO_PALETTES } from '@/shared/lib/theme/palettes/kabmo';
19
19
  import { DARK_PALETTES } from '@/shared/lib/theme/palettes/dark';
20
+ import { DARK_EXTENDED_PALETTES } from '@/shared/lib/theme/palettes/dark-extended';
20
21
  import { LIGHT_PALETTES } from '@/shared/lib/theme/palettes/light';
22
+ import { LIGHT_EXTENDED_PALETTES } from '@/shared/lib/theme/palettes/light-extended';
21
23
 
22
24
  /** The shipped default, and the fallback for any id the catalog does not know. */
23
25
  export const DEFAULT_THEME_ID = 'paper';
@@ -30,9 +32,17 @@ export const DEFAULT_THEME_ID = 'paper';
30
32
  export type ThemeId =
31
33
  | (typeof KABMO_PALETTES)[number]['id']
32
34
  | (typeof LIGHT_PALETTES)[number]['id']
33
- | (typeof DARK_PALETTES)[number]['id'];
35
+ | (typeof LIGHT_EXTENDED_PALETTES)[number]['id']
36
+ | (typeof DARK_PALETTES)[number]['id']
37
+ | (typeof DARK_EXTENDED_PALETTES)[number]['id'];
34
38
 
35
- const ALL_PALETTES = [...KABMO_PALETTES, ...LIGHT_PALETTES, ...DARK_PALETTES];
39
+ const ALL_PALETTES = [
40
+ ...KABMO_PALETTES,
41
+ ...LIGHT_PALETTES,
42
+ ...LIGHT_EXTENDED_PALETTES,
43
+ ...DARK_PALETTES,
44
+ ...DARK_EXTENDED_PALETTES,
45
+ ];
36
46
 
37
47
  const BY_ID: Record<string, ThemePalette | undefined> = Object.fromEntries(
38
48
  ALL_PALETTES.map((theme) => [theme.id, theme]),
@@ -50,7 +60,12 @@ const DEFAULT_PALETTE: ThemePalette = KABMO_PALETTES[0];
50
60
  */
51
61
  export const THEMES: readonly ThemePalette[] = (() => {
52
62
  const families = new Map<string, ThemePalette[]>();
53
- for (const palette of [...LIGHT_PALETTES, ...DARK_PALETTES]) {
63
+ for (const palette of [
64
+ ...LIGHT_PALETTES,
65
+ ...DARK_PALETTES,
66
+ ...LIGHT_EXTENDED_PALETTES,
67
+ ...DARK_EXTENDED_PALETTES,
68
+ ]) {
54
69
  const group = families.get(palette.family);
55
70
  if (group) group.push(palette);
56
71
  else families.set(palette.family, [palette]);