Files
hermes-agent/apps/shared/package.json
teknium1 e7657792df refactor(themes): web dashboard presets derive from the desktop palette table
The desktop and the web dashboard each carried a private copy of the
cyberpunk / ember / midnight / mono palettes and they had drifted: the
dashboard's cyberpunk canvas was #040608 with a mint #9bffcf accent
while the desktop's was #000a00 with #00ff41, ember and midnight
disagreed on both canvas and accent, mono agreed only by luck.

Move the raw palette table for every built-in preset into
@hermes/shared (`THEME_PRESET_PALETTES`, apps/shared/src/theme-presets.ts)
and make it the single source of truth:

- apps/desktop/src/themes/presets.ts spreads its `colors` / `darkColors`
  from the shared table; the OKLCH synthesis, terminal palettes and
  typography stay in the desktop. Serialised BUILTIN_THEMES are
  byte-identical to before, so the existing `--dt-primary-solid`
  parity pins stay green untouched.
- web/src/themes/presets.ts projects each shared preset onto its
  3-slot model through one pure function, `webPresetFromShared`
  (background <- background, midground <- primary, warmGlow <- the
  midground/ring accent), so cyberpunk / ember / midnight / mono now
  render the desktop's palette. Web-only presets (default,
  default-large, nous-blue, rose) are untouched.
- Invariant test (web): for every preset shared by both surfaces the
  dashboard canvas equals the shared background and the projected text
  colour keeps >= 3:1 contrast against it. Red on the previous hexes,
  green now.

Why: one edit in one place should recolour a preset on every surface;
two hand-maintained tables guarantee the drift the audit found.
2026-09-13 10:52:11 -07:00

37 lines
1.1 KiB
JSON

{
"name": "@hermes/shared",
"private": true,
"version": "0.0.0",
"type": "module",
"exports": {
".": "./src/index.ts",
"./ansi": "./src/ansi.ts",
"./billing": "./src/billing-types.ts",
"./billing-policy": "./src/billing-policy.ts",
"./charge-settlement": "./src/charge-settlement.ts",
"./color": "./src/color.ts",
"./format": "./src/format.ts",
"./fuzzy": "./src/fuzzy.ts",
"./gateway-events": "./src/gateway-events.ts",
"./i18n": "./src/i18n.ts",
"./json-rpc-channel": "./src/json-rpc-channel.ts",
"./model-search-text": "./src/model-search-text.ts",
"./reasoning-effort": "./src/reasoning-effort.ts",
"./reconnect-backoff": "./src/reconnect-backoff.ts",
"./skin": "./src/skin.ts",
"./slash": "./src/slash.ts",
"./theme-presets": "./src/theme-presets.ts"
},
"types": "./src/index.ts",
"scripts": {
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"fix": "npm run lint:fix",
"typecheck": "tsc -p . --noEmit",
"check": "npm run typecheck && npm run lint"
},
"devDependencies": {
"typescript": "6.0.3"
}
}