Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(desktop): 新建对话页快速开始卡片与顶部 pill 配色跟随主题联动 (#607) (#901)
xxxcc7c27a661e113
diff --git a/apps/desktop/src/renderer/themes/builtin/atom-one-light.ts b/apps/desktop/src/renderer/themes/builtin/atom-one-light.tsindex 0c97a50e3d..ec7caae7c8 100644--- a/apps/desktop/src/renderer/themes/builtin/atom-one-light.ts+++ b/apps/desktop/src/renderer/themes/builtin/atom-one-light.ts@@ -76,6 +76,24 @@ const singletonOverrides = {'agent-actions-rail': BORDER_BG,'ask-checkbox-border': TEXT_TERTIARY,background: SURFACE_BG_HSL,+ // CREATE AGENT 卡片 / 顶部 pill / 分段开关 + composer pill(#607):+ // 卡片底与 surface 同值收敛(模板惯例),icon 圆底用 CHIP,send 走 tier1 反相 CTA。+ 'create-agent-control-bg': SURFACE_BG,+ 'create-agent-control-bg-hover': HOVER_BG,+ 'create-agent-control-bg-pressed': HOVER_BG,+ 'create-agent-control-border': BORDER_BG,+ 'create-agent-control-icon': TEXT_PRIMARY,+ 'create-agent-control-text': TEXT_PRIMARY,+ 'create-agent-quick-card-bg': SURFACE_BG,+ 'create-agent-quick-card-bg-hover': HOVER_BG,+ 'create-agent-quick-card-border': BORDER_BG,+ 'create-agent-quick-card-icon': TEXT_PRIMARY,+ 'create-agent-quick-card-icon-bg': CHIP_BG,+ 'create-agent-quick-card-text': TEXT_PRIMARY,+ 'create-agent-segment-inactive-text': TEXT_SECONDARY,+ 'create-agent-segment-track-bg': SURFACE_BG,+ 'send-btn-bg': SURFACE_BG,+ 'send-btn-icon': TEXT_PRIMARY,'chat-input-chip-border': BORDER_BG,'chat-input-text': TEXT_PRIMARY,'color-primary': TEXT_PRIMARY,diff --git a/apps/desktop/src/renderer/themes/builtin/eclipse.ts b/apps/desktop/src/renderer/themes/builtin/eclipse.tsindex e04050cd74..7fb52fe3d1 100644--- a/apps/desktop/src/renderer/themes/builtin/eclipse.ts+++ b/apps/desktop/src/renderer/themes/builtin/eclipse.ts@@ -75,6 +75,24 @@ const singletonOverrides = {'agent-actions-rail': BOARD_NAVY,'ask-checkbox-border': TEXT_DISABLED,background: SURFACE_NAVY_HSL,+ // CREATE AGENT 卡片 / 顶部 pill / 分段开关 + composer pill(#607):+ // 卡片底与 surface 同值收敛(模板惯例),icon 圆底用 CHIP,send 走 tier1 反相 CTA。+ 'create-agent-control-bg': SURFACE_NAVY,+ 'create-agent-control-bg-hover': HOVER_NAVY,+ 'create-agent-control-bg-pressed': CHIP_NAVY,+ 'create-agent-control-border': BOARD_NAVY,+ 'create-agent-control-icon': TEXT_PRIMARY,+ 'create-agent-control-text': TEXT_PRIMARY,+ 'create-agent-quick-card-bg': SURFACE_NAVY,+ 'create-agent-quick-card-bg-hover': HOVER_NAVY,+ 'create-agent-quick-card-border': BOARD_NAVY,+ 'create-agent-quick-card-icon': TEXT_PRIMARY,+ 'create-agent-quick-card-icon-bg': BOARD_NAVY,+ 'create-agent-quick-card-text': TEXT_PRIMARY,+ 'create-agent-segment-inactive-text': TEXT_TERTIARY,+ 'create-agent-segment-track-bg': SURFACE_NAVY,+ 'send-btn-bg': TEXT_PRIMARY,+ 'send-btn-icon': SURFACE_NAVY,'chat-input-chip-border': BOARD_NAVY,'chat-input-text': TEXT_PRIMARY,'color-primary': TEXT_PRIMARY,diff --git a/apps/desktop/src/renderer/themes/builtin/github-dark.ts b/apps/desktop/src/renderer/themes/builtin/github-dark.tsindex 7d5c06ff87..e84ea24207 100644--- a/apps/desktop/src/renderer/themes/builtin/github-dark.ts+++ b/apps/desktop/src/renderer/themes/builtin/github-dark.ts@@ -78,6 +78,24 @@ const singletonOverrides = {'agent-actions-rail': BORDER_BG,'ask-checkbox-border': TEXT_DISABLED,background: SURFACE_BG_HSL,+ // CREATE AGENT 卡片 / 顶部 pill / 分段开关 + composer pill(#607):+ // 卡片底与 surface 同值收敛(模板惯例),icon 圆底用 CHIP,send 走 tier1 反相 CTA。+ 'create-agent-control-bg': SURFACE_BG,+ 'create-agent-control-bg-hover': HOVER_BG,+ 'create-agent-control-bg-pressed': CHIP_BG,+ 'create-agent-control-border': BORDER_BG,+ 'create-agent-control-icon': TEXT_PRIMARY,+ 'create-agent-control-text': TEXT_PRIMARY,+ 'create-agent-quick-card-bg': SURFACE_BG,+ 'create-agent-quick-card-bg-hover': HOVER_BG,+ 'create-agent-quick-card-border': BORDER_BG,+ 'create-agent-quick-card-icon': TEXT_PRIMARY,+ 'create-agent-quick-card-icon-bg': BORDER_BG,+ 'create-agent-quick-card-text': TEXT_PRIMARY,+ 'create-agent-segment-inactive-text': TEXT_TERTIARY,+ 'create-agent-segment-track-bg': SURFACE_BG,+ 'send-btn-bg': TEXT_PRIMARY,+ 'send-btn-icon': SURFACE_BG,'chat-input-chip-border': BORDER_BG,'chat-input-text': TEXT_PRIMARY,'color-primary': TEXT_PRIMARY,diff --git a/apps/desktop/src/renderer/themes/builtin/material-ocean-hc.ts b/apps/desktop/src/renderer/themes/builtin/material-ocean-hc.tsindex 48bb134dae..f8a8b8efc1 100644--- a/apps/desktop/src/renderer/themes/builtin/material-ocean-hc.ts+++ b/apps/desktop/src/renderer/themes/builtin/material-ocean-hc.ts@@ -73,6 +73,24 @@ const singletonOverrides = {'agent-actions-rail': BORDER_BG,'ask-checkbox-border': TEXT_DISABLED,background: SURFACE_BG_HSL,+ // CREATE AGENT 卡片 / 顶部 pill / 分段开关 + composer pill(#607):+ // 卡片底与 surface 同值收敛(模板惯例),icon 圆底用 CHIP,send 走 tier1 反相 CTA。+ 'create-agent-control-bg': SURFACE_BG,+ 'create-agent-control-bg-hover': HOVER_BG,+ 'create-agent-control-bg-pressed': CHIP_BG,+ 'create-agent-control-border': BORDER_BG,+ 'create-agent-control-icon': TEXT_PRIMARY,+ 'create-agent-control-text': TEXT_PRIMARY,+ 'create-agent-quick-card-bg': SURFACE_BG,+ 'create-agent-quick-card-bg-hover': HOVER_BG,+ 'create-agent-quick-card-border': BORDER_BG,+ 'create-agent-quick-card-icon': TEXT_PRIMARY,+ 'create-agent-quick-card-icon-bg': BORDER_BG,+ 'create-agent-quick-card-text': TEXT_PRIMARY,+ 'create-agent-segment-inactive-text': TEXT_TERTIARY,+ 'create-agent-segment-track-bg': SURFACE_BG,+ 'send-btn-bg': TEXT_PRIMARY,+ 'send-btn-icon': SURFACE_BG,'chat-input-chip-border': BORDER_BG,'chat-input-text': TEXT_PRIMARY,'color-primary': TEXT_PRIMARY,diff --git a/apps/desktop/src/renderer/themes/builtin/monokai-pro.ts b/apps/desktop/src/renderer/themes/builtin/monokai-pro.tsindex cd19c829f1..5c49cae7cd 100644--- a/apps/desktop/src/renderer/themes/builtin/monokai-pro.ts+++ b/apps/desktop/src/renderer/themes/builtin/monokai-pro.ts@@ -72,6 +72,24 @@ const singletonOverrides = {'agent-actions-rail': BORDER_BG,'ask-checkbox-border': TEXT_DISABLED,background: SURFACE_BG_HSL,+ // CREATE AGENT 卡片 / 顶部 pill / 分段开关 + composer pill(#607):+ // 卡片底与 surface 同值收敛(模板惯例),icon 圆底用 CHIP,send 走 tier1 反相 CTA。+ 'create-agent-control-bg': SURFACE_BG,+ 'create-agent-control-bg-hover': HOVER_BG,+ 'create-agent-control-bg-pressed': CHIP_BG,+ 'create-agent-control-border': BORDER_BG,+ 'create-agent-control-icon': TEXT_PRIMARY,+ 'create-agent-control-text': TEXT_PRIMARY,+ 'create-agent-quick-card-bg': SURFACE_BG,+ 'create-agent-quick-card-bg-hover': HOVER_BG,+ 'create-agent-quick-card-border': BORDER_BG,+ 'create-agent-quick-card-icon': TEXT_PRIMARY,+ 'create-agent-quick-card-icon-bg': BORDER_BG,+ 'create-agent-quick-card-text': TEXT_PRIMARY,+ 'create-agent-segment-inactive-text': TEXT_TERTIARY,+ 'create-agent-segment-track-bg': SURFACE_BG,+ 'send-btn-bg': TEXT_PRIMARY,+ 'send-btn-icon': SURFACE_BG,'chat-input-chip-border': BORDER_BG,'chat-input-text': TEXT_PRIMARY,'color-primary': TEXT_PRIMARY,diff --git a/apps/desktop/src/renderer/themes/builtin/one-dark-pro.ts b/apps/desktop/src/renderer/themes/builtin/one-dark-pro.tsindex 99233d3f3f..579c8f1df0 100644--- a/apps/desktop/src/renderer/themes/builtin/one-dark-pro.ts+++ b/apps/desktop/src/renderer/themes/builtin/one-dark-pro.ts@@ -85,6 +85,24 @@ const singletonOverrides = {'agent-actions-rail': BORDER_BG,'ask-checkbox-border': TEXT_DISABLED,background: SURFACE_BG_HSL,+ // CREATE AGENT 卡片 / 顶部 pill / 分段开关 + composer pill(#607):+ // 卡片底与 surface 同值收敛(模板惯例),icon 圆底用 CHIP,send 走 tier1 反相 CTA。+ 'create-agent-control-bg': SURFACE_BG,+ 'create-agent-control-bg-hover': HOVER_BG,+ 'create-agent-control-bg-pressed': CHIP_BG,+ 'create-agent-control-border': BORDER_BG,+ 'create-agent-control-icon': TEXT_PRIMARY,+ 'create-agent-control-text': TEXT_PRIMARY,+ 'create-agent-quick-card-bg': SURFACE_BG,+ 'create-agent-quick-card-bg-hover': HOVER_BG,+ 'create-agent-quick-card-border': BORDER_BG,+ 'create-agent-quick-card-icon': TEXT_PRIMARY,+ 'create-agent-quick-card-icon-bg': BORDER_BG,+ 'create-agent-quick-card-text': TEXT_PRIMARY,+ 'create-agent-segment-inactive-text': TEXT_TERTIARY,+ 'create-agent-segment-track-bg': SURFACE_BG,+ 'send-btn-bg': TEXT_PRIMARY,+ 'send-btn-icon': SURFACE_BG,'chat-input-chip-border': BORDER_BG,'chat-input-text': TEXT_PRIMARY,'color-primary': TEXT_PRIMARY,diff --git a/apps/desktop/src/renderer/themes/builtin/solarized-light.ts b/apps/desktop/src/renderer/themes/builtin/solarized-light.tsindex 52d2d154cf..e8d243e6e0 100644--- a/apps/desktop/src/renderer/themes/builtin/solarized-light.ts+++ b/apps/desktop/src/renderer/themes/builtin/solarized-light.ts@@ -85,6 +85,30 @@ const singletonOverrides = {'ask-checkbox-border': TEXT_TERTIARY,background: SURFACE_BG_HSL,'chat-input-bg': CHIP_BG,+ // CREATE AGENT 快速开始卡片 / 顶部 pill / 分段开关(#607):+ // 卡片用 base2(CHIP)下沉式抬起,与 chat-input 同层;边框/文字走 tier1 同源常量。+ // hover 必须提亮到 base3(SURFACE):CHIP 与 HOVER 在本主题同值,沿用 HOVER 会让+ // 卡片 default/hover 同色、icon 圆底与卡片同色(codex P1 3671116833)。+ 'create-agent-control-bg': CHIP_BG,+ 'create-agent-control-bg-hover': SURFACE_BG,+ 'create-agent-control-bg-pressed': HOVER_BG,+ 'create-agent-control-border': BORDER_BG,+ 'create-agent-control-icon': TEXT_PRIMARY,+ 'create-agent-control-text': TEXT_PRIMARY,+ 'create-agent-quick-card-bg': CHIP_BG,+ 'create-agent-quick-card-bg-hover': SURFACE_BG,+ 'create-agent-quick-card-border': BORDER_BG,+ 'create-agent-quick-card-icon': TEXT_PRIMARY,+ // icon 圆底 resting 提到 base3(SURFACE) 与 base2 卡片区分;hover 时卡片升到+ // base3、圆底由模板规则落回 base2(CHIP),两态均可分(codex P1 3671457570)。+ 'create-agent-quick-card-icon-bg': SURFACE_BG,+ // send 不用 accent(green) 底:共享 send token 还渲染 10-12px 文本+ // (VoiceInputOverlay / CollaborationModeToggle / SessionHandoffCard),白字仅+ // 3.20:1,不达 DESIGN.md §10 小字 4.5:1;回退 registry 反相中性(codex P1+ // 3671457561),故本主题不覆盖 send-btn-*。+ 'create-agent-quick-card-text': TEXT_PRIMARY,+ 'create-agent-segment-inactive-text': TEXT_SECONDARY,+ 'create-agent-segment-track-bg': CHIP_BG,'chat-input-chip-border': BORDER_BG,'chat-input-text': TEXT_PRIMARY,'color-primary': TEXT_PRIMARY,diff --git a/apps/desktop/src/shared/__tests__/themeImportPalette.test.ts b/apps/desktop/src/shared/__tests__/themeImportPalette.test.tsindex f0f68e7d43..564e7f26c2 100644--- a/apps/desktop/src/shared/__tests__/themeImportPalette.test.ts+++ b/apps/desktop/src/shared/__tests__/themeImportPalette.test.ts@@ -86,10 +86,15 @@ const SOLARIZED_LIGHT_PALETTE: ThemePalette = {accentPrimary: rgb('#859900'),accentSoft: rgb('#5e6a00'),accentDeep: rgb('#5e6a00'),+ // Solarized 惯例:卡片 / 输入框用 base2 压暗一档(solarized-light.ts 头部注释)。+ inputBg: rgb('#eee8d5'),};-/** 值为 HSL 三元组的 token → 它应当换算自哪个色板角色。 */-const HSL_TOKEN_ROLE: Record<string, keyof ThemePalette> = {+/** 值为 HSL 三元组的 token → 它应当换算自哪个色板角色(仅必填角色,可选的 inputBg 不在此列)。 */+type RequiredPaletteRole = {+ [K in keyof ThemePalette]-?: undefined extends ThemePalette[K] ? never : K;+}[keyof ThemePalette];+const HSL_TOKEN_ROLE: Record<string, RequiredPaletteRole> = {'surface-hsl': 'surface','surface-hover-hsl': 'hover','border-default-hsl': 'border',@@ -112,7 +117,7 @@ const HSL_TOKEN_ROLE: Record<string, keyof ThemePalette> = {};/** light / dark 取值不同、且 light 侧是固定字面量的 HSL token。 */-const HSL_TOKEN_ROLE_BY_TYPE: Record<string, { dark: keyof ThemePalette; light: keyof ThemePalette }> = {+const HSL_TOKEN_ROLE_BY_TYPE: Record<string, { dark: RequiredPaletteRole; light: RequiredPaletteRole }> = {'primary-foreground': { dark: 'surface', light: 'surface' },secondary: { dark: 'elevated', light: 'chip' },};diff --git a/apps/desktop/src/shared/theme-import/palette.ts b/apps/desktop/src/shared/theme-import/palette.tsindex b5ba9c1e61..4268362401 100644--- a/apps/desktop/src/shared/theme-import/palette.ts+++ b/apps/desktop/src/shared/theme-import/palette.ts@@ -5,8 +5,8 @@** `renderer/themes/builtin/` 下 7 个社区主题(one-dark-pro / github-dark /* eclipse / material-ocean-hc / monokai-pro / atom-one-light / solarized-light)- * 都是人工从 VSCode 主题移植的,它们 `colors` 的 key 集合**逐字相同**(91 个- * token = 35 个 Tier1 slot + 56 个 alias / singleton),值全部由同一组 13 个色板+ * 都是人工从 VSCode 主题移植的,它们 `colors` 的 key 集合**逐字相同**(108 个+ * token = 35 个 Tier1 slot + 73 个 alias / singleton),值全部由同一组 13 个色板* 常量派生。本文件就是那套派生规则的代码化:** - 5 个 dark 主题逐 key 一致(唯一例外:github-dark 把 4 个 on-accent 前景@@ -16,7 +16,7 @@** ## 为什么用 allow-list*- * 模板产出这 91 个基础 key(源主题提供 Markdown 色时额外追加 `md-h1-fg`…+ * 模板产出这 108 个基础 key(源主题提供 Markdown 色时额外追加 `md-h1-fg`…* `md-h6-fg` / `md-strong-fg`)。这 7 个主题都没有 override `--login-*`、品牌红、* `--destructive`、`--warning-accent`、`--status-bar-accent`、`--focus-ring`、* `--diff-*`(DESIGN.md §10 / §16 的语义豁免族),照抄它们的 key 列表就自动守住了@@ -57,6 +57,10 @@ export interface ThemePalette {accentSoft: Rgb;/** accent 压暗档(pressed;light 主题的链接色也走这档的 primary/deep 组合)。 */accentDeep: Rgb;+ /** light 主题可选:CREATE AGENT 卡片 / 输入框底色压暗一档(如 Solarized base2)。+ * 不传时与 surface 同值(chat-input-bg / quick-card / control / segment 底);+ * icon 圆底、hover、pressed 的取值见下方收敛规则,均不随 inputBg 变化。 */+ inputBg?: Rgb;}/** Markdown 标题 / 加粗色——源主题提供时才产出对应 token(Obsidian `--hN-color`)。 */@@ -76,7 +80,7 @@ const MARKDOWN_HEADING_TOKENS = [] as const;/**- * 模板产出的 91 个 token id。导出供测试断言"与 builtin 主题 key 集合一致",+ * 模板产出的 108 个 token id。导出供测试断言"与 builtin 主题 key 集合一致",* 以及供 importer 统计命中数量。*/export const TEMPLATE_TOKEN_IDS: readonly string[] = [@@ -133,6 +137,20 @@ export const TEMPLATE_TOKEN_IDS: readonly string[] = ['confirm-btn-secondary-hover','confirm-btn-secondary-text','confirm-title',+ 'create-agent-control-bg',+ 'create-agent-control-bg-hover',+ 'create-agent-control-bg-pressed',+ 'create-agent-control-border',+ 'create-agent-control-icon',+ 'create-agent-control-text',+ 'create-agent-quick-card-bg',+ 'create-agent-quick-card-bg-hover',+ 'create-agent-quick-card-border',+ 'create-agent-quick-card-icon',+ 'create-agent-quick-card-icon-bg',+ 'create-agent-quick-card-text',+ 'create-agent-segment-inactive-text',+ 'create-agent-segment-track-bg','drop-overlay-bg','file-chip-bg','file-remove-bg',@@ -154,6 +172,8 @@ export const TEMPLATE_TOKEN_IDS: readonly string[] = ['primary-foreground','search-match-fg','secondary',+ 'send-btn-bg',+ 'send-btn-icon','settings-btn-primary-text','settings-btn-secondary-hover-bg','text-placeholder',@@ -230,6 +250,19 @@ export function buildThemeColorsFromPalette(const linkColor = pick(accentSoft, accentPrimary);/** 弱化前景:dark 用 disabled 档,light 用 tertiary(浅底上 disabled 太淡)。 */const mutedIcon = pick(textDisabled, textTertiary);+ /** CREATE AGENT / 输入框底色:light 可用 inputBg 压暗一档(Solarized 惯例)。 */+ const inputBg = toHex(palette.inputBg ?? palette.surface);+ /** CREATE AGENT hover / icon 圆底 / pressed 收敛规则:+ * card hover 提亮到「lift 档」(light 传了与 surface 不同的 inputBg,如 Solarized+ * base2 卡片,则 lift 到 surface,否则用通用 hover);icon 圆底取「比 hover 卡片+ * 更深一档」的层——lift 主题用 chip(压在提亮卡片上),其余 dark 用 border、+ * 其余 light 用 chip——保证三态可分。pressed 恒 pick(chip, hover)。 */+ const liftsOffSurface = palette.inputBg !== undefined+ && toHex(palette.inputBg).toLowerCase() !== toHex(palette.surface).toLowerCase();+ const quickHover = toHex(liftsOffSurface ? palette.surface : palette.hover);+ const quickIconBg = liftsOffSurface+ ? toHex(palette.surface)+ : pick(toHex(palette.border), toHex(palette.chip));const colors: Record<string, string> = {// ── Tier1 语义 slot ──@@ -290,6 +323,20 @@ export function buildThemeColorsFromPalette(),'confirm-btn-secondary-text': textPrimary,'confirm-title': textPrimary,+ 'create-agent-control-bg': inputBg,+ 'create-agent-control-bg-hover': quickHover,+ 'create-agent-control-bg-pressed': pick(chip, hover),+ 'create-agent-control-border': border,+ 'create-agent-control-icon': textPrimary,+ 'create-agent-control-text': textPrimary,+ 'create-agent-quick-card-bg': inputBg,+ 'create-agent-quick-card-bg-hover': quickHover,+ 'create-agent-quick-card-border': border,+ 'create-agent-quick-card-icon': textPrimary,+ 'create-agent-quick-card-icon-bg': quickIconBg,+ 'create-agent-quick-card-text': textPrimary,+ 'create-agent-segment-inactive-text': pick(textTertiary, textSecondary),+ 'create-agent-segment-track-bg': inputBg,'drop-overlay-bg': toRgbaString(palette.accentPrimary, 0.1),'file-chip-bg': pick(border, chip),'file-remove-bg': mutedIcon,@@ -311,6 +358,11 @@ export function buildThemeColorsFromPalette('primary-foreground': pick(surfaceHsl, '0 0% 100%'),'search-match-fg': textPrimaryHsl,secondary: pick(elevatedHsl, chipHsl),+ // send 底用反相中性而非 accent:共享 send token 还渲染 10-12px 文本+ // (VoiceInputOverlay / CollaborationModeToggle / SessionHandoffCard),accent 底+ // 配白/黑字难稳定过 4.5:1 小字线,反相中性双模式均满足。+ 'send-btn-bg': pick(textPrimary, surface),+ 'send-btn-icon': pick(surface, textPrimary),'settings-btn-primary-text': onAccent,'settings-btn-secondary-hover-bg': hover,// placeholder 必须"读着像空",两个模式都取比 tertiary 更淡的 disabled 档。diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.mdindex a17af5d4f4..080e8e5b7b 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -469,7 +469,7 @@ This section is the authoritative token-usage text; i18n rules for UI copy liveSettings → Appearance can import a VSCode color theme (`*.json` / jsonc) or an Obsidian `theme.css` and convert it into a local theme. Implementation: `apps/desktop/src/shared/theme-import/` (pure conversion) + `apps/desktop/src/main/local-themes/importer.ts` (dialog / read / write). Rules that govern it:-- **One template, taken from the hand-ported community themes.** The seven ported themes under `apps/desktop/src/renderer/themes/builtin/` (one-dark-pro, github-dark, eclipse, material-ocean-hc, monokai-pro, atom-one-light, solarized-light) share a byte-identical key set of 91 tokens derived from 13 palette roles. `apps/desktop/src/shared/theme-import/palette.ts` is that derivation, code-ified; `one-dark-pro.ts`'s header comment is the source-of-truth for which VSCode key feeds which role. The template is **allow-list only** — it emits exactly those 91 base ids, plus optional Markdown tokens (`md-h1-fg`…`md-h6-fg` / `md-strong-fg`) when the source theme provides heading or bold colors.+- **One template, taken from the hand-ported community themes.** The seven ported themes under `apps/desktop/src/renderer/themes/builtin/` (one-dark-pro, github-dark, eclipse, material-ocean-hc, monokai-pro, atom-one-light, solarized-light) share a byte-identical key set of 108 tokens derived from 13 palette roles plus the optional light-only `inputBg` role (CREATE AGENT card/input background, e.g. Solarized base2; absent ⇒ collapses to `surface`). Within the template, when a light palette supplies an `inputBg` distinct from `surface` (e.g. Solarized base2 cards), CREATE AGENT `*-hover` and the resting `quick-card-icon-bg` lift to `surface` (icon drops back to `chip` on hover); otherwise `*-hover`=`hover` and `quick-card-icon-bg` is `border` in dark / `chip` in light — keeping default/hover/icon visually distinct in every theme. `control-bg-pressed` is `chip` in dark and `hover` in light. `send-btn-bg`/`send-btn-icon` use the inverse-neutral pair (`textPrimary`/`surface`), not the accent, because the shared send tokens also render 10–12px text that must clear 4.5:1. `apps/desktop/src/shared/theme-import/palette.ts` is that derivation, code-ified; `one-dark-pro.ts`'s header comment is the source-of-truth for which VSCode key feeds which role. The template is **allow-list only** — it emits exactly those 108 base ids, plus optional Markdown tokens (`md-h1-fg`…`md-h6-fg` / `md-strong-fg`) when the source theme provides heading or bold colors.- **Exemption families are never imported.** `--login-*`, brand red, `--destructive`, `--error-*`, `--warning-accent`, `--status-bar-accent`, `--focus-ring*`, `--diff-*`, shadows and overlays stay at their spec values under every imported theme (see the exemption table above and §16). `apps/desktop/src/shared/theme-import/protected-tokens.ts` enforces it as a second gate; the import report tells the user how many tokens were held back.- **`-hsl` tokens are computed, not copied.** Both forms of a color must denote the same color, so the converter derives every HSL triplet from its hex via `toHslTriplet()`. (Note: a few hand-written builtin themes carry approximate HSL values — `github-dark`'s `SURFACE_BG_HSL` was copied off one-dark-pro. Those are left as-is; new imports are exact.)- **Markdown text colors go through `--md-h1-fg`…`--md-h6-fg` / `--md-strong-fg`, and default to `inherit`.** Before these tokens existed, Markdown headings and bold text inherited their color from the container (`baseComponents` sets size/weight only). Defaulting to `var(--text-primary)` would have repainted headings inside blockquotes, tool cards and secondary-text regions, so the defaults are `inherit` — every built-in theme renders exactly as before. Imported themes fill them from Obsidian `--hN-color` / `--bold-color` or VSCode `markup.heading` / `markup.bold`. Guard: `themes/__tests__/markdownColorTokens.test.ts`.