@nonamelego/dsh-catppuccin 0.6.7 → 0.7.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.
- package/README.en.md +6 -1
- package/README.md +14 -6
- package/lib/client.js +327 -15
- package/lib/client.js.map +1 -1
- package/lib/index.js +233 -152
- package/lib/index.js.map +1 -1
- package/package.json +9 -2
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["pkg.version"],"sources":["../src/client/palettes.ts","../src/boot-palette.ts","../package.json","../src/registration-tolerance.ts","../src/versions.ts","../src/update-check.ts","../src/profile-detect.ts","../src/update-check/host.ts","../src/state.ts","../src/legacy-state.ts","../src/migrate-legacy.ts","../src/settings-catppuccin.ts","../src/index.ts"],"sourcesContent":["/**\n * AUTO-GENERATED by scripts/generate-palettes.mjs — do not edit by hand.\n * Catppuccin token tables for the DeepSeek Harness web GUI.\n * Source palette: https://github.com/catppuccin/catppuccin (palette.json v1.8.0).\n * // UPSTREAM_PIN: 639ed015397290b3745d163aafe02ffee4aa3f84\n * Each flavour carries a flat dictionary of every --dsw-static-*,\n * --dsw-alias-* and --dsw-specific-* token the official theme stylesheet\n * declares, plus the --dsw-* tokens outside those families (0.2.0's\n * --dsw-menu-surface-fill). Alias/specific entries keep their var() references\n * so the static overrides below flow through automatically; literal (non-var)\n * entries are remapped to Catppuccin colours — see aliasLiteralOverrides.\n */\nexport type CatppuccinFlavorId = 'latte' | 'frappe' | 'macchiato' | 'mocha'\nexport interface CatppuccinFlavorInfo {\n /** Theme id registered into ThemeRuntime. */\n themeId: string\n /** Base color scheme this flavour builds on. */\n colorScheme: 'light' | 'dark'\n /** Display label. */\n label: string\n /** Accent colour for the settings row swatch. */\n accent: string\n /** Token dictionary (--dsw-* names). */\n tokens: Record<string, string>\n}\n\nexport const CATPPUCCIN_LATTE: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-latte',\n colorScheme: 'light',\n label: 'Latte',\n accent: '#1e66f5',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #fe640b 20%, #eff1f5)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #fe640b 70%, #eff1f5)\",\n \"--dsw-static-amber-500\": \"#fe640b\",\n \"--dsw-static-amber-600\": \"#fe640b\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #fe640b 32%, #eff1f5)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #1e66f5 22%, #eff1f5)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #1e66f5 48%, #eff1f5)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #1e66f5 65%, #eff1f5)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-blue-500\": \"#1e66f5\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #1e66f5 8%, #eff1f5)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #1e66f5 12%, #eff1f5)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #1e66f5 16%, #eff1f5)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #1e66f5 50%, #eff1f5)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #1e66f5 30%, #4c4f69)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #1e66f5 26%, #eff1f5)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #1e66f5 22%, #eff1f5)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #1e66f5 34%, #eff1f5)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #1e66f5 48%, #eff1f5)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #1e66f5 65%, #eff1f5)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-deepseek-500\": \"#1e66f5\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #1e66f5 8%, #eff1f5)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #1e66f5 66%, #eff1f5)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #1e66f5 50%, #eff1f5)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #1e66f5 38%, #eff1f5)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #40a02b 18%, #eff1f5)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #40a02b 80%, #eff1f5)\",\n \"--dsw-static-green-500\": \"#40a02b\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #40a02b 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #40a02b 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #40a02b 30%, #eff1f5)\",\n \"--dsw-static-neutral-00\": \"#eff1f5\",\n \"--dsw-static-neutral-1000\": \"#4c4f69\",\n \"--dsw-static-neutral-100\": \"#bcc0cc\",\n \"--dsw-static-neutral-150\": \"#acb0be\",\n \"--dsw-static-neutral-200\": \"#9ca0b0\",\n \"--dsw-static-neutral-250\": \"#9ca0b0\",\n \"--dsw-static-neutral-300\": \"#8c8fa1\",\n \"--dsw-static-neutral-400\": \"#7c7f93\",\n \"--dsw-static-neutral-500\": \"#6c6f85\",\n \"--dsw-static-neutral-50\": \"#e6e9ef\",\n \"--dsw-static-neutral-550\": \"#6c6f85\",\n \"--dsw-static-neutral-600\": \"#5c5f77\",\n \"--dsw-static-neutral-700\": \"#5c5f77\",\n \"--dsw-static-neutral-800\": \"#4c4f69\",\n \"--dsw-static-neutral-850\": \"#4c4f69\",\n \"--dsw-static-neutral-900\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-00\": \"#eff1f5\",\n \"--dsw-static-neutral-bluish-1000\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-100\": \"#bcc0cc\",\n \"--dsw-static-neutral-bluish-150\": \"#acb0be\",\n \"--dsw-static-neutral-bluish-200\": \"#9ca0b0\",\n \"--dsw-static-neutral-bluish-300\": \"#8c8fa1\",\n \"--dsw-static-neutral-bluish-400\": \"#7c7f93\",\n \"--dsw-static-neutral-bluish-500\": \"#6c6f85\",\n \"--dsw-static-neutral-bluish-50\": \"#e6e9ef\",\n \"--dsw-static-neutral-bluish-600\": \"#5c5f77\",\n \"--dsw-static-neutral-bluish-60\": \"#e6e9ef\",\n \"--dsw-static-neutral-bluish-700\": \"#5c5f77\",\n \"--dsw-static-neutral-bluish-750\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-75\": \"#ccd0da\",\n \"--dsw-static-neutral-bluish-800\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-850\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-875\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-900\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-950\": \"#4c4f69\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #d20f39 20%, #eff1f5)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #d20f39 70%, #eff1f5)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #db5371 12%, transparent)\",\n \"--dsw-static-red-500\": \"#d20f39\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #d20f39 10%, #eff1f5)\",\n \"--dsw-static-red-600\": \"#d20f39\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #d20f39 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #d20f39 34%, #eff1f5)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.24)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.12)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(255, 255, 255, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(0, 0, 0, 0.04)\",\n \"--dsw-alias-border-inverted2\": \"rgba(0, 0, 0, 0)\",\n \"--dsw-alias-border-inverted\": \"rgba(0, 0, 0, 0)\",\n \"--dsw-alias-border-l1\": \"rgba(0, 0, 0, 0.04)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(0, 0, 0, 0.1)\",\n \"--dsw-alias-border-l2\": \"rgba(0, 0, 0, 0.1)\",\n \"--dsw-alias-border-l3\": \"rgba(0, 0, 0, 0.12)\",\n \"--dsw-alias-border-l4\": \"rgba(0, 0, 0, 0.16)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#1e66f5\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-500)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(38, 49, 72, 0.1)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(38, 49, 72, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(236, 19, 19, 0.05)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(38, 49, 72, 0.06)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-500) 70%, var(--dsw-static-blue-950))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-deepseek-500) 30%, var(--dsw-static-blue-950))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-blue-900)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-1000) 30%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-50)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-200)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-200)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-300)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-300)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-100)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a08)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-600-a08)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a08)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 4%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-600-a08)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 4%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-600)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-300)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-100)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-100)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-markdown-code-block)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-deepseek-200)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-deepseek-50)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-deepseek-100)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 58%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_FRAPPE: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-frappe',\n colorScheme: 'dark',\n label: 'Frappé',\n accent: '#8caaee',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #ef9f76 20%, #303446)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #ef9f76 70%, #303446)\",\n \"--dsw-static-amber-500\": \"#ef9f76\",\n \"--dsw-static-amber-600\": \"#ef9f76\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #ef9f76 18%, #232634)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #8caaee 24%, #303446)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #8caaee 50%, #303446)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #8caaee 66%, #303446)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-blue-500\": \"#8caaee\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #8caaee 10%, #303446)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #8caaee 14%, #303446)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #8caaee 18%, #303446)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #8caaee 18%, #232634)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #8caaee 14%, #232634)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #8caaee 10%, #232634)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #8caaee 24%, #303446)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #8caaee 36%, #303446)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #8caaee 50%, #303446)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #8caaee 66%, #303446)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-deepseek-500\": \"#8caaee\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #8caaee 10%, #303446)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #8caaee 68%, #303446)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #8caaee 18%, #232634)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #8caaee 14%, #232634)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #a6d189 18%, #303446)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #a6d189 80%, #303446)\",\n \"--dsw-static-green-500\": \"#a6d189\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #a6d189 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #a6d189 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #a6d189 18%, #232634)\",\n \"--dsw-static-neutral-00\": \"#c6d0f5\",\n \"--dsw-static-neutral-1000\": \"#232634\",\n \"--dsw-static-neutral-100\": \"#a5adce\",\n \"--dsw-static-neutral-150\": \"#a5adce\",\n \"--dsw-static-neutral-200\": \"#949cbb\",\n \"--dsw-static-neutral-250\": \"#949cbb\",\n \"--dsw-static-neutral-300\": \"#838ba7\",\n \"--dsw-static-neutral-400\": \"#737994\",\n \"--dsw-static-neutral-500\": \"#626880\",\n \"--dsw-static-neutral-50\": \"#c6d0f5\",\n \"--dsw-static-neutral-550\": \"#51576d\",\n \"--dsw-static-neutral-600\": \"#51576d\",\n \"--dsw-static-neutral-700\": \"#414559\",\n \"--dsw-static-neutral-800\": \"#414559\",\n \"--dsw-static-neutral-850\": \"#303446\",\n \"--dsw-static-neutral-900\": \"#292c3c\",\n \"--dsw-static-neutral-bluish-00\": \"#c6d0f5\",\n \"--dsw-static-neutral-bluish-1000\": \"#232634\",\n \"--dsw-static-neutral-bluish-100\": \"#a5adce\",\n \"--dsw-static-neutral-bluish-150\": \"#a5adce\",\n \"--dsw-static-neutral-bluish-200\": \"#949cbb\",\n \"--dsw-static-neutral-bluish-300\": \"#838ba7\",\n \"--dsw-static-neutral-bluish-400\": \"#737994\",\n \"--dsw-static-neutral-bluish-500\": \"#626880\",\n \"--dsw-static-neutral-bluish-50\": \"#c6d0f5\",\n \"--dsw-static-neutral-bluish-600\": \"#51576d\",\n \"--dsw-static-neutral-bluish-60\": \"#b5bfe2\",\n \"--dsw-static-neutral-bluish-700\": \"#414559\",\n \"--dsw-static-neutral-bluish-750\": \"#414559\",\n \"--dsw-static-neutral-bluish-75\": \"#b5bfe2\",\n \"--dsw-static-neutral-bluish-800\": \"#414559\",\n \"--dsw-static-neutral-bluish-850\": \"#303446\",\n \"--dsw-static-neutral-bluish-875\": \"#292c3c\",\n \"--dsw-static-neutral-bluish-900\": \"#292c3c\",\n \"--dsw-static-neutral-bluish-950\": \"#232634\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #e78284 20%, #303446)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #e78284 70%, #303446)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #b06b71 12%, transparent)\",\n \"--dsw-static-red-500\": \"#e78284\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #e78284 10%, #303446)\",\n \"--dsw-static-red-600\": \"#e78284\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #e78284 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #e78284 34%, #303446)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-875)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.5)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.2)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(39, 39, 48, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-850)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted2\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l1\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2\": \"rgba(255, 255, 255, 0.12)\",\n \"--dsw-alias-border-l3\": \"rgba(255, 255, 255, 0.16)\",\n \"--dsw-alias-border-l4\": \"rgba(255, 255, 255, 0.2)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#8caaee\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(255, 255, 255, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(255, 255, 255, 0.24)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(242, 90, 90, 0.15)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-450) 55%, var(--dsw-static-neutral-bluish-400))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-blue-300) 65%, var(--dsw-static-deepseek-400))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-00) 45%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-alias-label-primary-dimmed)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-800)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-700)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-550)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-800)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-900)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-900)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-active)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 45%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_MACCHIATO: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-macchiato',\n colorScheme: 'dark',\n label: 'Macchiato',\n accent: '#8aadf4',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #f5a97f 20%, #24273a)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #f5a97f 70%, #24273a)\",\n \"--dsw-static-amber-500\": \"#f5a97f\",\n \"--dsw-static-amber-600\": \"#f5a97f\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #f5a97f 18%, #181926)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #8aadf4 24%, #24273a)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #8aadf4 50%, #24273a)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #8aadf4 66%, #24273a)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-blue-500\": \"#8aadf4\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #8aadf4 10%, #24273a)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #8aadf4 14%, #24273a)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #8aadf4 18%, #24273a)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #8aadf4 18%, #181926)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #8aadf4 14%, #181926)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #8aadf4 10%, #181926)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #8aadf4 24%, #24273a)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #8aadf4 36%, #24273a)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #8aadf4 50%, #24273a)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #8aadf4 66%, #24273a)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-deepseek-500\": \"#8aadf4\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #8aadf4 10%, #24273a)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #8aadf4 68%, #24273a)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #8aadf4 18%, #181926)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #8aadf4 14%, #181926)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #a6da95 18%, #24273a)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #a6da95 80%, #24273a)\",\n \"--dsw-static-green-500\": \"#a6da95\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #a6da95 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #a6da95 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #a6da95 18%, #181926)\",\n \"--dsw-static-neutral-00\": \"#cad3f5\",\n \"--dsw-static-neutral-1000\": \"#181926\",\n \"--dsw-static-neutral-100\": \"#a5adcb\",\n \"--dsw-static-neutral-150\": \"#a5adcb\",\n \"--dsw-static-neutral-200\": \"#939ab7\",\n \"--dsw-static-neutral-250\": \"#939ab7\",\n \"--dsw-static-neutral-300\": \"#8087a2\",\n \"--dsw-static-neutral-400\": \"#6e738d\",\n \"--dsw-static-neutral-500\": \"#5b6078\",\n \"--dsw-static-neutral-50\": \"#cad3f5\",\n \"--dsw-static-neutral-550\": \"#494d64\",\n \"--dsw-static-neutral-600\": \"#494d64\",\n \"--dsw-static-neutral-700\": \"#363a4f\",\n \"--dsw-static-neutral-800\": \"#363a4f\",\n \"--dsw-static-neutral-850\": \"#24273a\",\n \"--dsw-static-neutral-900\": \"#1e2030\",\n \"--dsw-static-neutral-bluish-00\": \"#cad3f5\",\n \"--dsw-static-neutral-bluish-1000\": \"#181926\",\n \"--dsw-static-neutral-bluish-100\": \"#a5adcb\",\n \"--dsw-static-neutral-bluish-150\": \"#a5adcb\",\n \"--dsw-static-neutral-bluish-200\": \"#939ab7\",\n \"--dsw-static-neutral-bluish-300\": \"#8087a2\",\n \"--dsw-static-neutral-bluish-400\": \"#6e738d\",\n \"--dsw-static-neutral-bluish-500\": \"#5b6078\",\n \"--dsw-static-neutral-bluish-50\": \"#cad3f5\",\n \"--dsw-static-neutral-bluish-600\": \"#494d64\",\n \"--dsw-static-neutral-bluish-60\": \"#b8c0e0\",\n \"--dsw-static-neutral-bluish-700\": \"#363a4f\",\n \"--dsw-static-neutral-bluish-750\": \"#363a4f\",\n \"--dsw-static-neutral-bluish-75\": \"#b8c0e0\",\n \"--dsw-static-neutral-bluish-800\": \"#363a4f\",\n \"--dsw-static-neutral-bluish-850\": \"#24273a\",\n \"--dsw-static-neutral-bluish-875\": \"#1e2030\",\n \"--dsw-static-neutral-bluish-900\": \"#1e2030\",\n \"--dsw-static-neutral-bluish-950\": \"#181926\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #ed8796 20%, #24273a)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #ed8796 70%, #24273a)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #b16a7a 12%, transparent)\",\n \"--dsw-static-red-500\": \"#ed8796\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #ed8796 10%, #24273a)\",\n \"--dsw-static-red-600\": \"#ed8796\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #ed8796 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #ed8796 34%, #24273a)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-875)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.5)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.2)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(39, 39, 48, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-850)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted2\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l1\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2\": \"rgba(255, 255, 255, 0.12)\",\n \"--dsw-alias-border-l3\": \"rgba(255, 255, 255, 0.16)\",\n \"--dsw-alias-border-l4\": \"rgba(255, 255, 255, 0.2)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#8aadf4\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(255, 255, 255, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(255, 255, 255, 0.24)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(242, 90, 90, 0.15)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-450) 55%, var(--dsw-static-neutral-bluish-400))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-blue-300) 65%, var(--dsw-static-deepseek-400))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-00) 45%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-alias-label-primary-dimmed)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-800)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-700)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-550)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-800)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-900)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-900)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-active)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 45%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_MOCHA: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-mocha',\n colorScheme: 'dark',\n label: 'Mocha',\n accent: '#89b4fa',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #fab387 20%, #1e1e2e)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #fab387 70%, #1e1e2e)\",\n \"--dsw-static-amber-500\": \"#fab387\",\n \"--dsw-static-amber-600\": \"#fab387\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #fab387 18%, #11111b)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #89b4fa 24%, #1e1e2e)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #89b4fa 50%, #1e1e2e)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #89b4fa 66%, #1e1e2e)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-blue-500\": \"#89b4fa\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #89b4fa 10%, #1e1e2e)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #89b4fa 14%, #1e1e2e)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #89b4fa 18%, #1e1e2e)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #89b4fa 18%, #11111b)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #89b4fa 14%, #11111b)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #89b4fa 10%, #11111b)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #89b4fa 24%, #1e1e2e)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #89b4fa 36%, #1e1e2e)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #89b4fa 50%, #1e1e2e)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #89b4fa 66%, #1e1e2e)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-deepseek-500\": \"#89b4fa\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #89b4fa 10%, #1e1e2e)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #89b4fa 68%, #1e1e2e)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #89b4fa 18%, #11111b)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #89b4fa 14%, #11111b)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #a6e3a1 18%, #1e1e2e)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #a6e3a1 80%, #1e1e2e)\",\n \"--dsw-static-green-500\": \"#a6e3a1\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #a6e3a1 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #a6e3a1 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #a6e3a1 18%, #11111b)\",\n \"--dsw-static-neutral-00\": \"#cdd6f4\",\n \"--dsw-static-neutral-1000\": \"#11111b\",\n \"--dsw-static-neutral-100\": \"#a6adc8\",\n \"--dsw-static-neutral-150\": \"#a6adc8\",\n \"--dsw-static-neutral-200\": \"#9399b2\",\n \"--dsw-static-neutral-250\": \"#9399b2\",\n \"--dsw-static-neutral-300\": \"#7f849c\",\n \"--dsw-static-neutral-400\": \"#6c7086\",\n \"--dsw-static-neutral-500\": \"#585b70\",\n \"--dsw-static-neutral-50\": \"#cdd6f4\",\n \"--dsw-static-neutral-550\": \"#45475a\",\n \"--dsw-static-neutral-600\": \"#45475a\",\n \"--dsw-static-neutral-700\": \"#313244\",\n \"--dsw-static-neutral-800\": \"#313244\",\n \"--dsw-static-neutral-850\": \"#1e1e2e\",\n \"--dsw-static-neutral-900\": \"#181825\",\n \"--dsw-static-neutral-bluish-00\": \"#cdd6f4\",\n \"--dsw-static-neutral-bluish-1000\": \"#11111b\",\n \"--dsw-static-neutral-bluish-100\": \"#a6adc8\",\n \"--dsw-static-neutral-bluish-150\": \"#a6adc8\",\n \"--dsw-static-neutral-bluish-200\": \"#9399b2\",\n \"--dsw-static-neutral-bluish-300\": \"#7f849c\",\n \"--dsw-static-neutral-bluish-400\": \"#6c7086\",\n \"--dsw-static-neutral-bluish-500\": \"#585b70\",\n \"--dsw-static-neutral-bluish-50\": \"#cdd6f4\",\n \"--dsw-static-neutral-bluish-600\": \"#45475a\",\n \"--dsw-static-neutral-bluish-60\": \"#bac2de\",\n \"--dsw-static-neutral-bluish-700\": \"#313244\",\n \"--dsw-static-neutral-bluish-750\": \"#313244\",\n \"--dsw-static-neutral-bluish-75\": \"#bac2de\",\n \"--dsw-static-neutral-bluish-800\": \"#313244\",\n \"--dsw-static-neutral-bluish-850\": \"#1e1e2e\",\n \"--dsw-static-neutral-bluish-875\": \"#181825\",\n \"--dsw-static-neutral-bluish-900\": \"#181825\",\n \"--dsw-static-neutral-bluish-950\": \"#11111b\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #f38ba8 20%, #1e1e2e)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #f38ba8 70%, #1e1e2e)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #b36a83 12%, transparent)\",\n \"--dsw-static-red-500\": \"#f38ba8\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #f38ba8 10%, #1e1e2e)\",\n \"--dsw-static-red-600\": \"#f38ba8\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #f38ba8 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #f38ba8 34%, #1e1e2e)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-875)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.5)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.2)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(39, 39, 48, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-850)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted2\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l1\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2\": \"rgba(255, 255, 255, 0.12)\",\n \"--dsw-alias-border-l3\": \"rgba(255, 255, 255, 0.16)\",\n \"--dsw-alias-border-l4\": \"rgba(255, 255, 255, 0.2)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#89b4fa\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(255, 255, 255, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(255, 255, 255, 0.24)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(242, 90, 90, 0.15)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-450) 55%, var(--dsw-static-neutral-bluish-400))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-blue-300) 65%, var(--dsw-static-deepseek-400))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-00) 45%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-alias-label-primary-dimmed)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-800)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-700)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-550)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-800)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-900)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-900)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-active)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 45%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_FLAVORS: readonly CatppuccinFlavorInfo[] = [\n CATPPUCCIN_LATTE,\n CATPPUCCIN_FRAPPE,\n CATPPUCCIN_MACCHIATO,\n CATPPUCCIN_MOCHA,\n]\n","/**\n * Pre-paint palette: the flavour's `--dsw-*` table, injected into the index\n * HTML so the FIRST frame is already Catppuccin (issue #30 补充, 2026-10-27).\n *\n * Why this exists. The official `dsh-client-ui-theme` Host half contributes two\n * boot rows through `webserver/index-inject` (prepended): a head `<style>`\n * painting `body{background-color:#151517}` (or `#fff`) plus `color-scheme`,\n * and a body script that sets `data-ds-dark-theme` for the durable built-in\n * preference. Those decide the colour of everything BEFORE any script runs.\n * Our flavours can only be `theme.register()`ed and `setTheme()`d by the\n * Client bundle, i.e. strictly after first paint — so a Catppuccin user sees\n * the official dark (or light) canvas flash first. Measured by the reporter on\n * 0.6.4 (CPU 3x, fresh browser): first-frame centre pixel `#151517`, official\n * dark, with `flavor: catppuccin-frappe` persisted.\n *\n * The fix mirrors the official rows: paint the same document canvas with the\n * flavour's own token table, and let the Client remove the sheet the moment the\n * flavour theme actually takes over (the sheet must not outlive that point —\n * its selector outranks the official `body` block, so a leftover sheet would\n * pin every token and defeat later theme switches).\n *\n * Contract notes (all verified against the 0.2.1-rc.3 release):\n * - Rows are plain JSON (`IndexInjection`): `{ kind: 'style', text }`,\n * `{ kind: 'html', placement, html }`, `{ kind: 'script', placement, text }`.\n * This module uses `html` for the sheet so it can carry an identifying\n * attribute the Client can query — a `style` row renders without attributes.\n * - The official rows are pushed with `{ prepend: true }`, so rows appended\n * from here land AFTER them; both the style order and the body-script order\n * therefore favour us. Do not rely on that alone: the sheet selector is\n * `html body` (0,0,2), which beats the official `body` (0,0,1) block that the\n * Client bundle injects later, no matter the order.\n * - The served index carries no CSP header, so inline style/script is allowed\n * (the official theme relies on exactly that).\n * - The Host only knows the durable flavour where the config field is a\n * volatile ref (`Config.flavor.get()` on DSH >= 0.1.7). On the legacy seam\n * the entry config is the profile patch's static value, NOT the settings\n * document, so injecting from it would paint the wrong palette — those hosts\n * get no rows at all (`bootPaletteRows` returns `[]`).\n */\nimport { CATPPUCCIN_FLAVORS, type CatppuccinFlavorInfo } from './client/palettes.ts'\n\n/** Attribute marking the injected `<style>` so the Client can find it. */\nexport const BOOT_PALETTE_ATTR = 'data-dsh-catppuccin-boot'\n\n/** One index-injection row, structurally typed (the host package is not a\n * dependency of this plugin, so the shape is declared here — same reasoning as\n * `WebServerLike` in `src/update-check/host.ts`). */\nexport type BootPaletteRow =\n | { kind: 'style'; text: string }\n | { kind: 'script'; placement: 'head' | 'body'; text: string }\n | { kind: 'html'; placement: 'head' | 'body'; html: string }\n\n/** The two config fields this module reads, in BOTH shapes they arrive in:\n * a volatile ref (`{ get() }`) on DSH >= 0.1.7, a plain value on older hosts\n * (where the value is the patch's static default, not the durable choice). */\nexport interface BootPaletteConfig {\n flavor?: { get(): unknown } | unknown\n overrides?: { get(): unknown } | unknown\n}\n\n/** Read a volatile config ref; `undefined` when the field is NOT a ref.\n *\n * Returning `undefined` for plain values is the legacy-host gate described in\n * the module header: a plain `flavor` is the profile patch's default, so\n * painting it would fight the durable document. */\nfunction readVolatile(value: unknown): unknown {\n if (typeof value !== 'object' || value === null) return undefined\n const getter = (value as { get?: unknown }).get\n if (typeof getter !== 'function') return undefined\n try {\n return (getter as () => unknown).call(value)\n } catch {\n return undefined\n }\n}\n\n/**\n * Keep only override entries that are safe to embed in a `<style>` text node.\n *\n * `sanitizeOverrides` (the durable contract) already drops non-`--` keys and\n * non-string values, but a value is arbitrary text: `}</style><script>…` would\n * escape the element, and `;`/`{`/`}` would escape the declaration. Values are\n * CSS expressions, so everything else stays allowed (`color-mix(…)`, `var(…)`,\n * `rgba(…)`, quotes, slashes).\n * @param raw - the durable overrides map as the Host resolved it.\n * @returns the subset safe to concatenate into the sheet.\n */\nexport function cssSafeOverrides(raw: unknown): Record<string, string> {\n const out: Record<string, string> = {}\n if (typeof raw !== 'object' || raw === null) return out\n for (const [key, value] of Object.entries(raw as Record<string, unknown>)) {\n if (typeof value !== 'string') continue\n if (!/^--[A-Za-z0-9_-]+$/u.test(key)) continue\n if (/[<>\\\\{};\\u0000-\\u001f]/u.test(value)) continue\n out[key] = value\n }\n return out\n}\n\n/** The declaration block for one flavour: every token, then the user overrides\n * (last wins), then the canvas colour the boot splash reads. */\nfunction declarationBlock(flavor: CatppuccinFlavorInfo, overrides: Record<string, string>): string {\n const tokens = Object.entries(flavor.tokens).map(([name, value]) => `${name}:${value}`)\n const extra = Object.entries(overrides).map(([name, value]) => `${name}:${value}`)\n return [...tokens, ...extra, 'background-color:var(--dsw-alias-bg-base)'].join(';')\n}\n\n/**\n * The pre-paint `<style>` element (carries {@link BOOT_PALETTE_ATTR}).\n *\n * Two selectors on purpose: `html body` outranks the official `body` block\n * (which the Client bundle installs later), and the `[data-ds-dark-theme]`\n * variant keeps the sheet in force when the official boot script toggled the\n * attribute to the opposite scheme.\n * @param flavor - the persisted flavour.\n * @param overrides - already filtered by {@link cssSafeOverrides}.\n * @returns a complete `<style>…</style>` fragment for a `kind: 'html'` row.\n */\nexport function bootPaletteStyle(\n flavor: CatppuccinFlavorInfo,\n overrides: Record<string, string> = {},\n): string {\n // `color-scheme` follows the flavour so scrollbars, form controls and the\n // `Canvas` keyword are right from the first frame (the official row sets it\n // from the built-in preference, which can be the opposite scheme).\n return `<style ${BOOT_PALETTE_ATTR}>`\n + `:root{color-scheme:${flavor.colorScheme}}`\n + `html body,html body[data-ds-dark-theme]{${declarationBlock(flavor, overrides)}}`\n + '</style>'\n}\n\n/**\n * The body script that aligns the shell's dark-variant attribute with the\n * flavour. Runs after the official script (the official rows are prepended), so\n * it wins; it touches NOTHING else — `data-ds-theme-source` and the font\n * variables stay the official script's business.\n * @param flavor - the persisted flavour.\n * @returns the script text for a `kind: 'script'` row.\n */\nexport function bootPaletteScript(flavor: CatppuccinFlavorInfo): string {\n return `(()=>{document.body.toggleAttribute('data-ds-dark-theme',${flavor.colorScheme === 'dark'})})()`\n}\n\n/**\n * The boot rows for the current Host state: empty when no flavour is persisted\n * (`off`), when the config carries no volatile ref (legacy seam — see the\n * module header), or when the value names no known flavour.\n * @param config - the plugin config the Loader hands `apply`.\n * @returns rows to `push` into the `webserver/index-inject` table.\n */\nexport function bootPaletteRows(config: BootPaletteConfig | undefined): BootPaletteRow[] {\n const flavorId = readVolatile(config?.flavor)\n if (typeof flavorId !== 'string') return []\n const flavor = CATPPUCCIN_FLAVORS.find((candidate) => candidate.themeId === flavorId)\n if (flavor === undefined) return []\n const overrides = cssSafeOverrides(readVolatile(config?.overrides))\n return [\n { kind: 'html', placement: 'head', html: bootPaletteStyle(flavor, overrides) },\n { kind: 'script', placement: 'body', text: bootPaletteScript(flavor) },\n ]\n}\n","","/**\n * Fault-tolerant registration for the plugin's boot-critical wiring.\n *\n * Client and Host share one failure shape: an entry whose `apply()` throws is\n * marked `failed`, the assembly aborts the whole boot (`web boot: N entries\n * did not activate`), and the official desktop's crash rescue then runs\n * `disableAllPlugins()` — taking EVERY third-party plugin down with it. A peer\n * plugin already owning what we are about to register is the realistic\n * trigger (language packs and their BCP 47 ids — issue #23; a duplicate\n * install and its route / slot / theme ids), and the right answer to\n * \"someone else already did this\" is to skip OUR copy — never to fail the\n * boot. Full evidence chain and the per-call-site audit live in\n * `docs/issue-23-registration-tolerance.md`.\n *\n * Known \"already owned\" shapes are skipped quietly — the peer's registration\n * stands, matching `dsh-locale-pack`'s own tolerance. Anything else is logged\n * and skipped too: no registration in this plugin is worth the user's whole\n * plugin set. (To restore fail-fast for a class of errors, `throw error` in\n * the warn branch — every call site routes through here on purpose.)\n */\n\n/** The \"another party already owns this\" messages the runtimes throw, checked\n * against the 0.2.0-rc.2 sources (table in the doc's §6):\n * - `locale \"ja\" is already registered` (dsh-client-locale addLanguage)\n * - `locale namespace \"…\" already has locale \"…\"` (dsh-client-locale register)\n * - `theme \"…\" is already registered` (dsh-client-ui-theme register)\n * - `list slot \"…\" already has an entry with id \"…\"` (dsh-client-ui-slots)\n * - `webserver: duplicate exact route \"…\"` (dsh-host-webserver register) */\nconst ALREADY_OWNED = /already (?:registered|has locale|has an entry)|duplicate .*route/u\n\n/**\n * Run one registration call, degrading any failure to a no-op disposer.\n * @param run - the registration call, returning its disposer (if any).\n * @returns the real disposer, or a no-op when the registration was skipped.\n */\nexport function tolerantRegistration(run: () => (() => void) | void): () => void {\n try {\n return run() ?? (() => {})\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n if (!ALREADY_OWNED.test(message)) {\n console.warn(`[dsh-catppuccin] registration skipped — ${message}`)\n }\n return () => {}\n }\n}\n","/**\n * Minimal semver comparison for update detection — dependency-free, so the\n * Host half and the unit tests share one implementation. Follows the semver\n * 2.0.0 precedence rules for `major.minor.patch[-prerelease][+build]`:\n * build metadata is ignored, prerelease identifiers compare numerically when\n * both are numeric and ASCII-wise otherwise, and a prerelease of the same\n * core sorts before its stable release.\n */\n\n/** A parsed semver triple plus its prerelease identifiers. */\nexport interface ParsedVersion {\n major: number\n minor: number\n patch: number\n /** Prerelease identifiers: numeric parts become numbers, the rest strings. */\n prerelease: readonly (string | number)[]\n}\n\n/** Parse a semver string, or null when it is not `v?x.y.z[-pre][+build]`. */\nexport function parseVersion(raw: string): ParsedVersion | null {\n const match = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?(?:\\+[0-9A-Za-z.-]+)?$/.exec(raw.trim())\n if (match === null) return null\n const prerelease = (match[4] ?? '').split('.').filter((part) => part !== '').map((part) =>\n /^\\d+$/.test(part) ? Number(part) : part,\n )\n return {\n major: Number(match[1]),\n minor: Number(match[2]),\n patch: Number(match[3]),\n prerelease,\n }\n}\n\n/**\n * Order two version strings per semver precedence.\n * @returns -1 when `a` < `b`, 0 when equal, 1 when `a` > `b`.\n * Unparseable inputs sort after every parseable version (equal to\n * each other), so a garbage `current` never reports an update.\n */\nexport function compareVersions(a: string, b: string): number {\n const pa = parseVersion(a)\n const pb = parseVersion(b)\n if (pa === null && pb === null) return 0\n if (pa === null) return 1\n if (pb === null) return -1\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (pa[key] !== pb[key]) return pa[key] < pb[key] ? -1 : 1\n }\n if (pa.prerelease.length === 0 && pb.prerelease.length === 0) return 0\n if (pa.prerelease.length === 0) return 1\n if (pb.prerelease.length === 0) return -1\n const shared = Math.min(pa.prerelease.length, pb.prerelease.length)\n for (let i = 0; i < shared; i += 1) {\n const x = pa.prerelease[i]\n const y = pb.prerelease[i]\n if (x === y) continue\n // Numeric identifiers sort before alphanumeric ones; two numerics compare\n // numerically, two strings ASCII-wise.\n if (typeof x === 'number' && typeof y === 'number') return x < y ? -1 : 1\n if (typeof x === 'number') return -1\n if (typeof y === 'number') return 1\n return x < y ? -1 : 1\n }\n if (pa.prerelease.length !== pb.prerelease.length) {\n return pa.prerelease.length < pb.prerelease.length ? -1 : 1\n }\n return 0\n}\n\n/**\n * Whether `latest` is a strictly newer release than `current` — i.e. whether\n * an update is available. A newer installed prerelease (e.g. a git install\n * ahead of npm) correctly reports no update.\n */\nexport function isUpdateAvailable(current: string, latest: string): boolean {\n return compareVersions(current, latest) < 0\n}\n","/**\n * Shared contract of the update-check feature — consumed by both halves:\n * the Host registers an exact webServer route answering this JSON payload,\n * and the Client settings row fetches that same-origin route and renders it.\n * This module is dependency-free so both bundles inline it.\n */\nimport { compareVersions, parseVersion } from './versions.ts'\nimport type { UpdateChannel } from './state.ts'\n// Type-only (erased at build time): `update-check.ts` stays dependency-free for\n// both bundles while the payload can still name the host kind.\nimport type { ShellKind } from './profile-detect.ts'\n\nexport type { UpdateChannel } from './state.ts'\nexport type { ShellKind } from './profile-detect.ts'\n\n/** The plugin's own npm name (the registry lookup key). */\nexport const PACKAGE_NAME = '@nonamelego/dsh-catppuccin'\n\n/**\n * npm registry abbreviated packument endpoint (the `install-v1` document).\n * The `latest` endpoint alone is not enough: this project ships prereleases\n * under the `beta` dist-tag while `latest` stays on the last stable, so the\n * check reads `dist-tags` to serve both channels.\n */\nexport const REGISTRY_PACKUMENT_URL =\n `https://registry.npmjs.org/${PACKAGE_NAME.replace('/', '%2F')}`\n\n/** Host route the Client row fetches (exact match, same origin). */\nexport const UPDATE_ROUTE_PATH = '/catppuccin/check-update'\n\n/** Network budget for the Host's registry lookup. */\nexport const UPDATE_FETCH_TIMEOUT_MS = 8000\n\n/** Budget for the CLIENT half's same-origin fetch of {@link UPDATE_ROUTE_PATH}\n * (R3, 2026-10-10 review). The Host's own registry lookup is capped at\n * {@link UPDATE_FETCH_TIMEOUT_MS}, so this only ever bites when the host\n * process itself stopped answering — without it a wedged host leaves the\n * settings row stuck in its `checking` phase, where the disabled check button\n * makes a retry impossible. Comfortably larger than the host budget so a\n * slow-but-alive registry lookup is never cut off client-side. */\nexport const UPDATE_CHECK_CLIENT_TIMEOUT_MS = 15_000\n\n/** The `dist-tags` object of an npm packument. */\nexport interface DistTags {\n latest?: string\n beta?: string\n}\n\n/** The newest release a given install should chase, and on which channel. */\nexport interface NewestRelease {\n version: string\n channel: UpdateChannel\n}\n\n/**\n * The copyable CLI upgrade command for one channel (`dsh plugin` is a thin\n * pnpm forwarder). The profile name comes from the Host's runtime probe\n * (`src/profile-detect.ts`), never hard-coded, so the command works on any\n * deployment out of the box.\n *\n * ⚠️ **只适用于 `web` 与 `community-desktop`**(社区壳的应用内 DSH 终端里有效)。\n * 官方 Electron 壳的用户没有可达的终端入口(`resources/runtime/cli/bin/dsh.cmd`\n * 在代码上允许 `manageDesktopProfile: true`,但官方壳 UI 不提供终端),那条路改用\n * {@link pluginSpecFor} + 应用内「插件」页重装。\n * @param channel - the dist-tag to chase.\n * @param profile - the DSH profile name to target.\n */\nexport function updateCommandFor(channel: UpdateChannel, profile: string): string {\n return `dsh plugin --profile ${profile} add ${PACKAGE_NAME}@${channel}`\n}\n\n/**\n * The value to paste into a plugin manager's \"add plugin\" field — the shape the\n * official Electron shell's Plugins page accepts. Its 升级 path is\n * 「先删除、再重新安装同一个包名」, so the spec (not a CLI command) is the\n * copyable artefact there.\n * @param channel - the dist-tag to chase.\n */\nexport function pluginSpecFor(channel: UpdateChannel): string {\n return `${PACKAGE_NAME}@${channel}`\n}\n\n/**\n * Pick the newest release worth reporting for the given install:\n * - with NO channel preference: a stable install chases only `latest` (never\n * downgrades onto a beta), while a prerelease install (e.g. a\n * `beta`-tagged version) also chases `beta` — so beta users see newer\n * betas, and a stable release that outranks their prerelease promotes\n * them via `@latest`;\n * - an explicit `beta` preference (the settings row's prerelease pick)\n * chases `beta` even from a stable install — beta testers opt in without\n * changing their install; the newest of the two tags still wins, so a\n * newer stable promotes them back onto `@latest`;\n * - an explicit `latest` preference pins the check to the stable tag —\n * never a beta, even from a prerelease install.\n * @param current - the installed version.\n * @param tags - the registry's dist-tags.\n * @param preferredChannel - optional persisted channel preference (item I).\n * @returns the newest candidate and its channel, or null when nothing applies.\n */\nexport function selectNewest(current: string, tags: DistTags, preferredChannel?: UpdateChannel): NewestRelease | null {\n const candidates: NewestRelease[] = []\n if (tags.latest !== undefined) candidates.push({ version: tags.latest, channel: 'latest' })\n if (preferredChannel === 'beta') {\n // Beta chase, opt-in: follow the beta tag even from a stable install.\n if (tags.beta !== undefined) candidates.push({ version: tags.beta, channel: 'beta' })\n } else if (preferredChannel === undefined) {\n // No preference: prerelease installs chase beta on top of latest.\n const parsed = parseVersion(current)\n if (tags.beta !== undefined && parsed !== null && parsed.prerelease.length > 0) {\n candidates.push({ version: tags.beta, channel: 'beta' })\n }\n }\n // preferredChannel === 'latest': candidates hold the stable tag only.\n if (candidates.length === 0) return null\n let best = candidates[0]\n for (const candidate of candidates.slice(1)) {\n if (compareVersions(best.version, candidate.version) < 0) best = candidate\n }\n return best\n}\n\n/** Stable machine-readable outcome code (borrowed from the plugin-update\n * error-code discipline of dsh-vision-toolkit): the Client maps it to copy\n * instead of sniffing human text. `network.*` splits the old catch-all\n * `network` (item U): `network.local` means the browser→Host hop failed\n * (host unreachable / DNS — \"check your network\"), `network.upstream` means\n * the Host reached the registry but the lookup timed out (\"npm is\n * temporarily unavailable\"). */\nexport type UpdateErrorCode =\n | 'ok'\n | 'network.local' // the same-origin fetch itself failed (client side)\n | 'network.upstream' // the Host's registry fetch timed out\n | 'registry-unreachable' // npm registry could not be reached (fetch threw)\n | 'registry-http' // registry answered with a non-2xx status\n | 'no-dist-tags' // registry returned no usable dist-tags\n | 'invalid-response' // registry response could not be parsed\n\n/** How this package is installed inside the probed DSH profile. */\nexport type InstallSource = 'registry' | 'link' | 'file' | 'git' | 'unknown'\n\n/** Runtime that answered the check — drives the copy (command hint / restart). */\nexport type UpdateEnv = 'desktop' | 'web'\n\n/**\n * JSON payload of the update check. `ok: false` carries a human-readable\n * `error` plus a stable `code`; `ok: true` carries the comparison result.\n * The Host owns the semver comparison, the channel selection, and the\n * profile probe (single source of truth), so the Client never parses\n * versions or guesses the profile name itself.\n */\nexport interface UpdateCheckPayload {\n /** Whether the registry lookup succeeded. */\n ok: boolean\n /** Installed version (from this package's own manifest). */\n current?: string\n /** Newest release worth chasing (`latest`, plus `beta` for prerelease installs). */\n latest?: string\n /** `latest` is strictly newer than `current`. */\n outdated?: boolean\n /** The dist-tag the newest release came from. */\n channel?: UpdateChannel\n /** Copyable CLI upgrade command (present when outdated). Only on `web` and\n * `community-desktop` — the official shell has no reachable CLI path. */\n updateCommand?: string\n /** `pkg@tag` spec for the Plugins page's \"add plugin\" field. Present instead\n * of {@link updateCommand} on the official desktop shell. */\n updateSpec?: string\n /** Which host answered the check (drives the copy). */\n shell?: ShellKind\n /** DSH profile name the upgrade command targets (probed, not guessed). */\n profile?: string\n /** Whether the profile probe actually found the install (false = fallback). */\n profileDetected?: boolean\n /** Runtime that answered: DSH Desktop vs standard dsh web (drives copy). */\n env?: UpdateEnv\n /** How the package is installed in that profile (drives copy). */\n installSource?: InstallSource\n /** ISO timestamp of the check (registry lookup moment). */\n checkedAt?: string\n /** Stable outcome code (see {@link UpdateErrorCode}). */\n code?: UpdateErrorCode\n /** Failure detail (only when `ok` is false). */\n error?: string\n}\n","/**\n * Runtime probe of the DSH profile this plugin is installed into.\n *\n * Borrowed from dsh-vision-toolkit's plugin-update module (MIT) and trimmed\n * to what the update check needs: instead of hard-coding a profile name into\n * the upgrade command, the Host scans the DSH home's `profiles/` directory\n * (plus the `--profile` argv hint) for the profile whose package.json lists\n * this package as a direct dependency, and classifies the install source so\n * the Client can tell \"registry install → copy the npm command\" apart from\n * \"local link/file/git install → the npm command does not apply\".\n *\n * Pure functions (`profileHint`, `isRegistrySpec`, `installSourceOf`) are\n * dependency-free and unit-tested; the IO probe (`detectProfile`) reads only\n * package.json manifests and never mutates anything.\n */\nimport { readFile, readdir } from 'node:fs/promises'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport type { InstallSource } from './update-check.ts'\nimport { PACKAGE_NAME } from './update-check.ts'\n\n/** Fallback profile name when nothing can be probed (keeps the command valid). */\nexport const FALLBACK_PROFILE = 'web'\n\n/** Which host owns the running profile process. Decides whether a CLI upgrade\n * command applies at all (the official Electron shell has no CLI path a user\n * can reach — see `docs/`/`AGENTS.md`「两个壳两条路」).\n *\n * - `'web'` — plain Node (`dsh web` / CLI / headless).\n * - `'official-desktop'` — `deepseek-ai/deepseek-harness` 的 `apps/desktop`:\n * 取证(2026-10-03,`resources/app.asar` 内 `desktopNodeEnvironment`)——\n * host 子进程的 env 只被写成 `{...壳自己的 env, ELECTRON_RUN_AS_NODE: '1'}`,\n * **不设** `DSH_DESKTOP_NODE_EXECUTABLE`(那段在 `bin === undefined` 时被跳过:\n * `desktopNodeEnvironment(this.node, void 0, this.environment)`),\n * `apps/desktop-host` 也不注册任何 cordis 服务(官方 0.2.0-rc.2 全套包里\n * `desktopProfiles` 命中 **0**)⇒ 它在 profile 进程里只剩\n * 「Electron-as-node 运行时」这一条痕迹。\n * - `'community-desktop'` — `anywhere-labs/dsh-desktop`:Stable/Beta 通道的 launcher\n * 注册 `desktopProfiles` 服务(`dsh-plugin-desktop/src/profile-service.ts`),\n * Next 通道的 host env 里放 `DSH_DESKTOP_NODE_EXECUTABLE`\n * (`dsh-desktop-next/src/host/index.ts`)——任一命中即可。\n *\n * ⚠️ 判定顺序:**先两条社区信号,再拿 Electron 运行时尚余的当官方**。\n * 代价与 `isDesktopShellEnv` 相同——「用 Electron 壳跑 dsh web」这类少见组合会落到\n * `official-desktop`,而误判只影响提示文案(不出现 CLI 命令),不出现危险动作。\n */\nexport type ShellKind = 'web' | 'official-desktop' | 'community-desktop'\n\n/** The community launcher's env marker (`dsh-desktop-next` sets it on the host,\n * and both community channels set it on package-install children). */\nfunction hasCommunityMarker(env: Record<string, string | undefined>): boolean {\n const marker = env.DSH_DESKTOP_NODE_EXECUTABLE\n return typeof marker === 'string' && marker.trim() !== ''\n}\n\n/**\n * Classify the host that owns this profile process (see {@link ShellKind} for\n * the evidence behind each branch).\n * @param options - the inputs to classify on, all injectable for tests.\n * @param options.env - the process environment to inspect.\n * @param options.versions - `process.versions` to inspect (defaults to the running process's).\n * @param options.desktopProfilesCurrent - `desktopProfiles.current.name` when the\n * community launcher exposes that service; `undefined` on the official shell.\n * @returns the host kind.\n */\nexport function classifyShell(options: {\n env: Record<string, string | undefined>\n versions?: Record<string, string | undefined>\n desktopProfilesCurrent?: string | undefined\n}): ShellKind {\n const current = options.desktopProfilesCurrent\n if (typeof current === 'string' && current.trim() !== '') return 'community-desktop'\n if (hasCommunityMarker(options.env)) return 'community-desktop'\n return isElectronRuntime(options.versions ?? process.versions) ? 'official-desktop' : 'web'\n}\n\n/** Whether this process runs inside Electron (Node mode included).\n *\n * Electron-as-node(`ELECTRON_RUN_AS_NODE=1`)**仍然**填 `process.versions.electron`\n * —— 2026-09-24 本机实测:Electron 37.10.3 下为 `'37.10.3'`,纯 node 下为 `undefined`。\n * 官方桌面壳的 Host 正是由 Electron 以 node 模式 spawn 的(`apps/desktop/src/host-process.ts`\n * 用 Electron 可执行文件 + `ELECTRON_RUN_AS_NODE=1`),所以这是它在 profile 进程里留下的**唯一**痕迹。\n * @param versions - `process.versions` to inspect (injectable so tests need no real Electron).\n * @returns whether the runtime is Electron rather than a plain Node.js.\n */\nexport function isElectronRuntime(\n versions: Record<string, string | undefined> = process.versions,\n): boolean {\n const electron = versions.electron\n return typeof electron === 'string' && electron.trim() !== ''\n}\n\n/**\n * Detect a DSH desktop shell — two independent signals, either one is enough:\n *\n * 1. **社区壳**(`anywhere-labs/dsh-desktop`,含其 `dsh-desktop-next` 重写版)在 profile\n * 进程的环境里放 `DSH_DESKTOP_NODE_EXECUTABLE`(它的包安装/内部启动器约定)。\n * 2. **官方壳**(`deepseek-ai/deepseek-harness` 的 `apps/desktop` + `apps/desktop-host`,\n * `private: true`、未发 npm)**什么都不设**:⚠️ 2026-09-24 取证推翻 2026-09-22 的假设——\n * 上游架构说明原话是「`DSH_DESKTOP_NODE_EXECUTABLE` **仅为包安装注入**」\n * (`.agents/notes/implemented/architecture/2026-09-11-desktop-electron-node-runtime.zh.md`),\n * 代码印证:`host-process.ts` 以 `desktopNodeEnvironment(this.node, undefined, …)` 起 host,\n * `bin === undefined` 时不设它;`apps/desktop-host/src/index.ts` 只在\n * `runProfile({ packageManager: { env } })` 里给它。于是官方壳在 profile 进程里靠**运行时**识别:\n * Host 是 Electron-as-node,故 `process.versions.electron` 有值(见 `isElectronRuntime`)。\n *\n * 官方仓**没有** `desktopProfiles` 服务(2026-09-22 全仓搜索命中 0),所以那路服务探测只覆盖社区壳;\n * 两路都不命中时回落纯 web 文案——**profile 名不受影响**(`detectProfile` 扫 `profiles/` 目录命中 `desktop`),\n * 持久化也不受影响(走 `configForms` seam,与壳无关)。\n * 代价权衡:在「用 Electron 壳跑 dsh web」这类少见组合下会误判成桌面,而误判只影响提示文案措辞。\n * @param env - the environment to inspect (injectable so tests need no real desktop).\n * @param versions - `process.versions` to inspect (injectable for the same reason).\n * @returns whether this process looks like a DSH desktop shell.\n */\nexport function isDesktopShellEnv(\n env: Record<string, string | undefined>,\n versions: Record<string, string | undefined> = process.versions,\n): boolean {\n // Coarse OR, expressed through the single source of truth so the two can\n // never drift: the `desktopProfiles` signal is the caller's (host-side) input\n // and is simply absent here. Prefer `classifyShell` when the copy must\n // distinguish the two shells.\n return classifyShell({ env, versions }) !== 'web'\n}\n\n/** The DSH home the running process owns — `$DSH_HOME` when set, else\n * `~/.dsh`. Port-independent and stable across restarts, so it is the right\n * root for the plugin's durable state file. */\nexport function defaultDshHome(): string {\n return process.env.DSH_HOME?.trim() || join(homedir(), '.dsh')\n}\n\n/** How this package's dependency spec was written in the profile manifest. */\nexport interface ProfileProbe {\n /** Profile name to target in the upgrade command. */\n name: string\n /** Whether the probe actually matched a profile (false = fallback). */\n detected: boolean\n /** Install source classification of this package in that profile. */\n installSource: InstallSource\n}\n\n/**\n * Extract the profile name a running DSH process was started with: either a\n * leading bare `web`-style argument or an explicit `--profile <name>` /\n * `--profile=<name>` flag. Mirrors vision-toolkit's `profileHint`.\n */\nexport function profileHint(argv: readonly string[]): string | undefined {\n if (argv[0] === 'web') return 'web'\n for (let index = 0; index < argv.length; index += 1) {\n const value = argv[index]\n if (value?.startsWith('--profile=')) return value.slice('--profile='.length)\n if (value === '--profile') return argv[index + 1]\n }\n return undefined\n}\n\n/**\n * Whether a dependency spec is a plain npm registry spec (a semver range),\n * not a local/workspace/git/URL source. Mirrors vision-toolkit's\n * `registryInstallSpec`.\n */\nexport function isRegistrySpec(spec: string): boolean {\n const normalized = spec.trim().toLowerCase()\n return normalized.length > 0\n && !normalized.startsWith('workspace:')\n && !/^[a-z][a-z0-9+.-]*:/u.test(normalized)\n && !normalized.includes('/')\n && !normalized.includes('\\\\')\n}\n\n/** Classify a non-registry spec into the more precise local source kind. */\nexport function installSourceOf(spec: string): InstallSource {\n const normalized = spec.trim().toLowerCase()\n if (normalized.startsWith('link:') || normalized.startsWith('workspace:')) return 'link'\n if (normalized.startsWith('file:')) return 'file'\n return 'git'\n}\n\n/** Read one profile's manifest at its manifest dir and return this package's install source. */\nasync function inspectProfileAt(manifestDir: string): Promise<InstallSource | undefined> {\n try {\n const manifest = JSON.parse(\n await readFile(join(manifestDir, 'package.json'), 'utf8'),\n ) as { dependencies?: Record<string, unknown> }\n const spec = manifest.dependencies?.[PACKAGE_NAME]\n if (typeof spec !== 'string') return undefined\n return isRegistrySpec(spec) ? 'registry' : installSourceOf(spec)\n } catch {\n return undefined\n }\n}\n\n/** Read one profile under the DSH home and return this package's install source. */\nasync function inspectProfile(dshHome: string, name: string): Promise<InstallSource | undefined> {\n return inspectProfileAt(join(dshHome, 'profiles', name))\n}\n\n/** The launcher-resolved profile under DSH Desktop (`desktopProfiles.current`). */\nexport interface DesktopProfileHint {\n /** Launcher-selected profile name. */\n name: string\n /** Absolute manifest dir; falls back to the DSH-home scan path when absent. */\n dir?: string\n}\n\n/**\n * Probe the DSH profile this package is installed into.\n * Priority: an authoritative `desktopProfile` (DSH Desktop's\n * `desktopProfiles.current` — the Desktop docs say never infer the profile\n * from argv / settings / `$DSH_HOME` when it is available), then the\n * `--profile`/bare-name argv hint, then a scan of every `profiles/` entry\n * whose manifest lists this package as a direct dependency. Falls back to\n * `FALLBACK_PROFILE` with `detected: false` when nothing matches (e.g. a dev\n * install outside any profile).\n */\nexport async function detectProfile(options: {\n /** DSH home; defaults to $DSH_HOME or `~/.dsh`. */\n dshHome?: string\n /** Process argv slice; defaults to the running process's argv. */\n argv?: readonly string[]\n /** Authoritative profile under DSH Desktop (`desktopProfiles.current`), when running there. */\n desktopProfile?: DesktopProfileHint | undefined\n} = {}): Promise<ProfileProbe> {\n const dshHome = options.dshHome ?? defaultDshHome()\n const argv = options.argv ?? process.argv.slice(2)\n\n // DSH Desktop wins over every probe: the launcher already resolved the\n // active profile, so the upgrade command targets it directly. The install\n // source still comes from reading that profile's manifest (via its explicit\n // dir) so the \"npm command does not apply\" local-install hint keeps working.\n const desktop = options.desktopProfile\n if (desktop?.name) {\n const dir = desktop.dir?.trim() || join(dshHome, 'profiles', desktop.name)\n const source = await inspectProfileAt(dir)\n return { name: desktop.name, detected: true, installSource: source ?? 'unknown' }\n }\n\n const hint = profileHint(argv)\n\n if (hint !== undefined) {\n const source = await inspectProfile(dshHome, hint)\n if (source !== undefined) return { name: hint, detected: true, installSource: source }\n }\n\n const profilesDir = join(dshHome, 'profiles')\n let names: string[] = []\n try {\n names = (await readdir(profilesDir, { withFileTypes: true }))\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name)\n } catch {\n // No profiles directory — the fallback below still produces a valid command.\n }\n if (hint !== undefined && !names.includes(hint)) names.push(hint)\n\n for (const name of names) {\n const source = await inspectProfile(dshHome, name)\n if (source !== undefined) return { name, detected: true, installSource: source }\n }\n\n return { name: hint ?? FALLBACK_PROFILE, detected: false, installSource: 'unknown' }\n}","/**\n * Host half of the update-check feature (extracted from `src/index.ts` —\n * item A). Owns the exact webServer route, the npm registry lookup, the\n * short-TTL verdict cache, the ETag conditional-request cache (item W), and\n * the channel preference parsed from the query string (item I).\n *\n * The Client settings row fetches this same-origin route and renders the\n * verdict; every move the route makes (semver comparison, channel choice,\n * profile probe) happens here so the Client never parses versions or\n * guesses profile names.\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport pkg from '../../package.json'\nimport { tolerantRegistration } from '../registration-tolerance.ts'\nimport {\n REGISTRY_PACKUMENT_URL,\n UPDATE_FETCH_TIMEOUT_MS,\n UPDATE_ROUTE_PATH,\n pluginSpecFor,\n selectNewest,\n updateCommandFor,\n type UpdateChannel,\n type UpdateCheckPayload,\n type UpdateEnv,\n} from '../update-check.ts'\nimport { isUpdateAvailable } from '../versions.ts'\nimport { classifyShell, detectProfile, type ShellKind } from '../profile-detect.ts'\n\n// Minimal structural types for the parts of node:http and the webServer\n// service this plugin touches. The host bundle resolves cordis and friends\n// from the profile tree at runtime and ships no @types/node, so the route\n// contract is spelled out locally instead of imported.\ninterface HttpRequestLike {\n url?: string\n method?: string\n on(event: 'data', listener: (chunk: Uint8Array) => void): unknown\n on(event: 'end', listener: () => void): unknown\n on(event: 'error', listener: (error: Error) => void): unknown\n}\ninterface HttpResponseLike {\n writeHead(status: number, headers: Record<string, string>): void\n end(body?: string): void\n}\ninterface WebRouteLike {\n kind: 'exact' | 'prefix'\n path: string\n handler: (req: HttpRequestLike, res: HttpResponseLike) => void | Promise<void>\n}\ninterface WebServerLike {\n register(route: WebRouteLike): () => void\n}\n\n/** Minimal structural type for DSH Desktop's public `desktopProfiles` service\n * (the host bundle ships no dsh-plugin-desktop types). */\ninterface DesktopProfilesLike {\n readonly current?: {\n readonly name: string\n readonly dir?: string\n }\n}\n\n/** Query-string channel preference (item I): `?channel=beta` chases the\n * beta tag from a stable install; anything else keeps the install-derived\n * channel logic of `selectNewest`. */\nfunction parseChannel(url: string | undefined): UpdateChannel | undefined {\n if (url === undefined) return undefined\n try {\n const channel = new URL(url, 'http://dsh.localhost').searchParams.get('channel')\n return channel === 'beta' ? 'beta' : channel === 'latest' ? 'latest' : undefined\n } catch {\n return undefined\n }\n}\n\nfunction sendJson(res: HttpResponseLike, status: number, payload: unknown): void {\n res.writeHead(status, { 'content-type': 'application/json; charset=utf-8' })\n res.end(JSON.stringify(payload))\n}\n\n/** Result of one registry lookup: an OK payload, a 304 not-modified (serve\n * the cached verdict), or an error payload (never cached). */\ntype FetchResult =\n | { kind: 'ok'; payload: UpdateCheckPayload; etag?: string }\n | { kind: 'not-modified' }\n | { kind: 'error'; payload: UpdateCheckPayload }\n\n/** Query the npm registry and build the check payload. The probe result\n * feeds the upgrade command's profile name and the install-source copy, so\n * the Client never guesses either. Under DSH Desktop the target profile is\n * `desktopProfiles.current` (launcher-resolved, authoritative), so the\n * copied command targets the right profile there too.\n *\n * The `shell` decides WHICH artefact is copyable: `web` / `community-desktop`\n * get the CLI command (`dsh plugin --profile … add …`), the official Electron\n * shell gets the bare `pkg@tag` spec, because its 升级 path is the in-app\n * Plugins page (delete → re-add) and its users have no reachable terminal.\n *\n * Failure classification (item U): a timed-out lookup (the abort fired) is\n * `network.upstream` — the npm registry is temporarily unavailable; a\n * fetch that throws outright (DNS / connection refused) stays\n * `registry-unreachable`; the 304 conditional path (item W) revalidates\n * the cached verdict without pulling the full packument again. */\nasync function fetchLatestVersion(options: {\n env: UpdateEnv\n shell: ShellKind\n channel?: UpdateChannel\n etag?: string\n desktopProfile?: DesktopProfilesLike['current']\n}): Promise<FetchResult> {\n const current = pkg.version\n const probe = await detectProfile(\n options.desktopProfile !== undefined ? { desktopProfile: options.desktopProfile } : {},\n )\n const base = {\n current,\n env: options.env,\n shell: options.shell,\n profile: probe.name,\n profileDetected: probe.detected,\n installSource: probe.installSource,\n checkedAt: new Date().toISOString(),\n }\n const controller = new AbortController()\n const timer = setTimeout(() => controller.abort(), UPDATE_FETCH_TIMEOUT_MS)\n let response: Response\n try {\n response = await fetch(REGISTRY_PACKUMENT_URL, {\n signal: controller.signal,\n headers: {\n accept: 'application/vnd.npm.install-v1+json',\n // Item W: conditional request — a 304 answer revalidates the cached\n // verdict without pulling the full packument again.\n ...(options.etag !== undefined ? { 'if-none-match': options.etag } : {}),\n },\n })\n } catch (error) {\n const timedOut = controller.signal.aborted\n return {\n kind: 'error',\n payload: {\n ...base,\n ok: false,\n code: timedOut ? 'network.upstream' : 'registry-unreachable',\n error: error instanceof Error ? error.message : String(error),\n },\n }\n } finally {\n clearTimeout(timer)\n }\n // 304: the registry's own cache says our cached verdict is still current.\n if (response.status === 304) return { kind: 'not-modified' }\n if (!response.ok) {\n return {\n kind: 'error',\n payload: {\n ...base,\n ok: false,\n code: 'registry-http',\n error: `npm registry responded HTTP ${response.status}`,\n },\n }\n }\n let data: { 'dist-tags'?: Record<string, string> }\n try {\n data = await response.json() as { 'dist-tags'?: Record<string, string> }\n } catch {\n return {\n kind: 'error',\n payload: { ...base, ok: false, code: 'invalid-response', error: 'npm registry returned an unparseable packument' },\n }\n }\n const newest = selectNewest(current, data['dist-tags'] ?? {}, options.channel)\n if (newest === null) {\n return {\n kind: 'error',\n payload: { ...base, ok: false, code: 'no-dist-tags', error: 'npm registry returned no usable dist-tags' },\n }\n }\n const outdated = isUpdateAvailable(current, newest.version)\n const etag = response.headers.get('etag') ?? undefined\n return {\n kind: 'ok',\n ...(etag !== undefined ? { etag } : {}),\n payload: {\n ...base,\n ok: true,\n code: 'ok',\n latest: newest.version,\n outdated,\n channel: newest.channel,\n ...(outdated\n ? options.shell === 'official-desktop'\n ? { updateSpec: pluginSpecFor(newest.channel) }\n : { updateCommand: updateCommandFor(newest.channel, probe.name) }\n : {}),\n },\n }\n}\n\n/** Short TTL for the cached registry verdict: repeated checks (settings row\n * re-opened, user re-clicks) don't re-hit npm; failures stay uncached so the\n * next click retries for real. The ETag (item W) lets a stale-but-valid\n * cache refresh itself with a conditional request instead of a full\n * packument pull — npm traffic drops to one 304 per 5 minutes.\n *\n * The cache is keyed by the requested channel (item I): switching the row's\n * channel must produce the new channel's verdict, not a stale cached one. */\nconst UPDATE_CACHE_TTL_MS = 5 * 60 * 1000\n\ninterface UpdateCacheEntry {\n at: number\n etag?: string\n payload: UpdateCheckPayload\n}\n\n/** Channel cache buckets. No query param and an explicit channel select\n * differently for a prerelease install (`selectNewest` only chases beta\n * without a preference), so the default bucket is DISTINCT from `latest` —\n * a pinned-latest check must never serve a beta verdict from the\n * unopinionated bucket (and vice versa). */\ntype CacheBucket = 'default' | UpdateChannel\n\nconst updateCaches = new Map<CacheBucket, UpdateCacheEntry>()\n\nfunction cacheKeyOf(channel: UpdateChannel | undefined): CacheBucket {\n return channel ?? 'default'\n}\n\n/** Answer the update-check route with the JSON contract from update-check.ts.\n * Classifies the host into `web` / `community-desktop` / `official-desktop`\n * (see `classifyShell`) and shapes the upgrade copy accordingly: a CLI command\n * for the first two, the `pkg@tag` spec for the official Electron shell —\n * whose env marker is **absent** by construction, and where an in-app\n * Plugins-page reinstall is the only path a user can actually take.\n *\n * The route itself is stateless about retries: item V's 30s auto-retry is\n * scheduled by the settings row (an immediate route retry would just hang\n * a manual click); once a failure has passed the 5-minute window, the next\n * request re-runs the lookup for real. */\nasync function handleUpdateCheck(ctx: Context, req: HttpRequestLike, res: HttpResponseLike): Promise<void> {\n const channel = parseChannel(req.url)\n const key = cacheKeyOf(channel)\n const entry = updateCaches.get(key)\n if (entry !== undefined && Date.now() - entry.at < UPDATE_CACHE_TTL_MS) {\n sendJson(res, 200, entry.payload)\n return\n }\n const desktopProfiles = ctx.get('desktopProfiles') as DesktopProfilesLike | undefined\n const current = desktopProfiles?.current\n // Classify the host (see `classifyShell` for the evidence): two community\n // signals first — the launcher's `desktopProfiles` service and its\n // `DSH_DESKTOP_NODE_EXECUTABLE` host marker — then Electron-as-node as the\n // official shell's only trace. The kind decides WHICH artefact is copyable:\n // web / community get the CLI command, the official shell gets the `pkg@tag`\n // spec for its in-app Plugins page.\n const shell = classifyShell({ env: process.env, desktopProfilesCurrent: current?.name })\n const isDesktop = shell !== 'web'\n const result = await fetchLatestVersion({\n env: isDesktop ? 'desktop' : 'web',\n shell,\n channel,\n ...(entry?.etag !== undefined ? { etag: entry.etag } : {}),\n ...(isDesktop ? { desktopProfile: current } : {}),\n })\n if (result.kind === 'ok') {\n updateCaches.set(key, { at: Date.now(), payload: result.payload, ...(result.etag !== undefined ? { etag: result.etag } : {}) })\n sendJson(res, 200, result.payload)\n return\n }\n if (result.kind === 'not-modified') {\n // The registry 304'd our conditional request: refresh the cache window\n // and serve the stored verdict (item W). A cache is guaranteed here —\n // we only send If-None-Match when one exists.\n if (entry !== undefined) updateCaches.set(key, { ...entry, at: Date.now() })\n const cached = entry?.payload\n if (cached !== undefined) {\n sendJson(res, 200, cached)\n return\n }\n }\n // Registry failure (or the unreachable not-modified-without-cache\n // combination): the error payload is never cached, so the next check\n // retries for real.\n sendJson(res, 502, result.kind === 'error'\n ? result.payload\n : { ok: false, code: 'invalid-response', error: 'registry state inconsistency' } as UpdateCheckPayload)\n}\n\n/** Register the update-check route on the owning context. `webServer` is a\n * hard inject dependency of the Host plugin, so it is guaranteed live when\n * this runs — mounting can never race ahead of the service. */\nexport function registerUpdateCheckRoute(ctx: Context): void {\n const webServer = ctx.get('webServer') as WebServerLike\n // Tolerant (issue #23): a duplicate install registers the same exact route\n // twice and upstream throws `webserver: duplicate exact route \"…\"` — a raw\n // throw here fails this Host entry at startup. A skip is right: the peer's\n // instance serves the route.\n ctx.effect(() => tolerantRegistration(() => webServer.register({\n kind: 'exact',\n path: UPDATE_ROUTE_PATH,\n // Request-scope guard: this is a bare `void` call, so an escaping\n // rejection would be an unhandled rejection (Node's default terminates\n // the process). Every internal branch already catches; this is the\n // last-resort log.\n handler: (req, res) => {\n void handleUpdateCheck(ctx, req, res).catch((error: unknown) => {\n console.warn(`[dsh-catppuccin] update-check route failed: ${String(error)}`)\n })\n },\n })), 'dsh-catppuccin: update-check route')\n}","/**\n * Durable Catppuccin state — the shared contract between the two halves.\n *\n * Why this exists: localStorage is scoped per origin, so it is the wrong place\n * for the ONLY copy of a preference. It is per-browser (two browsers on one\n * machine disagree), per-loopback-port (a second Desktop instance that lands\n * on the next free port gets a different origin — the official shell pins\n * `19387` and `anywhere-labs/dsh-desktop` starts at `43120` and increments on\n * a bind collision, both observed 2026-09-24), and it disappears whenever the\n * user clears site data. The durable copy lives in the official settings seam\n * under the DSH home, which is the machine-wide truth every browser and every\n * profile entry reads.\n *\n * (Historical note, corrected 2026-09-24: the 0.5.0 rationale claimed DSH\n * Desktop launched the profile with `--port 0`, \"a fresh random port every\n * launch\". That was already untrue when 0.5.0 shipped — the community shell\n * pinned a stable port on 2026-08-21, and the official shell passes an\n * explicit `--port 19387`. The design is unchanged and still justified by the\n * reasons above, but do not repeat the port-per-launch claim.)\n *\n * Since 0.5.0 the DURABLE copy lives in the official settings seam, which\n * persists under the DSH home exactly like the legacy\n * `$DSH_HOME/catppuccin-state.json` did — origin-independent, so it survives\n * the Desktop's per-launch port churn. The legacy file is kept as a\n * read-only migration source (`src/legacy-state.ts`) and rolled into the\n * settings document once (`src/index.ts`). Browser localStorage remains the\n * in-browser cache and cross-tab sync bus, and the Client's fallback when the\n * settings transport is unavailable. This module is dependency-free so both\n * bundles inline it (like `update-check.ts`).\n *\n * The seam itself is version-dependent (issue #15): DSH <= 0.1.6-alpha.2\n * serves a Client `ctx.settingsScope` bound to a namespace the plugin\n * registers itself (`CATPPUCCIN_SETTINGS_NS`), while >= 0.1.7-alpha.1 serves\n * `ctx.configForms` projecting the plugin's volatile `Config` form, keyed by\n * the PROFILE ENTRY ID (`CATPPUCCIN_ENTRY_ID`). Both are addressed from this\n * one contract (see `src/client/state-sync.ts`).\n */\nexport const STATE_VERSION = 1\n\n/** Release channels the update check knows about (a persisted preference;\n * `selectNewest` in `update-check.ts` consumes it). */\nexport type UpdateChannel = 'latest' | 'beta'\n\n/** Shiki syntax-highlighting style variants (see `src/client/shiki-tokens.ts`). */\nexport type ShikiStyle = 'default' | 'italic-comments'\n\n/** Legacy settings namespace (DSH <= 0.1.6-alpha.2): the Host registers it\n * through `settings.installSection`, the Client binds it through\n * `ctx.settingsScope` (see `src/settings-catppuccin.ts`). */\nexport const CATPPUCCIN_SETTINGS_NS = 'catppuccin'\n\n/**\n * Profile entry id carrying the plugin (DSH >= 0.1.7-alpha.1): the settings\n * service projects our volatile `Config` into a form named by the ACTIVE\n * PROFILE ENTRY's id, so this constant is the new seam's namespace.\n *\n * It is a CONTRACT with `cordis.patch.yml`: the `insert` row whose `name` is\n * `@nonamelego/dsh-catppuccin` must keep `id: dsh-catppuccin`, because the\n * Client can only address the form by that id (asserted by\n * `tests/settings-seam.spec.ts`). A user who renames the entry loses the new\n * seam and degrades to localStorage-only — the legacy seam is unaffected,\n * since that namespace is registered by the plugin itself.\n */\nexport const CATPPUCCIN_ENTRY_ID = 'dsh-catppuccin'\n\n/** State file name under the DSH home (kept next to the Desktop-managed\n * `cordis.patch.yml` so it survives the Desktop's per-launch port churn). */\nexport const STATE_FILENAME = 'catppuccin-state.json'\n\n/**\n * Whether a raw settings view carries a user layer at all.\n *\n * The two seams answer this differently and the difference is load-bearing\n * (issue #15): the NEW form's `user` is the profile patch's `override`, which\n * `configEditor.configuration()` defaults to `{}` — so \"absent\" arrives as an\n * EMPTY OBJECT, and `!== undefined` would be true forever. The LEGACY\n * document omits the field entirely when the document holds no such section,\n * so the old `!== undefined` test stays correct there. Callers must use the\n * predicate their channel defines (see `src/client/state-sync.ts`).\n * @param user - a snapshot's raw user layer.\n * @returns whether it holds at least one entry.\n */\nexport function hasUserLayerSection(user: unknown): boolean {\n return typeof user === 'object' && user !== null && !Array.isArray(user) && Object.keys(user).length > 0\n}\n\n/** The four registered Catppuccin theme ids. MUST stay in sync with the\n * `themeId` of `CATPPUCCIN_FLAVORS` in `src/client/palettes.ts` — guarded by\n * `tests/state.spec.ts` — because the persisted flavour value IS the theme id. */\nexport const CATPPUCCIN_THEME_IDS = [\n 'catppuccin-latte',\n 'catppuccin-frappe',\n 'catppuccin-macchiato',\n 'catppuccin-mocha',\n] as const\n\n/** A persisted flavour choice: one registered theme id or `off` (fall back to\n * the official theme). */\nexport type FlavorValue = (typeof CATPPUCCIN_THEME_IDS)[number] | 'off'\n\n/** Durable glass-layer settings (no derived `dark` field — that resolves at\n * runtime from the active theme). */\nexport interface GlassState {\n /** Layer enable flag. */\n enabled: boolean\n /** Rendering mode. */\n mode: 'mica' | 'compat'\n /** Glass blur radius, px (0-40). */\n blur: number\n /** Glass fill frost, 0-100. */\n frost: number\n /** Backdrop brightness, 0-100. */\n brightness: number\n /**\n * Floating-card inset, px (issue #31, {@link GLASS_GAP_MIN}..{@link GLASS_GAP_MAX}).\n *\n * The whitespace between every mica-mode card and the window edge: the\n * sidebar sheet's margin on all four sides, the header card's top margin,\n * the trajectory card's top/bottom margin and the composer bar's bottom pad.\n * ONE knob for all of them, because they were all a hardcoded 12px and the\n * reporter's problem (\"在我这块屏上略挤\") is the whole chrome reading tight,\n * not one card.\n *\n * It deliberately does NOT touch content width: the chat column keeps its\n * upstream-computed width and the reading-column gutter (`calc(100% - 32px)`)\n * stays a literal. The sidebar SHEET does narrow by the delta, because its\n * margin is taken out of the (upstream-fixed) sidebar column — that trade is\n * the documented semantics, see `docs/issue-gh-31-card-gap.md`.\n */\n gap: number\n /**\n * How strong the ground glows read, percent of the shipped 0.6.3 look\n * (`GLOW_STRENGTH_DEFAULT` = 100 = the alphas issue #25 shipped; 0 = gone).\n * Only meaningful while {@link glow} is on — a separate scalar instead of\n * folding the switch into the number, because the settings seam reads\n * \"resolves to the shipped default\" as \"no user choice yet\": merging the two\n * would make every existing `glow: true` document (which has no strength\n * field) resolve to 0 and silently switch the glows off.\n *\n * The ceiling is a PROVISIONAL, deliberately conservative number: the glows\n * are painted under text, and Latte is the strictest scheme (both glows sit\n * on `#eff1f5`). 200% keeps the brand glow's peak alpha at 24%, which is the\n * last step that plausibly leaves `label-primary` at AA over the brightest\n * patch — the CDP contrast run that pins the real limit is listed as an open\n * item in `docs/issue-32-glow-tuning.md` §6. Lower this constant if that run\n * disagrees; never raise it without one.\n */\n glowStrength: number\n /**\n * How far the two ground glows SPREAD, percent of the shipped 0.6.3 geometry\n * (issue #32 follow-up, 100 = `58% 46%` / `48% 42%` as #25 drew them).\n * `GLOW_SIZE_MIN` is 100 on purpose — the knob only ENLARGES, and its left\n * end is the shipped look, so \"unchanged\" is always reachable without\n * guessing. Enlarging keeps the peak alpha where it was (the radius is\n * geometry, not opacity) and flattens the falloff, which is the answer to\n * the reporter's real complaint: at 200% strength on Latte the TWO centre\n * patches read as \"a stuck-on colour dab\"; spreading them does not touch the\n * peak, it just stops the light piling up in the corner. It also LOWERS the\n * per-pane variation issue #26 measured, because the gradient slope across a\n * pane shrinks with the radius.\n *\n * Only meaningful while {@link glow} is on. Positions stay hardcoded — the\n * \"where is the light\" axis is deliberately not exposed (see\n * `docs/issue-32-glow-tuning.md` §2).\n */\n glowSize: number\n /**\n * The optional ground GLOWS (issue #26, 2026-10-16). The page ground is\n * always a same-family wash (the \"C\" answer to the reporter's report: the\n * wash gives the glass something to transmit without localising the\n * brightness); this knob adds back the two static radial glows that shipped\n * in 0.6.3-beta.0 (issue #25) for users who liked them.\n *\n * Default OFF, and that default IS the reported fix: the glows are fixed to\n * screen coordinates while the glass panes sit elsewhere, so each pane\n * transmits a different slice of them — measured on the live page, one\n * sidebar card read ΔRGB (12,15,21) between its own top and bottom with the\n * glows on, and ≤(4,4,5) with the wash alone (see\n * `docs/issue-26-ambient-ground.md` / the CHANGELOG entry). The knob exists\n * because #25 was filed by the same reporter: rather than deleting the look\n * outright, it stays an opt-in.\n */\n glow: boolean\n}\n\n/** The whole durable state the plugin persists. */\nexport interface CatppuccinState {\n /** Schema version; anything else is treated as unknown and defaulted. */\n version: typeof STATE_VERSION\n /** Selected flavour (theme id or `off`). */\n flavor: FlavorValue\n /** Glass-layer settings (enable flag + knobs). */\n glass: GlassState\n /** Automatically re-check for updates (boot + periodic, while on). */\n autoCheck: boolean\n /** Release channel the update check chases. */\n updateChannel: UpdateChannel\n /** Per-token `--dsw-*` overrides merged LAST into the active theme. */\n overrides: Record<string, string>\n /** Shiki syntax-highlighting style variant. */\n shikiStyle: ShikiStyle\n}\n\n/** The settings-document section: `CatppuccinState` minus the synthetic\n * `version` field — the official seam resolves defaults, composition and the\n * user layer itself, so no plugin-side version is stored. */\nexport interface CatppuccinSettingsSection {\n /** Selected flavour (theme id or `off`). */\n flavor: FlavorValue\n /** Glass-layer settings (enable flag + knobs). */\n glass: GlassState\n /** Automatically re-check for updates (boot + periodic, while on). */\n autoCheck: boolean\n /** Release channel the update check chases. */\n updateChannel: UpdateChannel\n /** Per-token `--dsw-*` overrides merged LAST into the active theme. */\n overrides: Record<string, string>\n /** Shiki syntax-highlighting style variant. */\n shikiStyle: ShikiStyle\n}\n\n/** Lower bound of the floating-card inset (issue #31). 4px is the tightest a\n * card can sit against the window edge and still read as a floating sheet —\n * below that the rim and the drop shadow collapse into the edge. */\nexport const GLASS_GAP_MIN = 4\n\n/** Upper bound of the floating-card inset (issue #31). 24px is where the\n * collapsed sidebar rail's right-edge cap (16px, see the CSS) starts to be\n * exceeded on purpose rather than by accident: every value above 16 makes the\n * rail overlap the transcript's card, so the ceiling keeps that at 8px. */\nexport const GLASS_GAP_MAX = 24\n/** Upper bound of the ground-glow strength (issue #32), in percent of the\n * shipped look. A contrast budget, not a taste number: the glows are painted\n * under text and Latte is the strictest scheme. Evidence now exists — the\n * reporter measured body text on Latte at 100% ≈ 6.1:1 and 200% ≈ 5.7:1\n * (both AA; the top-bar label 4.3 → 4.2 was already low before the glows), so\n * 200% stays. Raise it only with a new measurement; see\n * {@link GlassState.glowStrength} and `docs/issue-32-glow-tuning.md` §6. */\nexport const GLOW_STRENGTH_MAX = 200\n\n/** The shipped glow strength: 100% = exactly the two alphas issue #25\n * introduced, so a profile that never opens the new knob renders the same\n * ground it rendered in 0.6.6. */\nexport const GLOW_STRENGTH_DEFAULT = 100\n\n/** Lower bound of the glow SPREAD (issue #32 follow-up). 100% = the shipped\n * 0.6.3 geometry, i.e. the knob only enlarges: a tighter hotspot is what the\n * reporter complained about, so the axis starts at \"unchanged\". */\nexport const GLOW_SIZE_MIN = 100\n\n/** Upper bound of the glow spread, in percent of the shipped radii (2.5x).\n * Above this the two ellipses cover the whole page and the field stops\n * reading as two light sources — it becomes an off-centre wash, which is the\n * wash's job, not the glows'. */\nexport const GLOW_SIZE_MAX = 250\n\n/** The shipped glow spread: 100% = `58% 46%` / `48% 42%` exactly as #25 drew\n * them, so an untouched profile renders the 0.6.x ground. */\nexport const GLOW_SIZE_DEFAULT = 100\n\n/** Shipped glass defaults — the single source of truth; the client glass layer\n * (`src/client/glass/glass-layer.ts`) derives its knob defaults from here. */\nexport const DEFAULT_GLASS: GlassState = {\n enabled: false,\n mode: 'mica',\n blur: 5,\n frost: 20,\n brightness: 50,\n // The 0.6.x chrome: every floating card sat 12px in from the window edge.\n // This default IS the pre-#31 look, so an untouched profile renders\n // byte-identically to 0.6.x.\n gap: 12,\n glowStrength: GLOW_STRENGTH_DEFAULT,\n glowSize: GLOW_SIZE_DEFAULT,\n glow: false,\n}\n\n/** Shipped update-check preference: automatic checks on. */\nexport const DEFAULT_AUTO_CHECK = true\n/** Shipped update-check channel: chase the stable `latest` tag. */\nexport const DEFAULT_UPDATE_CHANNEL: UpdateChannel = 'latest'\n/** Shipped syntax-highlighting style. */\nexport const DEFAULT_SHIKI_STYLE: ShikiStyle = 'default'\n\n/** A fully default state: no Catppuccin flavour and no glass. */\nexport function defaultState(): CatppuccinState {\n return {\n version: STATE_VERSION,\n flavor: 'off',\n glass: { ...DEFAULT_GLASS },\n autoCheck: DEFAULT_AUTO_CHECK,\n updateChannel: DEFAULT_UPDATE_CHANNEL,\n overrides: {},\n shikiStyle: DEFAULT_SHIKI_STYLE,\n }\n}\n\n/**\n * Keep only well-formed custom token overrides: string values under a `--`\n * key (the token shape `--dsw-*` names). Everything else is dropped so a\n * hand-edited document can never smuggle junk into the theme registration.\n */\nexport function sanitizeOverrides(input: unknown): Record<string, string> {\n const out: Record<string, string> = {}\n if (typeof input !== 'object' || input === null) return out\n for (const [key, value] of Object.entries(input)) {\n if (typeof value === 'string' && key.startsWith('--')) out[key] = value\n }\n return out\n}\n\n/**\n * Whether a raw overrides map carries entries {@link sanitizeOverrides} would\n * drop — a key that is not a `--` token, or a non-string value.\n *\n * The settings-document schema types `overrides` as a dict of strings only, so\n * a hand-edited document can hold such entries. The client reads them away but\n * never wrote the cleaned map back, so every settings publish re-ran the\n * \"document wins\" adoption for a difference nothing could clear (audit F7).\n * The caller uses this to push the sanitized shape back once, so the document\n * converges instead of drifting forever.\n */\nexport function hasUnpersistableOverrides(raw: unknown): boolean {\n if (typeof raw !== 'object' || raw === null) return false\n return Object.entries(raw).some(([key, value]) => typeof value !== 'string' || !key.startsWith('--'))\n}\n\n/** Clamp a finite number into [min, max]; non-finite values fall back. */\nfunction clampFinite(value: unknown, min: number, max: number, fallback: number): number {\n return typeof value === 'number' && Number.isFinite(value)\n ? Math.min(max, Math.max(min, value))\n : fallback\n}\n\n/**\n * Normalize arbitrary input (JSON from disk or the wire) into a valid state:\n * unknown/missing fields fall back to defaults, out-of-range numbers clamp,\n * and unknown flavours/invalid enums fall back too. The Host applies this on\n * both read and write so a corrupt file or a hand-crafted payload can never\n * poison the plugin's settings.\n */\nexport function sanitizeState(input: unknown): CatppuccinState {\n const state = defaultState()\n if (typeof input !== 'object' || input === null) return state\n const raw = input as Record<string, unknown>\n\n const flavor = raw.flavor\n if (typeof flavor === 'string' && (CATPPUCCIN_THEME_IDS as readonly string[]).includes(flavor)) {\n state.flavor = flavor as FlavorValue\n } else if (flavor === 'off') {\n state.flavor = 'off'\n }\n\n const glass = typeof raw.glass === 'object' && raw.glass !== null\n ? raw.glass as Record<string, unknown>\n : {}\n state.glass.enabled = glass.enabled === true\n state.glass.mode = glass.mode === 'compat' ? 'compat' : 'mica'\n state.glass.blur = clampFinite(glass.blur, 0, 40, DEFAULT_GLASS.blur)\n state.glass.frost = clampFinite(glass.frost, 0, 100, DEFAULT_GLASS.frost)\n state.glass.brightness = clampFinite(glass.brightness, 0, 100, DEFAULT_GLASS.brightness)\n // Issue #31: the floating-card inset. Its own range (not 0-100) — a\n // hand-edited document must not be able to push the cards off the window.\n state.glass.gap = clampFinite(glass.gap, GLASS_GAP_MIN, GLASS_GAP_MAX, DEFAULT_GLASS.gap)\n // Issue #32: the glow STRENGTH. Its own range, and an absent field means the\n // shipped 100% — a document written by 0.6.x has `glow: true` and no\n // strength, and must keep rendering exactly what it rendered then.\n state.glass.glowStrength = clampFinite(glass.glowStrength, 0, GLOW_STRENGTH_MAX, DEFAULT_GLASS.glowStrength)\n // Issue #32 follow-up: the glow SPREAD. Its own range (100-250%) — a\n // hand-edited document must not be able to collapse the two light sources\n // into a pinhole or blow them up past the page.\n state.glass.glowSize = clampFinite(glass.glowSize, GLOW_SIZE_MIN, GLOW_SIZE_MAX, DEFAULT_GLASS.glowSize)\n // Issue #26: boolean-only, shipped OFF (the wash-only ground is the fix).\n state.glass.glow = glass.glow === true\n\n // Preference fields: absent values keep their shipped defaults, so a v1\n // document (predating them) rolls forward without a migration step.\n state.autoCheck = raw.autoCheck !== false\n state.updateChannel = raw.updateChannel === 'beta' ? 'beta' : 'latest'\n state.overrides = sanitizeOverrides(raw.overrides)\n state.shikiStyle = raw.shikiStyle === 'italic-comments' ? 'italic-comments' : 'default'\n\n return state\n}\n\n/**\n * Version-aware migration of an arbitrary persisted document. Version 1\n * documents roll forward through `sanitizeState` (every field added since\n * v1 has a sanitize-time default, so no structural step exists yet); future\n * versions chain their steps here, oldest first. Documents from a NEWER\n * plugin keep every field `sanitizeState` understands instead of being\n * nuked — a downgrade never destroys user state. The version-upgrade\n * convention lives in `docs/state-migrations.md` (item Y).\n */\nexport function migrate(raw: unknown): CatppuccinState {\n if (typeof raw !== 'object' || raw === null) return defaultState()\n const record = raw as Record<string, unknown>\n const version = typeof record.version === 'number' ? record.version : 1\n // Future schema steps chain here, oldest first:\n // let current: unknown = record\n // if (version < 2) current = migrateV1toV2(current)\n // if (version < 3) current = migrateV2toV3(current)\n // (the state contract of each step is spelled out in docs/state-migrations.md)\n return sanitizeState(record)\n}\n\n/** Whether a normalized state carries nothing beyond the shipped defaults —\n * i.e. the user never actually chose anything worth persisting. Used to tell\n * \"no durable state yet\" apart from \"an explicit default choice\". */\nexport function isDefaultState(state: CatppuccinState): boolean {\n const expected = defaultState()\n return state.flavor === expected.flavor\n && state.glass.enabled === expected.glass.enabled\n && state.glass.mode === expected.glass.mode\n && state.glass.blur === expected.glass.blur\n && state.glass.frost === expected.glass.frost\n && state.glass.brightness === expected.glass.brightness\n && state.glass.gap === expected.glass.gap\n && state.glass.glowStrength === expected.glass.glowStrength\n && state.glass.glowSize === expected.glass.glowSize\n && state.glass.glow === expected.glass.glow\n && state.autoCheck === expected.autoCheck\n && state.updateChannel === expected.updateChannel\n && Object.keys(state.overrides).length === 0\n && state.shikiStyle === expected.shikiStyle\n}\n\n/** Default settings-document section: no flavour and no glass (mirrors\n * `defaultState()` minus the synthetic `version`). */\nexport function defaultSettingsSection(): CatppuccinSettingsSection {\n return {\n flavor: 'off',\n glass: { ...DEFAULT_GLASS },\n autoCheck: DEFAULT_AUTO_CHECK,\n updateChannel: DEFAULT_UPDATE_CHANNEL,\n overrides: {},\n shikiStyle: DEFAULT_SHIKI_STYLE,\n }\n}\n\n/** Drop the synthetic `version` field: full state → settings-document section. */\nexport function settingsSectionFromState(state: CatppuccinState): CatppuccinSettingsSection {\n return {\n flavor: state.flavor,\n glass: { ...state.glass },\n autoCheck: state.autoCheck,\n updateChannel: state.updateChannel,\n overrides: { ...state.overrides },\n shikiStyle: state.shikiStyle,\n }\n}\n\n/** Lift a settings-document section back into the full state-shaped contract\n * (re-sanitized so a hand-edited document can never poison the plugin). */\nexport function stateFromSettingsSection(section: CatppuccinSettingsSection): CatppuccinState {\n return sanitizeState(section)\n}\n\n/** Field-for-field equality of two override maps — the same rule\n * {@link settingsSectionsEqual} applies to them (both directions, so a key\n * that only one side holds makes them differ). */\nexport function sameOverrides(a: Record<string, string>, b: Record<string, string>): boolean {\n const keys = Object.keys(a)\n return keys.length === Object.keys(b).length && keys.every((key) => b[key] === a[key])\n}\n\n/** Whether two settings sections are field-for-field equal (used to skip\n * redundant mirror writes and to recognize the Host echoing our own write). */\nexport function settingsSectionsEqual(a: CatppuccinSettingsSection, b: CatppuccinSettingsSection): boolean {\n return a.flavor === b.flavor\n && a.glass.enabled === b.glass.enabled\n && a.glass.mode === b.glass.mode\n && a.glass.blur === b.glass.blur\n && a.glass.frost === b.glass.frost\n && a.glass.brightness === b.glass.brightness\n && a.glass.gap === b.glass.gap\n && a.glass.glowStrength === b.glass.glowStrength\n && a.glass.glowSize === b.glass.glowSize\n && a.glass.glow === b.glass.glow\n && a.autoCheck === b.autoCheck\n && a.updateChannel === b.updateChannel\n && a.shikiStyle === b.shikiStyle\n && sameOverrides(a.overrides, b.overrides)\n}\n\n/**\n * Replay the local changes a window made BEFORE the durable channel became\n * usable onto the document state — the issue #30 fix.\n *\n * The R2 mechanism (`pendingLocalPush` in `src/client/index.ts`) exists so a\n * change made during the boot window is not rolled back by the first snapshot\n * the settings scope resolves. It used to replay the WHOLE local state, and on\n * a fresh origin (empty localStorage: a new port, a cleared site, a webview\n * partition) \"the whole local state\" is nothing but the shipped defaults — so\n * the first snapshot rewrote the document to `flavor: off`, `glass.enabled:\n * false`, `mode: mica`. The trigger is not even a user action: the glass layer\n * republishes on every `theme/change`, and `ui-theme` adopts its preference on\n * every boot.\n *\n * This replays only the fields whose value moved away from `baseline` — the\n * local section as of the last moment the window knew it was in sync with the\n * document (boot, or the last adoption / successful write). Everything else\n * keeps the document's value, and `changed === false` tells the caller to take\n * the ordinary \"document wins\" adoption path instead of writing anything.\n *\n * ⚠️ Every field of {@link CatppuccinSettingsSection} must be carried here.\n * A missing one is SILENT in both directions — a boot-window change to it is\n * dropped, and (because the caller's whole-state fallback is gone) nothing\n * else would notice. Same rule as `stateToMutateOps` (issue #26), and\n * `tests/state.spec.ts` holds a drift guard that fails when a field is added\n * without a mutant here.\n *\n * Known gap (accepted): a delta cannot tell \"untouched\" from \"explicitly set\n * to the current default\", so setting a field BACK to its default value inside\n * the boot window yields to the document. The window is sub-second and the\n * direction is \"document wins\", i.e. no durable data is lost.\n *\n * @param document - the section the settings document resolved (wins).\n * @param baseline - the local section at the last sync point.\n * @param local - the local section right now.\n * @returns the merged state plus whether anything actually differed.\n */\nexport function replayLocalChanges(\n document: CatppuccinState,\n baseline: CatppuccinSettingsSection,\n local: CatppuccinSettingsSection,\n): { state: CatppuccinState; changed: boolean } {\n // A fresh section (glass/overrides cloned) so the caller's document state is\n // never mutated in place.\n const merged = settingsSectionFromState(document)\n let changed = false\n const carry = <K extends 'flavor' | 'autoCheck' | 'updateChannel' | 'shikiStyle'>(key: K): void => {\n if (local[key] !== baseline[key]) {\n merged[key] = local[key]\n changed = true\n }\n }\n const carryGlass = <K extends keyof GlassState>(key: K): void => {\n if (local.glass[key] !== baseline.glass[key]) {\n merged.glass[key] = local.glass[key]\n changed = true\n }\n }\n carry('flavor')\n carryGlass('enabled')\n carryGlass('mode')\n carryGlass('blur')\n carryGlass('frost')\n carryGlass('brightness')\n carryGlass('gap')\n carryGlass('glowStrength')\n carryGlass('glowSize')\n carryGlass('glow')\n carry('autoCheck')\n carry('updateChannel')\n carry('shikiStyle')\n // The override map is carried as a WHOLE map: a per-key replay cannot express\n // a removal (the local map simply lacks the key), and the boot window is far\n // too short for two windows to edit different tokens inside it.\n if (!sameOverrides(local.overrides, baseline.overrides)) {\n merged.overrides = { ...local.overrides }\n changed = true\n }\n return { state: sanitizeState(merged), changed }\n}\n","/**\n * Legacy durable-state read — the one-shot migration source for 0.5.0.\n *\n * Up to 0.4.x the plugin persisted its state in a small JSON file under the\n * DSH home (`catppuccin-state.json`), served to the Client through the\n * `/catppuccin/state` route. 0.5.0 migrates persistence to the official\n * settings seam (`ctx.settings` Host-side, and whichever Client transport the\n * host serves — see `src/client/state-sync.ts`), which is durable across\n * browsers and origins just like the file was (it lives in the DSH home). The legacy file is READ-ONLY here: 0.5.0 migrates its content into\n * the settings document once and keeps the file on disk as a rollback copy\n * (an affected user can restore their old state by hand from it).\n *\n * Host-only module (node:fs / node:path resolve at runtime in the DSH\n * process); the Client never sees it.\n */\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { defaultDshHome } from './profile-detect.ts'\nimport { STATE_FILENAME, sanitizeState, type CatppuccinState } from './state.ts'\n\n/** Absolute path of the legacy state file under a DSH home. */\nexport function legacyStateFilePath(home = defaultDshHome()): string {\n return join(home, STATE_FILENAME)\n}\n\n/** Read the legacy durable state; absent or unparseable input means none yet. */\nexport function readLegacyState(home = defaultDshHome()): CatppuccinState | null {\n try {\n return sanitizeState(JSON.parse(readFileSync(legacyStateFilePath(home), 'utf8')))\n } catch {\n // Missing file (fresh install or a user who never wrote state) or a\n // corrupt/partial write — nothing to migrate.\n return null\n }\n}","/**\n * One-shot migration of the pre-0.5.0 durable file into whichever settings\n * seam the running host offers (issue #15 split it out of `src/index.ts` so\n * the composition stays thin and the migration is unit-testable).\n *\n * The migration writes `$DSH_HOME/catppuccin-state.json` into the durable\n * store exactly once, and only while that store holds NO user layer yet — a\n * user who already configured through the official settings surface (or a\n * previous migration) is never overwritten. The legacy file is left on disk\n * untouched as a rollback copy; a corrupt or absent file means nothing to\n * migrate. Every failure is non-fatal.\n *\n * Two host shapes, two addressing rules:\n *\n * - LEGACY (DSH <= 0.1.6-alpha.2): the namespace is one the plugin just\n * registered itself, so `describe()` finds it immediately and the caller\n * can run {@link migrateLegacyStateOnce} synchronously. \"No user layer\"\n * arrives as an ABSENT `user` field.\n * - NEW (DSH >= 0.1.7-alpha.1): the namespace IS the profile entry, and the\n * settings service only lists an entry whose own fiber is ACTIVE. The\n * `settings` inject callback fires SYNCHRONOUSLY when the service is\n * already live — at that instant the entry is still activating, so an\n * immediate `describe()` cannot see it and the migration would be silently\n * skipped. {@link scheduleLegacyMigration} defers it and also retries on\n * the entry's own `settings/document-updated`. Here \"no user layer\"\n * arrives as an EMPTY OBJECT (`configEditor` defaults `override` to `{}`),\n * which is why the predicate is injected rather than hard-coded.\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport { readLegacyState } from './legacy-state.ts'\nimport { isDefaultState, settingsSectionFromState } from './state.ts'\n\n/** The settings-service surface this module needs — satisfied by both seams\n * (`SettingsForms` on 0.1.7+, the document provider before it). */\nexport interface SettingsLike {\n /** Read the active namespaces (keyed by namespace / profile entry id). */\n describe(options?: { redactSecrets?: boolean }): readonly SettingsLikeDescriptor[]\n /** Merge a patch into one namespace's user layer. */\n update(ns: string, patch: object, expectedRevision?: number): Promise<void>\n}\n\n/** The descriptor fields this module reads. */\nexport interface SettingsLikeDescriptor {\n ns: string\n revision?: number\n user?: unknown\n}\n\n/** Outcome of one migration attempt. `pending` means \"not yet addressable —\n * try again\", which is the only one the caller should retry. */\nexport type MigrationOutcome =\n /** The legacy state was written into the durable store. */\n | 'migrated'\n /** The legacy file is absent or already equals the shipped defaults. */\n | 'absent'\n /** The store already holds a user layer — never overwritten. */\n | 'skipped'\n /** The namespace is not addressable yet (entry still activating / service\n * has not published its first describe). */\n | 'pending'\n\n/** Options for one migration attempt. */\nexport interface MigrationOptions {\n /**\n * Send the descriptor's revision as the write fence. The NEW seam sets it\n * (its `update` validates the revision the caller read); the LEGACY seam\n * omits it, so that line's write stays exactly what 0.5.x issued and cannot\n * turn into a spurious conflict against a namespace only we write.\n */\n fence?: boolean\n}\n\n/**\n * Run the migration once.\n * @param settings - the live settings service.\n * @param ns - the namespace to write: `CATPPUCCIN_SETTINGS_NS` on the legacy\n * seam, `CATPPUCCIN_ENTRY_ID` on the new one.\n * @param hasUserLayer - the channel's own \"the store already holds a user\n * layer\" predicate (see the module header).\n * @param options - fence policy (see {@link MigrationOptions}).\n * @returns the outcome; only `pending` is worth retrying.\n */\nexport async function migrateLegacyStateOnce(\n settings: SettingsLike,\n ns: string,\n hasUserLayer: (user: unknown) => boolean,\n options: MigrationOptions = {},\n): Promise<MigrationOutcome> {\n const legacy = readLegacyState()\n if (legacy === null || isDefaultState(legacy)) return 'absent'\n const descriptor = settings.describe({ redactSecrets: true })\n .find((candidate) => candidate.ns === ns)\n if (descriptor === undefined) return 'pending'\n if (hasUserLayer(descriptor.user)) return 'skipped'\n await settings.update(\n ns,\n settingsSectionFromState(legacy),\n options.fence === true ? descriptor.revision : undefined,\n )\n return 'migrated'\n}\n\n/**\n * Run the migration on the NEW seam without racing the plugin's own\n * activation: one deferred attempt, one retry when the entry's form finally\n * lands in the describe mirror, and one last attempt a few seconds later.\n * Bounded on purpose — a permanently missing entry (a user who renamed it)\n * must not leave a timer running for the process lifetime. The whole schedule\n * is fiber-scoped, so unloading the plugin cancels it.\n * @param ctx - the Host plugin context.\n * @param settings - the live settings service.\n * @param ns - the profile entry id carrying the form.\n * @param hasUserLayer - the new seam's user-layer predicate.\n */\nexport function scheduleLegacyMigration(\n ctx: Context,\n settings: SettingsLike,\n ns: string,\n hasUserLayer: (user: unknown) => boolean,\n): void {\n let settled = false\n // One attempt in flight at a time. The deferred timer and the entry's own\n // `settings/document-updated` routinely land within the same tick, and two\n // concurrent `describe` → `update` pairs race on the namespace revision: the\n // loser is refused and reported as a FAILURE even though the migration\n // succeeded (observed on a real 0.1.7 host, 2026-09-24). `claimed` is set\n // synchronously before the first `await`, so the second caller cannot pass.\n let claimed = false\n const attempt = (): void => {\n if (settled || claimed) return\n claimed = true\n void migrateLegacyStateOnce(settings, ns, hasUserLayer, { fence: true })\n .then((outcome) => {\n if (outcome === 'pending') {\n // Not addressable yet — release the slot so a later attempt retries.\n claimed = false\n return\n }\n settled = true\n if (outcome === 'migrated') {\n console.info(`[dsh-catppuccin] migrated the legacy state file into \"${ns}\"`)\n }\n })\n .catch((error: unknown) => {\n settled = true\n console.warn(`[dsh-catppuccin] legacy state migration failed: ${String(error)}`)\n })\n }\n ctx.effect(() => {\n const deferred = setTimeout(attempt, 0)\n const late = setTimeout(attempt, 3000)\n // The entry becomes addressable exactly when the settings service emits\n // its own document-changed notification for it.\n const off = ctx.on('settings/document-updated', (documentNs: string) => {\n if (String(documentNs) === ns) attempt()\n })\n return () => {\n clearTimeout(deferred)\n clearTimeout(late)\n off()\n }\n }, 'catppuccin: legacy state migration')\n}\n","/**\n * The Catppuccin settings contract — the official-settings shape of the\n * plugin's durable state (0.5.0+, replacing the legacy\n * `catppuccin-state.json`), in BOTH forms the DSH versions in the wild need.\n *\n * Two seams, one contract (issue #15):\n *\n * - **DSH <= 0.1.6-alpha.2** (`latest` on npm) serves an abstract settings\n * document. The Host half registers a namespace on it\n * (`settings.installSection(CATPPUCCIN_SETTINGS_NS, schema, base, hooks)`)\n * and the Client binds that namespace through `ctx.settingsScope`. This\n * module owns the registered schema ({@link CatppuccinSettingsSchema}) and\n * the composition `base` ({@link CATPPUCCIN_SETTINGS_BASE}).\n * - **DSH >= 0.1.7-alpha.1** (`next`) dropped both. A plugin no longer\n * registers a namespace: it declares a `Config` schema whose fields carry\n * `.volatile()`, and the settings service projects exactly those fields\n * into a form named by the ACTIVE PROFILE ENTRY id\n * (`CATPPUCCIN_ENTRY_ID`). That projected schema is {@link Config}, the\n * module's only export the Loader consumes.\n *\n * Both forms are built from ONE field table ({@link catppuccinSchemaFields}),\n * so a field can never drift between them. They must NOT share node\n * instances: `.volatile()` mutates the node's meta in place and returns it,\n * so reusing a node would silently mark the legacy schema volatile as well.\n *\n * {@link maybeVolatile} is the compatibility hinge: `.volatile()` exists only\n * from schemastery **3.18.3** (DSH 0.1.5/0.1.6 hosts pin `3.18.2`), and this\n * module is loaded with the HOST's schemastery (it stays external in the lib\n * build). An unconditional `.volatile()` would therefore throw at module\n * evaluation time on every old host — turning \"plugin pending\" into \"plugin\n * failed to load\". On such a host the guarded call is a no-op, which is\n * exactly the pre-0.1.7 status quo (no entry-level form exists there).\n *\n * This module is Host-side because it imports `@deepseek-ai/schemastery`\n * (resolved from the DSH profile tree at runtime). The Client never imports\n * it; it consumes the form by name.\n */\nimport Schema from '@deepseek-ai/schemastery'\nimport {\n CATPPUCCIN_THEME_IDS,\n DEFAULT_AUTO_CHECK,\n DEFAULT_GLASS,\n DEFAULT_SHIKI_STYLE,\n DEFAULT_UPDATE_CHANNEL,\n GLASS_GAP_MAX,\n GLASS_GAP_MIN,\n GLOW_SIZE_MAX,\n GLOW_SIZE_MIN,\n GLOW_STRENGTH_MAX,\n defaultSettingsSection,\n type CatppuccinSettingsSection,\n} from './state.ts'\n\n/** The subset of a schemastery node this module relies on. */\ninterface VolatileCapable {\n volatile?: () => unknown\n}\n\n/**\n * Mark a schema node volatile when the running schemastery supports it.\n *\n * Guarded on purpose (see the module header): `.volatile()` landed in\n * schemastery 3.18.3, while DSH <= 0.1.6-alpha.2 hosts pin 3.18.2 and this\n * module resolves schemastery from THEIR tree. Calling it unconditionally\n * throws at import time on those hosts.\n * @param node - freshly built schema node (never reused across schemas).\n * @returns the same node, marked volatile when the capability exists.\n */\nexport function maybeVolatile<T extends object>(node: T): T {\n const capable = node as VolatileCapable\n return typeof capable.volatile === 'function' ? capable.volatile() as T : node\n}\n\n/**\n * Build FRESH schema nodes for every field of the durable contract. Every\n * field maps 1:1 onto `CatppuccinSettingsSection` in `src/state.ts`, and every\n * default is the shipped default — the Client treats \"resolves to the shipped\n * defaults\" as \"no user choice yet\", so a wrong default would write garbage\n * into a user's profile on first boot.\n *\n * Callers MUST NOT share the returned nodes between schemas (see the header).\n * @returns a new field table, one fresh node per field.\n */\nexport function catppuccinSchemaFields(): Record<string, Schema> {\n return {\n flavor: Schema.union([...CATPPUCCIN_THEME_IDS, 'off']).default('off'),\n glass: Schema.object({\n enabled: Schema.boolean().default(DEFAULT_GLASS.enabled),\n mode: Schema.union(['mica', 'compat']).default(DEFAULT_GLASS.mode),\n blur: Schema.number().min(0).max(40).default(DEFAULT_GLASS.blur),\n frost: Schema.number().min(0).max(100).default(DEFAULT_GLASS.frost),\n brightness: Schema.number().min(0).max(100).default(DEFAULT_GLASS.brightness),\n // Issue #31: the floating-card inset. Bounded by the same pair the\n // sanitizer uses — the form is the ONE place a user can type a raw\n // number, so it must not be able to hold a value `sanitizeState` would\n // immediately clamp away (that difference would make every publish\n // re-write the document).\n gap: Schema.number().min(GLASS_GAP_MIN).max(GLASS_GAP_MAX).default(DEFAULT_GLASS.gap),\n // Issue #32: how strong the two glows read. Bounded by the same ceiling\n // the sanitizer uses — the form is the one place a raw number can be\n // typed, so it must not be able to hold a value `sanitizeState` would\n // immediately clamp away (that gap would make every publish re-write).\n glowStrength: Schema.number().min(0).max(GLOW_STRENGTH_MAX).default(DEFAULT_GLASS.glowStrength),\n // Issue #32 follow-up: the glow SPREAD. Same rule — the form must not be\n // able to hold a value the sanitizer would clamp away on the next publish.\n glowSize: Schema.number().min(GLOW_SIZE_MIN).max(GLOW_SIZE_MAX).default(DEFAULT_GLASS.glowSize),\n // Issue #26: the optional ground glows (the wash-only ground is the\n // shipped default, so this must default to the same value as\n // `DEFAULT_GLASS.glow` — the client reads \"resolves to the shipped\n // defaults\" as \"no user choice yet\", and a wrong default here would make\n // every visit look like an explicit choice).\n glow: Schema.boolean().default(DEFAULT_GLASS.glow),\n }),\n autoCheck: Schema.boolean().default(DEFAULT_AUTO_CHECK),\n updateChannel: Schema.union(['latest', 'beta']).default(DEFAULT_UPDATE_CHANNEL),\n overrides: Schema.dict(Schema.string()).default({}),\n shikiStyle: Schema.union(['default', 'italic-comments']).default(DEFAULT_SHIKI_STYLE),\n }\n}\n\n/** The same table with every leaf marked volatile where the capability exists.\n * Marking the leaves (rather than the `glass` subtree) keeps\n * `isVolatilePath` true for each nested path without putting volatile inside\n * volatile — schemastery rejects that combination. */\nfunction volatileFields(): Record<string, Schema> {\n const fields = catppuccinSchemaFields()\n const glassFields = (fields.glass as Schema & { dict?: Record<string, Schema> }).dict ?? {}\n return {\n flavor: maybeVolatile(fields.flavor),\n glass: Schema.object(Object.fromEntries(\n Object.entries(glassFields).map(([key, node]) => [key, maybeVolatile(node)]),\n )),\n autoCheck: maybeVolatile(fields.autoCheck),\n updateChannel: maybeVolatile(fields.updateChannel),\n overrides: maybeVolatile(fields.overrides),\n shikiStyle: maybeVolatile(fields.shikiStyle),\n }\n}\n\n/**\n * The namespace schema registered by the LEGACY Host seam\n * (`settings.installSection`). Deliberately plain: on a host that has\n * `installSection` there is no `.volatile()` capability, and the field set is\n * resolved by the settings document rather than by a form projection.\n */\nexport const CatppuccinSettingsSchema = Schema.object(catppuccinSchemaFields())\n\n/** The composition `base` for the legacy namespace: the shipped defaults. */\nexport const CATPPUCCIN_SETTINGS_BASE: CatppuccinSettingsSection = defaultSettingsSection()\n\n/**\n * The plugin `Config` consumed by the NEW Host seam (DSH >= 0.1.7-alpha.1).\n * Its volatile fields are what the settings service projects into the form the\n * Client addresses by `CATPPUCCIN_ENTRY_ID`; the Host half never reads the\n * values itself. On a legacy host every field stays plain, so the entry\n * exposes no form at all — the old seam keeps doing the persisting.\n */\nexport const Config = Schema.object(volatileFields())\n\n/**\n * The value shape the Loader hands `apply` for {@link Config}. Every leaf is a\n * `Volatile` reference on a 0.1.7 host (read it with `.get()`); the Host half\n * deliberately consumes none of them, so this interface exists to document the\n * contract and to keep the schema honest.\n */\nexport interface CatppuccinConfig {\n flavor: { get(): CatppuccinSettingsSection['flavor'] }\n glass: {\n enabled: { get(): boolean }\n mode: { get(): CatppuccinSettingsSection['glass']['mode'] }\n blur: { get(): number }\n frost: { get(): number }\n brightness: { get(): number }\n /** Issue #31 floating-card inset, px. */\n gap: { get(): number }\n /** Issue #32 ground-glow strength, percent of the shipped look. */\n glowStrength: { get(): number }\n }\n autoCheck: { get(): boolean }\n updateChannel: { get(): CatppuccinSettingsSection['updateChannel'] }\n overrides: { get(): Record<string, string> }\n shikiStyle: { get(): CatppuccinSettingsSection['shikiStyle'] }\n}\n","/**\n * Host half of the Catppuccin theme plugin for the DeepSeek Harness web GUI.\n *\n * Pure UI plugin: the four flavour themes and the glass skin ship in the\n * browser half (exports[\"./client\"], discovered through the package.json\n * dsh.client declaration). Since 0.5.0 the flavour/glass preferences persist\n * durably through the OFFICIAL settings seam — but that seam changed shape in\n * DSH 0.1.7-alpha.1 (issue #15), so this half wires BOTH:\n *\n * - **<= 0.1.6-alpha.2** (`latest` on npm): a settings SERVICE the plugin\n * registers a namespace on (`ctx.settings.installSection`) and the Client\n * binds through `ctx.settingsScope`.\n * - **>= 0.1.7-alpha.1** (`next`): no registration at all. The plugin\n * declares a `Config` schema with `.volatile()` fields (exported below),\n * and the settings service projects them into a form named by the active\n * profile entry id; the Client reads it through `ctx.configForms`.\n *\n * Which one is live is decided by FEATURE DETECTION, never by version parsing:\n * `installSection` is present exactly on the legacy service. Both wirings live\n * inside an optional `ctx.inject(['settings'], …)` child, so a deployment\n * without a settings provider keeps the plugin working from browser\n * localStorage alone (losing only cross-restart durability). No profile is\n * ever blocked on the settings service.\n *\n * The legacy seam itself predates DSH 0.1.1-rc.2, which is why 0.4.x shipped a\n * hand-rolled `$DSH_HOME/catppuccin-state.json` + `/catppuccin/state` route\n * instead: the Host settings wire then only served an explicit allowlist of\n * namespaces (see dsh-host-apiproxy's WEB_SETTINGS_NAMESPACES), so a\n * plugin-owned settings namespace answered `settings-not-exposed` even when\n * registered. 0.1.1-rc.2 dropped the allowlist (\"注册即暴露\"), and the legacy\n * file is now only a one-shot migration source (`src/legacy-state.ts`,\n * consumed by `src/migrate-legacy.ts`; the file stays as rollback).\n *\n * The one host-side behavior besides settings is the\n * `/catppuccin/check-update` exact webServer route, owned by\n * `src/update-check/host.ts` (item A: the update-check logic used to live\n * inline here; it moved so `index.ts` stays a thin composition of the host\n * responsibilities and the route module can be tested on its own).\n * `webServer` is a hard inject dependency, so Cordis starts this plugin only\n * after the service is live — mounting can never race ahead of it and\n * silently skip the routes. (An earlier version read `ctx.get('webServer')`\n * once and bailed silently when it was not yet visible, which left a\n * mounted-but-routeless plugin and made \"check for updates\" fail forever.)\n * A headless profile has no webServer and no settings UI, so the plugin\n * simply stays waiting there. The responses carry only the plugin's own\n * settings and public package metadata, so no workspace gate is needed.\n */\nimport type { Context } from '@deepseek-ai/cordis'\n// Type-only: pulls the settings service's Context merge (ctx.settings).\nimport type {} from '@deepseek-ai/dsh-settings'\nimport { bootPaletteRows, type BootPaletteConfig, type BootPaletteRow } from './boot-palette.ts'\nimport { registerUpdateCheckRoute } from './update-check/host.ts'\nimport { migrateLegacyStateOnce, scheduleLegacyMigration, type SettingsLike } from './migrate-legacy.ts'\nimport { CATPPUCCIN_SETTINGS_BASE, CatppuccinSettingsSchema } from './settings-catppuccin.ts'\nimport { CATPPUCCIN_ENTRY_ID, CATPPUCCIN_SETTINGS_NS, hasUserLayerSection } from './state.ts'\n\n/** Stable cordis plugin name (matches cordis.patch.yml insert id). */\nexport const name = 'dsh-catppuccin'\n\n/**\n * The host webserver's index-injection table (issue #30 补充).\n *\n * Declared structurally, like `WebServerLike`: `@deepseek-ai/dsh-host-webserver`\n * is NOT a dependency of this plugin (the event is emitted by the host), and\n * this is the only event consumed here. The shape matches the installed host\n * package's `IndexInjection`; a host that does not emit the event simply never\n * calls the listener (boot rows absent, i.e. the pre-0.6.6 behaviour).\n */\ndeclare module '@deepseek-ai/cordis' {\n interface Events {\n 'webserver/index-inject'(table: BootPaletteRow[]): void\n }\n}\n\n/**\n * Hard dependencies: the update check is a webServer route, so this Host\n * half is not activated until the webServer service is live. Declaring\n * inject (not a one-shot `ctx.get` probe) makes route registration\n * deterministic: Cordis reactivates the plugin once the service appears, no\n * matter the mount order.\n */\nexport const inject = ['webServer']\n\n/**\n * The plugin's volatile configuration form (DSH >= 0.1.7-alpha.1) — the\n * namespace the Client addresses by `CATPPUCCIN_ENTRY_ID`.\n *\n * Re-exported here because the Loader reads `Config` off the plugin module;\n * on a legacy host the guarded `.volatile()` calls inside it are no-ops, so\n * the entry exposes no form there and the `installSection` wiring below keeps\n * doing the persisting.\n */\nexport { Config } from './settings-catppuccin.ts'\n\n/**\n * The LEGACY settings service (DSH <= 0.1.6-alpha.2): it registers plugin\n * namespaces. Declared as a local structural type on purpose — 0.1.7 removed\n * the method from the published types, and this shape is all this branch\n * touches, so the cross-version code stays honest instead of reaching for\n * `any`.\n */\ninterface LegacySettings extends SettingsLike {\n installSection?: (\n owner: Context,\n ns: string,\n schema: unknown,\n base: unknown,\n hooks: { setSource: () => void, onChange: () => void },\n ) => void\n}\n\n/** The NEW settings service's extra surface (DSH >= 0.1.7-alpha.1). */\ninterface ModernSettings extends SettingsLike {\n /** Own this plugin instance's automatic-page policy (`auto` defaults true).\n * Absent on the legacy seam, hence the feature detection. */\n configure?: (presentation: { auto?: boolean }, owner?: unknown) => unknown\n}\n\n/** The legacy document describes \"no user layer\" as an ABSENT field (it maps\n * over the namespaces it has a section for), so presence is the whole test —\n * the same predicate 0.5.x used. */\nfunction legacyUserLayer(user: unknown): boolean {\n return user !== undefined\n}\n\n/** Host plugin body: register the update-check route and wire whichever\n * settings seam the running host offers (webServer is inject; settings is\n * optional wiring). */\nexport function apply(ctx: Context, config?: BootPaletteConfig): void {\n registerUpdateCheckRoute(ctx)\n\n // Pre-paint palette (issue #30 补充, 2026-10-27): the index HTML ships the\n // persisted flavour's own token table, so the first frame is Catppuccin\n // instead of the official dark the theme bootstrap paints. The listener reads\n // the durable value on every render, so a page load always reflects the\n // document as it stands then.\n //\n // `config` is the Loader-validated plugin config; on DSH >= 0.1.7 its fields\n // are volatile refs, which is the only shape `bootPaletteRows` accepts (see\n // its module header for why a plain value must NOT be painted).\n ctx.on('webserver/index-inject', (table) => {\n table.push(...bootPaletteRows(config))\n })\n\n ctx.inject(['settings'], (sctx) => {\n const settings = sctx.settings as unknown as LegacySettings & ModernSettings\n if (typeof settings.installSection === 'function') {\n // Legacy seam. Registering and migrating inline reproduces 0.5.x\n // behaviour exactly: the namespace is ours, so it is addressable the\n // moment `installSection` returns, and the write stays unfenced.\n settings.installSection(\n sctx,\n CATPPUCCIN_SETTINGS_NS,\n CatppuccinSettingsSchema,\n CATPPUCCIN_SETTINGS_BASE,\n {\n // Host half never consumes the resolved value itself — the Client\n // renders and edits it through its own bound scope — so the source\n // sink and change hook are intentionally empty (the wiring still\n // needs them to keep the registration fiber-scoped).\n setSource() {},\n onChange() {},\n },\n )\n void migrateLegacyStateOnce(settings, CATPPUCCIN_SETTINGS_NS, legacyUserLayer)\n .catch((error: unknown) => {\n console.warn(`[dsh-catppuccin] legacy state migration failed: ${String(error)}`)\n })\n return\n }\n\n // New seam. Nothing to register: the exported `Config` IS the namespace,\n // and its volatile fields are what the settings service projects into the\n // form the Client reads. Suppress the schema-generated page — this plugin\n // ships its own settings rows.\n //\n // The disposer is OWNED here (issue #23 audit): upstream documents\n // \"register it with the calling plugin's effects\" and throws `Settings\n // presentation is already configured for this plugin instance` when the\n // same owner configures twice. Dropping the disposer pinned the policy to\n // the top-level fiber forever, so the next activation of this child\n // (host fiber restart / HMR / service reload) would re-run `configure`,\n // fail the child, and skip the migration wiring below it.\n const releasePresentation = settings.configure?.({ auto: false }, ctx.fiber)\n // The entry is not addressable until its own fiber is ACTIVE, so the\n // migration is deferred and retried rather than run inline (a synchronous\n // `describe()` here cannot see us yet — see `src/migrate-legacy.ts`).\n scheduleLegacyMigration(ctx, settings, CATPPUCCIN_ENTRY_ID, hasUserLayerSection)\n // Child-fiber cleanup: release the presentation policy with this child.\n return () => {\n if (typeof releasePresentation === 'function') (releasePresentation as () => void)()\n }\n })\n}\n"],"mappings":";;;;;AAszBA,MAAa,qBAAsD;CACjE;EA5xBA,SAAS;EACT,aAAa;EACb,OAAO;EACP,QAAQ;EACR,QAAQ;GACN,0BAA0B;GAC1B,0BAA0B;GAC1B,0BAA0B;GAC1B,0BAA0B;GAC1B,0BAA0B;GAC1B,yBAAyB;GACzB,yBAAyB;GACzB,yBAAyB;GACzB,yBAAyB;GACzB,yBAAyB;GACzB,wBAAwB;GACxB,yBAAyB;GACzB,yBAAyB;GACzB,wBAAwB;GACxB,yBAAyB;GACzB,yBAAyB;GACzB,yBAAyB;GACzB,6BAA6B;GAC7B,6BAA6B;GAC7B,6BAA6B;GAC7B,6BAA6B;GAC7B,6BAA6B;GAC7B,6BAA6B;GAC7B,4BAA4B;GAC5B,6BAA6B;GAC7B,oCAAoC;GACpC,6BAA6B;GAC7B,6BAA6B;GAC7B,0BAA0B;GAC1B,0BAA0B;GAC1B,0BAA0B;GAC1B,8BAA8B;GAC9B,8BAA8B;GAC9B,0BAA0B;GAC1B,2BAA2B;GAC3B,6BAA6B;GAC7B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,2BAA2B;GAC3B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,4BAA4B;GAC5B,kCAAkC;GAClC,oCAAoC;GACpC,mCAAmC;GACnC,mCAAmC;GACnC,mCAAmC;GACnC,mCAAmC;GACnC,mCAAmC;GACnC,mCAAmC;GACnC,kCAAkC;GACl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,WAAW,KAAK;EACtB,IAAI,OAAO,SAAS,mBAAmB,YAAY;GAIjD,SAAS,eACP,MACA,wBACA,0BACA,0BACA;IAKE,YAAY,CAAC;IACb,WAAW,CAAC;GACd,CACF;GACA,uBAA4B,UAAU,wBAAwB,eAAe,CAAC,CAC3E,OAAO,UAAmB;IACzB,QAAQ,KAAK,mDAAmD,OAAO,KAAK,GAAG;GACjF,CAAC;GACH;EACF;EAcA,MAAM,sBAAsB,SAAS,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK;EAI3E,wBAAwB,KAAK,UAAU,qBAAqB,mBAAmB;EAE/E,aAAa;GACX,IAAI,OAAO,wBAAwB,YAAY,oBAAoC;EACrF;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["pkg.version"],"sources":["../src/client/palettes.ts","../src/state.ts","../src/boot-palette.ts","../package.json","../src/registration-tolerance.ts","../src/versions.ts","../src/update-check.ts","../src/profile-detect.ts","../src/update-check/host.ts","../src/legacy-state.ts","../src/migrate-legacy.ts","../src/settings-catppuccin.ts","../src/index.ts"],"sourcesContent":["/**\n * AUTO-GENERATED by scripts/generate-palettes.mjs — do not edit by hand.\n * Catppuccin token tables for the DeepSeek Harness web GUI.\n * Source palette: https://github.com/catppuccin/catppuccin (palette.json v1.8.0).\n * // UPSTREAM_PIN: 639ed015397290b3745d163aafe02ffee4aa3f84\n * Each flavour carries a flat dictionary of every --dsw-static-*,\n * --dsw-alias-* and --dsw-specific-* token the official theme stylesheet\n * declares, plus the --dsw-* tokens outside those families (0.2.0's\n * --dsw-menu-surface-fill). Alias/specific entries keep their var() references\n * so the static overrides below flow through automatically; literal (non-var)\n * entries are remapped to Catppuccin colours — see aliasLiteralOverrides.\n */\nexport type CatppuccinFlavorId = 'latte' | 'frappe' | 'macchiato' | 'mocha'\nexport interface CatppuccinFlavorInfo {\n /** Theme id registered into ThemeRuntime. */\n themeId: string\n /** Base color scheme this flavour builds on. */\n colorScheme: 'light' | 'dark'\n /** Display label. */\n label: string\n /** Accent colour for the settings row swatch. */\n accent: string\n /** Token dictionary (--dsw-* names). */\n tokens: Record<string, string>\n}\n\nexport const CATPPUCCIN_LATTE: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-latte',\n colorScheme: 'light',\n label: 'Latte',\n accent: '#1e66f5',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #fe640b 20%, #eff1f5)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #fe640b 70%, #eff1f5)\",\n \"--dsw-static-amber-500\": \"#fe640b\",\n \"--dsw-static-amber-600\": \"#fe640b\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #fe640b 32%, #eff1f5)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #1e66f5 22%, #eff1f5)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #1e66f5 48%, #eff1f5)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #1e66f5 65%, #eff1f5)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-blue-500\": \"#1e66f5\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #1e66f5 8%, #eff1f5)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #1e66f5 12%, #eff1f5)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #1e66f5 16%, #eff1f5)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #1e66f5 50%, #eff1f5)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #1e66f5 30%, #4c4f69)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #1e66f5 26%, #eff1f5)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #1e66f5 22%, #eff1f5)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #1e66f5 34%, #eff1f5)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #1e66f5 48%, #eff1f5)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #1e66f5 65%, #eff1f5)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-deepseek-500\": \"#1e66f5\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #1e66f5 8%, #eff1f5)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #1e66f5 82%, #eff1f5)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #1e66f5 66%, #eff1f5)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #1e66f5 50%, #eff1f5)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #1e66f5 38%, #eff1f5)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #40a02b 18%, #eff1f5)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #40a02b 80%, #eff1f5)\",\n \"--dsw-static-green-500\": \"#40a02b\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #40a02b 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #40a02b 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #40a02b 30%, #eff1f5)\",\n \"--dsw-static-neutral-00\": \"#eff1f5\",\n \"--dsw-static-neutral-1000\": \"#4c4f69\",\n \"--dsw-static-neutral-100\": \"#bcc0cc\",\n \"--dsw-static-neutral-150\": \"#acb0be\",\n \"--dsw-static-neutral-200\": \"#9ca0b0\",\n \"--dsw-static-neutral-250\": \"#9ca0b0\",\n \"--dsw-static-neutral-300\": \"#8c8fa1\",\n \"--dsw-static-neutral-400\": \"#7c7f93\",\n \"--dsw-static-neutral-500\": \"#6c6f85\",\n \"--dsw-static-neutral-50\": \"#e6e9ef\",\n \"--dsw-static-neutral-550\": \"#6c6f85\",\n \"--dsw-static-neutral-600\": \"#5c5f77\",\n \"--dsw-static-neutral-700\": \"#5c5f77\",\n \"--dsw-static-neutral-800\": \"#4c4f69\",\n \"--dsw-static-neutral-850\": \"#4c4f69\",\n \"--dsw-static-neutral-900\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-00\": \"#eff1f5\",\n \"--dsw-static-neutral-bluish-1000\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-100\": \"#bcc0cc\",\n \"--dsw-static-neutral-bluish-150\": \"#acb0be\",\n \"--dsw-static-neutral-bluish-200\": \"#9ca0b0\",\n \"--dsw-static-neutral-bluish-300\": \"#8c8fa1\",\n \"--dsw-static-neutral-bluish-400\": \"#7c7f93\",\n \"--dsw-static-neutral-bluish-500\": \"#6c6f85\",\n \"--dsw-static-neutral-bluish-50\": \"#e6e9ef\",\n \"--dsw-static-neutral-bluish-600\": \"#5c5f77\",\n \"--dsw-static-neutral-bluish-60\": \"#e6e9ef\",\n \"--dsw-static-neutral-bluish-700\": \"#5c5f77\",\n \"--dsw-static-neutral-bluish-750\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-75\": \"#ccd0da\",\n \"--dsw-static-neutral-bluish-800\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-850\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-875\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-900\": \"#4c4f69\",\n \"--dsw-static-neutral-bluish-950\": \"#4c4f69\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #d20f39 20%, #eff1f5)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #d20f39 70%, #eff1f5)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #db5371 12%, transparent)\",\n \"--dsw-static-red-500\": \"#d20f39\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #d20f39 10%, #eff1f5)\",\n \"--dsw-static-red-600\": \"#d20f39\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #d20f39 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #d20f39 34%, #eff1f5)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.24)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.12)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(255, 255, 255, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(0, 0, 0, 0.04)\",\n \"--dsw-alias-border-inverted2\": \"rgba(0, 0, 0, 0)\",\n \"--dsw-alias-border-inverted\": \"rgba(0, 0, 0, 0)\",\n \"--dsw-alias-border-l1\": \"rgba(0, 0, 0, 0.04)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(0, 0, 0, 0.1)\",\n \"--dsw-alias-border-l2\": \"rgba(0, 0, 0, 0.1)\",\n \"--dsw-alias-border-l3\": \"rgba(0, 0, 0, 0.12)\",\n \"--dsw-alias-border-l4\": \"rgba(0, 0, 0, 0.16)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#1e66f5\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-500)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(38, 49, 72, 0.1)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(38, 49, 72, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(236, 19, 19, 0.05)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(38, 49, 72, 0.06)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-500) 70%, var(--dsw-static-blue-950))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-deepseek-500) 30%, var(--dsw-static-blue-950))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-blue-900)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-1000) 30%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-50)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-200)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-200)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-300)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-300)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-100)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a08)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-600-a08)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a08)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 4%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-600-a08)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 4%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-600)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-300)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-100)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-100)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-markdown-code-block)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-deepseek-200)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-deepseek-50)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-deepseek-100)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-60)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 58%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_FRAPPE: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-frappe',\n colorScheme: 'dark',\n label: 'Frappé',\n accent: '#8caaee',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #ef9f76 20%, #303446)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #ef9f76 70%, #303446)\",\n \"--dsw-static-amber-500\": \"#ef9f76\",\n \"--dsw-static-amber-600\": \"#ef9f76\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #ef9f76 18%, #232634)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #8caaee 24%, #303446)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #8caaee 50%, #303446)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #8caaee 66%, #303446)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-blue-500\": \"#8caaee\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #8caaee 10%, #303446)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #8caaee 14%, #303446)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #8caaee 18%, #303446)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #8caaee 18%, #232634)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #8caaee 14%, #232634)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #8caaee 10%, #232634)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #8caaee 24%, #303446)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #8caaee 36%, #303446)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #8caaee 50%, #303446)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #8caaee 66%, #303446)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-deepseek-500\": \"#8caaee\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #8caaee 10%, #303446)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #8caaee 84%, #303446)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #8caaee 68%, #303446)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #8caaee 18%, #232634)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #8caaee 14%, #232634)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #a6d189 18%, #303446)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #a6d189 80%, #303446)\",\n \"--dsw-static-green-500\": \"#a6d189\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #a6d189 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #a6d189 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #a6d189 18%, #232634)\",\n \"--dsw-static-neutral-00\": \"#c6d0f5\",\n \"--dsw-static-neutral-1000\": \"#232634\",\n \"--dsw-static-neutral-100\": \"#a5adce\",\n \"--dsw-static-neutral-150\": \"#a5adce\",\n \"--dsw-static-neutral-200\": \"#949cbb\",\n \"--dsw-static-neutral-250\": \"#949cbb\",\n \"--dsw-static-neutral-300\": \"#838ba7\",\n \"--dsw-static-neutral-400\": \"#737994\",\n \"--dsw-static-neutral-500\": \"#626880\",\n \"--dsw-static-neutral-50\": \"#c6d0f5\",\n \"--dsw-static-neutral-550\": \"#51576d\",\n \"--dsw-static-neutral-600\": \"#51576d\",\n \"--dsw-static-neutral-700\": \"#414559\",\n \"--dsw-static-neutral-800\": \"#414559\",\n \"--dsw-static-neutral-850\": \"#303446\",\n \"--dsw-static-neutral-900\": \"#292c3c\",\n \"--dsw-static-neutral-bluish-00\": \"#c6d0f5\",\n \"--dsw-static-neutral-bluish-1000\": \"#232634\",\n \"--dsw-static-neutral-bluish-100\": \"#a5adce\",\n \"--dsw-static-neutral-bluish-150\": \"#a5adce\",\n \"--dsw-static-neutral-bluish-200\": \"#949cbb\",\n \"--dsw-static-neutral-bluish-300\": \"#838ba7\",\n \"--dsw-static-neutral-bluish-400\": \"#737994\",\n \"--dsw-static-neutral-bluish-500\": \"#626880\",\n \"--dsw-static-neutral-bluish-50\": \"#c6d0f5\",\n \"--dsw-static-neutral-bluish-600\": \"#51576d\",\n \"--dsw-static-neutral-bluish-60\": \"#b5bfe2\",\n \"--dsw-static-neutral-bluish-700\": \"#414559\",\n \"--dsw-static-neutral-bluish-750\": \"#414559\",\n \"--dsw-static-neutral-bluish-75\": \"#b5bfe2\",\n \"--dsw-static-neutral-bluish-800\": \"#414559\",\n \"--dsw-static-neutral-bluish-850\": \"#303446\",\n \"--dsw-static-neutral-bluish-875\": \"#292c3c\",\n \"--dsw-static-neutral-bluish-900\": \"#292c3c\",\n \"--dsw-static-neutral-bluish-950\": \"#232634\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #e78284 20%, #303446)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #e78284 70%, #303446)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #b06b71 12%, transparent)\",\n \"--dsw-static-red-500\": \"#e78284\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #e78284 10%, #303446)\",\n \"--dsw-static-red-600\": \"#e78284\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #e78284 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #e78284 34%, #303446)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-875)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.5)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.2)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(39, 39, 48, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-850)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted2\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l1\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2\": \"rgba(255, 255, 255, 0.12)\",\n \"--dsw-alias-border-l3\": \"rgba(255, 255, 255, 0.16)\",\n \"--dsw-alias-border-l4\": \"rgba(255, 255, 255, 0.2)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#8caaee\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(255, 255, 255, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(255, 255, 255, 0.24)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(242, 90, 90, 0.15)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-450) 55%, var(--dsw-static-neutral-bluish-400))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-blue-300) 65%, var(--dsw-static-deepseek-400))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-00) 45%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-alias-label-primary-dimmed)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-800)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-700)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-550)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-800)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-900)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-900)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-active)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 45%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_MACCHIATO: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-macchiato',\n colorScheme: 'dark',\n label: 'Macchiato',\n accent: '#8aadf4',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #f5a97f 20%, #24273a)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #f5a97f 70%, #24273a)\",\n \"--dsw-static-amber-500\": \"#f5a97f\",\n \"--dsw-static-amber-600\": \"#f5a97f\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #f5a97f 18%, #181926)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #8aadf4 24%, #24273a)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #8aadf4 50%, #24273a)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #8aadf4 66%, #24273a)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-blue-500\": \"#8aadf4\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #8aadf4 10%, #24273a)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #8aadf4 14%, #24273a)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #8aadf4 18%, #24273a)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #8aadf4 18%, #181926)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #8aadf4 14%, #181926)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #8aadf4 10%, #181926)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #8aadf4 24%, #24273a)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #8aadf4 36%, #24273a)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #8aadf4 50%, #24273a)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #8aadf4 66%, #24273a)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-deepseek-500\": \"#8aadf4\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #8aadf4 10%, #24273a)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #8aadf4 84%, #24273a)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #8aadf4 68%, #24273a)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #8aadf4 18%, #181926)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #8aadf4 14%, #181926)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #a6da95 18%, #24273a)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #a6da95 80%, #24273a)\",\n \"--dsw-static-green-500\": \"#a6da95\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #a6da95 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #a6da95 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #a6da95 18%, #181926)\",\n \"--dsw-static-neutral-00\": \"#cad3f5\",\n \"--dsw-static-neutral-1000\": \"#181926\",\n \"--dsw-static-neutral-100\": \"#a5adcb\",\n \"--dsw-static-neutral-150\": \"#a5adcb\",\n \"--dsw-static-neutral-200\": \"#939ab7\",\n \"--dsw-static-neutral-250\": \"#939ab7\",\n \"--dsw-static-neutral-300\": \"#8087a2\",\n \"--dsw-static-neutral-400\": \"#6e738d\",\n \"--dsw-static-neutral-500\": \"#5b6078\",\n \"--dsw-static-neutral-50\": \"#cad3f5\",\n \"--dsw-static-neutral-550\": \"#494d64\",\n \"--dsw-static-neutral-600\": \"#494d64\",\n \"--dsw-static-neutral-700\": \"#363a4f\",\n \"--dsw-static-neutral-800\": \"#363a4f\",\n \"--dsw-static-neutral-850\": \"#24273a\",\n \"--dsw-static-neutral-900\": \"#1e2030\",\n \"--dsw-static-neutral-bluish-00\": \"#cad3f5\",\n \"--dsw-static-neutral-bluish-1000\": \"#181926\",\n \"--dsw-static-neutral-bluish-100\": \"#a5adcb\",\n \"--dsw-static-neutral-bluish-150\": \"#a5adcb\",\n \"--dsw-static-neutral-bluish-200\": \"#939ab7\",\n \"--dsw-static-neutral-bluish-300\": \"#8087a2\",\n \"--dsw-static-neutral-bluish-400\": \"#6e738d\",\n \"--dsw-static-neutral-bluish-500\": \"#5b6078\",\n \"--dsw-static-neutral-bluish-50\": \"#cad3f5\",\n \"--dsw-static-neutral-bluish-600\": \"#494d64\",\n \"--dsw-static-neutral-bluish-60\": \"#b8c0e0\",\n \"--dsw-static-neutral-bluish-700\": \"#363a4f\",\n \"--dsw-static-neutral-bluish-750\": \"#363a4f\",\n \"--dsw-static-neutral-bluish-75\": \"#b8c0e0\",\n \"--dsw-static-neutral-bluish-800\": \"#363a4f\",\n \"--dsw-static-neutral-bluish-850\": \"#24273a\",\n \"--dsw-static-neutral-bluish-875\": \"#1e2030\",\n \"--dsw-static-neutral-bluish-900\": \"#1e2030\",\n \"--dsw-static-neutral-bluish-950\": \"#181926\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #ed8796 20%, #24273a)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #ed8796 70%, #24273a)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #b16a7a 12%, transparent)\",\n \"--dsw-static-red-500\": \"#ed8796\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #ed8796 10%, #24273a)\",\n \"--dsw-static-red-600\": \"#ed8796\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #ed8796 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #ed8796 34%, #24273a)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-875)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.5)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.2)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(39, 39, 48, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-850)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted2\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l1\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2\": \"rgba(255, 255, 255, 0.12)\",\n \"--dsw-alias-border-l3\": \"rgba(255, 255, 255, 0.16)\",\n \"--dsw-alias-border-l4\": \"rgba(255, 255, 255, 0.2)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#8aadf4\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(255, 255, 255, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(255, 255, 255, 0.24)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(242, 90, 90, 0.15)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-450) 55%, var(--dsw-static-neutral-bluish-400))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-blue-300) 65%, var(--dsw-static-deepseek-400))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-00) 45%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-alias-label-primary-dimmed)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-800)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-700)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-550)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-800)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-900)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-900)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-active)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 45%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_MOCHA: CatppuccinFlavorInfo = {\n themeId: 'catppuccin-mocha',\n colorScheme: 'dark',\n label: 'Mocha',\n accent: '#89b4fa',\n tokens: {\n \"--dsw-static-amber-100\": \"color-mix(in srgb, #fab387 20%, #1e1e2e)\",\n \"--dsw-static-amber-400\": \"color-mix(in srgb, #fab387 70%, #1e1e2e)\",\n \"--dsw-static-amber-500\": \"#fab387\",\n \"--dsw-static-amber-600\": \"#fab387\",\n \"--dsw-static-amber-900\": \"color-mix(in srgb, #fab387 18%, #11111b)\",\n \"--dsw-static-blue-100\": \"color-mix(in srgb, #89b4fa 24%, #1e1e2e)\",\n \"--dsw-static-blue-300\": \"color-mix(in srgb, #89b4fa 50%, #1e1e2e)\",\n \"--dsw-static-blue-400\": \"color-mix(in srgb, #89b4fa 66%, #1e1e2e)\",\n \"--dsw-static-blue-450\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-blue-500\": \"#89b4fa\",\n \"--dsw-static-blue-50\": \"color-mix(in srgb, #89b4fa 10%, #1e1e2e)\",\n \"--dsw-static-blue-50p\": \"color-mix(in srgb, #89b4fa 14%, #1e1e2e)\",\n \"--dsw-static-blue-600\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-blue-75\": \"color-mix(in srgb, #89b4fa 18%, #1e1e2e)\",\n \"--dsw-static-blue-800\": \"color-mix(in srgb, #89b4fa 18%, #11111b)\",\n \"--dsw-static-blue-900\": \"color-mix(in srgb, #89b4fa 14%, #11111b)\",\n \"--dsw-static-blue-950\": \"color-mix(in srgb, #89b4fa 10%, #11111b)\",\n \"--dsw-static-deepseek-100\": \"color-mix(in srgb, #89b4fa 24%, #1e1e2e)\",\n \"--dsw-static-deepseek-200\": \"color-mix(in srgb, #89b4fa 36%, #1e1e2e)\",\n \"--dsw-static-deepseek-300\": \"color-mix(in srgb, #89b4fa 50%, #1e1e2e)\",\n \"--dsw-static-deepseek-400\": \"color-mix(in srgb, #89b4fa 66%, #1e1e2e)\",\n \"--dsw-static-deepseek-450\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-deepseek-500\": \"#89b4fa\",\n \"--dsw-static-deepseek-50\": \"color-mix(in srgb, #89b4fa 10%, #1e1e2e)\",\n \"--dsw-static-deepseek-600\": \"color-mix(in srgb, #89b4fa 84%, #1e1e2e)\",\n \"--dsw-static-deepseek-700-delete\": \"color-mix(in srgb, #89b4fa 68%, #1e1e2e)\",\n \"--dsw-static-deepseek-800\": \"color-mix(in srgb, #89b4fa 18%, #11111b)\",\n \"--dsw-static-deepseek-900\": \"color-mix(in srgb, #89b4fa 14%, #11111b)\",\n \"--dsw-static-green-100\": \"color-mix(in srgb, #a6e3a1 18%, #1e1e2e)\",\n \"--dsw-static-green-400\": \"color-mix(in srgb, #a6e3a1 80%, #1e1e2e)\",\n \"--dsw-static-green-500\": \"#a6e3a1\",\n \"--dsw-static-green-500-a08\": \"color-mix(in srgb, #a6e3a1 8%, transparent)\",\n \"--dsw-static-green-500-a12\": \"color-mix(in srgb, #a6e3a1 12%, transparent)\",\n \"--dsw-static-green-900\": \"color-mix(in srgb, #a6e3a1 18%, #11111b)\",\n \"--dsw-static-neutral-00\": \"#cdd6f4\",\n \"--dsw-static-neutral-1000\": \"#11111b\",\n \"--dsw-static-neutral-100\": \"#a6adc8\",\n \"--dsw-static-neutral-150\": \"#a6adc8\",\n \"--dsw-static-neutral-200\": \"#9399b2\",\n \"--dsw-static-neutral-250\": \"#9399b2\",\n \"--dsw-static-neutral-300\": \"#7f849c\",\n \"--dsw-static-neutral-400\": \"#6c7086\",\n \"--dsw-static-neutral-500\": \"#585b70\",\n \"--dsw-static-neutral-50\": \"#cdd6f4\",\n \"--dsw-static-neutral-550\": \"#45475a\",\n \"--dsw-static-neutral-600\": \"#45475a\",\n \"--dsw-static-neutral-700\": \"#313244\",\n \"--dsw-static-neutral-800\": \"#313244\",\n \"--dsw-static-neutral-850\": \"#1e1e2e\",\n \"--dsw-static-neutral-900\": \"#181825\",\n \"--dsw-static-neutral-bluish-00\": \"#cdd6f4\",\n \"--dsw-static-neutral-bluish-1000\": \"#11111b\",\n \"--dsw-static-neutral-bluish-100\": \"#a6adc8\",\n \"--dsw-static-neutral-bluish-150\": \"#a6adc8\",\n \"--dsw-static-neutral-bluish-200\": \"#9399b2\",\n \"--dsw-static-neutral-bluish-300\": \"#7f849c\",\n \"--dsw-static-neutral-bluish-400\": \"#6c7086\",\n \"--dsw-static-neutral-bluish-500\": \"#585b70\",\n \"--dsw-static-neutral-bluish-50\": \"#cdd6f4\",\n \"--dsw-static-neutral-bluish-600\": \"#45475a\",\n \"--dsw-static-neutral-bluish-60\": \"#bac2de\",\n \"--dsw-static-neutral-bluish-700\": \"#313244\",\n \"--dsw-static-neutral-bluish-750\": \"#313244\",\n \"--dsw-static-neutral-bluish-75\": \"#bac2de\",\n \"--dsw-static-neutral-bluish-800\": \"#313244\",\n \"--dsw-static-neutral-bluish-850\": \"#1e1e2e\",\n \"--dsw-static-neutral-bluish-875\": \"#181825\",\n \"--dsw-static-neutral-bluish-900\": \"#181825\",\n \"--dsw-static-neutral-bluish-950\": \"#11111b\",\n \"--dsw-static-red-100\": \"color-mix(in srgb, #f38ba8 20%, #1e1e2e)\",\n \"--dsw-static-red-400\": \"color-mix(in srgb, #f38ba8 70%, #1e1e2e)\",\n \"--dsw-static-red-400-a12\": \"color-mix(in srgb, #b36a83 12%, transparent)\",\n \"--dsw-static-red-500\": \"#f38ba8\",\n \"--dsw-static-red-50\": \"color-mix(in srgb, #f38ba8 10%, #1e1e2e)\",\n \"--dsw-static-red-600\": \"#f38ba8\",\n \"--dsw-static-red-600-a08\": \"color-mix(in srgb, #f38ba8 8%, transparent)\",\n \"--dsw-static-red-900\": \"color-mix(in srgb, #f38ba8 34%, #1e1e2e)\",\n \"--dsw-alias-bg-base\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-preview\": \"var(--dsw-static-neutral-bluish-950)\",\n \"--dsw-alias-bg-document-selection\": \"color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)\",\n \"--dsw-alias-label-document-preview\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-bg-layer-1\": \"var(--dsw-static-neutral-bluish-875)\",\n \"--dsw-alias-bg-layer-2\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-bg-layer-3\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-mask-1\": \"rgba(0, 0, 0, 0.5)\",\n \"--dsw-alias-bg-mask-2\": \"rgba(0, 0, 0, 0.2)\",\n \"--dsw-alias-bg-mask-3\": \"rgba(0, 0, 0, 0.48)\",\n \"--dsw-alias-bg-mask-photo\": \"rgba(0, 0, 0, 0.88)\",\n \"--dsw-alias-bg-mask-drop\": \"rgba(39, 39, 48, 0.7)\",\n \"--dsw-alias-bg-module-platform\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-bg-multi-select\": \"var(--dsw-static-neutral-850)\",\n \"--dsw-alias-bg-overlay\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-bg-skeleton\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted2\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-border-inverted\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l1\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2-darkmode-thin\": \"rgba(255, 255, 255, 0.06)\",\n \"--dsw-alias-border-l2\": \"rgba(255, 255, 255, 0.12)\",\n \"--dsw-alias-border-l3\": \"rgba(255, 255, 255, 0.16)\",\n \"--dsw-alias-border-l4\": \"rgba(255, 255, 255, 0.2)\",\n \"--dsw-alias-brand-primary-invert\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-primary-new-colorprimary-new-color\": \"#89b4fa\",\n \"--dsw-alias-brand-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-brand-text\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-contrast-fill\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-button-elevated-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-floating-fill\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-button-floating-hover\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-button-ghost-active-border\": \"var(--dsw-static-neutral-bluish-600)\",\n \"--dsw-alias-button-ghost-active-fill\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-ghost-active-hover\": \"var(--dsw-static-neutral-bluish-700)\",\n \"--dsw-alias-button-info-fill\": \"var(--dsw-static-deepseek-400)\",\n \"--dsw-alias-button-info-hover\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-button-primary-dimmed\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-button-primary-fill\": \"var(--dsw-alias-brand-primary)\",\n \"--dsw-alias-button-primary-hover\": \"var(--dsw-static-neutral-bluish-100)\",\n \"--dsw-alias-button-tool-bar-fill-invisible\": \"rgba(31, 31, 31, 0.36)\",\n \"--dsw-alias-button-tool-bar-fill\": \"rgba(84, 85, 87, 0.5)\",\n \"--dsw-alias-button-tool-bar-hover\": \"rgba(84, 85, 87, 0.6)\",\n \"--dsw-alias-interactive-bg-active\": \"rgba(255, 255, 255, 0.14)\",\n \"--dsw-alias-interactive-bg-hover-accent\": \"rgba(255, 255, 255, 0.24)\",\n \"--dsw-alias-interactive-bg-hover-danger\": \"rgba(242, 90, 90, 0.15)\",\n \"--dsw-alias-interactive-bg-hover-solid\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-interactive-bg-hover\": \"rgba(255, 255, 255, 0.08)\",\n \"--dsw-alias-label-caption\": \"var(--dsw-static-neutral-bluish-300)\",\n \"--dsw-alias-label-deep-diving\": \"color-mix(in srgb, var(--dsw-static-deepseek-450) 55%, var(--dsw-static-neutral-bluish-400))\",\n \"--dsw-alias-label-deep-diving-shimmer\": \"color-mix(in srgb, var(--dsw-static-blue-300) 65%, var(--dsw-static-deepseek-400))\",\n \"--dsw-alias-label-dimmed\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-label-primary-bluish\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-primary-dimmed\": \"var(--dsw-static-neutral-bluish-75)\",\n \"--dsw-alias-label-primary-foreground\": \"var(--dsw-static-neutral-bluish-1000)\",\n \"--dsw-alias-label-primary-inverted\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-label-primary\": \"var(--dsw-static-neutral-bluish-50)\",\n \"--dsw-alias-label-secondary\": \"var(--dsw-static-neutral-bluish-150)\",\n \"--dsw-alias-label-shimmer\": \"color-mix(in srgb, var(--dsw-static-neutral-00) 45%, transparent)\",\n \"--dsw-alias-label-tertiary\": \"var(--dsw-static-neutral-bluish-200)\",\n \"--dsw-alias-menu-icon\": \"var(--dsw-alias-label-primary-dimmed)\",\n \"--dsw-alias-link\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-markdown-citation\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-block-banner\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-code-block\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-code-segment-selected\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-alias-markdown-code-segment-unselected\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-alias-markdown-inline-code\": \"var(--dsw-static-neutral-800)\",\n \"--dsw-alias-markdown-placeholder\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-markdown-tag\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-alias-scrollbar-bg-l1\": \"var(--dsw-static-neutral-700)\",\n \"--dsw-alias-scrollbar-bg-l2\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l1\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-scrollbar-hover-l2\": \"var(--dsw-static-neutral-550)\",\n \"--dsw-alias-state-business-primary\": \"var(--dsw-static-deepseek-500)\",\n \"--dsw-alias-state-business-tertiary\": \"var(--dsw-static-deepseek-800)\",\n \"--dsw-alias-code-diff-added\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-code-diff-deleted\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-added-bg\": \"var(--dsw-static-green-500-a12)\",\n \"--dsw-alias-file-diff-added-gutter\": \"color-mix(in srgb, var(--dsw-static-green-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-added-marker\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-file-diff-deleted-bg\": \"var(--dsw-static-red-400-a12)\",\n \"--dsw-alias-file-diff-deleted-gutter\": \"color-mix(in srgb, var(--dsw-static-red-500) 6%, transparent)\",\n \"--dsw-alias-file-diff-deleted-marker\": \"var(--dsw-static-red-500)\",\n \"--dsw-alias-state-error-primary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-error-secondary\": \"var(--dsw-static-red-400)\",\n \"--dsw-alias-state-idle-primary\": \"var(--dsw-static-neutral-600)\",\n \"--dsw-alias-state-success-primary\": \"var(--dsw-static-green-500)\",\n \"--dsw-alias-state-success-secondary\": \"var(--dsw-static-green-400)\",\n \"--dsw-alias-state-success-tertiary\": \"var(--dsw-static-green-900)\",\n \"--dsw-alias-state-warn-label\": \"var(--dsw-static-amber-600)\",\n \"--dsw-alias-state-warn-primary\": \"var(--dsw-static-amber-500)\",\n \"--dsw-alias-state-warn-secondary\": \"var(--dsw-static-amber-400)\",\n \"--dsw-alias-state-warn-tertiary\": \"var(--dsw-static-amber-900)\",\n \"--dsw-alias-switch-thumb\": \"var(--dsw-static-neutral-bluish-400)\",\n \"--dsw-alias-toast-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-toast-label\": \"var(--dsw-static-neutral-bluish-00)\",\n \"--dsw-alias-turn-trigger-bg\": \"var(--dsw-alias-interactive-bg-hover)\",\n \"--dsw-alias-turn-trigger-bg-hover\": \"var(--dsw-alias-interactive-bg-active)\",\n \"--dsw-alias-tooltip-bg\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-alias-tooltip-key-bg\": \"color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)\",\n \"--dsw-alias-menu-group-header-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 94%, transparent)\",\n \"--dsw-specific-bubble-highlight\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-bubble\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-input-major\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-login-input\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-menu\": \"var(--dsw-menu-surface-fill)\",\n \"--dsw-specific-selector\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-fill\": \"var(--dsw-static-neutral-bluish-900)\",\n \"--dsw-specific-sidebar-nav-item-active-accent\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-specific-sidebar-nav-item-active\": \"var(--dsw-static-neutral-bluish-750)\",\n \"--dsw-specific-sidebar-nav-item-hover\": \"var(--dsw-static-neutral-bluish-850)\",\n \"--dsw-specific-tip\": \"var(--dsw-static-neutral-bluish-800)\",\n \"--dsw-menu-surface-fill\": \"color-mix(in srgb, var(--dsw-alias-bg-layer-3) 45%, transparent)\",\n },\n}\n\nexport const CATPPUCCIN_FLAVORS: readonly CatppuccinFlavorInfo[] = [\n CATPPUCCIN_LATTE,\n CATPPUCCIN_FRAPPE,\n CATPPUCCIN_MACCHIATO,\n CATPPUCCIN_MOCHA,\n]\n","/**\n * Durable Catppuccin state — the shared contract between the two halves.\n *\n * Why this exists: localStorage is scoped per origin, so it is the wrong place\n * for the ONLY copy of a preference. It is per-browser (two browsers on one\n * machine disagree), per-loopback-port (a second Desktop instance that lands\n * on the next free port gets a different origin — the official shell pins\n * `19387` and `anywhere-labs/dsh-desktop` starts at `43120` and increments on\n * a bind collision, both observed 2026-09-24), and it disappears whenever the\n * user clears site data. The durable copy lives in the official settings seam\n * under the DSH home, which is the machine-wide truth every browser and every\n * profile entry reads.\n *\n * (Historical note, corrected 2026-09-24: the 0.5.0 rationale claimed DSH\n * Desktop launched the profile with `--port 0`, \"a fresh random port every\n * launch\". That was already untrue when 0.5.0 shipped — the community shell\n * pinned a stable port on 2026-08-21, and the official shell passes an\n * explicit `--port 19387`. The design is unchanged and still justified by the\n * reasons above, but do not repeat the port-per-launch claim.)\n *\n * Since 0.5.0 the DURABLE copy lives in the official settings seam, which\n * persists under the DSH home exactly like the legacy\n * `$DSH_HOME/catppuccin-state.json` did — origin-independent, so it survives\n * the Desktop's per-launch port churn. The legacy file is kept as a\n * read-only migration source (`src/legacy-state.ts`) and rolled into the\n * settings document once (`src/index.ts`). Browser localStorage remains the\n * in-browser cache and cross-tab sync bus, and the Client's fallback when the\n * settings transport is unavailable. This module is dependency-free so both\n * bundles inline it (like `update-check.ts`).\n *\n * The seam itself is version-dependent (issue #15): DSH <= 0.1.6-alpha.2\n * serves a Client `ctx.settingsScope` bound to a namespace the plugin\n * registers itself (`CATPPUCCIN_SETTINGS_NS`), while >= 0.1.7-alpha.1 serves\n * `ctx.configForms` projecting the plugin's volatile `Config` form, keyed by\n * the PROFILE ENTRY ID (`CATPPUCCIN_ENTRY_ID`). Both are addressed from this\n * one contract (see `src/client/state-sync.ts`).\n */\nexport const STATE_VERSION = 1\n\n/** Release channels the update check knows about (a persisted preference;\n * `selectNewest` in `update-check.ts` consumes it). */\nexport type UpdateChannel = 'latest' | 'beta'\n\n/** Shiki syntax-highlighting style variants (see `src/client/shiki-tokens.ts`). */\nexport type ShikiStyle = 'default' | 'italic-comments'\n\n/** Legacy settings namespace (DSH <= 0.1.6-alpha.2): the Host registers it\n * through `settings.installSection`, the Client binds it through\n * `ctx.settingsScope` (see `src/settings-catppuccin.ts`). */\nexport const CATPPUCCIN_SETTINGS_NS = 'catppuccin'\n\n/**\n * Profile entry id carrying the plugin (DSH >= 0.1.7-alpha.1): the settings\n * service projects our volatile `Config` into a form named by the ACTIVE\n * PROFILE ENTRY's id, so this constant is the new seam's namespace.\n *\n * It is a CONTRACT with `cordis.patch.yml`: the `insert` row whose `name` is\n * `@nonamelego/dsh-catppuccin` must keep `id: dsh-catppuccin`, because the\n * Client can only address the form by that id (asserted by\n * `tests/settings-seam.spec.ts`). A user who renames the entry loses the new\n * seam and degrades to localStorage-only — the legacy seam is unaffected,\n * since that namespace is registered by the plugin itself.\n */\nexport const CATPPUCCIN_ENTRY_ID = 'dsh-catppuccin'\n\n/** State file name under the DSH home (kept next to the Desktop-managed\n * `cordis.patch.yml` so it survives the Desktop's per-launch port churn). */\nexport const STATE_FILENAME = 'catppuccin-state.json'\n\n/**\n * Whether a raw settings view carries a user layer at all.\n *\n * The two seams answer this differently and the difference is load-bearing\n * (issue #15): the NEW form's `user` is the profile patch's `override`, which\n * `configEditor.configuration()` defaults to `{}` — so \"absent\" arrives as an\n * EMPTY OBJECT, and `!== undefined` would be true forever. The LEGACY\n * document omits the field entirely when the document holds no such section,\n * so the old `!== undefined` test stays correct there. Callers must use the\n * predicate their channel defines (see `src/client/state-sync.ts`).\n * @param user - a snapshot's raw user layer.\n * @returns whether it holds at least one entry.\n */\nexport function hasUserLayerSection(user: unknown): boolean {\n return typeof user === 'object' && user !== null && !Array.isArray(user) && Object.keys(user).length > 0\n}\n\n/** The four registered Catppuccin theme ids. MUST stay in sync with the\n * `themeId` of `CATPPUCCIN_FLAVORS` in `src/client/palettes.ts` — guarded by\n * `tests/state.spec.ts` — because the persisted flavour value IS the theme id. */\nexport const CATPPUCCIN_THEME_IDS = [\n 'catppuccin-latte',\n 'catppuccin-frappe',\n 'catppuccin-macchiato',\n 'catppuccin-mocha',\n] as const\n\n/** A persisted flavour choice: one registered theme id or `off` (fall back to\n * the official theme). */\nexport type FlavorValue = (typeof CATPPUCCIN_THEME_IDS)[number] | 'off'\n\n/**\n * The LIGHT end of \"follow the OS\" (issue #36). Latte is the only light\n * flavour Catppuccin ships, so the light half is a constant instead of a\n * setting — a picker here would offer exactly one real option.\n */\nexport const FOLLOW_LIGHT_FLAVOR = 'catppuccin-latte' as const\n\n/** The flavours the follow mode may use for its DARK end. Only the three dark\n * flavours: Latte here would paint a light palette into the dark half. */\nexport const FOLLOW_DARK_FLAVORS = [\n 'catppuccin-frappe',\n 'catppuccin-macchiato',\n 'catppuccin-mocha',\n] as const\n\n/** The dark end of follow mode (one of {@link FOLLOW_DARK_FLAVORS}). */\nexport type FollowDarkFlavor = (typeof FOLLOW_DARK_FLAVORS)[number]\n\n/** Shipped follow-mode dark end: Mocha, Catppuccin's most common dark pick. */\nexport const DEFAULT_FOLLOW_DARK: FollowDarkFlavor = 'catppuccin-mocha'\n\n/** Shipped follow-mode flag: off, i.e. 0.6.x behaviour exactly. */\nexport const DEFAULT_FOLLOW_SYSTEM = false\n\n/** Durable glass-layer settings (no derived `dark` field — that resolves at\n * runtime from the active theme). */\nexport interface GlassState {\n /** Layer enable flag. */\n enabled: boolean\n /** Rendering mode. */\n mode: 'mica' | 'compat'\n /** Glass blur radius, px (0-40). */\n blur: number\n /** Glass fill frost, 0-100. */\n frost: number\n /** Backdrop brightness, 0-100. */\n brightness: number\n /**\n * Floating-card inset, px (issue #31, {@link GLASS_GAP_MIN}..{@link GLASS_GAP_MAX}).\n *\n * The whitespace between every mica-mode card and the window edge: the\n * sidebar sheet's margin on all four sides, the header card's top margin,\n * the trajectory card's top/bottom margin and the composer bar's bottom pad.\n * ONE knob for all of them, because they were all a hardcoded 12px and the\n * reporter's problem (\"在我这块屏上略挤\") is the whole chrome reading tight,\n * not one card.\n *\n * It deliberately does NOT touch content width: the chat column keeps its\n * upstream-computed width and the reading-column gutter (`calc(100% - 32px)`)\n * stays a literal. The sidebar SHEET does narrow by the delta, because its\n * margin is taken out of the (upstream-fixed) sidebar column — that trade is\n * the documented semantics, see `docs/issue-gh-31-card-gap.md`.\n */\n gap: number\n /**\n * How strong the ground glows read, percent of the shipped 0.6.3 look\n * (`GLOW_STRENGTH_DEFAULT` = 100 = the alphas issue #25 shipped; 0 = gone).\n * Only meaningful while {@link glow} is on — a separate scalar instead of\n * folding the switch into the number, because the settings seam reads\n * \"resolves to the shipped default\" as \"no user choice yet\": merging the two\n * would make every existing `glow: true` document (which has no strength\n * field) resolve to 0 and silently switch the glows off.\n *\n * The ceiling is a PROVISIONAL, deliberately conservative number: the glows\n * are painted under text, and Latte is the strictest scheme (both glows sit\n * on `#eff1f5`). 200% keeps the brand glow's peak alpha at 24%, which is the\n * last step that plausibly leaves `label-primary` at AA over the brightest\n * patch — the CDP contrast run that pins the real limit is listed as an open\n * item in `docs/issue-32-glow-tuning.md` §6. Lower this constant if that run\n * disagrees; never raise it without one.\n */\n glowStrength: number\n /**\n * How far the two ground glows SPREAD, percent of the shipped 0.6.3 geometry\n * (issue #32 follow-up, 100 = `58% 46%` / `48% 42%` as #25 drew them).\n * `GLOW_SIZE_MIN` is 100 on purpose — the knob only ENLARGES, and its left\n * end is the shipped look, so \"unchanged\" is always reachable without\n * guessing. Enlarging keeps the peak alpha where it was (the radius is\n * geometry, not opacity) and flattens the falloff, which is the answer to\n * the reporter's real complaint: at 200% strength on Latte the TWO centre\n * patches read as \"a stuck-on colour dab\"; spreading them does not touch the\n * peak, it just stops the light piling up in the corner. It also LOWERS the\n * per-pane variation issue #26 measured, because the gradient slope across a\n * pane shrinks with the radius.\n *\n * Only meaningful while {@link glow} is on. Positions stay hardcoded — the\n * \"where is the light\" axis is deliberately not exposed (see\n * `docs/issue-32-glow-tuning.md` §2).\n */\n glowSize: number\n /**\n * The optional ground GLOWS (issue #26, 2026-10-16). The page ground is\n * always a same-family wash (the \"C\" answer to the reporter's report: the\n * wash gives the glass something to transmit without localising the\n * brightness); this knob adds back the two static radial glows that shipped\n * in 0.6.3-beta.0 (issue #25) for users who liked them.\n *\n * Default OFF, and that default IS the reported fix: the glows are fixed to\n * screen coordinates while the glass panes sit elsewhere, so each pane\n * transmits a different slice of them — measured on the live page, one\n * sidebar card read ΔRGB (12,15,21) between its own top and bottom with the\n * glows on, and ≤(4,4,5) with the wash alone (see\n * `docs/issue-26-ambient-ground.md` / the CHANGELOG entry). The knob exists\n * because #25 was filed by the same reporter: rather than deleting the look\n * outright, it stays an opt-in.\n */\n glow: boolean\n}\n\n/** The whole durable state the plugin persists. */\nexport interface CatppuccinState {\n /** Schema version; anything else is treated as unknown and defaulted. */\n version: typeof STATE_VERSION\n /** Selected flavour (theme id or `off`). */\n flavor: FlavorValue\n /**\n * Follow the OS light/dark scheme (issue #36): Latte for the light half,\n * {@link followDark} for the dark half.\n *\n * This is a SEPARATE axis from {@link flavor} on purpose. A registered theme\n * carries ONE `colorScheme`, so \"light and dark at once\" cannot be expressed\n * as a theme id; the runtime keeps the official preference on `system` and\n * stacks a `{ light, dark }` token layer instead (see `applyFollowLayer` in\n * `src/client/index.ts`). A follow value inside `FlavorValue` would also\n * break the \"the persisted value IS the theme id\" invariant that\n * `readFlavor` / `bootPaletteRows` / `CATPPUCCIN_FLAVOR_VALUES` all rely on.\n *\n * Invariant (enforced by `sanitizeState`): `followSystem` is never true\n * while `flavor` is `off` — turning the plugin off must not leave a layer\n * painting the UI.\n */\n followSystem: boolean\n /** The dark half of follow mode ({@link FOLLOW_DARK_FLAVORS}). */\n followDark: FollowDarkFlavor\n /** Glass-layer settings (enable flag + knobs). */\n glass: GlassState\n /** Automatically re-check for updates (boot + periodic, while on). */\n autoCheck: boolean\n /** Release channel the update check chases. */\n updateChannel: UpdateChannel\n /** Per-token `--dsw-*` overrides merged LAST into the active theme. */\n overrides: Record<string, string>\n /** Shiki syntax-highlighting style variant. */\n shikiStyle: ShikiStyle\n}\n\n/** The settings-document section: `CatppuccinState` minus the synthetic\n * `version` field — the official seam resolves defaults, composition and the\n * user layer itself, so no plugin-side version is stored. */\nexport interface CatppuccinSettingsSection {\n /** Selected flavour (theme id or `off`). */\n flavor: FlavorValue\n /** Follow the OS light/dark scheme (issue #36). */\n followSystem: boolean\n /** The dark half of follow mode. */\n followDark: FollowDarkFlavor\n /** Glass-layer settings (enable flag + knobs). */\n glass: GlassState\n /** Automatically re-check for updates (boot + periodic, while on). */\n autoCheck: boolean\n /** Release channel the update check chases. */\n updateChannel: UpdateChannel\n /** Per-token `--dsw-*` overrides merged LAST into the active theme. */\n overrides: Record<string, string>\n /** Shiki syntax-highlighting style variant. */\n shikiStyle: ShikiStyle\n}\n\n/** Lower bound of the floating-card inset (issue #31). 4px is the tightest a\n * card can sit against the window edge and still read as a floating sheet —\n * below that the rim and the drop shadow collapse into the edge. */\nexport const GLASS_GAP_MIN = 4\n\n/** Upper bound of the floating-card inset (issue #31). 24px is where the\n * collapsed sidebar rail's right-edge cap (16px, see the CSS) starts to be\n * exceeded on purpose rather than by accident: every value above 16 makes the\n * rail overlap the transcript's card, so the ceiling keeps that at 8px. */\nexport const GLASS_GAP_MAX = 24\n/** Upper bound of the ground-glow strength (issue #32), in percent of the\n * shipped look. A contrast budget, not a taste number: the glows are painted\n * under text and Latte is the strictest scheme. Evidence now exists — the\n * reporter measured body text on Latte at 100% ≈ 6.1:1 and 200% ≈ 5.7:1\n * (both AA; the top-bar label 4.3 → 4.2 was already low before the glows), so\n * 200% stays. Raise it only with a new measurement; see\n * {@link GlassState.glowStrength} and `docs/issue-32-glow-tuning.md` §6. */\nexport const GLOW_STRENGTH_MAX = 200\n\n/** The shipped glow strength: 100% = exactly the two alphas issue #25\n * introduced, so a profile that never opens the new knob renders the same\n * ground it rendered in 0.6.6. */\nexport const GLOW_STRENGTH_DEFAULT = 100\n\n/** Lower bound of the glow SPREAD (issue #32 follow-up). 100% = the shipped\n * 0.6.3 geometry, i.e. the knob only enlarges: a tighter hotspot is what the\n * reporter complained about, so the axis starts at \"unchanged\". */\nexport const GLOW_SIZE_MIN = 100\n\n/** Upper bound of the glow spread, in percent of the shipped radii (2.5x).\n * Above this the two ellipses cover the whole page and the field stops\n * reading as two light sources — it becomes an off-centre wash, which is the\n * wash's job, not the glows'. */\nexport const GLOW_SIZE_MAX = 250\n\n/** The shipped glow spread: 100% = `58% 46%` / `48% 42%` exactly as #25 drew\n * them, so an untouched profile renders the 0.6.x ground. */\nexport const GLOW_SIZE_DEFAULT = 100\n\n/** Shipped glass defaults — the single source of truth; the client glass layer\n * (`src/client/glass/glass-layer.ts`) derives its knob defaults from here. */\nexport const DEFAULT_GLASS: GlassState = {\n enabled: false,\n mode: 'mica',\n blur: 5,\n frost: 20,\n brightness: 50,\n // The 0.6.x chrome: every floating card sat 12px in from the window edge.\n // This default IS the pre-#31 look, so an untouched profile renders\n // byte-identically to 0.6.x.\n gap: 12,\n glowStrength: GLOW_STRENGTH_DEFAULT,\n glowSize: GLOW_SIZE_DEFAULT,\n glow: false,\n}\n\n/** Shipped update-check preference: automatic checks on. */\nexport const DEFAULT_AUTO_CHECK = true\n/** Shipped update-check channel: chase the stable `latest` tag. */\nexport const DEFAULT_UPDATE_CHANNEL: UpdateChannel = 'latest'\n/** Shipped syntax-highlighting style. */\nexport const DEFAULT_SHIKI_STYLE: ShikiStyle = 'default'\n\n/** A fully default state: no Catppuccin flavour and no glass. */\nexport function defaultState(): CatppuccinState {\n return {\n version: STATE_VERSION,\n flavor: 'off',\n followSystem: DEFAULT_FOLLOW_SYSTEM,\n followDark: DEFAULT_FOLLOW_DARK,\n glass: { ...DEFAULT_GLASS },\n autoCheck: DEFAULT_AUTO_CHECK,\n updateChannel: DEFAULT_UPDATE_CHANNEL,\n overrides: {},\n shikiStyle: DEFAULT_SHIKI_STYLE,\n }\n}\n\n/**\n * Keep only well-formed custom token overrides: string values under a `--`\n * key (the token shape `--dsw-*` names). Everything else is dropped so a\n * hand-edited document can never smuggle junk into the theme registration.\n */\nexport function sanitizeOverrides(input: unknown): Record<string, string> {\n const out: Record<string, string> = {}\n if (typeof input !== 'object' || input === null) return out\n for (const [key, value] of Object.entries(input)) {\n if (typeof value === 'string' && key.startsWith('--')) out[key] = value\n }\n return out\n}\n\n/**\n * Whether a raw overrides map carries entries {@link sanitizeOverrides} would\n * drop — a key that is not a `--` token, or a non-string value.\n *\n * The settings-document schema types `overrides` as a dict of strings only, so\n * a hand-edited document can hold such entries. The client reads them away but\n * never wrote the cleaned map back, so every settings publish re-ran the\n * \"document wins\" adoption for a difference nothing could clear (audit F7).\n * The caller uses this to push the sanitized shape back once, so the document\n * converges instead of drifting forever.\n */\nexport function hasUnpersistableOverrides(raw: unknown): boolean {\n if (typeof raw !== 'object' || raw === null) return false\n return Object.entries(raw).some(([key, value]) => typeof value !== 'string' || !key.startsWith('--'))\n}\n\n/** Clamp a finite number into [min, max]; non-finite values fall back. */\nfunction clampFinite(value: unknown, min: number, max: number, fallback: number): number {\n return typeof value === 'number' && Number.isFinite(value)\n ? Math.min(max, Math.max(min, value))\n : fallback\n}\n\n/**\n * Normalize arbitrary input (JSON from disk or the wire) into a valid state:\n * unknown/missing fields fall back to defaults, out-of-range numbers clamp,\n * and unknown flavours/invalid enums fall back too. The Host applies this on\n * both read and write so a corrupt file or a hand-crafted payload can never\n * poison the plugin's settings.\n */\nexport function sanitizeState(input: unknown): CatppuccinState {\n const state = defaultState()\n if (typeof input !== 'object' || input === null) return state\n const raw = input as Record<string, unknown>\n\n const flavor = raw.flavor\n if (typeof flavor === 'string' && (CATPPUCCIN_THEME_IDS as readonly string[]).includes(flavor)) {\n state.flavor = flavor as FlavorValue\n } else if (flavor === 'off') {\n state.flavor = 'off'\n }\n\n // Issue #36: the follow-mode pair. Absent fields keep their shipped\n // defaults, so a document written by 0.6.x rolls forward untouched.\n // `followDark` is restricted to the three DARK flavours — Latte would paint\n // a light palette into the dark half of the layer.\n const followDark = raw.followDark\n state.followDark = typeof followDark === 'string' && (FOLLOW_DARK_FLAVORS as readonly string[]).includes(followDark)\n ? followDark as FollowDarkFlavor\n : DEFAULT_FOLLOW_DARK\n state.followSystem = raw.followSystem === true\n // Invariant: \"off\" wins over follow. Turning the plugin off must retire the\n // layer, or a document could keep `followSystem: true` while the user asked\n // for the official theme — the layer would keep painting Catppuccin tokens.\n if (state.flavor === 'off') state.followSystem = false\n\n const glass = typeof raw.glass === 'object' && raw.glass !== null\n ? raw.glass as Record<string, unknown>\n : {}\n state.glass.enabled = glass.enabled === true\n state.glass.mode = glass.mode === 'compat' ? 'compat' : 'mica'\n state.glass.blur = clampFinite(glass.blur, 0, 40, DEFAULT_GLASS.blur)\n state.glass.frost = clampFinite(glass.frost, 0, 100, DEFAULT_GLASS.frost)\n state.glass.brightness = clampFinite(glass.brightness, 0, 100, DEFAULT_GLASS.brightness)\n // Issue #31: the floating-card inset. Its own range (not 0-100) — a\n // hand-edited document must not be able to push the cards off the window.\n state.glass.gap = clampFinite(glass.gap, GLASS_GAP_MIN, GLASS_GAP_MAX, DEFAULT_GLASS.gap)\n // Issue #32: the glow STRENGTH. Its own range, and an absent field means the\n // shipped 100% — a document written by 0.6.x has `glow: true` and no\n // strength, and must keep rendering exactly what it rendered then.\n state.glass.glowStrength = clampFinite(glass.glowStrength, 0, GLOW_STRENGTH_MAX, DEFAULT_GLASS.glowStrength)\n // Issue #32 follow-up: the glow SPREAD. Its own range (100-250%) — a\n // hand-edited document must not be able to collapse the two light sources\n // into a pinhole or blow them up past the page.\n state.glass.glowSize = clampFinite(glass.glowSize, GLOW_SIZE_MIN, GLOW_SIZE_MAX, DEFAULT_GLASS.glowSize)\n // Issue #26: boolean-only, shipped OFF (the wash-only ground is the fix).\n state.glass.glow = glass.glow === true\n\n // Preference fields: absent values keep their shipped defaults, so a v1\n // document (predating them) rolls forward without a migration step.\n state.autoCheck = raw.autoCheck !== false\n state.updateChannel = raw.updateChannel === 'beta' ? 'beta' : 'latest'\n state.overrides = sanitizeOverrides(raw.overrides)\n state.shikiStyle = raw.shikiStyle === 'italic-comments' ? 'italic-comments' : 'default'\n\n return state\n}\n\n/**\n * Version-aware migration of an arbitrary persisted document. Version 1\n * documents roll forward through `sanitizeState` (every field added since\n * v1 has a sanitize-time default, so no structural step exists yet); future\n * versions chain their steps here, oldest first. Documents from a NEWER\n * plugin keep every field `sanitizeState` understands instead of being\n * nuked — a downgrade never destroys user state. The version-upgrade\n * convention lives in `docs/state-migrations.md` (item Y).\n */\nexport function migrate(raw: unknown): CatppuccinState {\n if (typeof raw !== 'object' || raw === null) return defaultState()\n const record = raw as Record<string, unknown>\n const version = typeof record.version === 'number' ? record.version : 1\n // Future schema steps chain here, oldest first:\n // let current: unknown = record\n // if (version < 2) current = migrateV1toV2(current)\n // if (version < 3) current = migrateV2toV3(current)\n // (the state contract of each step is spelled out in docs/state-migrations.md)\n return sanitizeState(record)\n}\n\n/** Whether a normalized state carries nothing beyond the shipped defaults —\n * i.e. the user never actually chose anything worth persisting. Used to tell\n * \"no durable state yet\" apart from \"an explicit default choice\". */\nexport function isDefaultState(state: CatppuccinState): boolean {\n const expected = defaultState()\n return state.flavor === expected.flavor\n && state.followSystem === expected.followSystem\n && state.followDark === expected.followDark\n && state.glass.enabled === expected.glass.enabled\n && state.glass.mode === expected.glass.mode\n && state.glass.blur === expected.glass.blur\n && state.glass.frost === expected.glass.frost\n && state.glass.brightness === expected.glass.brightness\n && state.glass.gap === expected.glass.gap\n && state.glass.glowStrength === expected.glass.glowStrength\n && state.glass.glowSize === expected.glass.glowSize\n && state.glass.glow === expected.glass.glow\n && state.autoCheck === expected.autoCheck\n && state.updateChannel === expected.updateChannel\n && Object.keys(state.overrides).length === 0\n && state.shikiStyle === expected.shikiStyle\n}\n\n/** Default settings-document section: no flavour and no glass (mirrors\n * `defaultState()` minus the synthetic `version`). */\nexport function defaultSettingsSection(): CatppuccinSettingsSection {\n return {\n flavor: 'off',\n followSystem: DEFAULT_FOLLOW_SYSTEM,\n followDark: DEFAULT_FOLLOW_DARK,\n glass: { ...DEFAULT_GLASS },\n autoCheck: DEFAULT_AUTO_CHECK,\n updateChannel: DEFAULT_UPDATE_CHANNEL,\n overrides: {},\n shikiStyle: DEFAULT_SHIKI_STYLE,\n }\n}\n\n/** Drop the synthetic `version` field: full state → settings-document section. */\nexport function settingsSectionFromState(state: CatppuccinState): CatppuccinSettingsSection {\n return {\n flavor: state.flavor,\n followSystem: state.followSystem,\n followDark: state.followDark,\n glass: { ...state.glass },\n autoCheck: state.autoCheck,\n updateChannel: state.updateChannel,\n overrides: { ...state.overrides },\n shikiStyle: state.shikiStyle,\n }\n}\n\n/** Lift a settings-document section back into the full state-shaped contract\n * (re-sanitized so a hand-edited document can never poison the plugin). */\nexport function stateFromSettingsSection(section: CatppuccinSettingsSection): CatppuccinState {\n return sanitizeState(section)\n}\n\n/** Field-for-field equality of two override maps — the same rule\n * {@link settingsSectionsEqual} applies to them (both directions, so a key\n * that only one side holds makes them differ). */\nexport function sameOverrides(a: Record<string, string>, b: Record<string, string>): boolean {\n const keys = Object.keys(a)\n return keys.length === Object.keys(b).length && keys.every((key) => b[key] === a[key])\n}\n\n/** Whether two settings sections are field-for-field equal (used to skip\n * redundant mirror writes and to recognize the Host echoing our own write). */\nexport function settingsSectionsEqual(a: CatppuccinSettingsSection, b: CatppuccinSettingsSection): boolean {\n return a.flavor === b.flavor\n && a.followSystem === b.followSystem\n && a.followDark === b.followDark\n && a.glass.enabled === b.glass.enabled\n && a.glass.mode === b.glass.mode\n && a.glass.blur === b.glass.blur\n && a.glass.frost === b.glass.frost\n && a.glass.brightness === b.glass.brightness\n && a.glass.gap === b.glass.gap\n && a.glass.glowStrength === b.glass.glowStrength\n && a.glass.glowSize === b.glass.glowSize\n && a.glass.glow === b.glass.glow\n && a.autoCheck === b.autoCheck\n && a.updateChannel === b.updateChannel\n && a.shikiStyle === b.shikiStyle\n && sameOverrides(a.overrides, b.overrides)\n}\n\n/**\n * Replay the local changes a window made BEFORE the durable channel became\n * usable onto the document state — the issue #30 fix.\n *\n * The R2 mechanism (`pendingLocalPush` in `src/client/index.ts`) exists so a\n * change made during the boot window is not rolled back by the first snapshot\n * the settings scope resolves. It used to replay the WHOLE local state, and on\n * a fresh origin (empty localStorage: a new port, a cleared site, a webview\n * partition) \"the whole local state\" is nothing but the shipped defaults — so\n * the first snapshot rewrote the document to `flavor: off`, `glass.enabled:\n * false`, `mode: mica`. The trigger is not even a user action: the glass layer\n * republishes on every `theme/change`, and `ui-theme` adopts its preference on\n * every boot.\n *\n * This replays only the fields whose value moved away from `baseline` — the\n * local section as of the last moment the window knew it was in sync with the\n * document (boot, or the last adoption / successful write). Everything else\n * keeps the document's value, and `changed === false` tells the caller to take\n * the ordinary \"document wins\" adoption path instead of writing anything.\n *\n * ⚠️ Every field of {@link CatppuccinSettingsSection} must be carried here.\n * A missing one is SILENT in both directions — a boot-window change to it is\n * dropped, and (because the caller's whole-state fallback is gone) nothing\n * else would notice. Same rule as `stateToMutateOps` (issue #26), and\n * `tests/state.spec.ts` holds a drift guard that fails when a field is added\n * without a mutant here.\n *\n * Known gap (accepted): a delta cannot tell \"untouched\" from \"explicitly set\n * to the current default\", so setting a field BACK to its default value inside\n * the boot window yields to the document. The window is sub-second and the\n * direction is \"document wins\", i.e. no durable data is lost.\n *\n * @param document - the section the settings document resolved (wins).\n * @param baseline - the local section at the last sync point.\n * @param local - the local section right now.\n * @returns the merged state plus whether anything actually differed.\n */\nexport function replayLocalChanges(\n document: CatppuccinState,\n baseline: CatppuccinSettingsSection,\n local: CatppuccinSettingsSection,\n): { state: CatppuccinState; changed: boolean } {\n // A fresh section (glass/overrides cloned) so the caller's document state is\n // never mutated in place.\n const merged = settingsSectionFromState(document)\n let changed = false\n const carry = <K extends 'flavor' | 'followSystem' | 'followDark' | 'autoCheck' | 'updateChannel' | 'shikiStyle'>(key: K): void => {\n if (local[key] !== baseline[key]) {\n merged[key] = local[key]\n changed = true\n }\n }\n const carryGlass = <K extends keyof GlassState>(key: K): void => {\n if (local.glass[key] !== baseline.glass[key]) {\n merged.glass[key] = local.glass[key]\n changed = true\n }\n }\n carry('flavor')\n // Issue #36: the follow pair rides the same replay as every other top-level\n // field — a boot-window toggle of it must survive the first snapshot.\n carry('followSystem')\n carry('followDark')\n carryGlass('enabled')\n carryGlass('mode')\n carryGlass('blur')\n carryGlass('frost')\n carryGlass('brightness')\n carryGlass('gap')\n carryGlass('glowStrength')\n carryGlass('glowSize')\n carryGlass('glow')\n carry('autoCheck')\n carry('updateChannel')\n carry('shikiStyle')\n // The override map is carried as a WHOLE map: a per-key replay cannot express\n // a removal (the local map simply lacks the key), and the boot window is far\n // too short for two windows to edit different tokens inside it.\n if (!sameOverrides(local.overrides, baseline.overrides)) {\n merged.overrides = { ...local.overrides }\n changed = true\n }\n return { state: sanitizeState(merged), changed }\n}\n","/**\n * Pre-paint palette: the flavour's `--dsw-*` table, injected into the index\n * HTML so the FIRST frame is already Catppuccin (issue #30 补充, 2026-10-27).\n *\n * Why this exists. The official `dsh-client-ui-theme` Host half contributes two\n * boot rows through `webserver/index-inject` (prepended): a head `<style>`\n * painting `body{background-color:#151517}` (or `#fff`) plus `color-scheme`,\n * and a body script that sets `data-ds-dark-theme` for the durable built-in\n * preference. Those decide the colour of everything BEFORE any script runs.\n * Our flavours can only be `theme.register()`ed and `setTheme()`d by the\n * Client bundle, i.e. strictly after first paint — so a Catppuccin user sees\n * the official dark (or light) canvas flash first. Measured by the reporter on\n * 0.6.4 (CPU 3x, fresh browser): first-frame centre pixel `#151517`, official\n * dark, with `flavor: catppuccin-frappe` persisted.\n *\n * The fix mirrors the official rows: paint the same document canvas with the\n * flavour's own token table, and let the Client remove the sheet the moment the\n * flavour theme actually takes over (the sheet must not outlive that point —\n * its selector outranks the official `body` block, so a leftover sheet would\n * pin every token and defeat later theme switches).\n *\n * Contract notes (all verified against the 0.2.1-rc.3 release):\n * - Rows are plain JSON (`IndexInjection`): `{ kind: 'style', text }`,\n * `{ kind: 'html', placement, html }`, `{ kind: 'script', placement, text }`.\n * This module uses `html` for the sheet so it can carry an identifying\n * attribute the Client can query — a `style` row renders without attributes.\n * - The official rows are pushed with `{ prepend: true }`, so rows appended\n * from here land AFTER them; both the style order and the body-script order\n * therefore favour us. Do not rely on that alone: the sheet selector is\n * `html body` (0,0,2), which beats the official `body` (0,0,1) block that the\n * Client bundle injects later, no matter the order.\n * - The served index carries no CSP header, so inline style/script is allowed\n * (the official theme relies on exactly that).\n * - The Host only knows the durable flavour where the config field is a\n * volatile ref (`Config.flavor.get()` on DSH >= 0.1.7). On the legacy seam\n * the entry config is the profile patch's static value, NOT the settings\n * document, so injecting from it would paint the wrong palette — those hosts\n * get no rows at all (`bootPaletteRows` returns `[]`).\n */\nimport { CATPPUCCIN_FLAVORS, type CatppuccinFlavorInfo } from './client/palettes.ts'\nimport { FOLLOW_LIGHT_FLAVOR } from './state.ts'\n\n/** Attribute marking the injected `<style>` so the Client can find it. */\nexport const BOOT_PALETTE_ATTR = 'data-dsh-catppuccin-boot'\n\n/** One index-injection row, structurally typed (the host package is not a\n * dependency of this plugin, so the shape is declared here — same reasoning as\n * `WebServerLike` in `src/update-check/host.ts`). */\nexport type BootPaletteRow =\n | { kind: 'style'; text: string }\n | { kind: 'script'; placement: 'head' | 'body'; text: string }\n | { kind: 'html'; placement: 'head' | 'body'; html: string }\n\n/** The two config fields this module reads, in BOTH shapes they arrive in:\n * a volatile ref (`{ get() }`) on DSH >= 0.1.7, a plain value on older hosts\n * (where the value is the patch's static default, not the durable choice). */\nexport interface BootPaletteConfig {\n flavor?: { get(): unknown } | unknown\n overrides?: { get(): unknown } | unknown\n /** Issue #36: follow the OS scheme — the pre-paint sheet then carries BOTH\n * halves behind a `prefers-color-scheme` query. */\n followSystem?: { get(): unknown } | unknown\n /** Issue #36: the dark half of follow mode. */\n followDark?: { get(): unknown } | unknown\n}\n\n/** Read a volatile config ref; `undefined` when the field is NOT a ref.\n *\n * Returning `undefined` for plain values is the legacy-host gate described in\n * the module header: a plain `flavor` is the profile patch's default, so\n * painting it would fight the durable document. */\nfunction readVolatile(value: unknown): unknown {\n if (typeof value !== 'object' || value === null) return undefined\n const getter = (value as { get?: unknown }).get\n if (typeof getter !== 'function') return undefined\n try {\n return (getter as () => unknown).call(value)\n } catch {\n return undefined\n }\n}\n\n/**\n * Keep only override entries that are safe to embed in a `<style>` text node.\n *\n * `sanitizeOverrides` (the durable contract) already drops non-`--` keys and\n * non-string values, but a value is arbitrary text: `}</style><script>…` would\n * escape the element, and `;`/`{`/`}` would escape the declaration. Values are\n * CSS expressions, so everything else stays allowed (`color-mix(…)`, `var(…)`,\n * `rgba(…)`, quotes, slashes).\n * @param raw - the durable overrides map as the Host resolved it.\n * @returns the subset safe to concatenate into the sheet.\n */\nexport function cssSafeOverrides(raw: unknown): Record<string, string> {\n const out: Record<string, string> = {}\n if (typeof raw !== 'object' || raw === null) return out\n for (const [key, value] of Object.entries(raw as Record<string, unknown>)) {\n if (typeof value !== 'string') continue\n if (!/^--[A-Za-z0-9_-]+$/u.test(key)) continue\n if (/[<>\\\\{};\\u0000-\\u001f]/u.test(value)) continue\n out[key] = value\n }\n return out\n}\n\n/** The declaration block for one flavour: every token, then the user overrides\n * (last wins), then the canvas colour the boot splash reads. */\nfunction declarationBlock(flavor: CatppuccinFlavorInfo, overrides: Record<string, string>): string {\n const tokens = Object.entries(flavor.tokens).map(([name, value]) => `${name}:${value}`)\n const extra = Object.entries(overrides).map(([name, value]) => `${name}:${value}`)\n return [...tokens, ...extra, 'background-color:var(--dsw-alias-bg-base)'].join(';')\n}\n\n/**\n * The pre-paint `<style>` element (carries {@link BOOT_PALETTE_ATTR}).\n *\n * Two selectors on purpose: `html body` outranks the official `body` block\n * (which the Client bundle installs later), and the `[data-ds-dark-theme]`\n * variant keeps the sheet in force when the official boot script toggled the\n * attribute to the opposite scheme.\n * @param flavor - the persisted flavour.\n * @param overrides - already filtered by {@link cssSafeOverrides}.\n * @returns a complete `<style>…</style>` fragment for a `kind: 'html'` row.\n */\nexport function bootPaletteStyle(\n flavor: CatppuccinFlavorInfo,\n overrides: Record<string, string> = {},\n): string {\n // `color-scheme` follows the flavour so scrollbars, form controls and the\n // `Canvas` keyword are right from the first frame (the official row sets it\n // from the built-in preference, which can be the opposite scheme).\n return `<style ${BOOT_PALETTE_ATTR}>`\n + `:root{color-scheme:${flavor.colorScheme}}`\n + `html body,html body[data-ds-dark-theme]{${declarationBlock(flavor, overrides)}}`\n + '</style>'\n}\n\n/**\n * The body script that aligns the shell's dark-variant attribute with the\n * flavour. Runs after the official script (the official rows are prepended), so\n * it wins; it touches NOTHING else — `data-ds-theme-source` and the font\n * variables stay the official script's business.\n * @param flavor - the persisted flavour.\n * @returns the script text for a `kind: 'script'` row.\n */\nexport function bootPaletteScript(flavor: CatppuccinFlavorInfo): string {\n return `(()=>{document.body.toggleAttribute('data-ds-dark-theme',${flavor.colorScheme === 'dark'})})()`\n}\n\n/**\n * The pre-paint sheet for FOLLOW mode (issue #36): the light half (Latte) is\n * the default block and the dark half sits behind `prefers-color-scheme`.\n *\n * Why a media query works here and NOT in the Client: this sheet is plain CSS\n * evaluated by the renderer before any script decides a preference, so it\n * tracks the OS by itself. The Client cannot do the same (see\n * `docs/issue-36-follow-system.md` §2) — which is exactly why follow mode keeps\n * the runtime preference on `system` and stacks a token layer.\n *\n * The dark block is emitted AFTER the light one so it wins on equal\n * specificity, and it also matches `[data-ds-dark-theme]` so a stale official\n * body script cannot leave the light table in force on a dark OS.\n * @param light - the light flavour (Latte).\n * @param dark - the persisted follow-mode dark flavour.\n * @param overrides - already filtered by {@link cssSafeOverrides}; applied to\n * BOTH halves (a user override is scheme-agnostic by contract).\n * @returns a complete `<style>…</style>` fragment for a `kind: 'html'` row.\n */\nexport function followPaletteStyle(\n light: CatppuccinFlavorInfo,\n dark: CatppuccinFlavorInfo,\n overrides: Record<string, string> = {},\n): string {\n const lightBlock = declarationBlock(light, overrides)\n const darkBlock = declarationBlock(dark, overrides)\n return `<style ${BOOT_PALETTE_ATTR}>`\n // `light dark` lets the UA resolve scrollbars/form controls per media too.\n + ':root{color-scheme:light dark}'\n + `html body,html body:not([data-ds-dark-theme]){${lightBlock}}`\n + `@media (prefers-color-scheme: dark){html body,html body[data-ds-dark-theme]{${darkBlock}}}`\n + '</style>'\n}\n\n/**\n * The body script for follow mode: align `data-ds-dark-theme` with the OS\n * instead of a fixed flavour scheme, so the attribute-keyed rules (ours and\n * the host's) are right on the first frame.\n * @returns the script text for a `kind: 'script'` row.\n */\nexport function followPaletteScript(): string {\n return \"(()=>{document.body.toggleAttribute('data-ds-dark-theme',matchMedia('(prefers-color-scheme: dark)').matches)})()\"\n}\n\n/**\n * The boot rows for the current Host state: empty when no flavour is persisted\n * (`off`), when the config carries no volatile ref (legacy seam — see the\n * module header), or when the value names no known flavour.\n *\n * Follow mode (issue #36) replaces the fixed-flavour rows with the two-half\n * sheet; it still requires a persisted flavour, because follow mode is a\n * modifier on a Catppuccin choice, never a way to paint Catppuccin while the\n * document says `off`.\n * @param config - the plugin config the Loader hands `apply`.\n * @returns rows to `push` into the `webserver/index-inject` table.\n */\nexport function bootPaletteRows(config: BootPaletteConfig | undefined): BootPaletteRow[] {\n const flavorId = readVolatile(config?.flavor)\n if (typeof flavorId !== 'string') return []\n const flavor = CATPPUCCIN_FLAVORS.find((candidate) => candidate.themeId === flavorId)\n if (flavor === undefined) return []\n const overrides = cssSafeOverrides(readVolatile(config?.overrides))\n if (readVolatile(config?.followSystem) === true) {\n const light = CATPPUCCIN_FLAVORS.find((candidate) => candidate.themeId === FOLLOW_LIGHT_FLAVOR)\n const darkId = readVolatile(config?.followDark)\n const dark = CATPPUCCIN_FLAVORS.find((candidate) => (\n candidate.themeId === darkId && candidate.colorScheme === 'dark'\n ))\n // A malformed dark half falls back to the fixed-flavour sheet rather than\n // painting half a palette: follow mode is an enhancement, never a reason\n // to ship a broken first frame.\n if (light !== undefined && dark !== undefined) {\n return [\n { kind: 'html', placement: 'head', html: followPaletteStyle(light, dark, overrides) },\n { kind: 'script', placement: 'body', text: followPaletteScript() },\n ]\n }\n }\n return [\n { kind: 'html', placement: 'head', html: bootPaletteStyle(flavor, overrides) },\n { kind: 'script', placement: 'body', text: bootPaletteScript(flavor) },\n ]\n}\n","","/**\n * Fault-tolerant registration for the plugin's boot-critical wiring.\n *\n * Client and Host share one failure shape: an entry whose `apply()` throws is\n * marked `failed`, the assembly aborts the whole boot (`web boot: N entries\n * did not activate`), and the official desktop's crash rescue then runs\n * `disableAllPlugins()` — taking EVERY third-party plugin down with it. A peer\n * plugin already owning what we are about to register is the realistic\n * trigger (language packs and their BCP 47 ids — issue #23; a duplicate\n * install and its route / slot / theme ids), and the right answer to\n * \"someone else already did this\" is to skip OUR copy — never to fail the\n * boot. Full evidence chain and the per-call-site audit live in\n * `docs/issue-23-registration-tolerance.md`.\n *\n * Known \"already owned\" shapes are skipped quietly — the peer's registration\n * stands, matching `dsh-locale-pack`'s own tolerance. Anything else is logged\n * and skipped too: no registration in this plugin is worth the user's whole\n * plugin set. (To restore fail-fast for a class of errors, `throw error` in\n * the warn branch — every call site routes through here on purpose.)\n */\n\n/** The \"another party already owns this\" messages the runtimes throw, checked\n * against the 0.2.0-rc.2 sources (table in the doc's §6):\n * - `locale \"ja\" is already registered` (dsh-client-locale addLanguage)\n * - `locale namespace \"…\" already has locale \"…\"` (dsh-client-locale register)\n * - `theme \"…\" is already registered` (dsh-client-ui-theme register)\n * - `list slot \"…\" already has an entry with id \"…\"` (dsh-client-ui-slots)\n * - `webserver: duplicate exact route \"…\"` (dsh-host-webserver register) */\nconst ALREADY_OWNED = /already (?:registered|has locale|has an entry)|duplicate .*route/u\n\n/**\n * Run one registration call, degrading any failure to a no-op disposer.\n * @param run - the registration call, returning its disposer (if any).\n * @returns the real disposer, or a no-op when the registration was skipped.\n */\nexport function tolerantRegistration(run: () => (() => void) | void): () => void {\n try {\n return run() ?? (() => {})\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n if (!ALREADY_OWNED.test(message)) {\n console.warn(`[dsh-catppuccin] registration skipped — ${message}`)\n }\n return () => {}\n }\n}\n","/**\n * Minimal semver comparison for update detection — dependency-free, so the\n * Host half and the unit tests share one implementation. Follows the semver\n * 2.0.0 precedence rules for `major.minor.patch[-prerelease][+build]`:\n * build metadata is ignored, prerelease identifiers compare numerically when\n * both are numeric and ASCII-wise otherwise, and a prerelease of the same\n * core sorts before its stable release.\n */\n\n/** A parsed semver triple plus its prerelease identifiers. */\nexport interface ParsedVersion {\n major: number\n minor: number\n patch: number\n /** Prerelease identifiers: numeric parts become numbers, the rest strings. */\n prerelease: readonly (string | number)[]\n}\n\n/** Parse a semver string, or null when it is not `v?x.y.z[-pre][+build]`. */\nexport function parseVersion(raw: string): ParsedVersion | null {\n const match = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?(?:\\+[0-9A-Za-z.-]+)?$/.exec(raw.trim())\n if (match === null) return null\n const prerelease = (match[4] ?? '').split('.').filter((part) => part !== '').map((part) =>\n /^\\d+$/.test(part) ? Number(part) : part,\n )\n return {\n major: Number(match[1]),\n minor: Number(match[2]),\n patch: Number(match[3]),\n prerelease,\n }\n}\n\n/**\n * Order two version strings per semver precedence.\n * @returns -1 when `a` < `b`, 0 when equal, 1 when `a` > `b`.\n * Unparseable inputs sort after every parseable version (equal to\n * each other), so a garbage `current` never reports an update.\n */\nexport function compareVersions(a: string, b: string): number {\n const pa = parseVersion(a)\n const pb = parseVersion(b)\n if (pa === null && pb === null) return 0\n if (pa === null) return 1\n if (pb === null) return -1\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (pa[key] !== pb[key]) return pa[key] < pb[key] ? -1 : 1\n }\n if (pa.prerelease.length === 0 && pb.prerelease.length === 0) return 0\n if (pa.prerelease.length === 0) return 1\n if (pb.prerelease.length === 0) return -1\n const shared = Math.min(pa.prerelease.length, pb.prerelease.length)\n for (let i = 0; i < shared; i += 1) {\n const x = pa.prerelease[i]\n const y = pb.prerelease[i]\n if (x === y) continue\n // Numeric identifiers sort before alphanumeric ones; two numerics compare\n // numerically, two strings ASCII-wise.\n if (typeof x === 'number' && typeof y === 'number') return x < y ? -1 : 1\n if (typeof x === 'number') return -1\n if (typeof y === 'number') return 1\n return x < y ? -1 : 1\n }\n if (pa.prerelease.length !== pb.prerelease.length) {\n return pa.prerelease.length < pb.prerelease.length ? -1 : 1\n }\n return 0\n}\n\n/**\n * Whether `latest` is a strictly newer release than `current` — i.e. whether\n * an update is available. A newer installed prerelease (e.g. a git install\n * ahead of npm) correctly reports no update.\n */\nexport function isUpdateAvailable(current: string, latest: string): boolean {\n return compareVersions(current, latest) < 0\n}\n","/**\n * Shared contract of the update-check feature — consumed by both halves:\n * the Host registers an exact webServer route answering this JSON payload,\n * and the Client settings row fetches that same-origin route and renders it.\n * This module is dependency-free so both bundles inline it.\n */\nimport { compareVersions, parseVersion } from './versions.ts'\nimport type { UpdateChannel } from './state.ts'\n// Type-only (erased at build time): `update-check.ts` stays dependency-free for\n// both bundles while the payload can still name the host kind.\nimport type { ShellKind } from './profile-detect.ts'\n\nexport type { UpdateChannel } from './state.ts'\nexport type { ShellKind } from './profile-detect.ts'\n\n/** The plugin's own npm name (the registry lookup key). */\nexport const PACKAGE_NAME = '@nonamelego/dsh-catppuccin'\n\n/**\n * npm registry abbreviated packument endpoint (the `install-v1` document).\n * The `latest` endpoint alone is not enough: this project ships prereleases\n * under the `beta` dist-tag while `latest` stays on the last stable, so the\n * check reads `dist-tags` to serve both channels.\n */\nexport const REGISTRY_PACKUMENT_URL =\n `https://registry.npmjs.org/${PACKAGE_NAME.replace('/', '%2F')}`\n\n/** Host route the Client row fetches (exact match, same origin). */\nexport const UPDATE_ROUTE_PATH = '/catppuccin/check-update'\n\n/** Network budget for the Host's registry lookup. */\nexport const UPDATE_FETCH_TIMEOUT_MS = 8000\n\n/** Budget for the CLIENT half's same-origin fetch of {@link UPDATE_ROUTE_PATH}\n * (R3, 2026-10-10 review). The Host's own registry lookup is capped at\n * {@link UPDATE_FETCH_TIMEOUT_MS}, so this only ever bites when the host\n * process itself stopped answering — without it a wedged host leaves the\n * settings row stuck in its `checking` phase, where the disabled check button\n * makes a retry impossible. Comfortably larger than the host budget so a\n * slow-but-alive registry lookup is never cut off client-side. */\nexport const UPDATE_CHECK_CLIENT_TIMEOUT_MS = 15_000\n\n/** The `dist-tags` object of an npm packument. */\nexport interface DistTags {\n latest?: string\n beta?: string\n}\n\n/** The newest release a given install should chase, and on which channel. */\nexport interface NewestRelease {\n version: string\n channel: UpdateChannel\n}\n\n/**\n * The copyable CLI upgrade command for one channel (`dsh plugin` is a thin\n * pnpm forwarder). The profile name comes from the Host's runtime probe\n * (`src/profile-detect.ts`), never hard-coded, so the command works on any\n * deployment out of the box.\n *\n * ⚠️ **只适用于 `web` 与 `community-desktop`**(社区壳的应用内 DSH 终端里有效)。\n * 官方 Electron 壳的用户没有可达的终端入口(`resources/runtime/cli/bin/dsh.cmd`\n * 在代码上允许 `manageDesktopProfile: true`,但官方壳 UI 不提供终端),那条路改用\n * {@link pluginSpecFor} + 应用内「插件」页重装。\n * @param channel - the dist-tag to chase.\n * @param profile - the DSH profile name to target.\n */\nexport function updateCommandFor(channel: UpdateChannel, profile: string): string {\n return `dsh plugin --profile ${profile} add ${PACKAGE_NAME}@${channel}`\n}\n\n/**\n * The value to paste into a plugin manager's \"add plugin\" field — the shape the\n * official Electron shell's Plugins page accepts. Its 升级 path is\n * 「先删除、再重新安装同一个包名」, so the spec (not a CLI command) is the\n * copyable artefact there.\n * @param channel - the dist-tag to chase.\n */\nexport function pluginSpecFor(channel: UpdateChannel): string {\n return `${PACKAGE_NAME}@${channel}`\n}\n\n/**\n * Pick the newest release worth reporting for the given install:\n * - with NO channel preference: a stable install chases only `latest` (never\n * downgrades onto a beta), while a prerelease install (e.g. a\n * `beta`-tagged version) also chases `beta` — so beta users see newer\n * betas, and a stable release that outranks their prerelease promotes\n * them via `@latest`;\n * - an explicit `beta` preference (the settings row's prerelease pick)\n * chases `beta` even from a stable install — beta testers opt in without\n * changing their install; the newest of the two tags still wins, so a\n * newer stable promotes them back onto `@latest`;\n * - an explicit `latest` preference pins the check to the stable tag —\n * never a beta, even from a prerelease install.\n * @param current - the installed version.\n * @param tags - the registry's dist-tags.\n * @param preferredChannel - optional persisted channel preference (item I).\n * @returns the newest candidate and its channel, or null when nothing applies.\n */\nexport function selectNewest(current: string, tags: DistTags, preferredChannel?: UpdateChannel): NewestRelease | null {\n const candidates: NewestRelease[] = []\n if (tags.latest !== undefined) candidates.push({ version: tags.latest, channel: 'latest' })\n if (preferredChannel === 'beta') {\n // Beta chase, opt-in: follow the beta tag even from a stable install.\n if (tags.beta !== undefined) candidates.push({ version: tags.beta, channel: 'beta' })\n } else if (preferredChannel === undefined) {\n // No preference: prerelease installs chase beta on top of latest.\n const parsed = parseVersion(current)\n if (tags.beta !== undefined && parsed !== null && parsed.prerelease.length > 0) {\n candidates.push({ version: tags.beta, channel: 'beta' })\n }\n }\n // preferredChannel === 'latest': candidates hold the stable tag only.\n if (candidates.length === 0) return null\n let best = candidates[0]\n for (const candidate of candidates.slice(1)) {\n if (compareVersions(best.version, candidate.version) < 0) best = candidate\n }\n return best\n}\n\n/** Stable machine-readable outcome code (borrowed from the plugin-update\n * error-code discipline of dsh-vision-toolkit): the Client maps it to copy\n * instead of sniffing human text. `network.*` splits the old catch-all\n * `network` (item U): `network.local` means the browser→Host hop failed\n * (host unreachable / DNS — \"check your network\"), `network.upstream` means\n * the Host reached the registry but the lookup timed out (\"npm is\n * temporarily unavailable\"). */\nexport type UpdateErrorCode =\n | 'ok'\n | 'network.local' // the same-origin fetch itself failed (client side)\n | 'network.upstream' // the Host's registry fetch timed out\n | 'registry-unreachable' // npm registry could not be reached (fetch threw)\n | 'registry-http' // registry answered with a non-2xx status\n | 'no-dist-tags' // registry returned no usable dist-tags\n | 'invalid-response' // registry response could not be parsed\n\n/** How this package is installed inside the probed DSH profile. */\nexport type InstallSource = 'registry' | 'link' | 'file' | 'git' | 'unknown'\n\n/** Runtime that answered the check — drives the copy (command hint / restart). */\nexport type UpdateEnv = 'desktop' | 'web'\n\n/**\n * JSON payload of the update check. `ok: false` carries a human-readable\n * `error` plus a stable `code`; `ok: true` carries the comparison result.\n * The Host owns the semver comparison, the channel selection, and the\n * profile probe (single source of truth), so the Client never parses\n * versions or guesses the profile name itself.\n */\nexport interface UpdateCheckPayload {\n /** Whether the registry lookup succeeded. */\n ok: boolean\n /** Installed version (from this package's own manifest). */\n current?: string\n /** Newest release worth chasing (`latest`, plus `beta` for prerelease installs). */\n latest?: string\n /** `latest` is strictly newer than `current`. */\n outdated?: boolean\n /** The dist-tag the newest release came from. */\n channel?: UpdateChannel\n /** Copyable CLI upgrade command (present when outdated). Only on `web` and\n * `community-desktop` — the official shell has no reachable CLI path. */\n updateCommand?: string\n /** `pkg@tag` spec for the Plugins page's \"add plugin\" field. Present instead\n * of {@link updateCommand} on the official desktop shell. */\n updateSpec?: string\n /** Which host answered the check (drives the copy). */\n shell?: ShellKind\n /** DSH profile name the upgrade command targets (probed, not guessed). */\n profile?: string\n /** Whether the profile probe actually found the install (false = fallback). */\n profileDetected?: boolean\n /** Runtime that answered: DSH Desktop vs standard dsh web (drives copy). */\n env?: UpdateEnv\n /** How the package is installed in that profile (drives copy). */\n installSource?: InstallSource\n /** ISO timestamp of the check (registry lookup moment). */\n checkedAt?: string\n /** Stable outcome code (see {@link UpdateErrorCode}). */\n code?: UpdateErrorCode\n /** Failure detail (only when `ok` is false). */\n error?: string\n}\n","/**\n * Runtime probe of the DSH profile this plugin is installed into.\n *\n * Borrowed from dsh-vision-toolkit's plugin-update module (MIT) and trimmed\n * to what the update check needs: instead of hard-coding a profile name into\n * the upgrade command, the Host scans the DSH home's `profiles/` directory\n * (plus the `--profile` argv hint) for the profile whose package.json lists\n * this package as a direct dependency, and classifies the install source so\n * the Client can tell \"registry install → copy the npm command\" apart from\n * \"local link/file/git install → the npm command does not apply\".\n *\n * Pure functions (`profileHint`, `isRegistrySpec`, `installSourceOf`) are\n * dependency-free and unit-tested; the IO probe (`detectProfile`) reads only\n * package.json manifests and never mutates anything.\n */\nimport { readFile, readdir } from 'node:fs/promises'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport type { InstallSource } from './update-check.ts'\nimport { PACKAGE_NAME } from './update-check.ts'\n\n/** Fallback profile name when nothing can be probed (keeps the command valid). */\nexport const FALLBACK_PROFILE = 'web'\n\n/** Which host owns the running profile process. Decides whether a CLI upgrade\n * command applies at all (the official Electron shell has no CLI path a user\n * can reach — see `docs/`/`AGENTS.md`「两个壳两条路」).\n *\n * - `'web'` — plain Node (`dsh web` / CLI / headless).\n * - `'official-desktop'` — `deepseek-ai/deepseek-harness` 的 `apps/desktop`:\n * 取证(2026-10-03,`resources/app.asar` 内 `desktopNodeEnvironment`)——\n * host 子进程的 env 只被写成 `{...壳自己的 env, ELECTRON_RUN_AS_NODE: '1'}`,\n * **不设** `DSH_DESKTOP_NODE_EXECUTABLE`(那段在 `bin === undefined` 时被跳过:\n * `desktopNodeEnvironment(this.node, void 0, this.environment)`),\n * `apps/desktop-host` 也不注册任何 cordis 服务(官方 0.2.0-rc.2 全套包里\n * `desktopProfiles` 命中 **0**)⇒ 它在 profile 进程里只剩\n * 「Electron-as-node 运行时」这一条痕迹。\n * - `'community-desktop'` — `anywhere-labs/dsh-desktop`:Stable/Beta 通道的 launcher\n * 注册 `desktopProfiles` 服务(`dsh-plugin-desktop/src/profile-service.ts`),\n * Next 通道的 host env 里放 `DSH_DESKTOP_NODE_EXECUTABLE`\n * (`dsh-desktop-next/src/host/index.ts`)——任一命中即可。\n *\n * ⚠️ 判定顺序:**先两条社区信号,再拿 Electron 运行时尚余的当官方**。\n * 代价与 `isDesktopShellEnv` 相同——「用 Electron 壳跑 dsh web」这类少见组合会落到\n * `official-desktop`,而误判只影响提示文案(不出现 CLI 命令),不出现危险动作。\n */\nexport type ShellKind = 'web' | 'official-desktop' | 'community-desktop'\n\n/** The community launcher's env marker (`dsh-desktop-next` sets it on the host,\n * and both community channels set it on package-install children). */\nfunction hasCommunityMarker(env: Record<string, string | undefined>): boolean {\n const marker = env.DSH_DESKTOP_NODE_EXECUTABLE\n return typeof marker === 'string' && marker.trim() !== ''\n}\n\n/**\n * Classify the host that owns this profile process (see {@link ShellKind} for\n * the evidence behind each branch).\n * @param options - the inputs to classify on, all injectable for tests.\n * @param options.env - the process environment to inspect.\n * @param options.versions - `process.versions` to inspect (defaults to the running process's).\n * @param options.desktopProfilesCurrent - `desktopProfiles.current.name` when the\n * community launcher exposes that service; `undefined` on the official shell.\n * @returns the host kind.\n */\nexport function classifyShell(options: {\n env: Record<string, string | undefined>\n versions?: Record<string, string | undefined>\n desktopProfilesCurrent?: string | undefined\n}): ShellKind {\n const current = options.desktopProfilesCurrent\n if (typeof current === 'string' && current.trim() !== '') return 'community-desktop'\n if (hasCommunityMarker(options.env)) return 'community-desktop'\n return isElectronRuntime(options.versions ?? process.versions) ? 'official-desktop' : 'web'\n}\n\n/** Whether this process runs inside Electron (Node mode included).\n *\n * Electron-as-node(`ELECTRON_RUN_AS_NODE=1`)**仍然**填 `process.versions.electron`\n * —— 2026-09-24 本机实测:Electron 37.10.3 下为 `'37.10.3'`,纯 node 下为 `undefined`。\n * 官方桌面壳的 Host 正是由 Electron 以 node 模式 spawn 的(`apps/desktop/src/host-process.ts`\n * 用 Electron 可执行文件 + `ELECTRON_RUN_AS_NODE=1`),所以这是它在 profile 进程里留下的**唯一**痕迹。\n * @param versions - `process.versions` to inspect (injectable so tests need no real Electron).\n * @returns whether the runtime is Electron rather than a plain Node.js.\n */\nexport function isElectronRuntime(\n versions: Record<string, string | undefined> = process.versions,\n): boolean {\n const electron = versions.electron\n return typeof electron === 'string' && electron.trim() !== ''\n}\n\n/**\n * Detect a DSH desktop shell — two independent signals, either one is enough:\n *\n * 1. **社区壳**(`anywhere-labs/dsh-desktop`,含其 `dsh-desktop-next` 重写版)在 profile\n * 进程的环境里放 `DSH_DESKTOP_NODE_EXECUTABLE`(它的包安装/内部启动器约定)。\n * 2. **官方壳**(`deepseek-ai/deepseek-harness` 的 `apps/desktop` + `apps/desktop-host`,\n * `private: true`、未发 npm)**什么都不设**:⚠️ 2026-09-24 取证推翻 2026-09-22 的假设——\n * 上游架构说明原话是「`DSH_DESKTOP_NODE_EXECUTABLE` **仅为包安装注入**」\n * (`.agents/notes/implemented/architecture/2026-09-11-desktop-electron-node-runtime.zh.md`),\n * 代码印证:`host-process.ts` 以 `desktopNodeEnvironment(this.node, undefined, …)` 起 host,\n * `bin === undefined` 时不设它;`apps/desktop-host/src/index.ts` 只在\n * `runProfile({ packageManager: { env } })` 里给它。于是官方壳在 profile 进程里靠**运行时**识别:\n * Host 是 Electron-as-node,故 `process.versions.electron` 有值(见 `isElectronRuntime`)。\n *\n * 官方仓**没有** `desktopProfiles` 服务(2026-09-22 全仓搜索命中 0),所以那路服务探测只覆盖社区壳;\n * 两路都不命中时回落纯 web 文案——**profile 名不受影响**(`detectProfile` 扫 `profiles/` 目录命中 `desktop`),\n * 持久化也不受影响(走 `configForms` seam,与壳无关)。\n * 代价权衡:在「用 Electron 壳跑 dsh web」这类少见组合下会误判成桌面,而误判只影响提示文案措辞。\n * @param env - the environment to inspect (injectable so tests need no real desktop).\n * @param versions - `process.versions` to inspect (injectable for the same reason).\n * @returns whether this process looks like a DSH desktop shell.\n */\nexport function isDesktopShellEnv(\n env: Record<string, string | undefined>,\n versions: Record<string, string | undefined> = process.versions,\n): boolean {\n // Coarse OR, expressed through the single source of truth so the two can\n // never drift: the `desktopProfiles` signal is the caller's (host-side) input\n // and is simply absent here. Prefer `classifyShell` when the copy must\n // distinguish the two shells.\n return classifyShell({ env, versions }) !== 'web'\n}\n\n/** The DSH home the running process owns — `$DSH_HOME` when set, else\n * `~/.dsh`. Port-independent and stable across restarts, so it is the right\n * root for the plugin's durable state file. */\nexport function defaultDshHome(): string {\n return process.env.DSH_HOME?.trim() || join(homedir(), '.dsh')\n}\n\n/** How this package's dependency spec was written in the profile manifest. */\nexport interface ProfileProbe {\n /** Profile name to target in the upgrade command. */\n name: string\n /** Whether the probe actually matched a profile (false = fallback). */\n detected: boolean\n /** Install source classification of this package in that profile. */\n installSource: InstallSource\n}\n\n/**\n * Extract the profile name a running DSH process was started with: either a\n * leading bare `web`-style argument or an explicit `--profile <name>` /\n * `--profile=<name>` flag. Mirrors vision-toolkit's `profileHint`.\n */\nexport function profileHint(argv: readonly string[]): string | undefined {\n if (argv[0] === 'web') return 'web'\n for (let index = 0; index < argv.length; index += 1) {\n const value = argv[index]\n if (value?.startsWith('--profile=')) return value.slice('--profile='.length)\n if (value === '--profile') return argv[index + 1]\n }\n return undefined\n}\n\n/**\n * Whether a dependency spec is a plain npm registry spec (a semver range),\n * not a local/workspace/git/URL source. Mirrors vision-toolkit's\n * `registryInstallSpec`.\n */\nexport function isRegistrySpec(spec: string): boolean {\n const normalized = spec.trim().toLowerCase()\n return normalized.length > 0\n && !normalized.startsWith('workspace:')\n && !/^[a-z][a-z0-9+.-]*:/u.test(normalized)\n && !normalized.includes('/')\n && !normalized.includes('\\\\')\n}\n\n/** Classify a non-registry spec into the more precise local source kind. */\nexport function installSourceOf(spec: string): InstallSource {\n const normalized = spec.trim().toLowerCase()\n if (normalized.startsWith('link:') || normalized.startsWith('workspace:')) return 'link'\n if (normalized.startsWith('file:')) return 'file'\n return 'git'\n}\n\n/** Read one profile's manifest at its manifest dir and return this package's install source. */\nasync function inspectProfileAt(manifestDir: string): Promise<InstallSource | undefined> {\n try {\n const manifest = JSON.parse(\n await readFile(join(manifestDir, 'package.json'), 'utf8'),\n ) as { dependencies?: Record<string, unknown> }\n const spec = manifest.dependencies?.[PACKAGE_NAME]\n if (typeof spec !== 'string') return undefined\n return isRegistrySpec(spec) ? 'registry' : installSourceOf(spec)\n } catch {\n return undefined\n }\n}\n\n/** Read one profile under the DSH home and return this package's install source. */\nasync function inspectProfile(dshHome: string, name: string): Promise<InstallSource | undefined> {\n return inspectProfileAt(join(dshHome, 'profiles', name))\n}\n\n/** The launcher-resolved profile under DSH Desktop (`desktopProfiles.current`). */\nexport interface DesktopProfileHint {\n /** Launcher-selected profile name. */\n name: string\n /** Absolute manifest dir; falls back to the DSH-home scan path when absent. */\n dir?: string\n}\n\n/**\n * Probe the DSH profile this package is installed into.\n * Priority: an authoritative `desktopProfile` (DSH Desktop's\n * `desktopProfiles.current` — the Desktop docs say never infer the profile\n * from argv / settings / `$DSH_HOME` when it is available), then the\n * `--profile`/bare-name argv hint, then a scan of every `profiles/` entry\n * whose manifest lists this package as a direct dependency. Falls back to\n * `FALLBACK_PROFILE` with `detected: false` when nothing matches (e.g. a dev\n * install outside any profile).\n */\nexport async function detectProfile(options: {\n /** DSH home; defaults to $DSH_HOME or `~/.dsh`. */\n dshHome?: string\n /** Process argv slice; defaults to the running process's argv. */\n argv?: readonly string[]\n /** Authoritative profile under DSH Desktop (`desktopProfiles.current`), when running there. */\n desktopProfile?: DesktopProfileHint | undefined\n} = {}): Promise<ProfileProbe> {\n const dshHome = options.dshHome ?? defaultDshHome()\n const argv = options.argv ?? process.argv.slice(2)\n\n // DSH Desktop wins over every probe: the launcher already resolved the\n // active profile, so the upgrade command targets it directly. The install\n // source still comes from reading that profile's manifest (via its explicit\n // dir) so the \"npm command does not apply\" local-install hint keeps working.\n const desktop = options.desktopProfile\n if (desktop?.name) {\n const dir = desktop.dir?.trim() || join(dshHome, 'profiles', desktop.name)\n const source = await inspectProfileAt(dir)\n return { name: desktop.name, detected: true, installSource: source ?? 'unknown' }\n }\n\n const hint = profileHint(argv)\n\n if (hint !== undefined) {\n const source = await inspectProfile(dshHome, hint)\n if (source !== undefined) return { name: hint, detected: true, installSource: source }\n }\n\n const profilesDir = join(dshHome, 'profiles')\n let names: string[] = []\n try {\n names = (await readdir(profilesDir, { withFileTypes: true }))\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name)\n } catch {\n // No profiles directory — the fallback below still produces a valid command.\n }\n if (hint !== undefined && !names.includes(hint)) names.push(hint)\n\n for (const name of names) {\n const source = await inspectProfile(dshHome, name)\n if (source !== undefined) return { name, detected: true, installSource: source }\n }\n\n return { name: hint ?? FALLBACK_PROFILE, detected: false, installSource: 'unknown' }\n}","/**\n * Host half of the update-check feature (extracted from `src/index.ts` —\n * item A). Owns the exact webServer route, the npm registry lookup, the\n * short-TTL verdict cache, the ETag conditional-request cache (item W), and\n * the channel preference parsed from the query string (item I).\n *\n * The Client settings row fetches this same-origin route and renders the\n * verdict; every move the route makes (semver comparison, channel choice,\n * profile probe) happens here so the Client never parses versions or\n * guesses profile names.\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport pkg from '../../package.json'\nimport { tolerantRegistration } from '../registration-tolerance.ts'\nimport {\n REGISTRY_PACKUMENT_URL,\n UPDATE_FETCH_TIMEOUT_MS,\n UPDATE_ROUTE_PATH,\n pluginSpecFor,\n selectNewest,\n updateCommandFor,\n type UpdateChannel,\n type UpdateCheckPayload,\n type UpdateEnv,\n} from '../update-check.ts'\nimport { isUpdateAvailable } from '../versions.ts'\nimport { classifyShell, detectProfile, type ShellKind } from '../profile-detect.ts'\n\n// Minimal structural types for the parts of node:http and the webServer\n// service this plugin touches. The host bundle resolves cordis and friends\n// from the profile tree at runtime and ships no @types/node, so the route\n// contract is spelled out locally instead of imported.\ninterface HttpRequestLike {\n url?: string\n method?: string\n on(event: 'data', listener: (chunk: Uint8Array) => void): unknown\n on(event: 'end', listener: () => void): unknown\n on(event: 'error', listener: (error: Error) => void): unknown\n}\ninterface HttpResponseLike {\n writeHead(status: number, headers: Record<string, string>): void\n end(body?: string): void\n}\ninterface WebRouteLike {\n kind: 'exact' | 'prefix'\n path: string\n handler: (req: HttpRequestLike, res: HttpResponseLike) => void | Promise<void>\n}\ninterface WebServerLike {\n register(route: WebRouteLike): () => void\n}\n\n/** Minimal structural type for DSH Desktop's public `desktopProfiles` service\n * (the host bundle ships no dsh-plugin-desktop types). */\ninterface DesktopProfilesLike {\n readonly current?: {\n readonly name: string\n readonly dir?: string\n }\n}\n\n/** Query-string channel preference (item I): `?channel=beta` chases the\n * beta tag from a stable install; anything else keeps the install-derived\n * channel logic of `selectNewest`. */\nfunction parseChannel(url: string | undefined): UpdateChannel | undefined {\n if (url === undefined) return undefined\n try {\n const channel = new URL(url, 'http://dsh.localhost').searchParams.get('channel')\n return channel === 'beta' ? 'beta' : channel === 'latest' ? 'latest' : undefined\n } catch {\n return undefined\n }\n}\n\nfunction sendJson(res: HttpResponseLike, status: number, payload: unknown): void {\n res.writeHead(status, { 'content-type': 'application/json; charset=utf-8' })\n res.end(JSON.stringify(payload))\n}\n\n/** Result of one registry lookup: an OK payload, a 304 not-modified (serve\n * the cached verdict), or an error payload (never cached). */\ntype FetchResult =\n | { kind: 'ok'; payload: UpdateCheckPayload; etag?: string }\n | { kind: 'not-modified' }\n | { kind: 'error'; payload: UpdateCheckPayload }\n\n/** Query the npm registry and build the check payload. The probe result\n * feeds the upgrade command's profile name and the install-source copy, so\n * the Client never guesses either. Under DSH Desktop the target profile is\n * `desktopProfiles.current` (launcher-resolved, authoritative), so the\n * copied command targets the right profile there too.\n *\n * The `shell` decides WHICH artefact is copyable: `web` / `community-desktop`\n * get the CLI command (`dsh plugin --profile … add …`), the official Electron\n * shell gets the bare `pkg@tag` spec, because its 升级 path is the in-app\n * Plugins page (delete → re-add) and its users have no reachable terminal.\n *\n * Failure classification (item U): a timed-out lookup (the abort fired) is\n * `network.upstream` — the npm registry is temporarily unavailable; a\n * fetch that throws outright (DNS / connection refused) stays\n * `registry-unreachable`; the 304 conditional path (item W) revalidates\n * the cached verdict without pulling the full packument again. */\nasync function fetchLatestVersion(options: {\n env: UpdateEnv\n shell: ShellKind\n channel?: UpdateChannel\n etag?: string\n desktopProfile?: DesktopProfilesLike['current']\n}): Promise<FetchResult> {\n const current = pkg.version\n const probe = await detectProfile(\n options.desktopProfile !== undefined ? { desktopProfile: options.desktopProfile } : {},\n )\n const base = {\n current,\n env: options.env,\n shell: options.shell,\n profile: probe.name,\n profileDetected: probe.detected,\n installSource: probe.installSource,\n checkedAt: new Date().toISOString(),\n }\n const controller = new AbortController()\n const timer = setTimeout(() => controller.abort(), UPDATE_FETCH_TIMEOUT_MS)\n let response: Response\n try {\n response = await fetch(REGISTRY_PACKUMENT_URL, {\n signal: controller.signal,\n headers: {\n accept: 'application/vnd.npm.install-v1+json',\n // Item W: conditional request — a 304 answer revalidates the cached\n // verdict without pulling the full packument again.\n ...(options.etag !== undefined ? { 'if-none-match': options.etag } : {}),\n },\n })\n } catch (error) {\n const timedOut = controller.signal.aborted\n return {\n kind: 'error',\n payload: {\n ...base,\n ok: false,\n code: timedOut ? 'network.upstream' : 'registry-unreachable',\n error: error instanceof Error ? error.message : String(error),\n },\n }\n } finally {\n clearTimeout(timer)\n }\n // 304: the registry's own cache says our cached verdict is still current.\n if (response.status === 304) return { kind: 'not-modified' }\n if (!response.ok) {\n return {\n kind: 'error',\n payload: {\n ...base,\n ok: false,\n code: 'registry-http',\n error: `npm registry responded HTTP ${response.status}`,\n },\n }\n }\n let data: { 'dist-tags'?: Record<string, string> }\n try {\n data = await response.json() as { 'dist-tags'?: Record<string, string> }\n } catch {\n return {\n kind: 'error',\n payload: { ...base, ok: false, code: 'invalid-response', error: 'npm registry returned an unparseable packument' },\n }\n }\n const newest = selectNewest(current, data['dist-tags'] ?? {}, options.channel)\n if (newest === null) {\n return {\n kind: 'error',\n payload: { ...base, ok: false, code: 'no-dist-tags', error: 'npm registry returned no usable dist-tags' },\n }\n }\n const outdated = isUpdateAvailable(current, newest.version)\n const etag = response.headers.get('etag') ?? undefined\n return {\n kind: 'ok',\n ...(etag !== undefined ? { etag } : {}),\n payload: {\n ...base,\n ok: true,\n code: 'ok',\n latest: newest.version,\n outdated,\n channel: newest.channel,\n ...(outdated\n ? options.shell === 'official-desktop'\n ? { updateSpec: pluginSpecFor(newest.channel) }\n : { updateCommand: updateCommandFor(newest.channel, probe.name) }\n : {}),\n },\n }\n}\n\n/** Short TTL for the cached registry verdict: repeated checks (settings row\n * re-opened, user re-clicks) don't re-hit npm; failures stay uncached so the\n * next click retries for real. The ETag (item W) lets a stale-but-valid\n * cache refresh itself with a conditional request instead of a full\n * packument pull — npm traffic drops to one 304 per 5 minutes.\n *\n * The cache is keyed by the requested channel (item I): switching the row's\n * channel must produce the new channel's verdict, not a stale cached one. */\nconst UPDATE_CACHE_TTL_MS = 5 * 60 * 1000\n\ninterface UpdateCacheEntry {\n at: number\n etag?: string\n payload: UpdateCheckPayload\n}\n\n/** Channel cache buckets. No query param and an explicit channel select\n * differently for a prerelease install (`selectNewest` only chases beta\n * without a preference), so the default bucket is DISTINCT from `latest` —\n * a pinned-latest check must never serve a beta verdict from the\n * unopinionated bucket (and vice versa). */\ntype CacheBucket = 'default' | UpdateChannel\n\nconst updateCaches = new Map<CacheBucket, UpdateCacheEntry>()\n\nfunction cacheKeyOf(channel: UpdateChannel | undefined): CacheBucket {\n return channel ?? 'default'\n}\n\n/** Answer the update-check route with the JSON contract from update-check.ts.\n * Classifies the host into `web` / `community-desktop` / `official-desktop`\n * (see `classifyShell`) and shapes the upgrade copy accordingly: a CLI command\n * for the first two, the `pkg@tag` spec for the official Electron shell —\n * whose env marker is **absent** by construction, and where an in-app\n * Plugins-page reinstall is the only path a user can actually take.\n *\n * The route itself is stateless about retries: item V's 30s auto-retry is\n * scheduled by the settings row (an immediate route retry would just hang\n * a manual click); once a failure has passed the 5-minute window, the next\n * request re-runs the lookup for real. */\nasync function handleUpdateCheck(ctx: Context, req: HttpRequestLike, res: HttpResponseLike): Promise<void> {\n const channel = parseChannel(req.url)\n const key = cacheKeyOf(channel)\n const entry = updateCaches.get(key)\n if (entry !== undefined && Date.now() - entry.at < UPDATE_CACHE_TTL_MS) {\n sendJson(res, 200, entry.payload)\n return\n }\n const desktopProfiles = ctx.get('desktopProfiles') as DesktopProfilesLike | undefined\n const current = desktopProfiles?.current\n // Classify the host (see `classifyShell` for the evidence): two community\n // signals first — the launcher's `desktopProfiles` service and its\n // `DSH_DESKTOP_NODE_EXECUTABLE` host marker — then Electron-as-node as the\n // official shell's only trace. The kind decides WHICH artefact is copyable:\n // web / community get the CLI command, the official shell gets the `pkg@tag`\n // spec for its in-app Plugins page.\n const shell = classifyShell({ env: process.env, desktopProfilesCurrent: current?.name })\n const isDesktop = shell !== 'web'\n const result = await fetchLatestVersion({\n env: isDesktop ? 'desktop' : 'web',\n shell,\n channel,\n ...(entry?.etag !== undefined ? { etag: entry.etag } : {}),\n ...(isDesktop ? { desktopProfile: current } : {}),\n })\n if (result.kind === 'ok') {\n updateCaches.set(key, { at: Date.now(), payload: result.payload, ...(result.etag !== undefined ? { etag: result.etag } : {}) })\n sendJson(res, 200, result.payload)\n return\n }\n if (result.kind === 'not-modified') {\n // The registry 304'd our conditional request: refresh the cache window\n // and serve the stored verdict (item W). A cache is guaranteed here —\n // we only send If-None-Match when one exists.\n if (entry !== undefined) updateCaches.set(key, { ...entry, at: Date.now() })\n const cached = entry?.payload\n if (cached !== undefined) {\n sendJson(res, 200, cached)\n return\n }\n }\n // Registry failure (or the unreachable not-modified-without-cache\n // combination): the error payload is never cached, so the next check\n // retries for real.\n sendJson(res, 502, result.kind === 'error'\n ? result.payload\n : { ok: false, code: 'invalid-response', error: 'registry state inconsistency' } as UpdateCheckPayload)\n}\n\n/** Register the update-check route on the owning context. `webServer` is a\n * hard inject dependency of the Host plugin, so it is guaranteed live when\n * this runs — mounting can never race ahead of the service. */\nexport function registerUpdateCheckRoute(ctx: Context): void {\n const webServer = ctx.get('webServer') as WebServerLike\n // Tolerant (issue #23): a duplicate install registers the same exact route\n // twice and upstream throws `webserver: duplicate exact route \"…\"` — a raw\n // throw here fails this Host entry at startup. A skip is right: the peer's\n // instance serves the route.\n ctx.effect(() => tolerantRegistration(() => webServer.register({\n kind: 'exact',\n path: UPDATE_ROUTE_PATH,\n // Request-scope guard: this is a bare `void` call, so an escaping\n // rejection would be an unhandled rejection (Node's default terminates\n // the process). Every internal branch already catches; this is the\n // last-resort log.\n handler: (req, res) => {\n void handleUpdateCheck(ctx, req, res).catch((error: unknown) => {\n console.warn(`[dsh-catppuccin] update-check route failed: ${String(error)}`)\n })\n },\n })), 'dsh-catppuccin: update-check route')\n}","/**\n * Legacy durable-state read — the one-shot migration source for 0.5.0.\n *\n * Up to 0.4.x the plugin persisted its state in a small JSON file under the\n * DSH home (`catppuccin-state.json`), served to the Client through the\n * `/catppuccin/state` route. 0.5.0 migrates persistence to the official\n * settings seam (`ctx.settings` Host-side, and whichever Client transport the\n * host serves — see `src/client/state-sync.ts`), which is durable across\n * browsers and origins just like the file was (it lives in the DSH home). The legacy file is READ-ONLY here: 0.5.0 migrates its content into\n * the settings document once and keeps the file on disk as a rollback copy\n * (an affected user can restore their old state by hand from it).\n *\n * Host-only module (node:fs / node:path resolve at runtime in the DSH\n * process); the Client never sees it.\n */\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { defaultDshHome } from './profile-detect.ts'\nimport { STATE_FILENAME, sanitizeState, type CatppuccinState } from './state.ts'\n\n/** Absolute path of the legacy state file under a DSH home. */\nexport function legacyStateFilePath(home = defaultDshHome()): string {\n return join(home, STATE_FILENAME)\n}\n\n/** Read the legacy durable state; absent or unparseable input means none yet. */\nexport function readLegacyState(home = defaultDshHome()): CatppuccinState | null {\n try {\n return sanitizeState(JSON.parse(readFileSync(legacyStateFilePath(home), 'utf8')))\n } catch {\n // Missing file (fresh install or a user who never wrote state) or a\n // corrupt/partial write — nothing to migrate.\n return null\n }\n}","/**\n * One-shot migration of the pre-0.5.0 durable file into whichever settings\n * seam the running host offers (issue #15 split it out of `src/index.ts` so\n * the composition stays thin and the migration is unit-testable).\n *\n * The migration writes `$DSH_HOME/catppuccin-state.json` into the durable\n * store exactly once, and only while that store holds NO user layer yet — a\n * user who already configured through the official settings surface (or a\n * previous migration) is never overwritten. The legacy file is left on disk\n * untouched as a rollback copy; a corrupt or absent file means nothing to\n * migrate. Every failure is non-fatal.\n *\n * Two host shapes, two addressing rules:\n *\n * - LEGACY (DSH <= 0.1.6-alpha.2): the namespace is one the plugin just\n * registered itself, so `describe()` finds it immediately and the caller\n * can run {@link migrateLegacyStateOnce} synchronously. \"No user layer\"\n * arrives as an ABSENT `user` field.\n * - NEW (DSH >= 0.1.7-alpha.1): the namespace IS the profile entry, and the\n * settings service only lists an entry whose own fiber is ACTIVE. The\n * `settings` inject callback fires SYNCHRONOUSLY when the service is\n * already live — at that instant the entry is still activating, so an\n * immediate `describe()` cannot see it and the migration would be silently\n * skipped. {@link scheduleLegacyMigration} defers it and also retries on\n * the entry's own `settings/document-updated`. Here \"no user layer\"\n * arrives as an EMPTY OBJECT (`configEditor` defaults `override` to `{}`),\n * which is why the predicate is injected rather than hard-coded.\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport { readLegacyState } from './legacy-state.ts'\nimport { isDefaultState, settingsSectionFromState } from './state.ts'\n\n/** The settings-service surface this module needs — satisfied by both seams\n * (`SettingsForms` on 0.1.7+, the document provider before it). */\nexport interface SettingsLike {\n /** Read the active namespaces (keyed by namespace / profile entry id). */\n describe(options?: { redactSecrets?: boolean }): readonly SettingsLikeDescriptor[]\n /** Merge a patch into one namespace's user layer. */\n update(ns: string, patch: object, expectedRevision?: number): Promise<void>\n}\n\n/** The descriptor fields this module reads. */\nexport interface SettingsLikeDescriptor {\n ns: string\n revision?: number\n user?: unknown\n}\n\n/** Outcome of one migration attempt. `pending` means \"not yet addressable —\n * try again\", which is the only one the caller should retry. */\nexport type MigrationOutcome =\n /** The legacy state was written into the durable store. */\n | 'migrated'\n /** The legacy file is absent or already equals the shipped defaults. */\n | 'absent'\n /** The store already holds a user layer — never overwritten. */\n | 'skipped'\n /** The namespace is not addressable yet (entry still activating / service\n * has not published its first describe). */\n | 'pending'\n\n/** Options for one migration attempt. */\nexport interface MigrationOptions {\n /**\n * Send the descriptor's revision as the write fence. The NEW seam sets it\n * (its `update` validates the revision the caller read); the LEGACY seam\n * omits it, so that line's write stays exactly what 0.5.x issued and cannot\n * turn into a spurious conflict against a namespace only we write.\n */\n fence?: boolean\n}\n\n/**\n * Run the migration once.\n * @param settings - the live settings service.\n * @param ns - the namespace to write: `CATPPUCCIN_SETTINGS_NS` on the legacy\n * seam, `CATPPUCCIN_ENTRY_ID` on the new one.\n * @param hasUserLayer - the channel's own \"the store already holds a user\n * layer\" predicate (see the module header).\n * @param options - fence policy (see {@link MigrationOptions}).\n * @returns the outcome; only `pending` is worth retrying.\n */\nexport async function migrateLegacyStateOnce(\n settings: SettingsLike,\n ns: string,\n hasUserLayer: (user: unknown) => boolean,\n options: MigrationOptions = {},\n): Promise<MigrationOutcome> {\n const legacy = readLegacyState()\n if (legacy === null || isDefaultState(legacy)) return 'absent'\n const descriptor = settings.describe({ redactSecrets: true })\n .find((candidate) => candidate.ns === ns)\n if (descriptor === undefined) return 'pending'\n if (hasUserLayer(descriptor.user)) return 'skipped'\n await settings.update(\n ns,\n settingsSectionFromState(legacy),\n options.fence === true ? descriptor.revision : undefined,\n )\n return 'migrated'\n}\n\n/**\n * Run the migration on the NEW seam without racing the plugin's own\n * activation: one deferred attempt, one retry when the entry's form finally\n * lands in the describe mirror, and one last attempt a few seconds later.\n * Bounded on purpose — a permanently missing entry (a user who renamed it)\n * must not leave a timer running for the process lifetime. The whole schedule\n * is fiber-scoped, so unloading the plugin cancels it.\n * @param ctx - the Host plugin context.\n * @param settings - the live settings service.\n * @param ns - the profile entry id carrying the form.\n * @param hasUserLayer - the new seam's user-layer predicate.\n */\nexport function scheduleLegacyMigration(\n ctx: Context,\n settings: SettingsLike,\n ns: string,\n hasUserLayer: (user: unknown) => boolean,\n): void {\n let settled = false\n // One attempt in flight at a time. The deferred timer and the entry's own\n // `settings/document-updated` routinely land within the same tick, and two\n // concurrent `describe` → `update` pairs race on the namespace revision: the\n // loser is refused and reported as a FAILURE even though the migration\n // succeeded (observed on a real 0.1.7 host, 2026-09-24). `claimed` is set\n // synchronously before the first `await`, so the second caller cannot pass.\n let claimed = false\n const attempt = (): void => {\n if (settled || claimed) return\n claimed = true\n void migrateLegacyStateOnce(settings, ns, hasUserLayer, { fence: true })\n .then((outcome) => {\n if (outcome === 'pending') {\n // Not addressable yet — release the slot so a later attempt retries.\n claimed = false\n return\n }\n // No success log on purpose: `console.info` writes to stdout, and stdout\n // is the ACP transport (`dsh --profile acp` speaks JSON-RPC over it).\n // Upstream fixed the same class of bug in 0.2.1-rc.4 (a diagnostic\n // `console.info` leaking into stdout). The migration is observable from\n // the settings document itself, so silence costs no diagnostics.\n settled = true\n })\n .catch((error: unknown) => {\n settled = true\n console.warn(`[dsh-catppuccin] legacy state migration failed: ${String(error)}`)\n })\n }\n ctx.effect(() => {\n const deferred = setTimeout(attempt, 0)\n const late = setTimeout(attempt, 3000)\n // The entry becomes addressable exactly when the settings service emits\n // its own document-changed notification for it.\n const off = ctx.on('settings/document-updated', (documentNs: string) => {\n if (String(documentNs) === ns) attempt()\n })\n return () => {\n clearTimeout(deferred)\n clearTimeout(late)\n off()\n }\n }, 'catppuccin: legacy state migration')\n}\n","/**\n * The Catppuccin settings contract — the official-settings shape of the\n * plugin's durable state (0.5.0+, replacing the legacy\n * `catppuccin-state.json`), in BOTH forms the DSH versions in the wild need.\n *\n * Two seams, one contract (issue #15):\n *\n * - **DSH <= 0.1.6-alpha.2** (`latest` on npm) serves an abstract settings\n * document. The Host half registers a namespace on it\n * (`settings.installSection(CATPPUCCIN_SETTINGS_NS, schema, base, hooks)`)\n * and the Client binds that namespace through `ctx.settingsScope`. This\n * module owns the registered schema ({@link CatppuccinSettingsSchema}) and\n * the composition `base` ({@link CATPPUCCIN_SETTINGS_BASE}).\n * - **DSH >= 0.1.7-alpha.1** (`next`) dropped both. A plugin no longer\n * registers a namespace: it declares a `Config` schema whose fields carry\n * `.volatile()`, and the settings service projects exactly those fields\n * into a form named by the ACTIVE PROFILE ENTRY id\n * (`CATPPUCCIN_ENTRY_ID`). That projected schema is {@link Config}, the\n * module's only export the Loader consumes.\n *\n * Both forms are built from ONE field table ({@link catppuccinSchemaFields}),\n * so a field can never drift between them. They must NOT share node\n * instances: `.volatile()` mutates the node's meta in place and returns it,\n * so reusing a node would silently mark the legacy schema volatile as well.\n *\n * {@link maybeVolatile} is the compatibility hinge: `.volatile()` exists only\n * from schemastery **3.18.3** (DSH 0.1.5/0.1.6 hosts pin `3.18.2`), and this\n * module is loaded with the HOST's schemastery (it stays external in the lib\n * build). An unconditional `.volatile()` would therefore throw at module\n * evaluation time on every old host — turning \"plugin pending\" into \"plugin\n * failed to load\". On such a host the guarded call is a no-op, which is\n * exactly the pre-0.1.7 status quo (no entry-level form exists there).\n *\n * This module is Host-side because it imports `@deepseek-ai/schemastery`\n * (resolved from the DSH profile tree at runtime). The Client never imports\n * it; it consumes the form by name.\n */\nimport Schema from '@deepseek-ai/schemastery'\nimport {\n CATPPUCCIN_THEME_IDS,\n DEFAULT_AUTO_CHECK,\n DEFAULT_FOLLOW_DARK,\n DEFAULT_FOLLOW_SYSTEM,\n DEFAULT_GLASS,\n DEFAULT_SHIKI_STYLE,\n DEFAULT_UPDATE_CHANNEL,\n FOLLOW_DARK_FLAVORS,\n GLASS_GAP_MAX,\n GLASS_GAP_MIN,\n GLOW_SIZE_MAX,\n GLOW_SIZE_MIN,\n GLOW_STRENGTH_MAX,\n defaultSettingsSection,\n type CatppuccinSettingsSection,\n} from './state.ts'\n\n/** The subset of a schemastery node this module relies on. */\ninterface VolatileCapable {\n volatile?: () => unknown\n}\n\n/**\n * Mark a schema node volatile when the running schemastery supports it.\n *\n * Guarded on purpose (see the module header): `.volatile()` landed in\n * schemastery 3.18.3, while DSH <= 0.1.6-alpha.2 hosts pin 3.18.2 and this\n * module resolves schemastery from THEIR tree. Calling it unconditionally\n * throws at import time on those hosts.\n * @param node - freshly built schema node (never reused across schemas).\n * @returns the same node, marked volatile when the capability exists.\n */\nexport function maybeVolatile<T extends object>(node: T): T {\n const capable = node as VolatileCapable\n return typeof capable.volatile === 'function' ? capable.volatile() as T : node\n}\n\n/**\n * Build FRESH schema nodes for every field of the durable contract. Every\n * field maps 1:1 onto `CatppuccinSettingsSection` in `src/state.ts`, and every\n * default is the shipped default — the Client treats \"resolves to the shipped\n * defaults\" as \"no user choice yet\", so a wrong default would write garbage\n * into a user's profile on first boot.\n *\n * Callers MUST NOT share the returned nodes between schemas (see the header).\n * @returns a new field table, one fresh node per field.\n */\nexport function catppuccinSchemaFields(): Record<string, Schema> {\n return {\n flavor: Schema.union([...CATPPUCCIN_THEME_IDS, 'off']).default('off'),\n // Issue #36 — the follow-mode pair. `followSystem` defaults to false, so a\n // profile that never touches it resolves to the shipped section and the\n // client treats the document as \"no user choice yet\" (same rule as every\n // other field here). `followDark` is restricted to the DARK flavours: the\n // light half is the Latte constant, not a setting.\n followSystem: Schema.boolean().default(DEFAULT_FOLLOW_SYSTEM),\n followDark: Schema.union([...FOLLOW_DARK_FLAVORS]).default(DEFAULT_FOLLOW_DARK),\n glass: Schema.object({\n enabled: Schema.boolean().default(DEFAULT_GLASS.enabled),\n mode: Schema.union(['mica', 'compat']).default(DEFAULT_GLASS.mode),\n blur: Schema.number().min(0).max(40).default(DEFAULT_GLASS.blur),\n frost: Schema.number().min(0).max(100).default(DEFAULT_GLASS.frost),\n brightness: Schema.number().min(0).max(100).default(DEFAULT_GLASS.brightness),\n // Issue #31: the floating-card inset. Bounded by the same pair the\n // sanitizer uses — the form is the ONE place a user can type a raw\n // number, so it must not be able to hold a value `sanitizeState` would\n // immediately clamp away (that difference would make every publish\n // re-write the document).\n gap: Schema.number().min(GLASS_GAP_MIN).max(GLASS_GAP_MAX).default(DEFAULT_GLASS.gap),\n // Issue #32: how strong the two glows read. Bounded by the same ceiling\n // the sanitizer uses — the form is the one place a raw number can be\n // typed, so it must not be able to hold a value `sanitizeState` would\n // immediately clamp away (that gap would make every publish re-write).\n glowStrength: Schema.number().min(0).max(GLOW_STRENGTH_MAX).default(DEFAULT_GLASS.glowStrength),\n // Issue #32 follow-up: the glow SPREAD. Same rule — the form must not be\n // able to hold a value the sanitizer would clamp away on the next publish.\n glowSize: Schema.number().min(GLOW_SIZE_MIN).max(GLOW_SIZE_MAX).default(DEFAULT_GLASS.glowSize),\n // Issue #26: the optional ground glows (the wash-only ground is the\n // shipped default, so this must default to the same value as\n // `DEFAULT_GLASS.glow` — the client reads \"resolves to the shipped\n // defaults\" as \"no user choice yet\", and a wrong default here would make\n // every visit look like an explicit choice).\n glow: Schema.boolean().default(DEFAULT_GLASS.glow),\n }),\n autoCheck: Schema.boolean().default(DEFAULT_AUTO_CHECK),\n updateChannel: Schema.union(['latest', 'beta']).default(DEFAULT_UPDATE_CHANNEL),\n overrides: Schema.dict(Schema.string()).default({}),\n shikiStyle: Schema.union(['default', 'italic-comments']).default(DEFAULT_SHIKI_STYLE),\n }\n}\n\n/** The same table with every leaf marked volatile where the capability exists.\n * Marking the leaves (rather than the `glass` subtree) keeps\n * `isVolatilePath` true for each nested path without putting volatile inside\n * volatile — schemastery rejects that combination. */\nfunction volatileFields(): Record<string, Schema> {\n const fields = catppuccinSchemaFields()\n const glassFields = (fields.glass as Schema & { dict?: Record<string, Schema> }).dict ?? {}\n return {\n flavor: maybeVolatile(fields.flavor),\n // Issue #36: both halves of the follow pair are volatile for the same\n // reason as `flavor` — the boot palette (Host side) reads them through\n // `.get()` to paint the right first frame.\n followSystem: maybeVolatile(fields.followSystem),\n followDark: maybeVolatile(fields.followDark),\n glass: Schema.object(Object.fromEntries(\n Object.entries(glassFields).map(([key, node]) => [key, maybeVolatile(node)]),\n )),\n autoCheck: maybeVolatile(fields.autoCheck),\n updateChannel: maybeVolatile(fields.updateChannel),\n overrides: maybeVolatile(fields.overrides),\n shikiStyle: maybeVolatile(fields.shikiStyle),\n }\n}\n\n/**\n * The namespace schema registered by the LEGACY Host seam\n * (`settings.installSection`). Deliberately plain: on a host that has\n * `installSection` there is no `.volatile()` capability, and the field set is\n * resolved by the settings document rather than by a form projection.\n */\nexport const CatppuccinSettingsSchema = Schema.object(catppuccinSchemaFields())\n\n/** The composition `base` for the legacy namespace: the shipped defaults. */\nexport const CATPPUCCIN_SETTINGS_BASE: CatppuccinSettingsSection = defaultSettingsSection()\n\n/**\n * The plugin `Config` consumed by the NEW Host seam (DSH >= 0.1.7-alpha.1).\n * Its volatile fields are what the settings service projects into the form the\n * Client addresses by `CATPPUCCIN_ENTRY_ID`; the Host half never reads the\n * values itself. On a legacy host every field stays plain, so the entry\n * exposes no form at all — the old seam keeps doing the persisting.\n */\nexport const Config = Schema.object(volatileFields())\n\n/**\n * The value shape the Loader hands `apply` for {@link Config}. Every leaf is a\n * `Volatile` reference on a 0.1.7 host (read it with `.get()`); the Host half\n * deliberately consumes none of them, so this interface exists to document the\n * contract and to keep the schema honest.\n */\nexport interface CatppuccinConfig {\n flavor: { get(): CatppuccinSettingsSection['flavor'] }\n /** Issue #36: follow the OS light/dark scheme. */\n followSystem: { get(): boolean }\n /** Issue #36: the dark half of follow mode. */\n followDark: { get(): CatppuccinSettingsSection['followDark'] }\n glass: {\n enabled: { get(): boolean }\n mode: { get(): CatppuccinSettingsSection['glass']['mode'] }\n blur: { get(): number }\n frost: { get(): number }\n brightness: { get(): number }\n /** Issue #31 floating-card inset, px. */\n gap: { get(): number }\n /** Issue #32 ground-glow strength, percent of the shipped look. */\n glowStrength: { get(): number }\n }\n autoCheck: { get(): boolean }\n updateChannel: { get(): CatppuccinSettingsSection['updateChannel'] }\n overrides: { get(): Record<string, string> }\n shikiStyle: { get(): CatppuccinSettingsSection['shikiStyle'] }\n}\n","/**\n * Host half of the Catppuccin theme plugin for the DeepSeek Harness web GUI.\n *\n * Pure UI plugin: the four flavour themes and the glass skin ship in the\n * browser half (exports[\"./client\"], discovered through the package.json\n * dsh.client declaration). Since 0.5.0 the flavour/glass preferences persist\n * durably through the OFFICIAL settings seam — but that seam changed shape in\n * DSH 0.1.7-alpha.1 (issue #15), so this half wires BOTH:\n *\n * - **<= 0.1.6-alpha.2** (`latest` on npm): a settings SERVICE the plugin\n * registers a namespace on (`ctx.settings.installSection`) and the Client\n * binds through `ctx.settingsScope`.\n * - **>= 0.1.7-alpha.1** (`next`): no registration at all. The plugin\n * declares a `Config` schema with `.volatile()` fields (exported below),\n * and the settings service projects them into a form named by the active\n * profile entry id; the Client reads it through `ctx.configForms`.\n *\n * Which one is live is decided by FEATURE DETECTION, never by version parsing:\n * `installSection` is present exactly on the legacy service. Both wirings live\n * inside an optional `ctx.inject(['settings'], …)` child, so a deployment\n * without a settings provider keeps the plugin working from browser\n * localStorage alone (losing only cross-restart durability). No profile is\n * ever blocked on the settings service.\n *\n * The legacy seam itself predates DSH 0.1.1-rc.2, which is why 0.4.x shipped a\n * hand-rolled `$DSH_HOME/catppuccin-state.json` + `/catppuccin/state` route\n * instead: the Host settings wire then only served an explicit allowlist of\n * namespaces (see dsh-host-apiproxy's WEB_SETTINGS_NAMESPACES), so a\n * plugin-owned settings namespace answered `settings-not-exposed` even when\n * registered. 0.1.1-rc.2 dropped the allowlist (\"注册即暴露\"), and the legacy\n * file is now only a one-shot migration source (`src/legacy-state.ts`,\n * consumed by `src/migrate-legacy.ts`; the file stays as rollback).\n *\n * The one host-side behavior besides settings is the\n * `/catppuccin/check-update` exact webServer route, owned by\n * `src/update-check/host.ts` (item A: the update-check logic used to live\n * inline here; it moved so `index.ts` stays a thin composition of the host\n * responsibilities and the route module can be tested on its own).\n * `webServer` is a hard inject dependency, so Cordis starts this plugin only\n * after the service is live — mounting can never race ahead of it and\n * silently skip the routes. (An earlier version read `ctx.get('webServer')`\n * once and bailed silently when it was not yet visible, which left a\n * mounted-but-routeless plugin and made \"check for updates\" fail forever.)\n * A headless profile has no webServer and no settings UI, so the plugin\n * simply stays waiting there. The responses carry only the plugin's own\n * settings and public package metadata, so no workspace gate is needed.\n */\nimport type { Context } from '@deepseek-ai/cordis'\n// Type-only: pulls the settings service's Context merge (ctx.settings).\nimport type {} from '@deepseek-ai/dsh-settings'\nimport { bootPaletteRows, type BootPaletteConfig, type BootPaletteRow } from './boot-palette.ts'\nimport { registerUpdateCheckRoute } from './update-check/host.ts'\nimport { migrateLegacyStateOnce, scheduleLegacyMigration, type SettingsLike } from './migrate-legacy.ts'\nimport { CATPPUCCIN_SETTINGS_BASE, CatppuccinSettingsSchema } from './settings-catppuccin.ts'\nimport { CATPPUCCIN_ENTRY_ID, CATPPUCCIN_SETTINGS_NS, hasUserLayerSection } from './state.ts'\n\n/** Stable cordis plugin name (matches cordis.patch.yml insert id). */\nexport const name = 'dsh-catppuccin'\n\n/**\n * The host webserver's index-injection table (issue #30 补充).\n *\n * Declared structurally, like `WebServerLike`: `@deepseek-ai/dsh-host-webserver`\n * is NOT a dependency of this plugin (the event is emitted by the host), and\n * this is the only event consumed here. The shape matches the installed host\n * package's `IndexInjection`; a host that does not emit the event simply never\n * calls the listener (boot rows absent, i.e. the pre-0.6.6 behaviour).\n */\ndeclare module '@deepseek-ai/cordis' {\n interface Events {\n 'webserver/index-inject'(table: BootPaletteRow[]): void\n }\n}\n\n/**\n * Hard dependencies: the update check is a webServer route, so this Host\n * half is not activated until the webServer service is live. Declaring\n * inject (not a one-shot `ctx.get` probe) makes route registration\n * deterministic: Cordis reactivates the plugin once the service appears, no\n * matter the mount order.\n */\nexport const inject = ['webServer']\n\n/**\n * The plugin's volatile configuration form (DSH >= 0.1.7-alpha.1) — the\n * namespace the Client addresses by `CATPPUCCIN_ENTRY_ID`.\n *\n * Re-exported here because the Loader reads `Config` off the plugin module;\n * on a legacy host the guarded `.volatile()` calls inside it are no-ops, so\n * the entry exposes no form there and the `installSection` wiring below keeps\n * doing the persisting.\n */\nexport { Config } from './settings-catppuccin.ts'\n\n/**\n * The LEGACY settings service (DSH <= 0.1.6-alpha.2): it registers plugin\n * namespaces. Declared as a local structural type on purpose — 0.1.7 removed\n * the method from the published types, and this shape is all this branch\n * touches, so the cross-version code stays honest instead of reaching for\n * `any`.\n */\ninterface LegacySettings extends SettingsLike {\n installSection?: (\n owner: Context,\n ns: string,\n schema: unknown,\n base: unknown,\n hooks: { setSource: () => void, onChange: () => void },\n ) => void\n}\n\n/** The NEW settings service's extra surface (DSH >= 0.1.7-alpha.1). */\ninterface ModernSettings extends SettingsLike {\n /** Own this plugin instance's automatic-page policy (`auto` defaults true).\n * Absent on the legacy seam, hence the feature detection. */\n configure?: (presentation: { auto?: boolean }, owner?: unknown) => unknown\n}\n\n/** The legacy document describes \"no user layer\" as an ABSENT field (it maps\n * over the namespaces it has a section for), so presence is the whole test —\n * the same predicate 0.5.x used. */\nfunction legacyUserLayer(user: unknown): boolean {\n return user !== undefined\n}\n\n/** Host plugin body: register the update-check route and wire whichever\n * settings seam the running host offers (webServer is inject; settings is\n * optional wiring). */\nexport function apply(ctx: Context, config?: BootPaletteConfig): void {\n registerUpdateCheckRoute(ctx)\n\n // Pre-paint palette (issue #30 补充, 2026-10-27): the index HTML ships the\n // persisted flavour's own token table, so the first frame is Catppuccin\n // instead of the official dark the theme bootstrap paints. The listener reads\n // the durable value on every render, so a page load always reflects the\n // document as it stands then.\n //\n // `config` is the Loader-validated plugin config; on DSH >= 0.1.7 its fields\n // are volatile refs, which is the only shape `bootPaletteRows` accepts (see\n // its module header for why a plain value must NOT be painted).\n ctx.on('webserver/index-inject', (table) => {\n table.push(...bootPaletteRows(config))\n })\n\n ctx.inject(['settings'], (sctx) => {\n const settings = sctx.settings as unknown as LegacySettings & ModernSettings\n if (typeof settings.installSection === 'function') {\n // Legacy seam. Registering and migrating inline reproduces 0.5.x\n // behaviour exactly: the namespace is ours, so it is addressable the\n // moment `installSection` returns, and the write stays unfenced.\n settings.installSection(\n sctx,\n CATPPUCCIN_SETTINGS_NS,\n CatppuccinSettingsSchema,\n CATPPUCCIN_SETTINGS_BASE,\n {\n // Host half never consumes the resolved value itself — the Client\n // renders and edits it through its own bound scope — so the source\n // sink and change hook are intentionally empty (the wiring still\n // needs them to keep the registration fiber-scoped).\n setSource() {},\n onChange() {},\n },\n )\n void migrateLegacyStateOnce(settings, CATPPUCCIN_SETTINGS_NS, legacyUserLayer)\n .catch((error: unknown) => {\n console.warn(`[dsh-catppuccin] legacy state migration failed: ${String(error)}`)\n })\n return\n }\n\n // New seam. Nothing to register: the exported `Config` IS the namespace,\n // and its volatile fields are what the settings service projects into the\n // form the Client reads. Suppress the schema-generated page — this plugin\n // ships its own settings rows.\n //\n // The disposer is OWNED here (issue #23 audit): upstream documents\n // \"register it with the calling plugin's effects\" and throws `Settings\n // presentation is already configured for this plugin instance` when the\n // same owner configures twice. Dropping the disposer pinned the policy to\n // the top-level fiber forever, so the next activation of this child\n // (host fiber restart / HMR / service reload) would re-run `configure`,\n // fail the child, and skip the migration wiring below it.\n const releasePresentation = settings.configure?.({ auto: false }, ctx.fiber)\n // The entry is not addressable until its own fiber is ACTIVE, so the\n // migration is deferred and retried rather than run inline (a synchronous\n // `describe()` here cannot see us yet — see `src/migrate-legacy.ts`).\n scheduleLegacyMigration(ctx, settings, CATPPUCCIN_ENTRY_ID, hasUserLayerSection)\n // Child-fiber cleanup: release the presentation policy with this child.\n return () => {\n if (typeof releasePresentation === 'function') (releasePresentation as () => void)()\n }\n })\n}\n"],"mappings":";;;;;AAszBA,MAAa,qBAAsD;CACjE;EA5xBA,SAAS;EACT,aAAa;EACb,OAAO;EACP,QAAQ;EACR,QAAQ;GACN,0BAA0B;GAC1B,0BAA0B;GAC1B,0BAA0B;GAC1B,0BAA0B;GAC1B,0BAA0B;GAC1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