The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): sidebar nav prefs become a `sidebarNav.prefs` contribution
teknium17fba0e6e731a
diff --git a/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsx b/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsxindex 3e236dd0e4e..8abd38f7ae4 100644--- a/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsx+++ b/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsx@@ -20,7 +20,7 @@ import {$workspaceCwdOwner} from '@/store/session'import { $removedSessionIds } from '@/store/session-removal'-import { $sidebarHiddenNavIds } from '@/store/sidebar-nav'+import { SIDEBAR_NAV_PREFS_AREA } from '@/store/sidebar-nav'import { makeSessionInfo } from '@/test/session-info'import { type AppView, ROUTES_AREA, SIDEBAR_NAV_AREA } from '../../routes'@@ -112,7 +112,6 @@ describe('ChatSidebar navigation activity', () => {$removedSessionIds.set(new Set())$layoutTree.set(null)noteActiveTreeGroup(null)- $sidebarHiddenNavIds.set([])})it('keeps navigation and session activity coherent with the focused pane', () => {@@ -177,20 +176,22 @@ describe('ChatSidebar navigation activity', () => {expectOnlySelectedSession(null)})- it('drops a nav row hidden through the nav preference (host.sidebar.hide)', () => {+ // Teardown proof: the loader disposes a plugin's contributions on disable,+ // and that disposer alone must bring the row back — no store to clear.+ it('hides a nav row while a sidebarNav.prefs contribution is registered and restores it on dispose', () => {renderSidebar('/kanban', 'extension')expect(screen.getByRole('button', { name: 'Kanban' })).toBeTruthy()+ let dispose = () => {}+act(() => {- $sidebarHiddenNavIds.set(['kanban-nav'])+ dispose = registry.register({ area: SIDEBAR_NAV_PREFS_AREA, id: 'prefs', data: { hide: ['kanban-nav'] } })})expect(screen.queryByRole('button', { name: 'Kanban' })).toBeNull()// A hidden row is a preference, not a removal: the sibling nav row stays.expect(screen.getByRole('button', { name: 'Reports' })).toBeTruthy()- act(() => {- $sidebarHiddenNavIds.set([])- })+ act(() => dispose())expect(screen.getByRole('button', { name: 'Kanban' })).toBeTruthy()})})diff --git a/apps/desktop/src/app/chat/sidebar/index.tsx b/apps/desktop/src/app/chat/sidebar/index.tsxindex ba5e9da72eb..d48fe2bb3e1 100644--- a/apps/desktop/src/app/chat/sidebar/index.tsx+++ b/apps/desktop/src/app/chat/sidebar/index.tsx@@ -134,7 +134,7 @@ import { $focusedSessionIsTile, $focusedStoredSessionId, $workingSessionIds } frimport { ackAllSessionsRead } from '@/store/session-unread'import { markSessionUnread } from '@/store/session-unread-remote'import { $archivedSessions, loadArchivedSessions } from '@/store/sidebar-archive'-import { $sidebarHiddenNavIds, $sidebarNavOrderIds, orderSidebarNav } from '@/store/sidebar-nav'+import { applySidebarNavPrefs, SIDEBAR_NAV_PREFS_AREA } from '@/store/sidebar-nav'import { $sidebarSessionRankIds } from '@/store/sidebar-sort'import {@@ -432,18 +432,15 @@ export function ChatSidebar({const interfaceMode = useStore($interfaceMode)const showsAdvancedChrome = useStore($showsAdvancedChrome)- // Nav preferences (host.sidebar): a plugin may hide rows or re-order them.- // Applied here, at render, so the preference never mutates the default list.- // They persist across a plugin disable → enable cycle by design (see- // store/sidebar-nav.ts) — which also means they outlive a plugin that is- // removed, so a row it hid stays hidden until something clears the store.- const hiddenNavIds = useStore($sidebarHiddenNavIds)- const navOrderIds = useStore($sidebarNavOrderIds)+ // Nav preferences (`sidebarNav.prefs` contributions): a plugin may hide rows+ // or re-order them. Merged here, at render, from the registry — so the+ // preference never mutates the default list, and a plugin's disable/reload+ // disposes its contribution and the rows come straight back.+ const navPrefs = useContributions(SIDEBAR_NAV_PREFS_AREA)const navItems = useMemo(- () =>- orderSidebarNav([...SIDEBAR_NAV, ...contributedNav].filter(shownInMode(interfaceMode)), hiddenNavIds, navOrderIds),- [contributedNav, hiddenNavIds, interfaceMode, navOrderIds]+ () => applySidebarNavPrefs([...SIDEBAR_NAV, ...contributedNav].filter(shownInMode(interfaceMode)), navPrefs),+ [contributedNav, interfaceMode, navPrefs])const panesFlipped = useStore($panesFlipped)diff --git a/apps/desktop/src/sdk/index.test.ts b/apps/desktop/src/sdk/index.test.tsindex c5cb6b111a3..796bb948e09 100644--- a/apps/desktop/src/sdk/index.test.ts+++ b/apps/desktop/src/sdk/index.test.ts@@ -449,30 +449,3 @@ describe('host.sessions session-list mutations', () => {expect($sessionColorOverrides.get()).toEqual({})})})--describe('host.sidebar nav preferences', () => {- beforeEach(async () => {- const nav = await import('@/store/sidebar-nav')-- nav.$sidebarHiddenNavIds.set([])- nav.$sidebarNavOrderIds.set([])- })-- it('hide/unhide write the hidden-nav store', async () => {- const { $sidebarHiddenNavIds } = await import('@/store/sidebar-nav')-- host.sidebar.hide('cron')- expect($sidebarHiddenNavIds.get()).toEqual(['cron'])-- host.sidebar.hide('cron', false)- expect($sidebarHiddenNavIds.get()).toEqual([])- })-- it('setOrder writes the manual nav order', async () => {- const { $sidebarNavOrderIds } = await import('@/store/sidebar-nav')-- host.sidebar.setOrder(['artifacts', 'cron'])-- expect($sidebarNavOrderIds.get()).toEqual(['artifacts', 'cron'])- })-})diff --git a/apps/desktop/src/sdk/index.ts b/apps/desktop/src/sdk/index.tsindex 25a2c065eb3..8b66a347003 100644--- a/apps/desktop/src/sdk/index.ts+++ b/apps/desktop/src/sdk/index.ts@@ -103,7 +103,6 @@ import {focusWorkspaceOwnerSessionTile,sessionTileDelegate} from '@/store/session-states'-import { setSidebarNavHidden, setSidebarNavOrder } from '@/store/sidebar-nav'import { runGatewayRestart } from '@/store/system-actions'import type { PaginatedSessions, UsageStats } from '@/types/hermes'@@ -923,33 +922,6 @@ export const host = {/** Session-list mutations (pin, reorder, colour) — see `./sessions`. */sessions: sessionsHost,- /** Sidebar nav preferences — hide or re-order the sidebar's nav rows (core- * built-ins and contributed rows alike), the way a sidebar-manager plugin- * wants to. Core still owns rendering: a preference only ever moves or drops- * a row that would otherwise render, and an id naming a row that no longer- * exists is inert.- *- * Preferences PERSIST (a disable → enable cycle must not scramble the layout- * the user chose), which means they also outlive the plugin that wrote them:- * a row this call hid stays hidden after the plugin is removed. Clearing one- * is the writer's job — `hide(id, false)` / `setOrder([])` — since the store- * does not yet record which plugin wrote a preference.- *- * Ids are the rows' own ids (`SIDEBAR_NAV` built-ins like `'capabilities'`,- * or a contributed nav contribution's id). */- sidebar: {- /** Hide or show one nav row. */- hide: (navId: string, hidden = true): void => {- setSidebarNavHidden(navId, hidden)- },-- /** Replace the manual nav order with `ids`. Rows the order does not name- * keep their default relative order after the named ones. */- setOrder: (ids: string[]): void => {- setSidebarNavOrder(ids)- }- },-/** Open a stored session the way core surfaces do. A plugin/Bot Mode open* is navigation, not a workspace or chrome API-home switch —* keepAllProfilesScope defaults true so `$activeGatewayProfile` /@@ -1940,6 +1912,10 @@ export { cn } from '@/lib/utils'* is gone. Pass the owning profile — a hidden session has no row to read it* from, and the persisted half is bucketed per profile. */export { ackStoredSessionId, forgetSessionUnread, markSessionUnreadFinished } from '@/store/session-unread'+/** `sidebarNav.prefs`: hide / re-order the sidebar's nav rows by CONTRIBUTING a+ * preference (union of hides; first-registered order wins). A contribution,+ * not a `host.sidebar` verb, so it is attributed and dropped on disable. */+export { SIDEBAR_NAV_PREFS_AREA, type SidebarNavPrefsContribution } from '@/store/sidebar-nav'/** Live accent override — set a hex and the ACTIVE theme repaints with its* accent family re-seeded from it (see `retintTheme`); `null` restores the* authored palette. Deliberately not persisted: it is an authoring knob, notdiff --git a/apps/desktop/src/store/sidebar-nav.test.ts b/apps/desktop/src/store/sidebar-nav.test.tsindex e3e38d8b349..99c55e9378e 100644--- a/apps/desktop/src/store/sidebar-nav.test.ts+++ b/apps/desktop/src/store/sidebar-nav.test.ts@@ -1,63 +1,24 @@-import { afterEach, describe, expect, it } from 'vitest'+import { describe, expect, it } from 'vitest'-import {- $sidebarHiddenNavIds,- $sidebarNavOrderIds,- orderSidebarNav,- setSidebarNavHidden,- setSidebarNavOrder-} from './sidebar-nav'+import { applySidebarNavPrefs, SIDEBAR_NAV_PREFS_AREA } from './sidebar-nav'-afterEach(() => {- $sidebarHiddenNavIds.set([])- $sidebarNavOrderIds.set([])-})--const rows = [{ id: 'a' }, { id: 'b' }, { id: 'c' }, { id: 'd' }]--describe('orderSidebarNav', () => {- it('keeps the default order when nothing is hidden or ordered', () => {- expect(orderSidebarNav(rows, [], []).map(r => r.id)).toEqual(['a', 'b', 'c', 'd'])- })-- it('drops hidden ids and ignores unknown ones', () => {- expect(orderSidebarNav(rows, ['b', 'missing'], []).map(r => r.id)).toEqual(['a', 'c', 'd'])- })-- it('names ordered ids first, in that order; unnamed rows keep their default order after', () => {- expect(orderSidebarNav(rows, [], ['c', 'a']).map(r => r.id)).toEqual(['c', 'a', 'b', 'd'])- })-- it('an ordered id that is also hidden stays hidden (hide wins)', () => {- expect(orderSidebarNav(rows, ['c'], ['c', 'a']).map(r => r.id)).toEqual(['a', 'b', 'd'])- })-- it('preserves the row objects themselves, not copies', () => {- const [first] = orderSidebarNav(rows, [], ['b'])-- expect(first).toBe(rows[1])- })-})+const rows = [{ id: 'a' }, { id: 'b' }, { id: 'c' }, { id: 'd' }, { id: 'e' }]-describe('sidebar nav preference setters', () => {- it('hide is idempotent and reversible', () => {- setSidebarNavHidden('cron')- setSidebarNavHidden('cron')- expect($sidebarHiddenNavIds.get()).toEqual(['cron'])-- setSidebarNavHidden('cron', false)- setSidebarNavHidden('cron', false)- expect($sidebarHiddenNavIds.get()).toEqual([])- })-- it('ignores blank ids', () => {- setSidebarNavHidden(' ')- expect($sidebarHiddenNavIds.get()).toEqual([])- })+const prefs = (id: string, data: { hide?: string[]; order?: string[] }) => ({ area: SIDEBAR_NAV_PREFS_AREA, id, data })- it('setOrder trims, drops blanks and dedupes', () => {- setSidebarNavOrder([' b ', '', 'a', 'b'])+describe('applySidebarNavPrefs', () => {+ // The arbitration rule two plugins live under: neither can un-hide the+ // other's row; the first-registered order owns the placement it names and a+ // later order only places what is still unplaced; unknown ids are inert;+ // rows nobody names keep their default relative order after the named ones.+ it('unions hides and lets the first-registered order win', () => {+ const merged = applySidebarNavPrefs(rows, [+ prefs('first', { hide: ['b'], order: ['d', 'a'] }),+ prefs('second', { hide: ['c', 'missing'], order: ['a', 'd', 'b', 'nope'] })+ ])- expect($sidebarNavOrderIds.get()).toEqual(['b', 'a'])+ expect(merged.map(r => r.id)).toEqual(['d', 'a', 'e'])+ expect(merged[0]).toBe(rows[3])+ expect(applySidebarNavPrefs(rows, []).map(r => r.id)).toEqual(['a', 'b', 'c', 'd', 'e'])})})diff --git a/apps/desktop/src/store/sidebar-nav.ts b/apps/desktop/src/store/sidebar-nav.tsindex 0afe353b1f7..cf551bf4e09 100644--- a/apps/desktop/src/store/sidebar-nav.ts+++ b/apps/desktop/src/store/sidebar-nav.ts@@ -1,73 +1,55 @@-import { Codecs, persistentAtom } from '@/lib/persisted'+import type { Contribution } from '@/contrib/types'-// Sidebar-nav preferences — the store behind `host.sidebar`. A plugin (the-// sidebar manager) hides rows or re-orders them; core still owns rendering, so-// a preference only ever moves or drops a row that would otherwise render, and-// an id naming a row that no longer exists is inert.+// Sidebar-nav preferences — the `sidebarNav.prefs` registry area. A plugin+// (the sidebar manager) hides nav rows or re-orders them by CONTRIBUTING a+// preference; core still owns rendering and merges every contribution at+// render, so a preference only ever moves or drops a row that would otherwise+// render, and an id naming a row that does not exist is inert.//-// These PERSIST, deliberately: a disable → enable cycle must not scramble the-// layout the user chose. The consequence is that they outlive the plugin that-// wrote them — a row hidden by a plugin stays hidden after that plugin is-// removed, and there is no core UI that restores it. The escape hatch is the-// API that wrote it (`host.sidebar.hide(id, false)`, or clearing-// `hermes.desktop.sidebarNavHidden.v1` / `...NavOrder.v1`), which means the-// plugin that owns the preference is the one that can hand it back. Scoping a-// preference to its writer needs the plugin's identity in this store, which the-// host API does not carry yet.-export const $sidebarHiddenNavIds = persistentAtom<string[]>(- 'hermes.desktop.sidebarNavHidden.v1',- [],- Codecs.stringArray-)--export const $sidebarNavOrderIds = persistentAtom<string[]>('hermes.desktop.sidebarNavOrder.v1', [], Codecs.stringArray)--/** Hide or show one nav row (idempotent; empty ids are ignored). */-export function setSidebarNavHidden(navId: string, hidden = true): void {- const id = navId.trim()-- if (!id) {- return- }-- const prev = $sidebarHiddenNavIds.get()- const present = prev.includes(id)-- if (present === hidden) {- return- }-- $sidebarHiddenNavIds.set(hidden ? [...prev, id] : prev.filter(existing => existing !== id))+// Why a contribution and not a persisted `host.sidebar.hide()` store: the+// `host` singleton cannot tell which plugin wrote a preference, so a persisted+// write would outlive the plugin that made it (a hidden row with nothing left+// to restore it) and two plugins would overwrite each other's order. A+// contribution is attributed, merged with a stated rule, and dropped by the+// loader's per-plugin disposer on disable/reload — the rows come back on their+// own. The USER's choices persist in the plugin's own `ctx.storage`; the plugin+// re-contributes them on register.++export const SIDEBAR_NAV_PREFS_AREA = 'sidebarNav.prefs'++/** Payload (`data`) of a `sidebarNav.prefs` contribution. Ids are the nav rows'+ * own ids: the core rows `'new-session' | 'capabilities' | 'messaging' |+ * 'artifacts' | 'cron'` (see `SidebarNavId`) or a `sidebar.nav` contribution's id. */+export interface SidebarNavPrefsContribution {+ /** Rows to drop. Merged as the UNION across contributions. */+ hide?: string[]+ /** Rows to place first, in this order. The first-registered contribution's+ * order wins; later ones place only ids not yet placed. */+ order?: string[]}-/** Replace the manual nav order with `ids` (deduped, blanks dropped). Rows the- * order does not name keep their default relative order after the named ones. */-export function setSidebarNavOrder(ids: string[]): void {- const seen = new Set<string>()- const next: string[] = []+const cleanIds = (ids: unknown): string[] =>+ Array.isArray(ids) ? ids.filter((id): id is string => typeof id === 'string' && id.trim() !== '') : []- for (const raw of ids) {- const id = (raw || '').trim()+/** Apply every `sidebarNav.prefs` contribution to the nav rows. Pure so the+ * arbitration is testable without a DOM: hidden = union of every `hide`+ * (hide beats order); `order` = first-registered contribution first, later+ * contributions place only ids not yet placed; rows no order names keep their+ * default relative order after the named ones; unknown ids are inert. */+export function applySidebarNavPrefs<T extends { id: string }>(+ items: readonly T[],+ contributions: readonly Contribution[]+): T[] {+ const hidden = new Set<string>()+ const order: string[] = []- if (id && !seen.has(id)) {- seen.add(id)- next.push(id)- }- }+ for (const c of contributions) {+ const prefs = c.data as SidebarNavPrefsContribution | undefined- $sidebarNavOrderIds.set(next)-}+ cleanIds(prefs?.hide).forEach(id => hidden.add(id))+ order.push(...cleanIds(prefs?.order))+ }-/** Apply hidden + order to the nav rows. Pure so the semantics are testable- * without a DOM: hidden ids drop out; ids named in `order` come first in that- * exact order; rows the order does not name keep their default relative order- * after them. Unknown ids in either list are inert. */-export function orderSidebarNav<T extends { id: string }>(- items: readonly T[],- hidden: readonly string[],- order: readonly string[]-): T[] {- const hiddenSet = new Set(hidden)const byId = new Map(items.map(item => [item.id, item]))const placed = new Set<string>()const ordered: T[] = []@@ -75,14 +57,14 @@ export function orderSidebarNav<T extends { id: string }>(for (const id of order) {const item = byId.get(id)- if (item && !hiddenSet.has(id) && !placed.has(id)) {+ if (item && !hidden.has(id) && !placed.has(id)) {ordered.push(item)placed.add(id)}}for (const item of items) {- if (!hiddenSet.has(item.id) && !placed.has(item.id)) {+ if (!hidden.has(item.id) && !placed.has(item.id)) {ordered.push(item)}}diff --git a/website/docs/developer-guide/desktop-plugin-sdk.md b/website/docs/developer-guide/desktop-plugin-sdk.mdindex e29081c7894..6eae0adfe70 100644--- a/website/docs/developer-guide/desktop-plugin-sdk.md+++ b/website/docs/developer-guide/desktop-plugin-sdk.md@@ -640,6 +640,64 @@ jsx(Contribute, {It registers on mount and disposes on unmount automatically.+### Sidebar nav visibility and order (`SIDEBAR_NAV_PREFS_AREA`)++A plugin hides or re-orders the sidebar's top nav rows by **contributing a+preference**, not by writing a setting. Core merges every `sidebarNav.prefs`+contribution at render and applies the result to the rows it would otherwise+show; the default list itself never changes.++```ts+import { SIDEBAR_NAV_PREFS_AREA, type SidebarNavPrefsContribution } from '@hermes/plugin-sdk'++// Payload (`data`) of a sidebarNav.prefs contribution+interface SidebarNavPrefsContribution {+ hide?: string[] // rows to drop+ order?: string[] // rows to place first, in this order+}++ctx.register({+ id: 'prefs',+ area: SIDEBAR_NAV_PREFS_AREA,+ data: { hide: ['cron'], order: ['capabilities', 'new-session'] } satisfies SidebarNavPrefsContribution+})+```++Nav ids are the rows' own ids. Core rows: `new-session`, `capabilities`,+`messaging`, `artifacts`, `cron` (the `SidebarNavId` type; `artifacts` and+`cron` only render in Advanced mode). A contributed row's id is its+`SIDEBAR_NAV_AREA` contribution id.++**Arbitration.** Hidden rows are the **union** of every contribution's `hide`+(no plugin can un-hide another's row; hide beats order). Order is+**first-registered wins**: the first contribution's `order` places its rows,+later contributions place only ids not yet placed, rows no order names keep+their default relative order after the named ones. Unknown ids are inert.++**Teardown.** The contribution lives in the registry, so disabling or reloading+the plugin disposes it and the rows come straight back — nothing to clear.+This is why it is not a `host.sidebar.hide()` verb: `host` is a singleton that+cannot attribute a write, a persisted preference would outlive the plugin, and+two plugins would overwrite each other's order.++**Persisting the user's choice** is the plugin's job, in its own+`ctx.storage`: read the saved prefs on `register`, contribute them, and on every+edit save + dispose + re-contribute (re-registering the same `id` replaces it).++```ts+// sidebar-manager: replaces `[data-sbm-off] { display:none }` + re-parenting <li>s+let dispose = () => {}+const apply = (prefs: SidebarNavPrefsContribution) => {+ dispose()+ dispose = ctx.register({ id: 'prefs', area: SIDEBAR_NAV_PREFS_AREA, data: prefs })+}+apply(ctx.storage.get('navPrefs', {}))+// in the editor's onChange:+ctx.storage.set('navPrefs', next); apply(next)+```++Session sections (Pinned, Recents, Cron jobs) are not covered — nav rows only.+## Host APIEverything on `host` is reachable from anywhere in a plugin. State atoms are@@ -702,9 +760,6 @@ host.sessions.pin(storedSessionId, pinned?, index?) // pin/unpin (default pinnehost.sessions.reorder(ids) // replace the manual Recents order (what a drag persists); [] resetshost.sessions.reorderPinned(ids) // permute the Pinned section (the pinned drag path)host.sessions.setColor(storedSessionId, color | null) // per-session colour override; null clears-host.sidebar.hide(navId, hidden?) // hide/show a sidebar nav row (built-in or contributed)-host.sidebar.setOrder(ids) // nav rows in `ids` order first; unnamed rows keep- // their default order after them````host.request` is the same JSON-RPC the app itself uses (sessions, config, skills,@@ -1206,8 +1261,8 @@ pipeline as a trust boundary.|----------|---------|| Host | `host` (`.state.*`, `.settings`, `.notify`, `.notifyError`, `.navigate`, `.onEvent`, `.logs`, `.status`, `.restartGateway`, `.request`, `.composer`, `.sessions`) || Plugin contract | `HermesPlugin`, `PluginContext`, `PluginContribution`, `PluginStorage`, `PluginOs`, `PluginRestOptions`, `PluginNativeNotificationInput`, `PluginNotificationAction`, `HermesOpenTarget`, `Contribution` |-| Area constants | `PANES_AREA`, `ROUTES_AREA`, `SIDEBAR_NAV_AREA`, `STATUSBAR_AREAS`, `TITLEBAR_AREAS`, `WORKSPACE_PAGE_HEADER_AREA`, `PALETTE_AREA`, `KEYBINDS_AREA`, `THEMES_AREA`, `COMPOSER_AREAS`, `SESSION_ROW_AREAS` |-| Area payloads | `RouteContribution`, `SidebarNavContribution`, `StatusbarItem`, `TitlebarTool`, `PaletteContribution`, `KeybindContribution`, `ComposerMiddleware`, `ComposerAttachmentProvider`, `SessionRowSlotContribution` |+| Area constants | `PANES_AREA`, `ROUTES_AREA`, `SIDEBAR_NAV_AREA`, `STATUSBAR_AREAS`, `TITLEBAR_AREAS`, `WORKSPACE_PAGE_HEADER_AREA`, `PALETTE_AREA`, `KEYBINDS_AREA`, `THEMES_AREA`, `COMPOSER_AREAS`, `SESSION_ROW_AREAS`, `SIDEBAR_NAV_PREFS_AREA` |+| Area payloads | `RouteContribution`, `SidebarNavContribution`, `StatusbarItem`, `TitlebarTool`, `PaletteContribution`, `KeybindContribution`, `ComposerMiddleware`, `ComposerAttachmentProvider`, `SessionRowSlotContribution`, `SidebarNavPrefsContribution` || React / state | `useValue`, `atom`, `computed`, `useQuery`, `useMutation`, `useQueryClient`, `queryClient`, `Contribute` || Theming | `useTheme`, `requestTheme`, `setAccentOverride`, `$accentOverride`, `retintTheme`, `themeHue`, `DesktopTheme`, `DesktopThemeColors`, plus OKLCH math (`hexToOklch`, `oklchToHex`, `oklchToSrgb255`, `mixOklab`, `maxChroma`, `hueDelta`, `normalizeHex`) and sRGB measures (`contrastRatio` — `number | null`, null for unparseable input — `readableOn`) || UI kit | `Button`, `Input`, `Textarea`, `Select*`, `Switch`, `Checkbox`, `SegmentedControl`, `Tabs*`, `Dialog*`, `ConfirmDialog`, `DropdownMenu*`, `ContextMenu*`, `Popover*`, `Tip`/`Tooltip*`, `Badge`, `Kbd`/`KbdGroup`, `SearchField`, `ScrollArea`, `Separator`, `Skeleton`, `GlyphSpinner`, `Loader`, `EmptyState`, `ErrorState`, `CopyButton`, `StatusDot`, `LogView`, `Codicon`, `DecodeText` |