From c3e183da48cc6c807b301a25c91fc0eaaec89a14 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 2 Jul 2026 10:44:51 -0400 Subject: feat(theme-studio): register the ai-term agent-color faces The nine ai-term faces (the bypass-banner accent plus one per Claude Code /color name) join the studio as a bespoke app, seeded with their dupre hues. The preview mirrors what they paint: the banner line and a mock input box per session color. Tuning one here recolors live agents on their next redraw. --- scripts/theme-studio/app.js | 2 +- scripts/theme-studio/face_data.py | 23 +++++++++++++++++++++++ scripts/theme-studio/previews.js | 13 +++++++++++++ scripts/theme-studio/theme-studio.html | 17 +++++++++++++++-- 4 files changed, 52 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/theme-studio/app.js b/scripts/theme-studio/app.js index 75ff9f58..7f846e6c 100644 --- a/scripts/theme-studio/app.js +++ b/scripts/theme-studio/app.js @@ -561,7 +561,7 @@ const PACKAGE_PREVIEWS={ org:renderOrgPreview,magit:renderMagitPreview,elfeed:renderElfeedPreview,eat:renderEatPreview, dashboard:renderDashboardPreview,mu4e:renderMu4ePreview,gnus:renderGnusPreview,orgfaces:renderOrgFacesPreview,lsp:renderLspPreview,gitgutter:renderGitGutterPreview, flycheck:renderFlycheckPreview,dired:renderDiredPreview,dirvish:renderDirvishPreview,calibredb:renderCalibredbPreview, - novreading:renderNovReadingPreview, + novreading:renderNovReadingPreview,aiterm:renderAiTermPreview, erc:renderErcPreview,orgdrill:renderOrgdrillPreview,orgnoter:renderOrgnoterPreview,signel:renderSignelPreview, pearl:renderPearlPreview,slack:renderSlackPreview,telega:renderTelegaPreview,shr:renderShrPreview, nerdicons:renderNerdIconsPreview diff --git a/scripts/theme-studio/face_data.py b/scripts/theme-studio/face_data.py index 3eb471d7..e2fa7c1d 100644 --- a/scripts/theme-studio/face_data.py +++ b/scripts/theme-studio/face_data.py @@ -361,6 +361,27 @@ NOV_READING_SEED={ "cj/nov-reading-light-heading":{"fg":"#5a3d28"}, "cj/nov-reading-light-link":{"fg":"#8a5a2a","underline":True}} +# ai-term: the dupre renderings of Claude Code's session colors inside agent +# terminals (config faces, not a package). The accent face carries the fixed +# bypass-permissions banner; the eight color faces carry the /color session +# accents. ai-term points each terminal's xterm-256 palette entries at these +# (cj/ai-term-palette-faces), so tuning one here recolors live agents on their +# next redraw. Seeded with the deffaces' dupre hexes. +AI_TERM_FACES=("cj/ai-term-accent " + "cj/ai-term-color-red cj/ai-term-color-blue cj/ai-term-color-green " + "cj/ai-term-color-yellow cj/ai-term-color-purple cj/ai-term-color-orange " + "cj/ai-term-color-pink cj/ai-term-color-cyan").split() +AI_TERM_SEED={ + "cj/ai-term-accent":{"fg":"#67809c"}, + "cj/ai-term-color-red":{"fg":"#d47c59"}, + "cj/ai-term-color-blue":{"fg":"#67809c"}, + "cj/ai-term-color-green":{"fg":"#a4ac64"}, + "cj/ai-term-color-yellow":{"fg":"#d7af5f"}, + "cj/ai-term-color-purple":{"fg":"#b294bb"}, + "cj/ai-term-color-orange":{"fg":"#edb08f"}, + "cj/ai-term-color-pink":{"fg":"#c397d8"}, + "cj/ai-term-color-cyan":{"fg":"#8a9496"}} + # The bespoke package apps, single-sourced here. Each row is # (key, label, preview, FACES, prefix, SEED); add an app by adding one row. # generate.py builds APPS from this, and app_inventory derives the set of @@ -383,6 +404,7 @@ BESPOKE_APP_SPECS=[ ("dirvish","dirvish","dirvish",DIRVISH_FACES,"dirvish-",DIRVISH_SEED), ("calibredb","calibredb","calibredb",CALIBREDB_FACES,"calibredb-",CALIBREDB_SEED), ("nov-reading","nov reading view","novreading",NOV_READING_FACES,"cj/nov-reading-",NOV_READING_SEED), + ("ai-term","ai-term agent colors","aiterm",AI_TERM_FACES,"cj/ai-term-",AI_TERM_SEED), ("erc","erc","erc",ERC_FACES,"erc-",ERC_SEED), ("org-drill","org-drill","orgdrill",ORGDRILL_FACES,"org-drill-",ORGDRILL_SEED), ("org-noter","org-noter","orgnoter",ORGNOTER_FACES,"org-noter-",ORGNOTER_SEED), @@ -401,4 +423,5 @@ APP_HOVERS={ "shr":"Simple HTML Renderer. Reused by eww, nov (epub reading), and mu4e / message for HTML mail.", "gnus":"Article-view faces, reused by mu4e's article view.", "dired":"Directory-listing faces, reused by dirvish (a dired frontend).", + "ai-term":"Claude Code accents in agent terminals: the fixed bypass banner (accent) plus one face per /color session color. ai-term repaints each agent's xterm-256 palette entries with these, so a tune here recolors live agents on their next redraw.", } diff --git a/scripts/theme-studio/previews.js b/scripts/theme-studio/previews.js index 658da370..378d550a 100644 --- a/scripts/theme-studio/previews.js +++ b/scripts/theme-studio/previews.js @@ -500,6 +500,19 @@ function renderNovReadingPreview(){ let h='
'; for(const row of base)h+=novReadingPage(a,row[0],row[1]); return h+'
';} +function renderAiTermPreview(){const a='ai-term',L=[]; + // What these faces actually paint: the Claude Code TUI inside an agent + // terminal. The banner is the fixed accent (every session); each /color + // session color draws the input-box rules and prompt. + L.push(os(a,'cj/ai-term-accent','⏵⏵ bypass permissions on (shift+tab to cycle)')+' · the fixed banner, every agent'); + const names=['red','blue','green','yellow','purple','orange','pink','cyan']; + for(const n of names){ + L.push(''); + L.push(os(a,'cj/ai-term-color-'+n,'──────────────────────────────────────────')+' /color '+n); + L.push(os(a,'cj/ai-term-color-'+n,'❯')+' implement the feature, then run the tests'); + L.push(os(a,'cj/ai-term-color-'+n,'──────────────────────────────────────────')); + } + return previewLines(L);} function renderSlackPreview(){const a='slack',L=[]; L.push(os(a,'slack-room-info-title-room-name-face','#general')+' '+os(a,'slack-room-info-title-face','Acme Workspace')); L.push(os(a,'slack-room-info-section-title-face','Topic')+' '+os(a,'slack-room-info-section-label-face','daily standup')+' '+os(a,'slack-room-unread-face','3 unread')); diff --git a/scripts/theme-studio/theme-studio.html b/scripts/theme-studio/theme-studio.html index 3b8d4b90..8cb6cc02 100644 --- a/scripts/theme-studio/theme-studio.html +++ b/scripts/theme-studio/theme-studio.html @@ -297,7 +297,7 @@