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": "light",
"vars": {
"darkCyan": "#008899",
"darkBlue": "#0066cc",
"darkGreen": "#008800",
"darkRed": "#cc0000",
"darkYellow": "#aa8800",
"mediumGray": 242,
"lightGray": 250,
"userMsgBg": "#e8e8e8",
"toolPendingBg": "#e8e8f0",
"toolSuccessBg": "#e8f0e8",
"toolErrorBg": "#f0e8e8"
},
"colors": {
"accent": "darkCyan",
"border": "darkBlue",
"borderAccent": "darkCyan",
"borderMuted": "lightGray",
"success": "darkGreen",
"error": "darkRed",
"warning": "darkYellow",
"muted": "mediumGray",
"text": "",
"userMessageBg": "userMsgBg",
"userMessageText": "",
"toolPendingBg": "toolPendingBg",
"toolSuccessBg": "toolSuccessBg",
"toolErrorBg": "toolErrorBg",
"toolText": "",
"mdHeading": "darkCyan",
"mdLink": "darkBlue",
"mdCode": "darkCyan",
"mdCodeBlock": "",
"mdCodeBlockBorder": "mediumGray",
"mdQuote": "mediumGray",
"mdQuoteBorder": "mediumGray",
"mdHr": "mediumGray",
"mdListBullet": "darkCyan",
"toolDiffAdded": "darkGreen",
"toolDiffRemoved": "darkRed",
"toolDiffContext": "mediumGray",
"syntaxComment": "mediumGray",
"syntaxKeyword": "darkCyan",
"syntaxFunction": "darkBlue",
"syntaxVariable": "",
"syntaxString": "darkGreen",
"syntaxNumber": "darkYellow",
"syntaxType": "darkCyan",
"syntaxOperator": "",
"syntaxPunctuation": "mediumGray"
}
}