lumira 0.6.2 → 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/LICENSE +21 -0
- package/README.md +158 -82
- package/dist/themes/catppuccin.d.ts +3 -0
- package/dist/themes/catppuccin.js +26 -0
- package/dist/themes/catppuccin.js.map +1 -0
- package/dist/themes/dracula.d.ts +3 -0
- package/dist/themes/dracula.js +26 -0
- package/dist/themes/dracula.js.map +1 -0
- package/dist/themes/gruvbox.d.ts +3 -0
- package/dist/themes/gruvbox.js +26 -0
- package/dist/themes/gruvbox.js.map +1 -0
- package/dist/themes/index.d.ts +17 -0
- package/dist/themes/index.js +64 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/monokai.d.ts +3 -0
- package/dist/themes/monokai.js +26 -0
- package/dist/themes/monokai.js.map +1 -0
- package/dist/themes/nord.d.ts +3 -0
- package/dist/themes/nord.js +26 -0
- package/dist/themes/nord.js.map +1 -0
- package/dist/themes/solarized.d.ts +3 -0
- package/dist/themes/solarized.js +26 -0
- package/dist/themes/solarized.js.map +1 -0
- package/dist/themes/tokyo-night.d.ts +3 -0
- package/dist/themes/tokyo-night.js +26 -0
- package/dist/themes/tokyo-night.js.map +1 -0
- package/dist/themes/types.d.ts +46 -0
- package/dist/themes/types.js +2 -0
- package/dist/themes/types.js.map +1 -0
- package/dist/themes/util.d.ts +19 -0
- package/dist/themes/util.js +93 -0
- package/dist/themes/util.js.map +1 -0
- package/dist/themes.d.ts +1 -52
- package/dist/themes.js +5 -263
- package/dist/themes.js.map +1 -1
- package/package.json +6 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Carlos Cativo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,41 +2,99 @@
|
|
|
2
2
|
|
|
3
3
|
Real-time statusline plugin for [Claude Code](https://code.claude.com) and Qwen Code.
|
|
4
4
|
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
[](https://asciinema.org/a/apvjkloigO9hrdVA)
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx lumira install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Interactive wizard — preset, theme, icons — previewed live before write.
|
|
16
|
+
|
|
17
|
+
[](https://www.npmjs.com/package/lumira)
|
|
18
|
+
[](https://www.npmjs.com/package/lumira)
|
|
19
|
+
[](LICENSE)
|
|
20
|
+

|
|
5
21
|

|
|
22
|
+

|
|
23
|
+
[](https://github.com/cativo23/lumira/actions/workflows/ci.yml)
|
|
6
24
|

|
|
7
25
|

|
|
8
|
-
|
|
9
|
-
|
|
26
|
+
|
|
27
|
+
> 🚀 Powering hundreds of Claude Code sessions per week — [share yours](https://github.com/cativo23/lumira/discussions) in Discussions.
|
|
28
|
+
|
|
29
|
+
## Table of contents
|
|
30
|
+
|
|
31
|
+
- [Why lumira?](#why-lumira)
|
|
32
|
+
- [Requirements](#requirements)
|
|
33
|
+
- [Features](#features)
|
|
34
|
+
- [Install](#install)
|
|
35
|
+
- [Display modes](#display)
|
|
36
|
+
- [Themes](#themes)
|
|
37
|
+
- [Powerline](#powerline)
|
|
38
|
+
- [Configuration](#configuration)
|
|
39
|
+
- [Architecture](#architecture)
|
|
40
|
+
- [Development](#development)
|
|
41
|
+
- [Contributing](#contributing)
|
|
42
|
+
- [License](#license)
|
|
43
|
+
|
|
44
|
+
## Why lumira?
|
|
45
|
+
|
|
46
|
+
Claude Code's default statusline shows the model name and current directory. That's it. Lumira surfaces what actually changes during a session and what you'd want to react to:
|
|
47
|
+
|
|
48
|
+
- **Context-window pressure** — color-coded bar from green to blinking red, with a `/compact?` hint at high fill so you act before hitting the wall.
|
|
49
|
+
- **Burn rate** — `$/h` next to total cost, so a runaway agent shows up immediately.
|
|
50
|
+
- **Rate-limit countdown** — 5h/7d usage with reset countdown, so you stop guessing how much budget you have left.
|
|
51
|
+
- **Active tools, agents, and todo progress** — parsed from the live transcript, updated every render.
|
|
52
|
+
- **Cross-platform** — same config drives Claude Code and Qwen Code; Qwen sessions auto-collapse to single-line.
|
|
53
|
+
|
|
54
|
+
Inspired by [claude-hud](https://github.com/jarrodwatts/claude-hud); takes a different stance on opt-in powerline rendering, theme contrast guarantees, and hyperlinked metadata.
|
|
55
|
+
|
|
56
|
+
## Requirements
|
|
57
|
+
|
|
58
|
+
- **Node ≥18**
|
|
59
|
+
- **Nerd Font** (recommended) — for the `` `` `` `` ``◐`` icons throughout the statusline. Falls back to plain glyphs via `icons: emoji` or `icons: none`.
|
|
60
|
+
- **Truecolor terminal** (for themes / powerline) — auto-detected via `COLORTERM=truecolor`. 256-color terminals get a nearest-index projection; named-ANSI terminals fall back to default colors silently.
|
|
10
61
|
|
|
11
62
|
## Features
|
|
12
63
|
|
|
13
|
-
- **
|
|
14
|
-
- **Powerline mode**
|
|
15
|
-
- **OSC 8 hyperlinks** — clickable directory
|
|
16
|
-
- **7
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
64
|
+
- **Context bar with thresholds** — green → yellow → orange → blinking red, plus an actionable `/compact?` hint when fill is high.
|
|
65
|
+
- **Powerline mode** + 7 separator presets (`arrow`, `flame`, `slant`, `round`, `diamond`, `compatible`, `plain`) across 3 lines.
|
|
66
|
+
- **OSC 8 hyperlinks** — clickable directory and version tag on iTerm2, WezTerm, Kitty, VS Code, Alacritty.
|
|
67
|
+
- **7 hand-curated themes** — `dracula`, `nord`, `tokyo-night`, `catppuccin`, `monokai`, `gruvbox`, `solarized`. WCAG AA contrast guaranteed in CI.
|
|
68
|
+
- **Token + cost metrics** — input/output counts, speed (tok/s), $ total + burn rate ($/h).
|
|
69
|
+
- **Auto-fits at <70 cols** — switches from 3-line custom mode to single-line minimal automatically.
|
|
70
|
+
- **Zero runtime dependencies** — Node 18+ only.
|
|
71
|
+
- **Dual-platform** — Claude Code and Qwen Code share the same config.
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary>Everything else lumira shows</summary>
|
|
75
|
+
|
|
76
|
+
- **Git status** — branch + staged/modified/untracked counts, 5s TTL cache. Branch turns red on dirty repos in powerline mode.
|
|
77
|
+
- **Rate limits** — 5h/7d usage with color warnings and reset countdown.
|
|
78
|
+
- **Active agents** — running subagent count and types from the transcript.
|
|
79
|
+
- **GSD integration** — current task and update notifications (opt-in).
|
|
80
|
+
- **Config health widget** — surfaces silent fallbacks (theme/powerline degrading in named-ANSI, missing GSD STATE.md). Opt-in.
|
|
81
|
+
- **Memory usage** — process RSS percentage.
|
|
82
|
+
- **MCP server detection** — count of attached MCP servers per session.
|
|
83
|
+
- **Vim-mode hint, thinking effort, worktree, output style, session name** — all togglable per-field via `display.*`.
|
|
84
|
+
- **3-tier color system** — named ANSI / 256-color / truecolor, auto-detected.
|
|
85
|
+
- **Config-driven** — every feature toggleable via JSON config + CLI flags.
|
|
86
|
+
|
|
87
|
+
</details>
|
|
30
88
|
|
|
31
89
|
## Install
|
|
32
90
|
|
|
33
|
-
|
|
91
|
+
The wizard at the top is the fastest path. For the long form:
|
|
34
92
|
|
|
35
93
|
```bash
|
|
36
94
|
npx lumira install
|
|
37
95
|
```
|
|
38
96
|
|
|
39
|
-
The installer walks you through three choices — **preset** (`full` / `balanced` / `minimal`), **theme**, and **icons** — showing a live preview
|
|
97
|
+
The installer walks you through three choices — **preset** (`full` / `balanced` / `minimal`), **theme**, and **icons** — showing a live preview at each step. Press `Esc` to abort without writing anything. In non-interactive shells (piped stdin, CI), the installer skips the wizard and writes sensible defaults (`preset: balanced`, `icons: nerd`). If Qwen Code is detected (`~/.qwen/` exists), the `/lumira` skill is installed for both CLIs.
|
|
40
98
|
|
|
41
99
|
Or install globally:
|
|
42
100
|
|
|
@@ -73,7 +131,7 @@ If installed from source:
|
|
|
73
131
|
{
|
|
74
132
|
"statusLine": {
|
|
75
133
|
"type": "command",
|
|
76
|
-
"command": "node /path/to/
|
|
134
|
+
"command": "node /path/to/lumira/dist/index.js",
|
|
77
135
|
"padding": 0
|
|
78
136
|
}
|
|
79
137
|
}
|
|
@@ -83,27 +141,78 @@ If installed from source:
|
|
|
83
141
|
|
|
84
142
|
### Custom Mode (default, >=70 columns)
|
|
85
143
|
|
|
86
|
-
|
|
87
|
-
Opus 4.6 (1M context) │ main ⇡1 !2 │ my-project +150 -30 │ default │ v2.1.92
|
|
88
|
-
[████████░░░░░░░░░░░░] 21% │ 131k↑ 25k↓ │ $1.31 $2.24/h │ 35m06s │ 142 tok/s │ 72%(5h)
|
|
89
|
-
✓ Read ×3 | ✓ Edit ×2 | ✓ Bash ×5 │ ████████░░ 8/10 | ◐ 1 | ○ 1
|
|
90
|
-
```
|
|
144
|
+

|
|
91
145
|
|
|
92
146
|
### Minimal Mode (<70 columns or `--minimal`)
|
|
93
147
|
|
|
94
|
-
|
|
95
|
-
my-project | main | Opus 4.6 | ████░░░░░░░░░░░░░░░░ 21% | 131k↑ 25k↓ | $1.31
|
|
96
|
-
```
|
|
148
|
+

|
|
97
149
|
|
|
98
150
|
### Powerline Mode (opt-in via `style: "powerline"`)
|
|
99
151
|
|
|
152
|
+

|
|
153
|
+
|
|
154
|
+
Each segment renders with a distinct background color drawn from the active theme; segments are separated by a Nerd Font glyph (default ``). On dirty git repos the branch segment turns red. Falls back to classic mode silently in named-ANSI terminals (powerline needs RGB backgrounds). See [Powerline](#powerline) below for the 7 separator styles.
|
|
155
|
+
|
|
156
|
+
## Themes
|
|
157
|
+
|
|
158
|
+
Seven hand-curated themes, every one tested for WCAG AA contrast against white foreground in CI. Themes apply to both classic and powerline modes:
|
|
159
|
+
|
|
160
|
+
`dracula` · `nord` · `tokyo-night` · `catppuccin` · `monokai` · `gruvbox` · `solarized`
|
|
161
|
+
|
|
162
|
+
**Classic mode** — pipe-separated layout, theme colors applied to text:
|
|
163
|
+
|
|
164
|
+

|
|
165
|
+
|
|
166
|
+
**Powerline mode** — colored segment backgrounds with arrow separators:
|
|
167
|
+
|
|
168
|
+

|
|
169
|
+
|
|
170
|
+
Themes apply in truecolor and 256-color terminals; named-ANSI terminals fall back to default colors (8 base hues can't represent arbitrary palettes).
|
|
171
|
+
|
|
172
|
+
### Browse from the CLI
|
|
173
|
+
|
|
174
|
+
Try a theme without touching your config:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
lumira themes # list all themes
|
|
178
|
+
lumira themes preview tokyo-night # render a sample
|
|
179
|
+
lumira themes preview nord --powerline # same in powerline (default arrow separator)
|
|
180
|
+
lumira themes preview gruvbox --style=flame # powerline with flame separator
|
|
181
|
+
lumira themes preview --all # render every theme in sequence
|
|
182
|
+
lumira themes preview --all --powerline # the powerline grid (great for screenshots)
|
|
100
183
|
```
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
184
|
+
|
|
185
|
+
### Want your favorite theme?
|
|
186
|
+
|
|
187
|
+
Adding a theme is a single new file plus a one-line registration. Every PR runs the **WCAG AA contrast guard** — if any powerline cell drops below 4.5:1 against the foreground, CI rejects it. See [CONTRIBUTING.md → Adding a theme](CONTRIBUTING.md#adding-a-theme) for the walkthrough.
|
|
188
|
+
|
|
189
|
+
## Powerline
|
|
190
|
+
|
|
191
|
+
`style: "powerline"` (or `--powerline`) renders the statusline with colored segment backgrounds and glyph separators inspired by powerline-go / oh-my-posh. Available separator presets via `powerline.style` (or `--powerline-style=<name>`):
|
|
192
|
+
|
|
193
|
+
| Style | Look |
|
|
194
|
+
|---|---|
|
|
195
|
+
| `arrow` | classic right-pointing triangle separator (default) |
|
|
196
|
+
| `flame` | wavy flame-shaped separator |
|
|
197
|
+
| `slant` | forward-slanting separator |
|
|
198
|
+
| `round` | rounded caps at line ends + thin internal separators |
|
|
199
|
+
| `diamond` | each segment isolated as its own pill with rounded caps |
|
|
200
|
+
| `compatible` | unicode `▶` separator (no Nerd Font required) |
|
|
201
|
+
| `plain` | no separator glyphs — just colored blocks |
|
|
202
|
+
| `auto` | picks `arrow` if Nerd Font icons are configured, else `compatible` |
|
|
203
|
+
|
|
204
|
+
### Hyperlinks (OSC 8)
|
|
205
|
+
|
|
206
|
+
The directory on line 1 becomes a clickable `file://` link, and the version tag links to its npm release page on terminals that support [OSC 8](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) (iTerm2, WezTerm, Kitty, Alacritty, VS Code terminal, tmux ≥3.4 with passthrough). Other terminals show plain text. Auto-disabled in `Apple_Terminal` (which leaks markers) and `TERM=dumb`.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
NO_HYPERLINKS=1 claude # disable
|
|
210
|
+
FORCE_HYPERLINK=1 claude # force-enable (overrides denylist)
|
|
104
211
|
```
|
|
105
212
|
|
|
106
|
-
|
|
213
|
+
### Qwen Code
|
|
214
|
+
|
|
215
|
+
Lumira auto-detects the platform. In Qwen Code sessions, the renderer automatically switches to single-line output regardless of your configured layout — Qwen only displays the first statusline row, so lumira fits everything (model, branch, context bar, cost, cached tokens, thoughts) into one line. **No configuration needed:** the same `config.json` serves both Claude Code and Qwen Code.
|
|
107
216
|
|
|
108
217
|
## Configuration
|
|
109
218
|
|
|
@@ -165,53 +274,6 @@ lumira --icons=nerd|emoji|none # Override icon set
|
|
|
165
274
|
lumira --preset=full|balanced|minimal
|
|
166
275
|
```
|
|
167
276
|
|
|
168
|
-
## Powerline
|
|
169
|
-
|
|
170
|
-
`style: "powerline"` (or `--powerline`) renders the statusline with colored segment backgrounds and glyph separators inspired by powerline-go / oh-my-posh. Available separator presets via `powerline.style` (or `--powerline-style=<name>`):
|
|
171
|
-
|
|
172
|
-
| Style | Look |
|
|
173
|
-
|---|---|
|
|
174
|
-
| `arrow` | classic right-pointing triangle separator (default) |
|
|
175
|
-
| `flame` | wavy flame-shaped separator |
|
|
176
|
-
| `slant` | forward-slanting separator |
|
|
177
|
-
| `round` | rounded caps at line ends + thin internal separators |
|
|
178
|
-
| `diamond` | each segment isolated as its own pill with rounded caps |
|
|
179
|
-
| `compatible` | unicode `▶` separator (no Nerd Font required) |
|
|
180
|
-
| `plain` | no separator glyphs — just colored blocks |
|
|
181
|
-
| `auto` | picks `arrow` if Nerd Font icons are configured, else `compatible` |
|
|
182
|
-
|
|
183
|
-
### Themes
|
|
184
|
-
|
|
185
|
-
Pick one of the 7 built-in themes via `theme: "<name>"` in config or during `lumira install`:
|
|
186
|
-
|
|
187
|
-
`dracula` · `nord` · `tokyo-night` · `catppuccin` · `monokai` · `gruvbox` · `solarized`
|
|
188
|
-
|
|
189
|
-
Each theme ships with a hand-curated **powerline palette** (per-segment background colors) that meets WCAG AA contrast for white foreground. Themes apply in truecolor and 256-color terminals; named-ANSI terminals fall back to default colors (8 base hues can't represent arbitrary palettes).
|
|
190
|
-
|
|
191
|
-
You can browse and preview themes from the CLI without touching your config:
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
lumira themes # list all themes with one-line descriptions
|
|
195
|
-
lumira themes preview dracula # render a sample with the dracula theme
|
|
196
|
-
lumira themes preview nord --powerline # same in powerline style (default arrow separator)
|
|
197
|
-
lumira themes preview gruvbox --style=flame # powerline with the flame separator
|
|
198
|
-
lumira themes preview --all # render every theme in sequence
|
|
199
|
-
lumira themes preview --all --powerline # the powerline grid (great for screenshots)
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Hyperlinks (OSC 8)
|
|
203
|
-
|
|
204
|
-
The directory on line 1 becomes a clickable `file://` link, and the version tag links to its npm release page on terminals that support [OSC 8](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) (iTerm2, WezTerm, Kitty, Alacritty, VS Code terminal, tmux ≥3.4 with passthrough). Other terminals show plain text. Auto-disabled in `Apple_Terminal` (which leaks markers) and `TERM=dumb`.
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
NO_HYPERLINKS=1 claude # disable
|
|
208
|
-
FORCE_HYPERLINK=1 claude # force-enable (overrides denylist)
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Qwen Code
|
|
212
|
-
|
|
213
|
-
Lumira auto-detects the platform. In Qwen Code sessions, the renderer automatically switches to single-line output regardless of your configured layout — Qwen only displays the first statusline row, so lumira fits everything (model, branch, context bar, cost, cached tokens, thoughts) into one line. **No configuration needed:** the same `config.json` serves both Claude Code and Qwen Code.
|
|
214
|
-
|
|
215
277
|
## Architecture
|
|
216
278
|
|
|
217
279
|
```text
|
|
@@ -246,10 +308,24 @@ Set `LUMIRA_DEBUG=1` to trace parser decisions on stderr — cache hits, GSD sta
|
|
|
246
308
|
LUMIRA_DEBUG=1 claude # or export LUMIRA_DEBUG=1
|
|
247
309
|
```
|
|
248
310
|
|
|
311
|
+
## Contributing
|
|
312
|
+
|
|
313
|
+
PRs welcome — particularly for new themes (one of the most common contribution paths). See [CONTRIBUTING.md](CONTRIBUTING.md) for the gitflow, theme submission walkthrough, and the contrast-guard CI step that runs on every theme PR.
|
|
314
|
+
|
|
315
|
+
### What's next
|
|
316
|
+
|
|
317
|
+
- **v0.7.0** — additional themes from the community, expanded `lumira themes` subcommand surface.
|
|
318
|
+
- **v1.0** — locked CLI flags surface, snapshot tests for layout regression, soak window before tagging stable. Tracked in [issue #36](https://github.com/cativo23/lumira/issues/36).
|
|
319
|
+
- **Backlog** — incremental transcript parsing for very large sessions ([PR #46](https://github.com/cativo23/lumira/pull/46), deferred until parser hardening lands).
|
|
320
|
+
|
|
321
|
+
For security issues, see [SECURITY.md](SECURITY.md).
|
|
322
|
+
|
|
249
323
|
## Credits
|
|
250
324
|
|
|
251
325
|
Inspired by [claude-hud](https://github.com/jarrodwatts/claude-hud). Migrated from [claude-setup](https://github.com/cativo23/claude-setup) statusline.
|
|
252
326
|
|
|
327
|
+
Theme palettes drawn from upstream specs: [Dracula](https://draculatheme.com), [Nord](https://www.nordtheme.com), [Tokyo Night](https://github.com/folke/tokyonight.nvim), [Catppuccin](https://catppuccin.com), [Monokai](https://monokai.pro), [Gruvbox](https://github.com/morhetz/gruvbox), [Solarized](https://ethanschoonover.com/solarized).
|
|
328
|
+
|
|
253
329
|
## License
|
|
254
330
|
|
|
255
|
-
MIT
|
|
331
|
+
MIT © [Carlos Cativo](https://github.com/cativo23) — see [LICENSE](LICENSE) for the full text.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgb, WHITE } from './util.js';
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'catppuccin',
|
|
4
|
+
mode: 'dark',
|
|
5
|
+
source: 'https://catppuccin.com/palette',
|
|
6
|
+
};
|
|
7
|
+
export const palette = {
|
|
8
|
+
cyan: rgb(137, 220, 235),
|
|
9
|
+
magenta: rgb(245, 194, 231),
|
|
10
|
+
yellow: rgb(249, 226, 175),
|
|
11
|
+
green: rgb(166, 227, 161),
|
|
12
|
+
orange: rgb(250, 179, 135),
|
|
13
|
+
red: rgb(243, 139, 168),
|
|
14
|
+
brightBlue: rgb(137, 180, 250),
|
|
15
|
+
gray: rgb(108, 112, 134),
|
|
16
|
+
powerline: {
|
|
17
|
+
modelBg: { r: 58, g: 98, b: 116 },
|
|
18
|
+
dirBg: { r: 74, g: 90, b: 154 },
|
|
19
|
+
branchCleanBg: { r: 122, g: 90, b: 168 },
|
|
20
|
+
branchDirtyBg: { r: 160, g: 72, b: 86 },
|
|
21
|
+
taskBg: { r: 160, g: 102, b: 58 },
|
|
22
|
+
versionBg: { r: 49, g: 50, b: 68 },
|
|
23
|
+
fg: WHITE,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=catppuccin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catppuccin.js","sourceRoot":"","sources":["../../src/themes/catppuccin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,gCAAgC;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,OAAO,EAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,KAAK,EAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,GAAG,EAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,SAAS,EAAE;QACT,OAAO,EAAQ,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,KAAK,EAAU,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG;QACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,EAAE,EAAE,KAAK;KACV;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgb, WHITE } from './util.js';
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'dracula',
|
|
4
|
+
mode: 'dark',
|
|
5
|
+
source: 'https://draculatheme.com/contribute',
|
|
6
|
+
};
|
|
7
|
+
export const palette = {
|
|
8
|
+
cyan: rgb(139, 233, 253),
|
|
9
|
+
magenta: rgb(255, 121, 198),
|
|
10
|
+
yellow: rgb(241, 250, 140),
|
|
11
|
+
green: rgb(80, 250, 123),
|
|
12
|
+
orange: rgb(255, 184, 108),
|
|
13
|
+
red: rgb(255, 85, 85),
|
|
14
|
+
brightBlue: rgb(189, 147, 249),
|
|
15
|
+
gray: rgb(98, 114, 164),
|
|
16
|
+
powerline: {
|
|
17
|
+
modelBg: { r: 62, g: 90, b: 106 },
|
|
18
|
+
dirBg: { r: 68, g: 71, b: 90 },
|
|
19
|
+
branchCleanBg: { r: 126, g: 61, b: 124 },
|
|
20
|
+
branchDirtyBg: { r: 139, g: 50, b: 50 },
|
|
21
|
+
taskBg: { r: 138, g: 108, b: 42 },
|
|
22
|
+
versionBg: { r: 58, g: 61, b: 74 },
|
|
23
|
+
fg: WHITE,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=dracula.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dracula.js","sourceRoot":"","sources":["../../src/themes/dracula.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,qCAAqC;CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,OAAO,EAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,KAAK,EAAO,GAAG,CAAC,EAAE,EAAG,GAAG,EAAE,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,GAAG,EAAS,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,EAAE,CAAC;IAC7B,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,IAAI,EAAQ,GAAG,CAAC,EAAE,EAAG,GAAG,EAAE,GAAG,CAAC;IAC9B,SAAS,EAAE;QACT,OAAO,EAAQ,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,KAAK,EAAU,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG;QACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,EAAE,EAAE,KAAK;KACV;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgb, WHITE } from './util.js';
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'gruvbox',
|
|
4
|
+
mode: 'dark',
|
|
5
|
+
source: 'https://github.com/morhetz/gruvbox',
|
|
6
|
+
};
|
|
7
|
+
export const palette = {
|
|
8
|
+
cyan: rgb(131, 165, 152),
|
|
9
|
+
magenta: rgb(211, 134, 155),
|
|
10
|
+
yellow: rgb(215, 153, 33),
|
|
11
|
+
green: rgb(152, 151, 26),
|
|
12
|
+
orange: rgb(214, 93, 14),
|
|
13
|
+
red: rgb(204, 36, 29),
|
|
14
|
+
brightBlue: rgb(69, 133, 136),
|
|
15
|
+
gray: rgb(146, 131, 116),
|
|
16
|
+
powerline: {
|
|
17
|
+
modelBg: { r: 60, g: 91, b: 95 },
|
|
18
|
+
dirBg: { r: 80, g: 73, b: 69 },
|
|
19
|
+
branchCleanBg: { r: 131, g: 61, b: 106 },
|
|
20
|
+
branchDirtyBg: { r: 157, g: 43, b: 34 },
|
|
21
|
+
taskBg: { r: 160, g: 104, b: 21 },
|
|
22
|
+
versionBg: { r: 60, g: 56, b: 54 },
|
|
23
|
+
fg: WHITE,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=gruvbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gruvbox.js","sourceRoot":"","sources":["../../src/themes/gruvbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,oCAAoC;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,OAAO,EAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAC7B,KAAK,EAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAC7B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,EAAE,CAAC;IAC7B,GAAG,EAAS,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,EAAE,CAAC;IAC7B,UAAU,EAAE,GAAG,CAAC,EAAE,EAAG,GAAG,EAAE,GAAG,CAAC;IAC9B,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,SAAS,EAAE;QACT,OAAO,EAAQ,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,KAAK,EAAU,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG;QACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,EAAE,EAAE,KAAK;KACV;CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface for the theme system. Re-exports types, utility helpers,
|
|
3
|
+
* and assembles the THEMES registry from per-theme modules. New themes are
|
|
4
|
+
* added by creating a new module here (see CONTRIBUTING.md → "Adding a theme")
|
|
5
|
+
* and registering it in the import block below.
|
|
6
|
+
*/
|
|
7
|
+
import type { ColorMode } from '../render/colors.js';
|
|
8
|
+
import type { ThemePalette, ThemeMetadata } from './types.js';
|
|
9
|
+
export type { ThemePalette, PowerlinePalette, RGB, ThemeMetadata } from './types.js';
|
|
10
|
+
export { rgb, parseRgb, rgbTo256Index, downgradePaletteTo256, derivePowerlinePalette, DEFAULT_POWERLINE_PALETTE, } from './util.js';
|
|
11
|
+
export declare function assertValidRegistry(registry: ReadonlyArray<{
|
|
12
|
+
metadata: ThemeMetadata;
|
|
13
|
+
}>): void;
|
|
14
|
+
export declare const THEMES: Record<string, ThemePalette>;
|
|
15
|
+
export declare const THEME_METADATA: Record<string, ThemeMetadata>;
|
|
16
|
+
export declare function getThemeNames(): string[];
|
|
17
|
+
export declare function resolveTheme(name: string | undefined, mode: ColorMode): ThemePalette | null;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { downgradePaletteTo256 } from './util.js';
|
|
2
|
+
import * as dracula from './dracula.js';
|
|
3
|
+
import * as nord from './nord.js';
|
|
4
|
+
import * as tokyoNight from './tokyo-night.js';
|
|
5
|
+
import * as catppuccin from './catppuccin.js';
|
|
6
|
+
import * as monokai from './monokai.js';
|
|
7
|
+
import * as gruvbox from './gruvbox.js';
|
|
8
|
+
import * as solarized from './solarized.js';
|
|
9
|
+
export { rgb, parseRgb, rgbTo256Index, downgradePaletteTo256, derivePowerlinePalette, DEFAULT_POWERLINE_PALETTE, } from './util.js';
|
|
10
|
+
const REGISTRY = [
|
|
11
|
+
dracula,
|
|
12
|
+
nord,
|
|
13
|
+
tokyoNight,
|
|
14
|
+
catppuccin,
|
|
15
|
+
monokai,
|
|
16
|
+
gruvbox,
|
|
17
|
+
solarized,
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Validate registry shape at module load. Catches contributor-PR mistakes
|
|
21
|
+
* before they pollute the THEMES map: every metadata.name must match
|
|
22
|
+
* lowercase kebab-case and must be unique (resolveTheme lowercases lookups,
|
|
23
|
+
* so "Dracula" + "dracula" both registering would shadow each other).
|
|
24
|
+
*
|
|
25
|
+
* Exported so the same check is unit-testable without booting the registry.
|
|
26
|
+
*/
|
|
27
|
+
const SLUG_RE = /^[a-z0-9][a-z0-9-]*$/;
|
|
28
|
+
export function assertValidRegistry(registry) {
|
|
29
|
+
const seen = new Set();
|
|
30
|
+
for (const t of registry) {
|
|
31
|
+
const name = t.metadata.name;
|
|
32
|
+
if (!SLUG_RE.test(name)) {
|
|
33
|
+
throw new Error(`Invalid theme metadata.name: "${name}". Must be lowercase kebab-case (^[a-z0-9][a-z0-9-]*$).`);
|
|
34
|
+
}
|
|
35
|
+
if (seen.has(name)) {
|
|
36
|
+
throw new Error(`Duplicate theme name in REGISTRY: "${name}". Each theme module must declare a unique metadata.name.`);
|
|
37
|
+
}
|
|
38
|
+
seen.add(name);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
assertValidRegistry(REGISTRY);
|
|
42
|
+
export const THEMES = Object.freeze(Object.fromEntries(REGISTRY.map(t => [t.metadata.name, t.palette])));
|
|
43
|
+
export const THEME_METADATA = Object.freeze(Object.fromEntries(REGISTRY.map(t => [t.metadata.name, t.metadata])));
|
|
44
|
+
export function getThemeNames() {
|
|
45
|
+
return Object.keys(THEMES);
|
|
46
|
+
}
|
|
47
|
+
export function resolveTheme(name, mode) {
|
|
48
|
+
if (!name)
|
|
49
|
+
return null;
|
|
50
|
+
const key = name.toLowerCase();
|
|
51
|
+
// hasOwn guard: a name like `__proto__` or `constructor` would otherwise
|
|
52
|
+
// resolve to `Object.prototype` (truthy), bypass the `!base` check, then
|
|
53
|
+
// crash later when render code reads `.cyan` etc. Reject anything not
|
|
54
|
+
// explicitly in the THEMES map.
|
|
55
|
+
if (!Object.prototype.hasOwnProperty.call(THEMES, key))
|
|
56
|
+
return null;
|
|
57
|
+
const base = THEMES[key];
|
|
58
|
+
if (mode === 'truecolor')
|
|
59
|
+
return base;
|
|
60
|
+
if (mode === '256')
|
|
61
|
+
return downgradePaletteTo256(base);
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,K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CAAC,MAAM,cAAc,GAAkC,MAAM,CAAC,MAAM,CACxE,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACrE,CAAC;AAEF,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAwB,EAAE,IAAe;IACpE,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC/B,yEAAyE;IACzE,yEAAyE;IACzE,sEAAsE;IACtE,gCAAgC;IAChC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IACtC,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgb, WHITE } from './util.js';
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'monokai',
|
|
4
|
+
mode: 'dark',
|
|
5
|
+
source: 'https://monokai.pro/',
|
|
6
|
+
};
|
|
7
|
+
export const palette = {
|
|
8
|
+
cyan: rgb(102, 217, 239),
|
|
9
|
+
magenta: rgb(249, 38, 114),
|
|
10
|
+
yellow: rgb(230, 219, 116),
|
|
11
|
+
green: rgb(166, 226, 46),
|
|
12
|
+
orange: rgb(253, 151, 31),
|
|
13
|
+
red: rgb(249, 38, 114),
|
|
14
|
+
brightBlue: rgb(102, 217, 239),
|
|
15
|
+
gray: rgb(117, 113, 94),
|
|
16
|
+
powerline: {
|
|
17
|
+
modelBg: { r: 42, g: 93, b: 110 },
|
|
18
|
+
dirBg: { r: 73, g: 72, b: 62 },
|
|
19
|
+
branchCleanBg: { r: 140, g: 30, b: 73 },
|
|
20
|
+
branchDirtyBg: { r: 166, g: 56, b: 37 },
|
|
21
|
+
taskBg: { r: 133, g: 107, b: 42 },
|
|
22
|
+
versionBg: { r: 39, g: 40, b: 34 },
|
|
23
|
+
fg: WHITE,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=monokai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monokai.js","sourceRoot":"","sources":["../../src/themes/monokai.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,sBAAsB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,OAAO,EAAK,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,KAAK,EAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAC7B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAC7B,GAAG,EAAS,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,GAAG,CAAC;IAC9B,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAC7B,SAAS,EAAE;QACT,OAAO,EAAQ,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,KAAK,EAAU,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG;QACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,EAAE,EAAE,KAAK;KACV;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgb, WHITE } from './util.js';
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'nord',
|
|
4
|
+
mode: 'dark',
|
|
5
|
+
source: 'https://www.nordtheme.com/docs/colors-and-palettes',
|
|
6
|
+
};
|
|
7
|
+
export const palette = {
|
|
8
|
+
cyan: rgb(136, 192, 208),
|
|
9
|
+
magenta: rgb(180, 142, 173),
|
|
10
|
+
yellow: rgb(235, 203, 139),
|
|
11
|
+
green: rgb(163, 190, 140),
|
|
12
|
+
orange: rgb(208, 135, 112),
|
|
13
|
+
red: rgb(191, 97, 106),
|
|
14
|
+
brightBlue: rgb(129, 161, 193),
|
|
15
|
+
gray: rgb(76, 86, 106),
|
|
16
|
+
powerline: {
|
|
17
|
+
modelBg: { r: 84, g: 113, b: 137 }, // darkened from (94,127,150) for WCAG AA against white fg
|
|
18
|
+
dirBg: { r: 76, g: 86, b: 106 },
|
|
19
|
+
branchCleanBg: { r: 109, g: 90, b: 130 },
|
|
20
|
+
branchDirtyBg: { r: 142, g: 72, b: 80 },
|
|
21
|
+
taskBg: { r: 160, g: 101, b: 58 },
|
|
22
|
+
versionBg: { r: 59, g: 66, b: 82 },
|
|
23
|
+
fg: WHITE,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=nord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nord.js","sourceRoot":"","sources":["../../src/themes/nord.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,oDAAoD;CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,OAAO,EAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,KAAK,EAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,GAAG,EAAS,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,GAAG,CAAC;IAC9B,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,IAAI,EAAQ,GAAG,CAAC,EAAE,EAAG,EAAE,EAAG,GAAG,CAAC;IAC9B,SAAS,EAAE;QACT,OAAO,EAAQ,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAG,0DAA0D;QACtG,KAAK,EAAU,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG;QACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,EAAE,EAAE,KAAK;KACV;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgb, WHITE } from './util.js';
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'solarized',
|
|
4
|
+
mode: 'dark',
|
|
5
|
+
source: 'https://ethanschoonover.com/solarized/',
|
|
6
|
+
};
|
|
7
|
+
export const palette = {
|
|
8
|
+
cyan: rgb(42, 161, 152),
|
|
9
|
+
magenta: rgb(211, 54, 130),
|
|
10
|
+
yellow: rgb(181, 137, 0),
|
|
11
|
+
green: rgb(133, 153, 0),
|
|
12
|
+
orange: rgb(203, 75, 22),
|
|
13
|
+
red: rgb(220, 50, 47),
|
|
14
|
+
brightBlue: rgb(38, 139, 210),
|
|
15
|
+
gray: rgb(101, 123, 131),
|
|
16
|
+
powerline: {
|
|
17
|
+
modelBg: { r: 31, g: 109, b: 103 },
|
|
18
|
+
dirBg: { r: 30, g: 88, b: 126 },
|
|
19
|
+
branchCleanBg: { r: 141, g: 40, b: 87 },
|
|
20
|
+
branchDirtyBg: { r: 168, g: 32, b: 31 },
|
|
21
|
+
taskBg: { r: 138, g: 79, b: 17 },
|
|
22
|
+
versionBg: { r: 7, g: 54, b: 66 },
|
|
23
|
+
fg: WHITE,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=solarized.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solarized.js","sourceRoot":"","sources":["../../src/themes/solarized.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,wCAAwC;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,IAAI,EAAQ,GAAG,CAAC,EAAE,EAAG,GAAG,EAAE,GAAG,CAAC;IAC9B,OAAO,EAAK,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,GAAG,CAAC;IAC9B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,KAAK,EAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,MAAM,EAAM,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,EAAE,CAAC;IAC7B,GAAG,EAAS,GAAG,CAAC,GAAG,EAAE,EAAE,EAAG,EAAE,CAAC;IAC7B,UAAU,EAAE,GAAG,CAAC,EAAE,EAAG,GAAG,EAAE,GAAG,CAAC;IAC9B,IAAI,EAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9B,SAAS,EAAE;QACT,OAAO,EAAQ,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;QACzC,KAAK,EAAU,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,GAAG,EAAE;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,SAAS,EAAM,EAAE,CAAC,EAAE,CAAC,EAAI,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,EAAE,EAAE,KAAK;KACV;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { rgb, WHITE } from './util.js';
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'tokyo-night',
|
|
4
|
+
mode: 'dark',
|
|
5
|
+
source: 'https://github.com/folke/tokyonight.nvim',
|
|
6
|
+
};
|
|
7
|
+
export const palette = {
|
|
8
|
+
cyan: rgb(125, 207, 255),
|
|
9
|
+
magenta: rgb(187, 154, 247),
|
|
10
|
+
yellow: rgb(224, 175, 104),
|
|
11
|
+
green: rgb(158, 206, 106),
|
|
12
|
+
orange: rgb(255, 158, 100),
|
|
13
|
+
red: rgb(247, 118, 142),
|
|
14
|
+
brightBlue: rgb(122, 162, 247),
|
|
15
|
+
gray: rgb(86, 95, 137),
|
|
16
|
+
powerline: {
|
|
17
|
+
modelBg: { r: 42, g: 58, b: 96 },
|
|
18
|
+
dirBg: { r: 61, g: 78, b: 138 },
|
|
19
|
+
branchCleanBg: { r: 90, g: 63, b: 140 },
|
|
20
|
+
branchDirtyBg: { r: 166, g: 58, b: 75 },
|
|
21
|
+
taskBg: { r: 138, g: 106, b: 46 },
|
|
22
|
+
versionBg: { r: 39, g: 43, b: 58 },
|
|
23
|
+
fg: WHITE,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# s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,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG;QACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;QACzC,EAAE,EAAE,KAAK;KACV;CACF,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A theme defines truecolor RGB values for each named color.
|
|
3
|
+
* At runtime:
|
|
4
|
+
* - truecolor terminals get the exact RGB via `\x1b[38;2;r;g;bm`
|
|
5
|
+
* - 256-color terminals get the nearest xterm 256-color index via `\x1b[38;5;Nm`
|
|
6
|
+
* - named-ANSI terminals fall back to defaults (themes are not applied)
|
|
7
|
+
*/
|
|
8
|
+
export interface ThemePalette {
|
|
9
|
+
cyan: string;
|
|
10
|
+
magenta: string;
|
|
11
|
+
yellow: string;
|
|
12
|
+
green: string;
|
|
13
|
+
orange: string;
|
|
14
|
+
red: string;
|
|
15
|
+
brightBlue: string;
|
|
16
|
+
gray: string;
|
|
17
|
+
/** Optional per-theme powerline palette; derived from fg colors when absent. */
|
|
18
|
+
powerline?: PowerlinePalette;
|
|
19
|
+
}
|
|
20
|
+
export interface PowerlinePalette {
|
|
21
|
+
modelBg: RGB;
|
|
22
|
+
dirBg: RGB;
|
|
23
|
+
branchCleanBg: RGB;
|
|
24
|
+
branchDirtyBg: RGB;
|
|
25
|
+
taskBg: RGB;
|
|
26
|
+
versionBg: RGB;
|
|
27
|
+
fg: RGB;
|
|
28
|
+
}
|
|
29
|
+
export interface RGB {
|
|
30
|
+
r: number;
|
|
31
|
+
g: number;
|
|
32
|
+
b: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Theme metadata exposed on each per-theme module's named export. Not part of
|
|
36
|
+
* the runtime ThemePalette; surfaced separately for validators, docs, and the
|
|
37
|
+
* `lumira themes list` command.
|
|
38
|
+
*/
|
|
39
|
+
export interface ThemeMetadata {
|
|
40
|
+
/** Slug used as registry key and CLI argument. Lowercase, kebab-case. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Light vs dark — informational only, doesn't affect rendering. */
|
|
43
|
+
mode: 'dark' | 'light';
|
|
44
|
+
/** Upstream source for brand colors (license check / attribution). */
|
|
45
|
+
source: string;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/themes/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ThemePalette, PowerlinePalette, RGB } from './types.js';
|
|
2
|
+
/** Build a truecolor fg escape `\x1b[38;2;r;g;bm`. */
|
|
3
|
+
export declare function rgb(r: number, g: number, b: number): string;
|
|
4
|
+
export declare const WHITE: RGB;
|
|
5
|
+
/** Parse a truecolor fg or bg escape (`\x1b[38;2;…m` / `\x1b[48;2;…m`) back into RGB. */
|
|
6
|
+
export declare function parseRgb(escape: string): RGB | null;
|
|
7
|
+
/** Convert RGB to the nearest xterm 256-color index (cube 16..231 + grayscale 232..255). */
|
|
8
|
+
export declare function rgbTo256Index(r: number, g: number, b: number): number;
|
|
9
|
+
/** Project a truecolor-only palette to 256-color escapes. */
|
|
10
|
+
export declare function downgradePaletteTo256(p: ThemePalette): ThemePalette;
|
|
11
|
+
/**
|
|
12
|
+
* Build a PowerlinePalette for a theme that doesn't define one explicitly.
|
|
13
|
+
* We darken the existing fg hues (by ~55%) so the palette reads as "background
|
|
14
|
+
* tones of the theme" rather than blown-out fg colors that would clash with
|
|
15
|
+
* white text. The branchDirtyBg uses `red` regardless of theme for signal.
|
|
16
|
+
*/
|
|
17
|
+
export declare function derivePowerlinePalette(theme: ThemePalette): PowerlinePalette;
|
|
18
|
+
/** Fallback powerline palette when no theme is selected (named-ANSI terminals use classic). */
|
|
19
|
+
export declare const DEFAULT_POWERLINE_PALETTE: PowerlinePalette;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** Build a truecolor fg escape `\x1b[38;2;r;g;bm`. */
|
|
2
|
+
export function rgb(r, g, b) {
|
|
3
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
4
|
+
}
|
|
5
|
+
export const WHITE = { r: 255, g: 255, b: 255 };
|
|
6
|
+
/** Parse a truecolor fg or bg escape (`\x1b[38;2;…m` / `\x1b[48;2;…m`) back into RGB. */
|
|
7
|
+
export function parseRgb(escape) {
|
|
8
|
+
const m = escape.match(/^\x1b\[[34]8;2;(\d+);(\d+);(\d+)m$/);
|
|
9
|
+
if (!m)
|
|
10
|
+
return null;
|
|
11
|
+
return { r: parseInt(m[1], 10), g: parseInt(m[2], 10), b: parseInt(m[3], 10) };
|
|
12
|
+
}
|
|
13
|
+
/** Convert RGB to the nearest xterm 256-color index (cube 16..231 + grayscale 232..255). */
|
|
14
|
+
export function rgbTo256Index(r, g, b) {
|
|
15
|
+
return rgbTo256(r, g, b);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Convert an RGB triple to the nearest xterm 256-color index (0..255).
|
|
19
|
+
* Uses the standard 6×6×6 color cube (indices 16..231) plus grayscale ramp
|
|
20
|
+
* (232..255). Algorithm follows Chalk/ansi-styles conventions.
|
|
21
|
+
*/
|
|
22
|
+
function rgbTo256(r, g, b) {
|
|
23
|
+
if (r === g && g === b) {
|
|
24
|
+
if (r < 8)
|
|
25
|
+
return 16;
|
|
26
|
+
if (r > 248)
|
|
27
|
+
return 231;
|
|
28
|
+
return Math.round((r - 8) / 247 * 24) + 232;
|
|
29
|
+
}
|
|
30
|
+
const cube = (v) => Math.round(v / 255 * 5);
|
|
31
|
+
return 16 + 36 * cube(r) + 6 * cube(g) + cube(b);
|
|
32
|
+
}
|
|
33
|
+
function rgbEscapeTo256(escape) {
|
|
34
|
+
const c = parseRgb(escape);
|
|
35
|
+
if (!c)
|
|
36
|
+
return escape;
|
|
37
|
+
return `\x1b[38;5;${rgbTo256(c.r, c.g, c.b)}m`;
|
|
38
|
+
}
|
|
39
|
+
/** Project a truecolor-only palette to 256-color escapes. */
|
|
40
|
+
export function downgradePaletteTo256(p) {
|
|
41
|
+
return {
|
|
42
|
+
cyan: rgbEscapeTo256(p.cyan),
|
|
43
|
+
magenta: rgbEscapeTo256(p.magenta),
|
|
44
|
+
yellow: rgbEscapeTo256(p.yellow),
|
|
45
|
+
green: rgbEscapeTo256(p.green),
|
|
46
|
+
orange: rgbEscapeTo256(p.orange),
|
|
47
|
+
red: rgbEscapeTo256(p.red),
|
|
48
|
+
brightBlue: rgbEscapeTo256(p.brightBlue),
|
|
49
|
+
gray: rgbEscapeTo256(p.gray),
|
|
50
|
+
// powerline stores raw RGB triples (projected to 256 at render time by
|
|
51
|
+
// rgbTo256Index), so pass it through as-is — no escape conversion needed.
|
|
52
|
+
...(p.powerline ? { powerline: p.powerline } : {}),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** Darken an RGB triple toward black by `factor` in [0,1]. */
|
|
56
|
+
function darken(c, factor) {
|
|
57
|
+
return {
|
|
58
|
+
r: Math.round(c.r * (1 - factor)),
|
|
59
|
+
g: Math.round(c.g * (1 - factor)),
|
|
60
|
+
b: Math.round(c.b * (1 - factor)),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build a PowerlinePalette for a theme that doesn't define one explicitly.
|
|
65
|
+
* We darken the existing fg hues (by ~55%) so the palette reads as "background
|
|
66
|
+
* tones of the theme" rather than blown-out fg colors that would clash with
|
|
67
|
+
* white text. The branchDirtyBg uses `red` regardless of theme for signal.
|
|
68
|
+
*/
|
|
69
|
+
export function derivePowerlinePalette(theme) {
|
|
70
|
+
const get = (escape, fallback) => parseRgb(escape) ?? fallback;
|
|
71
|
+
const f = 0.55;
|
|
72
|
+
const fb = { r: 80, g: 80, b: 80 };
|
|
73
|
+
return {
|
|
74
|
+
modelBg: darken(get(theme.cyan, fb), f),
|
|
75
|
+
dirBg: darken(get(theme.brightBlue, fb), f),
|
|
76
|
+
branchCleanBg: darken(get(theme.magenta, fb), f),
|
|
77
|
+
branchDirtyBg: darken(get(theme.red, fb), f),
|
|
78
|
+
taskBg: darken(get(theme.yellow, fb), f),
|
|
79
|
+
versionBg: darken(get(theme.gray, fb), f),
|
|
80
|
+
fg: WHITE,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Fallback powerline palette when no theme is selected (named-ANSI terminals use classic). */
|
|
84
|
+
export const DEFAULT_POWERLINE_PALETTE = {
|
|
85
|
+
modelBg: { r: 32, g: 96, b: 128 },
|
|
86
|
+
dirBg: { r: 48, g: 72, b: 128 },
|
|
87
|
+
branchCleanBg: { r: 96, g: 48, b: 112 },
|
|
88
|
+
branchDirtyBg: { r: 160, g: 40, b: 40 },
|
|
89
|
+
taskBg: { r: 128, g: 96, b: 24 },
|
|
90
|
+
versionBg: { r: 64, g: 64, b: 72 },
|
|
91
|
+
fg: WHITE,
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/themes/util.ts"],"names":[],"mappings":"AAEA,sDAAsD;AACtD,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IACjD,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;AAErD,yFAAyF;AACzF,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC7D,IAAI,CAAC,CAAC;QAAE,O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AG,EAAE;IACzC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;IACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;IACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;IACzC,EAAE,EAAa,KAAK;CACrB,CAAC"}
|
package/dist/themes.d.ts
CHANGED
|
@@ -1,52 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A theme defines truecolor RGB values for each named color.
|
|
4
|
-
* At runtime:
|
|
5
|
-
* - truecolor terminals get the exact RGB via `\x1b[38;2;r;g;bm`
|
|
6
|
-
* - 256-color terminals get the nearest xterm 256-color index via `\x1b[38;5;Nm`
|
|
7
|
-
* - named-ANSI terminals fall back to defaults (themes are not applied)
|
|
8
|
-
*/
|
|
9
|
-
export interface ThemePalette {
|
|
10
|
-
cyan: string;
|
|
11
|
-
magenta: string;
|
|
12
|
-
yellow: string;
|
|
13
|
-
green: string;
|
|
14
|
-
orange: string;
|
|
15
|
-
red: string;
|
|
16
|
-
brightBlue: string;
|
|
17
|
-
gray: string;
|
|
18
|
-
/** Optional per-theme powerline palette; derived from fg colors when absent. */
|
|
19
|
-
powerline?: PowerlinePalette;
|
|
20
|
-
}
|
|
21
|
-
export interface PowerlinePalette {
|
|
22
|
-
modelBg: RGB;
|
|
23
|
-
dirBg: RGB;
|
|
24
|
-
branchCleanBg: RGB;
|
|
25
|
-
branchDirtyBg: RGB;
|
|
26
|
-
taskBg: RGB;
|
|
27
|
-
versionBg: RGB;
|
|
28
|
-
fg: RGB;
|
|
29
|
-
}
|
|
30
|
-
export interface RGB {
|
|
31
|
-
r: number;
|
|
32
|
-
g: number;
|
|
33
|
-
b: number;
|
|
34
|
-
}
|
|
35
|
-
/** Parse a truecolor fg or bg escape (`\x1b[38;2;…m` / `\x1b[48;2;…m`) back into RGB. */
|
|
36
|
-
export declare function parseRgb(escape: string): RGB | null;
|
|
37
|
-
/** Convert RGB to the nearest xterm 256-color index (cube 16..231 + grayscale 232..255). */
|
|
38
|
-
export declare function rgbTo256Index(r: number, g: number, b: number): number;
|
|
39
|
-
/** Project a truecolor-only palette to 256-color escapes. */
|
|
40
|
-
export declare function downgradePaletteTo256(p: ThemePalette): ThemePalette;
|
|
41
|
-
export declare const THEMES: Record<string, ThemePalette>;
|
|
42
|
-
export declare function getThemeNames(): string[];
|
|
43
|
-
/**
|
|
44
|
-
* Build a PowerlinePalette for a theme that doesn't define one explicitly.
|
|
45
|
-
* We darken the existing fg hues (by ~55%) so the palette reads as "background
|
|
46
|
-
* tones of the theme" rather than blown-out fg colors that would clash with
|
|
47
|
-
* white text. The branchDirtyBg uses `red` regardless of theme for signal.
|
|
48
|
-
*/
|
|
49
|
-
export declare function derivePowerlinePalette(theme: ThemePalette): PowerlinePalette;
|
|
50
|
-
/** Fallback powerline palette when no theme is selected (named-ANSI terminals use classic). */
|
|
51
|
-
export declare const DEFAULT_POWERLINE_PALETTE: PowerlinePalette;
|
|
52
|
-
export declare function resolveTheme(name: string | undefined, mode: ColorMode): ThemePalette | null;
|
|
1
|
+
export * from './themes/index.js';
|
package/dist/themes.js
CHANGED
|
@@ -1,264 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
const m = escape.match(/^\x1b\[[34]8;2;(\d+);(\d+);(\d+)m$/);
|
|
7
|
-
if (!m)
|
|
8
|
-
return null;
|
|
9
|
-
return { r: parseInt(m[1], 10), g: parseInt(m[2], 10), b: parseInt(m[3], 10) };
|
|
10
|
-
}
|
|
11
|
-
/** Convert RGB to the nearest xterm 256-color index (cube 16..231 + grayscale 232..255). */
|
|
12
|
-
export function rgbTo256Index(r, g, b) {
|
|
13
|
-
return rgbTo256(r, g, b);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Convert an RGB triple to the nearest xterm 256-color index (0..255).
|
|
17
|
-
* Uses the standard 6×6×6 color cube (indices 16..231) plus grayscale ramp
|
|
18
|
-
* (232..255). Algorithm follows Chalk/ansi-styles conventions.
|
|
19
|
-
*/
|
|
20
|
-
function rgbTo256(r, g, b) {
|
|
21
|
-
// Grayscale shortcut when r≈g≈b
|
|
22
|
-
if (r === g && g === b) {
|
|
23
|
-
if (r < 8)
|
|
24
|
-
return 16;
|
|
25
|
-
if (r > 248)
|
|
26
|
-
return 231;
|
|
27
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
28
|
-
}
|
|
29
|
-
const cube = (v) => Math.round(v / 255 * 5);
|
|
30
|
-
return 16 + 36 * cube(r) + 6 * cube(g) + cube(b);
|
|
31
|
-
}
|
|
32
|
-
function rgbEscapeTo256(escape) {
|
|
33
|
-
const c = parseRgb(escape);
|
|
34
|
-
if (!c)
|
|
35
|
-
return escape;
|
|
36
|
-
return `\x1b[38;5;${rgbTo256(c.r, c.g, c.b)}m`;
|
|
37
|
-
}
|
|
38
|
-
/** Project a truecolor-only palette to 256-color escapes. */
|
|
39
|
-
export function downgradePaletteTo256(p) {
|
|
40
|
-
return {
|
|
41
|
-
cyan: rgbEscapeTo256(p.cyan),
|
|
42
|
-
magenta: rgbEscapeTo256(p.magenta),
|
|
43
|
-
yellow: rgbEscapeTo256(p.yellow),
|
|
44
|
-
green: rgbEscapeTo256(p.green),
|
|
45
|
-
orange: rgbEscapeTo256(p.orange),
|
|
46
|
-
red: rgbEscapeTo256(p.red),
|
|
47
|
-
brightBlue: rgbEscapeTo256(p.brightBlue),
|
|
48
|
-
gray: rgbEscapeTo256(p.gray),
|
|
49
|
-
// powerline stores raw RGB triples (projected to 256 at render time by
|
|
50
|
-
// rgbTo256Index), so pass it through as-is — no escape conversion needed.
|
|
51
|
-
...(p.powerline ? { powerline: p.powerline } : {}),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
// Hand-curated powerline palettes per theme. Auto-derivation (darken fg by
|
|
55
|
-
// ~55%) produced muddy/indistinguishable bgs for low-saturation themes like
|
|
56
|
-
// Nord and Solarized. These swatches are picked from each theme's official
|
|
57
|
-
// palette — darker enough so white text stays legible, distinct hues so
|
|
58
|
-
// segments are visually separable.
|
|
59
|
-
const WHITE = { r: 255, g: 255, b: 255 };
|
|
60
|
-
const DRACULA_POWERLINE = {
|
|
61
|
-
modelBg: { r: 62, g: 90, b: 106 }, // dark cyan
|
|
62
|
-
dirBg: { r: 68, g: 71, b: 90 }, // currentLine #44475a
|
|
63
|
-
branchCleanBg: { r: 126, g: 61, b: 124 }, // dark pink
|
|
64
|
-
branchDirtyBg: { r: 139, g: 50, b: 50 }, // dark red
|
|
65
|
-
taskBg: { r: 138, g: 108, b: 42 }, // dark yellow
|
|
66
|
-
versionBg: { r: 58, g: 61, b: 74 },
|
|
67
|
-
fg: WHITE,
|
|
68
|
-
};
|
|
69
|
-
const NORD_POWERLINE = {
|
|
70
|
-
modelBg: { r: 94, g: 127, b: 150 }, // frost muted
|
|
71
|
-
dirBg: { r: 76, g: 86, b: 106 }, // nord3
|
|
72
|
-
branchCleanBg: { r: 109, g: 90, b: 130 }, // aurora purple dimmed
|
|
73
|
-
branchDirtyBg: { r: 142, g: 72, b: 80 }, // aurora red dimmed
|
|
74
|
-
taskBg: { r: 160, g: 101, b: 58 }, // aurora orange dimmed
|
|
75
|
-
versionBg: { r: 59, g: 66, b: 82 }, // nord1
|
|
76
|
-
fg: WHITE,
|
|
77
|
-
};
|
|
78
|
-
const TOKYO_NIGHT_POWERLINE = {
|
|
79
|
-
modelBg: { r: 42, g: 58, b: 96 },
|
|
80
|
-
dirBg: { r: 61, g: 78, b: 138 },
|
|
81
|
-
branchCleanBg: { r: 90, g: 63, b: 140 },
|
|
82
|
-
branchDirtyBg: { r: 166, g: 58, b: 75 },
|
|
83
|
-
taskBg: { r: 138, g: 106, b: 46 },
|
|
84
|
-
versionBg: { r: 39, g: 43, b: 58 },
|
|
85
|
-
fg: WHITE,
|
|
86
|
-
};
|
|
87
|
-
const CATPPUCCIN_POWERLINE = {
|
|
88
|
-
modelBg: { r: 58, g: 98, b: 116 }, // dark teal
|
|
89
|
-
dirBg: { r: 74, g: 90, b: 154 }, // dark blue
|
|
90
|
-
branchCleanBg: { r: 122, g: 90, b: 168 }, // dark mauve
|
|
91
|
-
branchDirtyBg: { r: 160, g: 72, b: 86 }, // dark red
|
|
92
|
-
taskBg: { r: 160, g: 102, b: 58 }, // dark peach
|
|
93
|
-
versionBg: { r: 49, g: 50, b: 68 }, // surface0
|
|
94
|
-
fg: WHITE,
|
|
95
|
-
};
|
|
96
|
-
const MONOKAI_POWERLINE = {
|
|
97
|
-
modelBg: { r: 42, g: 93, b: 110 }, // dark cyan
|
|
98
|
-
dirBg: { r: 73, g: 72, b: 62 }, // bg variant
|
|
99
|
-
branchCleanBg: { r: 140, g: 30, b: 73 }, // dark pink
|
|
100
|
-
branchDirtyBg: { r: 166, g: 56, b: 37 }, // dark orange-red
|
|
101
|
-
taskBg: { r: 133, g: 107, b: 42 }, // dark yellow
|
|
102
|
-
versionBg: { r: 39, g: 40, b: 34 }, // bg
|
|
103
|
-
fg: WHITE,
|
|
104
|
-
};
|
|
105
|
-
const GRUVBOX_POWERLINE = {
|
|
106
|
-
modelBg: { r: 60, g: 91, b: 95 }, // dark aqua
|
|
107
|
-
dirBg: { r: 80, g: 73, b: 69 }, // bg2
|
|
108
|
-
branchCleanBg: { r: 131, g: 61, b: 106 }, // dark purple
|
|
109
|
-
branchDirtyBg: { r: 157, g: 43, b: 34 }, // dark red
|
|
110
|
-
taskBg: { r: 160, g: 104, b: 21 }, // dark yellow
|
|
111
|
-
versionBg: { r: 60, g: 56, b: 54 }, // bg1
|
|
112
|
-
fg: WHITE,
|
|
113
|
-
};
|
|
114
|
-
const SOLARIZED_POWERLINE = {
|
|
115
|
-
modelBg: { r: 31, g: 109, b: 103 }, // dark cyan
|
|
116
|
-
dirBg: { r: 30, g: 88, b: 126 }, // dark blue
|
|
117
|
-
branchCleanBg: { r: 141, g: 40, b: 87 }, // dark magenta
|
|
118
|
-
branchDirtyBg: { r: 168, g: 32, b: 31 }, // dark red
|
|
119
|
-
taskBg: { r: 138, g: 79, b: 17 }, // dark orange
|
|
120
|
-
versionBg: { r: 7, g: 54, b: 66 }, // base02
|
|
121
|
-
fg: WHITE,
|
|
122
|
-
};
|
|
123
|
-
export const THEMES = {
|
|
124
|
-
dracula: {
|
|
125
|
-
cyan: rgb(139, 233, 253),
|
|
126
|
-
magenta: rgb(255, 121, 198),
|
|
127
|
-
yellow: rgb(241, 250, 140),
|
|
128
|
-
green: rgb(80, 250, 123),
|
|
129
|
-
orange: rgb(255, 184, 108),
|
|
130
|
-
red: rgb(255, 85, 85),
|
|
131
|
-
brightBlue: rgb(189, 147, 249),
|
|
132
|
-
gray: rgb(98, 114, 164),
|
|
133
|
-
powerline: DRACULA_POWERLINE,
|
|
134
|
-
},
|
|
135
|
-
nord: {
|
|
136
|
-
cyan: rgb(136, 192, 208),
|
|
137
|
-
magenta: rgb(180, 142, 173),
|
|
138
|
-
yellow: rgb(235, 203, 139),
|
|
139
|
-
green: rgb(163, 190, 140),
|
|
140
|
-
orange: rgb(208, 135, 112),
|
|
141
|
-
red: rgb(191, 97, 106),
|
|
142
|
-
brightBlue: rgb(129, 161, 193),
|
|
143
|
-
gray: rgb(76, 86, 106),
|
|
144
|
-
powerline: NORD_POWERLINE,
|
|
145
|
-
},
|
|
146
|
-
'tokyo-night': {
|
|
147
|
-
cyan: rgb(125, 207, 255),
|
|
148
|
-
magenta: rgb(187, 154, 247),
|
|
149
|
-
yellow: rgb(224, 175, 104),
|
|
150
|
-
green: rgb(158, 206, 106),
|
|
151
|
-
orange: rgb(255, 158, 100),
|
|
152
|
-
red: rgb(247, 118, 142),
|
|
153
|
-
brightBlue: rgb(122, 162, 247),
|
|
154
|
-
gray: rgb(86, 95, 137),
|
|
155
|
-
powerline: TOKYO_NIGHT_POWERLINE,
|
|
156
|
-
},
|
|
157
|
-
catppuccin: {
|
|
158
|
-
cyan: rgb(137, 220, 235),
|
|
159
|
-
magenta: rgb(245, 194, 231),
|
|
160
|
-
yellow: rgb(249, 226, 175),
|
|
161
|
-
green: rgb(166, 227, 161),
|
|
162
|
-
orange: rgb(250, 179, 135),
|
|
163
|
-
red: rgb(243, 139, 168),
|
|
164
|
-
brightBlue: rgb(137, 180, 250),
|
|
165
|
-
gray: rgb(108, 112, 134),
|
|
166
|
-
powerline: CATPPUCCIN_POWERLINE,
|
|
167
|
-
},
|
|
168
|
-
monokai: {
|
|
169
|
-
cyan: rgb(102, 217, 239),
|
|
170
|
-
magenta: rgb(249, 38, 114),
|
|
171
|
-
yellow: rgb(230, 219, 116),
|
|
172
|
-
green: rgb(166, 226, 46),
|
|
173
|
-
orange: rgb(253, 151, 31),
|
|
174
|
-
red: rgb(249, 38, 114),
|
|
175
|
-
brightBlue: rgb(102, 217, 239),
|
|
176
|
-
gray: rgb(117, 113, 94),
|
|
177
|
-
powerline: MONOKAI_POWERLINE,
|
|
178
|
-
},
|
|
179
|
-
gruvbox: {
|
|
180
|
-
cyan: rgb(131, 165, 152),
|
|
181
|
-
magenta: rgb(211, 134, 155),
|
|
182
|
-
yellow: rgb(215, 153, 33),
|
|
183
|
-
green: rgb(152, 151, 26),
|
|
184
|
-
orange: rgb(214, 93, 14),
|
|
185
|
-
red: rgb(204, 36, 29),
|
|
186
|
-
brightBlue: rgb(69, 133, 136),
|
|
187
|
-
gray: rgb(146, 131, 116),
|
|
188
|
-
powerline: GRUVBOX_POWERLINE,
|
|
189
|
-
},
|
|
190
|
-
solarized: {
|
|
191
|
-
cyan: rgb(42, 161, 152),
|
|
192
|
-
magenta: rgb(211, 54, 130),
|
|
193
|
-
yellow: rgb(181, 137, 0),
|
|
194
|
-
green: rgb(133, 153, 0),
|
|
195
|
-
orange: rgb(203, 75, 22),
|
|
196
|
-
red: rgb(220, 50, 47),
|
|
197
|
-
brightBlue: rgb(38, 139, 210),
|
|
198
|
-
gray: rgb(101, 123, 131),
|
|
199
|
-
powerline: SOLARIZED_POWERLINE,
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
export function getThemeNames() {
|
|
203
|
-
return Object.keys(THEMES);
|
|
204
|
-
}
|
|
205
|
-
/** Darken an RGB triple toward black by `factor` in [0,1]. */
|
|
206
|
-
function darken(c, factor) {
|
|
207
|
-
return {
|
|
208
|
-
r: Math.round(c.r * (1 - factor)),
|
|
209
|
-
g: Math.round(c.g * (1 - factor)),
|
|
210
|
-
b: Math.round(c.b * (1 - factor)),
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Build a PowerlinePalette for a theme that doesn't define one explicitly.
|
|
215
|
-
* We darken the existing fg hues (by ~55%) so the palette reads as "background
|
|
216
|
-
* tones of the theme" rather than blown-out fg colors that would clash with
|
|
217
|
-
* white text. The branchDirtyBg uses `red` regardless of theme for signal.
|
|
218
|
-
*/
|
|
219
|
-
export function derivePowerlinePalette(theme) {
|
|
220
|
-
const get = (escape, fallback) => parseRgb(escape) ?? fallback;
|
|
221
|
-
const f = 0.55; // darkening factor — tuned so white fg stays legible
|
|
222
|
-
const fb = { r: 80, g: 80, b: 80 };
|
|
223
|
-
return {
|
|
224
|
-
modelBg: darken(get(theme.cyan, fb), f),
|
|
225
|
-
dirBg: darken(get(theme.brightBlue, fb), f),
|
|
226
|
-
branchCleanBg: darken(get(theme.magenta, fb), f),
|
|
227
|
-
branchDirtyBg: darken(get(theme.red, fb), f),
|
|
228
|
-
taskBg: darken(get(theme.yellow, fb), f),
|
|
229
|
-
versionBg: darken(get(theme.gray, fb), f),
|
|
230
|
-
fg: { r: 255, g: 255, b: 255 },
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
/** Fallback powerline palette when no theme is selected (named-ANSI terminals use classic). */
|
|
234
|
-
export const DEFAULT_POWERLINE_PALETTE = {
|
|
235
|
-
modelBg: { r: 32, g: 96, b: 128 },
|
|
236
|
-
dirBg: { r: 48, g: 72, b: 128 },
|
|
237
|
-
branchCleanBg: { r: 96, g: 48, b: 112 },
|
|
238
|
-
branchDirtyBg: { r: 160, g: 40, b: 40 },
|
|
239
|
-
taskBg: { r: 128, g: 96, b: 24 },
|
|
240
|
-
versionBg: { r: 64, g: 64, b: 72 },
|
|
241
|
-
fg: { r: 255, g: 255, b: 255 },
|
|
242
|
-
};
|
|
243
|
-
export function resolveTheme(name, mode) {
|
|
244
|
-
if (!name)
|
|
245
|
-
return null;
|
|
246
|
-
const key = name.toLowerCase();
|
|
247
|
-
// hasOwn guard: a name like `__proto__` or `constructor` would otherwise
|
|
248
|
-
// resolve to `Object.prototype` (truthy), bypass the `!base` check, then
|
|
249
|
-
// crash later when render code reads `.cyan` etc. Reject anything not
|
|
250
|
-
// explicitly in the THEMES map.
|
|
251
|
-
if (!Object.prototype.hasOwnProperty.call(THEMES, key))
|
|
252
|
-
return null;
|
|
253
|
-
const base = THEMES[key];
|
|
254
|
-
// Truecolor terminals get the exact palette; 256-color terminals get a
|
|
255
|
-
// nearest-index projection. Named-ANSI terminals cannot represent arbitrary
|
|
256
|
-
// palettes — fall back to built-in defaults rather than lying with mismatched
|
|
257
|
-
// named colors (only 8 base hues available).
|
|
258
|
-
if (mode === 'truecolor')
|
|
259
|
-
return base;
|
|
260
|
-
if (mode === '256')
|
|
261
|
-
return downgradePaletteTo256(base);
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
1
|
+
// Compatibility shim: the canonical surface lives in `./themes/index.ts`.
|
|
2
|
+
// Existing imports of `./themes.js` continue to work via this re-export so
|
|
3
|
+
// migrating the modular layout did not require a sweeping rename across
|
|
4
|
+
// callers (render/, commands/, installer-wizard, tests).
|
|
5
|
+
export * from './themes/index.js';
|
|
264
6
|
//# sourceMappingURL=themes.js.map
|
package/dist/themes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-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AAE,EAAG,CAAC,EAAE,EAAE,EAAG;IACzC,MAAM,EAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;IACzC,SAAS,EAAM,EAAE,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG,CAAC,EAAE,EAAE,EAAG;IACzC,EAAE,EAAa,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;CAC1C,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,IAAwB,EAAE,IAAe;IACpE,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC/B,yEAAyE;IACzE,yEAAyE;IACzE,sEAAsE;IACtE,gCAAgC;IAChC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,uEAAuE;IACvE,4EAA4E;IAC5E,8EAA8E;IAC9E,6CAA6C;IAC7C,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IACtC,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2EAA2E;AAC3E,wEAAwE;AACxE,yDAAyD;AACzD,cAAc,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lumira",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "lumira — real-time statusline for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"test:watch": "vitest",
|
|
15
15
|
"test:coverage": "vitest run --coverage",
|
|
16
16
|
"lint": "tsc --noEmit",
|
|
17
|
+
"themes:validate": "npm run build && node scripts/validate-themes.mjs",
|
|
17
18
|
"prepublishOnly": "npm run build && npm run test"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
@@ -26,6 +27,10 @@
|
|
|
26
27
|
"node": ">=18"
|
|
27
28
|
},
|
|
28
29
|
"license": "MIT",
|
|
30
|
+
"homepage": "https://github.com/cativo23/lumira#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/cativo23/lumira/issues"
|
|
33
|
+
},
|
|
29
34
|
"repository": {
|
|
30
35
|
"type": "git",
|
|
31
36
|
"url": "git+https://github.com/cativo23/lumira.git"
|