WIP: Add theming system with /theme command

- Consolidated theme system into single src/theme/ directory
- Created Theme class with fg(), bg(), bold(), italic(), underline()
- Added dark and light built-in themes with 36 color tokens
- Support for custom themes in ~/.pi/agent/themes/*.json
- JSON schema for theme validation
- Theme selector UI with /theme command
- Save theme preference to settings
- Uses chalk for text formatting to preserve colors

TODO:
- Replace hardcoded colors throughout TUI components
- Apply markdown theming to Markdown components
- Add theme support to all TUI elements
This commit is contained in:
Mario Zechner 2025-11-20 23:16:05 +01:00
parent 93a60b7969
commit cc88095140
13 changed files with 937 additions and 11 deletions

View file

@ -0,0 +1,59 @@
{
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/theme-schema.json",
"name": "dark",
"vars": {
"cyan": "#00d7ff",
"blue": "#0087ff",
"green": "#00ff00",
"red": "#ff0000",
"yellow": "#ffff00",
"gray": 242,
"darkGray": 238,
"userMsgBg": "#343541",
"toolPendingBg": "#282832",
"toolSuccessBg": "#283228",
"toolErrorBg": "#3c2828"
},
"colors": {
"accent": "cyan",
"border": "blue",
"borderAccent": "cyan",
"borderMuted": "darkGray",
"success": "green",
"error": "red",
"warning": "yellow",
"muted": "gray",
"text": "",
"userMessageBg": "userMsgBg",
"userMessageText": "",
"toolPendingBg": "toolPendingBg",
"toolSuccessBg": "toolSuccessBg",
"toolErrorBg": "toolErrorBg",
"toolText": "",
"mdHeading": "cyan",
"mdLink": "blue",
"mdCode": "cyan",
"mdCodeBlock": "",
"mdCodeBlockBorder": "gray",
"mdQuote": "gray",
"mdQuoteBorder": "gray",
"mdHr": "gray",
"mdListBullet": "cyan",
"toolDiffAdded": "green",
"toolDiffRemoved": "red",
"toolDiffContext": "gray",
"syntaxComment": "gray",
"syntaxKeyword": "cyan",
"syntaxFunction": "blue",
"syntaxVariable": "",
"syntaxString": "green",
"syntaxNumber": "yellow",
"syntaxType": "cyan",
"syntaxOperator": "",
"syntaxPunctuation": "gray"
}
}