@denizokcu/haze 1.0.0 → 1.1.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/CHANGELOG.md +10 -0
- package/README.md +12 -7
- package/SECURITY.md +3 -1
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/TaskBar.js +1 -1
- package/dist/cli/chat/inputSuggestions.js +1 -0
- package/dist/cli/chat/messages.js +3 -3
- package/dist/cli/chat/wizardDispatch.js +10 -0
- package/dist/cli/commands/chat.js +47 -5
- package/dist/cli/commands/commandHelp.js +2 -0
- package/dist/cli/commands/commands.js +2 -0
- package/dist/cli/commands/formatters.js +6 -0
- package/dist/cli/commands/settingsSummary.js +2 -0
- package/dist/cli/commands/themesCommand.d.ts +17 -0
- package/dist/cli/commands/themesCommand.js +24 -0
- package/dist/cli/commands/wizardFlow.d.ts +7 -0
- package/dist/cli/commands/wizardFlow.js +20 -0
- package/dist/config/settings.d.ts +2 -0
- package/dist/config/settings.js +1 -0
- package/dist/core/safety/secretPaths.d.ts +18 -0
- package/dist/core/safety/secretPaths.js +115 -0
- package/dist/llm/hazeTools.js +6 -0
- package/dist/llm/systemPrompt.js +3 -1
- package/dist/llm/toolResultTypes.d.ts +1 -1
- package/dist/llm/tools/failures.d.ts +6 -0
- package/dist/llm/tools/failures.js +8 -2
- package/dist/llm/tools/readRecovery.js +2 -0
- package/dist/llm/tools/shellTool.js +3 -0
- package/dist/llm/tools/workspaceFile.d.ts +4 -3
- package/dist/llm/tools/workspaceFile.js +30 -13
- package/dist/ui/components/Header.js +1 -1
- package/dist/ui/components/MarkdownText.js +10 -10
- package/dist/ui/components/TextInput.d.ts +1 -1
- package/dist/ui/components/TextInput.js +2 -2
- package/dist/ui/terminalColors.d.ts +29 -0
- package/dist/ui/terminalColors.js +47 -0
- package/dist/ui/theme.d.ts +105 -10
- package/dist/ui/theme.js +126 -15
- package/dist/ui/themes/af-magic.d.ts +7 -0
- package/dist/ui/themes/af-magic.js +25 -0
- package/dist/ui/themes/agnoster.d.ts +10 -0
- package/dist/ui/themes/agnoster.js +40 -0
- package/dist/ui/themes/bira.d.ts +10 -0
- package/dist/ui/themes/bira.js +28 -0
- package/dist/ui/themes/bureau.d.ts +10 -0
- package/dist/ui/themes/bureau.js +28 -0
- package/dist/ui/themes/clean.d.ts +9 -0
- package/dist/ui/themes/clean.js +27 -0
- package/dist/ui/themes/cloud.d.ts +6 -0
- package/dist/ui/themes/cloud.js +24 -0
- package/dist/ui/themes/dst.d.ts +10 -0
- package/dist/ui/themes/dst.js +28 -0
- package/dist/ui/themes/fishy.d.ts +7 -0
- package/dist/ui/themes/fishy.js +25 -0
- package/dist/ui/themes/index.d.ts +8 -0
- package/dist/ui/themes/index.js +36 -0
- package/dist/ui/themes/light.d.ts +3 -0
- package/dist/ui/themes/light.js +21 -0
- package/dist/ui/themes/purple.d.ts +7 -0
- package/dist/ui/themes/purple.js +26 -0
- package/dist/ui/themes/robbyrussell.d.ts +8 -0
- package/dist/ui/themes/robbyrussell.js +26 -0
- package/dist/ui/themes/solarized-dark.d.ts +16 -0
- package/dist/ui/themes/solarized-dark.js +44 -0
- package/dist/ui/themes/solarized-light.d.ts +12 -0
- package/dist/ui/themes/solarized-light.js +40 -0
- package/dist/ui/themes/steeef.d.ts +11 -0
- package/dist/ui/themes/steeef.js +29 -0
- package/package.json +1 -1
package/dist/ui/theme.d.ts
CHANGED
|
@@ -1,16 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Haze theming core, aligned with the oh-my-zsh / zsh `colors` vocabulary so
|
|
3
|
+
* that oh-my-zsh themes port over with minimal effort.
|
|
4
|
+
*
|
|
5
|
+
* oh-my-zsh themes never define RGB colors. They reference terminal palette
|
|
6
|
+
* slots using zsh's `colors` vocabulary:
|
|
7
|
+
*
|
|
8
|
+
* $fg[cyan] → the named palette slot `cyan`
|
|
9
|
+
* $fg_bold[green] → named slot `green` (bold is a text attribute, not a color)
|
|
10
|
+
* ${FG[214]} / %F{214} → an xterm-256 color index
|
|
11
|
+
* %F{#ff8800} → truecolor hex
|
|
12
|
+
*
|
|
13
|
+
* Haze themes mirror that split in two layers:
|
|
14
|
+
*
|
|
15
|
+
* 1. Palette — `ZSH_NAMED_COLORS`, one entry per zsh `colors` key
|
|
16
|
+
* (`black red green yellow blue magenta cyan white default`), approximated
|
|
17
|
+
* as RGB because haze cannot assume the host terminal's palette.
|
|
18
|
+
* A theme spec may override slots with `palette`.
|
|
19
|
+
* 2. Roles — semantic haze surfaces (accent, command, warning, …) whose
|
|
20
|
+
* values are written in the same vocabulary an oh-my-zsh theme uses:
|
|
21
|
+
* a zsh color name, an xterm-256 index string, or `#rrggbb` hex.
|
|
22
|
+
*
|
|
23
|
+
* The built-in themes live in `src/ui/themes/` (one file per theme, named like
|
|
24
|
+
* its oh-my-zsh counterpart) — including ports of famous `.zsh-theme` files
|
|
25
|
+
* where `robbyrussell`'s `$fg_bold[green]➜` becomes `accent: 'green'`, its
|
|
26
|
+
* `$fg[cyan]%c` becomes `command: 'cyan'`, etc. See `src/ui/themes/AGENTS.md`
|
|
27
|
+
* for the full conversion guide and `docs/theming-plan.md` §6–§7 for the
|
|
28
|
+
* research and the segment → role translation table.
|
|
29
|
+
*/
|
|
30
|
+
import { BUILT_IN_THEME_SPECS } from './themes/index.js';
|
|
31
|
+
export { BUILT_IN_THEME_SPECS };
|
|
32
|
+
/** The theme used when settings name none; also the fallback base for roles another theme omits. */
|
|
33
|
+
export declare const DEFAULT_THEME_NAME = "purple";
|
|
34
|
+
/** zsh `colors` associative-array keys — exactly the names `$fg[...]` accepts. */
|
|
35
|
+
export type ZshColorName = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'default';
|
|
36
|
+
export declare const ZSH_COLOR_NAMES: readonly ZshColorName[];
|
|
37
|
+
/**
|
|
38
|
+
* RGB approximation of the terminal palette slots the zsh names reference,
|
|
39
|
+
* based on the Tango palette (GNOME Terminal's classic default) because
|
|
40
|
+
* oh-my-zsh themes leave the actual RGB to the terminal. `default` approximates
|
|
41
|
+
* the terminal's default foreground color.
|
|
42
|
+
*/
|
|
43
|
+
export declare const ZSH_NAMED_COLORS: Record<ZshColorName, string>;
|
|
44
|
+
/**
|
|
45
|
+
* A theme color value, written the way oh-my-zsh writes colors:
|
|
46
|
+
* a zsh color name (`'cyan'` for `$fg[cyan]`), an xterm-256 index string
|
|
47
|
+
* (`'214'` for `${FG[214]}`), or truecolor hex (`'#ff8800'` for `%F{#ff8800}`).
|
|
48
|
+
*/
|
|
49
|
+
export type ColorSpec = ZshColorName | `#${string}` | `${number}`;
|
|
50
|
+
/**
|
|
51
|
+
* Resolved theme: every role is a normalized `#rrggbb` string Ink accepts.
|
|
52
|
+
* Semantic surfaces haze actually renders; the oh-my-zsh segment each one
|
|
53
|
+
* inherits from when porting is noted per role.
|
|
54
|
+
*/
|
|
55
|
+
export interface HazeTheme {
|
|
56
|
+
/** Terminal default background (OSC 11): the canvas behind every haze surface. omz/VS Code/Sublime: the theme's `background`. */
|
|
57
|
+
background: string;
|
|
58
|
+
/** Brand/accent: app header, tool names, markers, links. omz: prompt-symbol segment (`$fg_bold[green]➜`). */
|
|
59
|
+
accent: string;
|
|
60
|
+
/** Dim accent: rules, heading underlines, table borders. omz: separator rules (`${FG[237]}` dashes in af-magic). */
|
|
61
|
+
accentDim: string;
|
|
62
|
+
/** Chrome borders: input box, panels. omz: segment dividers. */
|
|
63
|
+
border: string;
|
|
64
|
+
/** Info/tool headers. omz: secondary segment (`${FG[075]}` git parens in af-magic, `AGNOSTER_STATUS_JOB_FG`). */
|
|
65
|
+
info: string;
|
|
66
|
+
/** Secondary text: hints, timestamps, elisions. omz: muted separators (`${FG[237]}`). */
|
|
6
67
|
muted: string;
|
|
7
|
-
|
|
8
|
-
|
|
68
|
+
/** Primary text: task titles, diff code lines. omz: `$fg[default]` body text. */
|
|
69
|
+
foreground: string;
|
|
70
|
+
/** Slash commands, paths, handles. omz: cwd segment (`$fg[cyan]%c` in robbyrussell). */
|
|
71
|
+
command: string;
|
|
72
|
+
/** Success text: ✓ icons, completions. omz: exit-status-ok / clean-git colors. */
|
|
9
73
|
success: string;
|
|
74
|
+
/** Background paired with `success` (added diff lines). */
|
|
10
75
|
successBg: string;
|
|
76
|
+
/** Danger text: ✗ icons, removed diff lines. omz: exit-status-fail / `$fg_bold[red]`. */
|
|
77
|
+
danger: string;
|
|
78
|
+
/** Background paired with `danger` (removed diff lines). */
|
|
79
|
+
dangerBg: string;
|
|
80
|
+
/** Warnings, in-progress states. omz: git dirty marker (`$fg[yellow]✗` in robbyrussell). */
|
|
11
81
|
warning: string;
|
|
12
|
-
/**
|
|
13
|
-
command: string;
|
|
82
|
+
/** Quoted/user message surfaces. */
|
|
14
83
|
surfaceBg: string;
|
|
84
|
+
/** Code fence / inline code background. */
|
|
15
85
|
codeBg: string;
|
|
16
|
-
}
|
|
86
|
+
}
|
|
87
|
+
export type HazeThemeRole = keyof HazeTheme;
|
|
88
|
+
export declare const THEME_ROLES: readonly HazeThemeRole[];
|
|
89
|
+
/**
|
|
90
|
+
* A theme as authored: role values in oh-my-zsh color vocabulary, plus optional
|
|
91
|
+
* palette overrides for themes whose host terminal palette defines the look
|
|
92
|
+
* (e.g. agnoster under Solarized). Roles omitted here inherit the `purple`
|
|
93
|
+
* theme's values, so partial ports are safe.
|
|
94
|
+
*/
|
|
95
|
+
export interface HazeThemeSpec {
|
|
96
|
+
/** Override terminal palette slots; values must be `#rrggbb` hex. */
|
|
97
|
+
palette?: Partial<Record<ZshColorName, string>>;
|
|
98
|
+
roles?: Partial<Record<HazeThemeRole, ColorSpec>>;
|
|
99
|
+
}
|
|
100
|
+
/** xterm-256 index → RGB hex, mirroring zsh's `%F{nnn}` / `${FG[nnn]}` resolution. Base slots 0–7 resolve through the given palette. */
|
|
101
|
+
export declare function xterm256Color(index: number, palette?: Record<ZshColorName, string>): string;
|
|
102
|
+
/**
|
|
103
|
+
* Resolve a color spec (`'cyan'`, `'214'`, `'#ff8800'`) to `#rrggbb` hex.
|
|
104
|
+
* Throws with the accepted vocabulary for unknown values (fail loudly).
|
|
105
|
+
*/
|
|
106
|
+
export declare function resolveColorSpec(spec: string, palette?: Record<ZshColorName, string>): string;
|
|
107
|
+
/** Resolve a built-in theme name (+ optional role overrides) to a complete `HazeTheme`. Throws with valid names for unknown themes. */
|
|
108
|
+
export declare function resolveTheme(name?: string, overrides?: Partial<Record<HazeThemeRole, string>>): HazeTheme;
|
|
109
|
+
/** The active theme instance; swap with `setActiveTheme` before rendering (and on future `/theme` switches). */
|
|
110
|
+
export declare let theme: HazeTheme;
|
|
111
|
+
export declare function setActiveTheme(next: HazeTheme): void;
|
package/dist/ui/theme.js
CHANGED
|
@@ -1,16 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Haze theming core, aligned with the oh-my-zsh / zsh `colors` vocabulary so
|
|
3
|
+
* that oh-my-zsh themes port over with minimal effort.
|
|
4
|
+
*
|
|
5
|
+
* oh-my-zsh themes never define RGB colors. They reference terminal palette
|
|
6
|
+
* slots using zsh's `colors` vocabulary:
|
|
7
|
+
*
|
|
8
|
+
* $fg[cyan] → the named palette slot `cyan`
|
|
9
|
+
* $fg_bold[green] → named slot `green` (bold is a text attribute, not a color)
|
|
10
|
+
* ${FG[214]} / %F{214} → an xterm-256 color index
|
|
11
|
+
* %F{#ff8800} → truecolor hex
|
|
12
|
+
*
|
|
13
|
+
* Haze themes mirror that split in two layers:
|
|
14
|
+
*
|
|
15
|
+
* 1. Palette — `ZSH_NAMED_COLORS`, one entry per zsh `colors` key
|
|
16
|
+
* (`black red green yellow blue magenta cyan white default`), approximated
|
|
17
|
+
* as RGB because haze cannot assume the host terminal's palette.
|
|
18
|
+
* A theme spec may override slots with `palette`.
|
|
19
|
+
* 2. Roles — semantic haze surfaces (accent, command, warning, …) whose
|
|
20
|
+
* values are written in the same vocabulary an oh-my-zsh theme uses:
|
|
21
|
+
* a zsh color name, an xterm-256 index string, or `#rrggbb` hex.
|
|
22
|
+
*
|
|
23
|
+
* The built-in themes live in `src/ui/themes/` (one file per theme, named like
|
|
24
|
+
* its oh-my-zsh counterpart) — including ports of famous `.zsh-theme` files
|
|
25
|
+
* where `robbyrussell`'s `$fg_bold[green]➜` becomes `accent: 'green'`, its
|
|
26
|
+
* `$fg[cyan]%c` becomes `command: 'cyan'`, etc. See `src/ui/themes/AGENTS.md`
|
|
27
|
+
* for the full conversion guide and `docs/theming-plan.md` §6–§7 for the
|
|
28
|
+
* research and the segment → role translation table.
|
|
29
|
+
*/
|
|
30
|
+
import { BUILT_IN_THEME_SPECS } from './themes/index.js';
|
|
31
|
+
import { purple } from './themes/purple.js';
|
|
32
|
+
export { BUILT_IN_THEME_SPECS };
|
|
33
|
+
/** The theme used when settings name none; also the fallback base for roles another theme omits. */
|
|
34
|
+
export const DEFAULT_THEME_NAME = 'purple';
|
|
35
|
+
export const ZSH_COLOR_NAMES = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default'];
|
|
36
|
+
/**
|
|
37
|
+
* RGB approximation of the terminal palette slots the zsh names reference,
|
|
38
|
+
* based on the Tango palette (GNOME Terminal's classic default) because
|
|
39
|
+
* oh-my-zsh themes leave the actual RGB to the terminal. `default` approximates
|
|
40
|
+
* the terminal's default foreground color.
|
|
41
|
+
*/
|
|
42
|
+
export const ZSH_NAMED_COLORS = {
|
|
43
|
+
black: '#2e3436',
|
|
44
|
+
red: '#cc0000',
|
|
45
|
+
green: '#4e9a06',
|
|
46
|
+
yellow: '#c4a000',
|
|
47
|
+
blue: '#3465a4',
|
|
48
|
+
magenta: '#75507b',
|
|
49
|
+
cyan: '#06989a',
|
|
50
|
+
white: '#d3d7cf',
|
|
51
|
+
default: '#ffffff',
|
|
16
52
|
};
|
|
53
|
+
/** Bright variants (ANSI slots 8–15), used to resolve xterm-256 indices 8–15. */
|
|
54
|
+
const ANSI_16_BRIGHT = [
|
|
55
|
+
'#555753', '#ef2929', '#8ae234', '#fce94f', '#729fcf', '#ad7fa8', '#34e2e2', '#eeeeec',
|
|
56
|
+
];
|
|
57
|
+
export const THEME_ROLES = [
|
|
58
|
+
'background', 'accent', 'accentDim', 'border', 'info', 'muted', 'foreground', 'command',
|
|
59
|
+
'success', 'successBg', 'danger', 'dangerBg', 'warning', 'surfaceBg', 'codeBg',
|
|
60
|
+
];
|
|
61
|
+
const HEX_COLOR = /^#[0-9a-fA-F]{6}$/;
|
|
62
|
+
const XTERM_CUBE_LEVELS = [0, 95, 135, 175, 215, 255];
|
|
63
|
+
/** xterm-256 index → RGB hex, mirroring zsh's `%F{nnn}` / `${FG[nnn]}` resolution. Base slots 0–7 resolve through the given palette. */
|
|
64
|
+
export function xterm256Color(index, palette = ZSH_NAMED_COLORS) {
|
|
65
|
+
if (index < 8)
|
|
66
|
+
return palette[ZSH_COLOR_NAMES[index]].toLowerCase();
|
|
67
|
+
if (index < 16)
|
|
68
|
+
return ANSI_16_BRIGHT[index - 8];
|
|
69
|
+
if (index <= 231) {
|
|
70
|
+
const n = index - 16;
|
|
71
|
+
const r = XTERM_CUBE_LEVELS[Math.floor(n / 36)];
|
|
72
|
+
const g = XTERM_CUBE_LEVELS[Math.floor(n / 6) % 6];
|
|
73
|
+
const b = XTERM_CUBE_LEVELS[n % 6];
|
|
74
|
+
return toHex(r, g, b);
|
|
75
|
+
}
|
|
76
|
+
const gray = 8 + 10 * (index - 232);
|
|
77
|
+
return toHex(gray, gray, gray);
|
|
78
|
+
}
|
|
79
|
+
function toHex(r, g, b) {
|
|
80
|
+
const part = (v) => v.toString(16).padStart(2, '0');
|
|
81
|
+
return `#${part(r)}${part(g)}${part(b)}`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Resolve a color spec (`'cyan'`, `'214'`, `'#ff8800'`) to `#rrggbb` hex.
|
|
85
|
+
* Throws with the accepted vocabulary for unknown values (fail loudly).
|
|
86
|
+
*/
|
|
87
|
+
export function resolveColorSpec(spec, palette = ZSH_NAMED_COLORS) {
|
|
88
|
+
const value = spec.trim();
|
|
89
|
+
if (HEX_COLOR.test(value))
|
|
90
|
+
return value.toLowerCase();
|
|
91
|
+
if (/^[0-9]{1,3}$/.test(value)) {
|
|
92
|
+
const index = Number(value);
|
|
93
|
+
if (index <= 255)
|
|
94
|
+
return xterm256Color(index, palette);
|
|
95
|
+
}
|
|
96
|
+
if (ZSH_COLOR_NAMES.includes(value))
|
|
97
|
+
return palette[value].toLowerCase();
|
|
98
|
+
throw new Error(`Unknown color "${spec}". Use a zsh color name (${ZSH_COLOR_NAMES.join(', ')}), an xterm-256 index like "214", or hex like "#ff8800".`);
|
|
99
|
+
}
|
|
100
|
+
/** Resolve a built-in theme name (+ optional role overrides) to a complete `HazeTheme`. Throws with valid names for unknown themes. */
|
|
101
|
+
export function resolveTheme(name, overrides) {
|
|
102
|
+
const spec = BUILT_IN_THEME_SPECS[name ?? DEFAULT_THEME_NAME];
|
|
103
|
+
if (!spec) {
|
|
104
|
+
const validNames = Object.keys(BUILT_IN_THEME_SPECS).join(', ');
|
|
105
|
+
throw new Error(`Unknown theme name "${name}". Valid themes: ${validNames}`);
|
|
106
|
+
}
|
|
107
|
+
const palette = { ...ZSH_NAMED_COLORS };
|
|
108
|
+
for (const [slot, value] of Object.entries(spec.palette ?? {})) {
|
|
109
|
+
if (!ZSH_COLOR_NAMES.includes(slot)) {
|
|
110
|
+
throw new Error(`Unknown palette color "${slot}" in theme "${name}". Valid palette colors: ${ZSH_COLOR_NAMES.join(', ')}.`);
|
|
111
|
+
}
|
|
112
|
+
if (typeof value !== 'string' || !HEX_COLOR.test(value)) {
|
|
113
|
+
throw new Error(`Palette overrides must be "#rrggbb" hex; theme "${name}" has "${slot}": "${String(value)}".`);
|
|
114
|
+
}
|
|
115
|
+
palette[slot] = value.toLowerCase();
|
|
116
|
+
}
|
|
117
|
+
const merged = { ...purple.roles, ...spec.roles, ...overrides };
|
|
118
|
+
const resolved = {};
|
|
119
|
+
for (const role of THEME_ROLES)
|
|
120
|
+
resolved[role] = resolveColorSpec(String(merged[role] ?? ''), palette);
|
|
121
|
+
return resolved;
|
|
122
|
+
}
|
|
123
|
+
/** The active theme instance; swap with `setActiveTheme` before rendering (and on future `/theme` switches). */
|
|
124
|
+
export let theme = resolveTheme();
|
|
125
|
+
export function setActiveTheme(next) {
|
|
126
|
+
theme = next;
|
|
127
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Port of af-magic.zsh-theme, which uses xterm-256 slots — kept numeric so
|
|
4
|
+
* the port stays a transliteration of ${FG[105]}», ${FG[032]}%~, ${FG[075]}(,
|
|
5
|
+
* ${FG[078]}branch, ${FG[214]}*, ${FG[237]}dashes, $fg[red]%? ↵.
|
|
6
|
+
*/
|
|
7
|
+
export declare const afMagic: HazeThemeSpec;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of af-magic.zsh-theme, which uses xterm-256 slots — kept numeric so
|
|
3
|
+
* the port stays a transliteration of ${FG[105]}», ${FG[032]}%~, ${FG[075]}(,
|
|
4
|
+
* ${FG[078]}branch, ${FG[214]}*, ${FG[237]}dashes, $fg[red]%? ↵.
|
|
5
|
+
*/
|
|
6
|
+
export const afMagic = {
|
|
7
|
+
roles: {
|
|
8
|
+
// Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
|
|
9
|
+
background: '#121212',
|
|
10
|
+
accent: '105',
|
|
11
|
+
accentDim: '61',
|
|
12
|
+
border: '237',
|
|
13
|
+
info: '75',
|
|
14
|
+
muted: '237',
|
|
15
|
+
foreground: '251',
|
|
16
|
+
command: '32',
|
|
17
|
+
success: '78',
|
|
18
|
+
successBg: '22',
|
|
19
|
+
danger: 'red',
|
|
20
|
+
dangerBg: '52',
|
|
21
|
+
warning: '214',
|
|
22
|
+
surfaceBg: '234',
|
|
23
|
+
codeBg: '234',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Port of agnoster.zsh-theme (Powerline segments): AGNOSTER_GIT_CLEAN_BG=green,
|
|
4
|
+
* AGNOSTER_DIR_BG=blue, AGNOSTER_GIT_DIRTY_BG=yellow, AGNOSTER_STATUS_RETVAL_FG=red,
|
|
5
|
+
* AGNOSTER_STATUS_JOB_FG=cyan. The theme's README recommends Solarized, so the
|
|
6
|
+
* port pins a Solarized-dark palette instead of the default Tango approximation.
|
|
7
|
+
* haze has no background segments, so the segment colors become the foreground
|
|
8
|
+
* identity.
|
|
9
|
+
*/
|
|
10
|
+
export declare const agnoster: HazeThemeSpec;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of agnoster.zsh-theme (Powerline segments): AGNOSTER_GIT_CLEAN_BG=green,
|
|
3
|
+
* AGNOSTER_DIR_BG=blue, AGNOSTER_GIT_DIRTY_BG=yellow, AGNOSTER_STATUS_RETVAL_FG=red,
|
|
4
|
+
* AGNOSTER_STATUS_JOB_FG=cyan. The theme's README recommends Solarized, so the
|
|
5
|
+
* port pins a Solarized-dark palette instead of the default Tango approximation.
|
|
6
|
+
* haze has no background segments, so the segment colors become the foreground
|
|
7
|
+
* identity.
|
|
8
|
+
*/
|
|
9
|
+
export const agnoster = {
|
|
10
|
+
palette: {
|
|
11
|
+
black: '#073642',
|
|
12
|
+
red: '#dc322f',
|
|
13
|
+
green: '#859900',
|
|
14
|
+
yellow: '#b58900',
|
|
15
|
+
blue: '#268bd2',
|
|
16
|
+
magenta: '#d33682',
|
|
17
|
+
cyan: '#2aa198',
|
|
18
|
+
white: '#93a1a1',
|
|
19
|
+
default: '#eee8d5',
|
|
20
|
+
},
|
|
21
|
+
roles: {
|
|
22
|
+
// The theme's README recommends Solarized Dark, so the canvas is base03 and
|
|
23
|
+
// the surfaces move to base02 to stay inside that palette.
|
|
24
|
+
background: '#002b36',
|
|
25
|
+
accent: 'green',
|
|
26
|
+
accentDim: '236',
|
|
27
|
+
border: '236',
|
|
28
|
+
info: 'cyan',
|
|
29
|
+
muted: '245',
|
|
30
|
+
foreground: 'default',
|
|
31
|
+
command: 'blue',
|
|
32
|
+
success: 'green',
|
|
33
|
+
successBg: '22',
|
|
34
|
+
danger: 'red',
|
|
35
|
+
dangerBg: '52',
|
|
36
|
+
warning: 'yellow',
|
|
37
|
+
surfaceBg: '#073642', // base02
|
|
38
|
+
codeBg: '#073642', // base02
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Port of bira.zsh-theme (the ╭─/╰─ two-line prompt):
|
|
4
|
+
* $fg[green]%n@%m (user, non-root) → accent 'green'
|
|
5
|
+
* %B$fg[blue]%~ (cwd, bold) → command 'blue'
|
|
6
|
+
* $fg[yellow]‹branch› → info 'yellow'
|
|
7
|
+
* $fg[red]● (dirty), %? ↵ → danger 'red'
|
|
8
|
+
* $fg[green]‹venv› → success 'green'
|
|
9
|
+
*/
|
|
10
|
+
export declare const bira: HazeThemeSpec;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of bira.zsh-theme (the ╭─/╰─ two-line prompt):
|
|
3
|
+
* $fg[green]%n@%m (user, non-root) → accent 'green'
|
|
4
|
+
* %B$fg[blue]%~ (cwd, bold) → command 'blue'
|
|
5
|
+
* $fg[yellow]‹branch› → info 'yellow'
|
|
6
|
+
* $fg[red]● (dirty), %? ↵ → danger 'red'
|
|
7
|
+
* $fg[green]‹venv› → success 'green'
|
|
8
|
+
*/
|
|
9
|
+
export const bira = {
|
|
10
|
+
roles: {
|
|
11
|
+
// Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
|
|
12
|
+
background: '#121212',
|
|
13
|
+
accent: 'green',
|
|
14
|
+
accentDim: 'green',
|
|
15
|
+
border: '236',
|
|
16
|
+
info: 'yellow',
|
|
17
|
+
muted: '245',
|
|
18
|
+
foreground: 'default',
|
|
19
|
+
command: 'blue',
|
|
20
|
+
success: 'green',
|
|
21
|
+
successBg: '22',
|
|
22
|
+
danger: 'red',
|
|
23
|
+
dangerBg: '52',
|
|
24
|
+
warning: 'yellow',
|
|
25
|
+
surfaceBg: '234',
|
|
26
|
+
codeBg: '234',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Port of bureau.zsh-theme [±master ▾●]:
|
|
4
|
+
* $fg_bold[green]± ✓ $ (prompt) → accent 'green'
|
|
5
|
+
* $fg_bold[white]%n %~ (user/path) → command 'white' (cwd), foreground
|
|
6
|
+
* $fg[cyan]▴ (ahead) → info 'cyan'
|
|
7
|
+
* $fg_bold[yellow]● (unstaged) → warning 'yellow'
|
|
8
|
+
* $fg_bold[red]● (untracked) → danger 'red'
|
|
9
|
+
*/
|
|
10
|
+
export declare const bureau: HazeThemeSpec;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of bureau.zsh-theme [±master ▾●]:
|
|
3
|
+
* $fg_bold[green]± ✓ $ (prompt) → accent 'green'
|
|
4
|
+
* $fg_bold[white]%n %~ (user/path) → command 'white' (cwd), foreground
|
|
5
|
+
* $fg[cyan]▴ (ahead) → info 'cyan'
|
|
6
|
+
* $fg_bold[yellow]● (unstaged) → warning 'yellow'
|
|
7
|
+
* $fg_bold[red]● (untracked) → danger 'red'
|
|
8
|
+
*/
|
|
9
|
+
export const bureau = {
|
|
10
|
+
roles: {
|
|
11
|
+
// Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
|
|
12
|
+
background: '#121212',
|
|
13
|
+
accent: 'green',
|
|
14
|
+
accentDim: '236',
|
|
15
|
+
border: '236',
|
|
16
|
+
info: 'cyan',
|
|
17
|
+
muted: '245',
|
|
18
|
+
foreground: 'default',
|
|
19
|
+
command: 'white',
|
|
20
|
+
success: 'green',
|
|
21
|
+
successBg: '22',
|
|
22
|
+
danger: 'red',
|
|
23
|
+
dangerBg: '52',
|
|
24
|
+
warning: 'yellow',
|
|
25
|
+
surfaceBg: '234',
|
|
26
|
+
codeBg: '235',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Port of clean.zsh-theme:
|
|
4
|
+
* $fg_bold[white]%n (user) → accent 'white'
|
|
5
|
+
* $fg_bold[blue]%c/ (cwd) → command 'blue'
|
|
6
|
+
* $fg_bold[blue]( git branch → info 'blue', branch $fg[yellow] → warning
|
|
7
|
+
* $fg_bold[red]✗ (dirty) → danger 'red'
|
|
8
|
+
*/
|
|
9
|
+
export declare const clean: HazeThemeSpec;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of clean.zsh-theme:
|
|
3
|
+
* $fg_bold[white]%n (user) → accent 'white'
|
|
4
|
+
* $fg_bold[blue]%c/ (cwd) → command 'blue'
|
|
5
|
+
* $fg_bold[blue]( git branch → info 'blue', branch $fg[yellow] → warning
|
|
6
|
+
* $fg_bold[red]✗ (dirty) → danger 'red'
|
|
7
|
+
*/
|
|
8
|
+
export const clean = {
|
|
9
|
+
roles: {
|
|
10
|
+
// Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
|
|
11
|
+
background: '#121212',
|
|
12
|
+
accent: 'white',
|
|
13
|
+
accentDim: '236',
|
|
14
|
+
border: '236',
|
|
15
|
+
info: 'blue',
|
|
16
|
+
muted: '245',
|
|
17
|
+
foreground: 'default',
|
|
18
|
+
command: 'blue',
|
|
19
|
+
success: 'green',
|
|
20
|
+
successBg: '22',
|
|
21
|
+
danger: 'red',
|
|
22
|
+
dangerBg: '52',
|
|
23
|
+
warning: 'yellow',
|
|
24
|
+
surfaceBg: '234',
|
|
25
|
+
codeBg: '234',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of cloud.zsh-theme: $fg_bold[cyan]☁, $fg[green]%c,
|
|
3
|
+
* $fg[green][$fg[cyan]branch, $fg[yellow]⚡ dirty.
|
|
4
|
+
*/
|
|
5
|
+
export const cloud = {
|
|
6
|
+
roles: {
|
|
7
|
+
// Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
|
|
8
|
+
background: '#121212',
|
|
9
|
+
accent: 'cyan',
|
|
10
|
+
accentDim: '236',
|
|
11
|
+
border: '236',
|
|
12
|
+
info: 'blue',
|
|
13
|
+
muted: '245',
|
|
14
|
+
foreground: 'default',
|
|
15
|
+
command: 'green',
|
|
16
|
+
success: 'green',
|
|
17
|
+
successBg: '22',
|
|
18
|
+
danger: 'red',
|
|
19
|
+
dangerBg: '52',
|
|
20
|
+
warning: 'yellow',
|
|
21
|
+
surfaceBg: '234',
|
|
22
|
+
codeBg: '234',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Port of dst.zsh-theme:
|
|
4
|
+
* $fg[magenta]%n (user) → accent 'magenta'
|
|
5
|
+
* $fg[yellow]%m (host) → warning 'yellow'
|
|
6
|
+
* $fg_bold[blue]%~ (cwd) → command 'blue'
|
|
7
|
+
* $fg[green]branch prefix → info 'green' $fg[red]! (dirty) → danger 'red'
|
|
8
|
+
* $fg[green][%*] (clock) → success 'green'
|
|
9
|
+
*/
|
|
10
|
+
export declare const dst: HazeThemeSpec;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of dst.zsh-theme:
|
|
3
|
+
* $fg[magenta]%n (user) → accent 'magenta'
|
|
4
|
+
* $fg[yellow]%m (host) → warning 'yellow'
|
|
5
|
+
* $fg_bold[blue]%~ (cwd) → command 'blue'
|
|
6
|
+
* $fg[green]branch prefix → info 'green' $fg[red]! (dirty) → danger 'red'
|
|
7
|
+
* $fg[green][%*] (clock) → success 'green'
|
|
8
|
+
*/
|
|
9
|
+
export const dst = {
|
|
10
|
+
roles: {
|
|
11
|
+
// Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
|
|
12
|
+
background: '#121212',
|
|
13
|
+
accent: 'magenta',
|
|
14
|
+
accentDim: 'magenta',
|
|
15
|
+
border: '236',
|
|
16
|
+
info: 'green',
|
|
17
|
+
muted: '245',
|
|
18
|
+
foreground: 'default',
|
|
19
|
+
command: 'blue',
|
|
20
|
+
success: 'green',
|
|
21
|
+
successBg: '22',
|
|
22
|
+
danger: 'red',
|
|
23
|
+
dangerBg: '52',
|
|
24
|
+
warning: 'yellow',
|
|
25
|
+
surfaceBg: '234',
|
|
26
|
+
codeBg: '234',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Port of fishy.zsh-theme: $fg[green]%n and cwd (user_color='green'),
|
|
4
|
+
* $fg_bold[red] exit status, and its git-status markers (+ green, ! blue,
|
|
5
|
+
* - red, > magenta, # yellow, ? cyan).
|
|
6
|
+
*/
|
|
7
|
+
export declare const fishy: HazeThemeSpec;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of fishy.zsh-theme: $fg[green]%n and cwd (user_color='green'),
|
|
3
|
+
* $fg_bold[red] exit status, and its git-status markers (+ green, ! blue,
|
|
4
|
+
* - red, > magenta, # yellow, ? cyan).
|
|
5
|
+
*/
|
|
6
|
+
export const fishy = {
|
|
7
|
+
roles: {
|
|
8
|
+
// Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
|
|
9
|
+
background: '#121212',
|
|
10
|
+
accent: 'green',
|
|
11
|
+
accentDim: 'green',
|
|
12
|
+
border: '236',
|
|
13
|
+
info: 'cyan',
|
|
14
|
+
muted: '245',
|
|
15
|
+
foreground: 'default',
|
|
16
|
+
command: 'green',
|
|
17
|
+
success: 'green',
|
|
18
|
+
successBg: '22',
|
|
19
|
+
danger: 'red',
|
|
20
|
+
dangerBg: '52',
|
|
21
|
+
warning: 'yellow',
|
|
22
|
+
surfaceBg: '234',
|
|
23
|
+
codeBg: '235',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HazeThemeSpec } from '../theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Every built-in theme, keyed by its settings name. Keys must equal their file
|
|
4
|
+
* names (minus `.ts`), mirroring how oh-my-zsh discovers `themes/<name>.zsh-theme`
|
|
5
|
+
* by `ZSH_THEME=<name>`; `tests/ui/theme.test.ts` enforces folder↔registry parity.
|
|
6
|
+
* See AGENTS.md in this folder for how to add/convert themes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BUILT_IN_THEME_SPECS: Record<string, HazeThemeSpec>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { purple } from './purple.js';
|
|
2
|
+
import { light } from './light.js';
|
|
3
|
+
import { afMagic } from './af-magic.js';
|
|
4
|
+
import { agnoster } from './agnoster.js';
|
|
5
|
+
import { bira } from './bira.js';
|
|
6
|
+
import { bureau } from './bureau.js';
|
|
7
|
+
import { clean } from './clean.js';
|
|
8
|
+
import { cloud } from './cloud.js';
|
|
9
|
+
import { dst } from './dst.js';
|
|
10
|
+
import { fishy } from './fishy.js';
|
|
11
|
+
import { robbyrussell } from './robbyrussell.js';
|
|
12
|
+
import { solarizedDark } from './solarized-dark.js';
|
|
13
|
+
import { solarizedLight } from './solarized-light.js';
|
|
14
|
+
import { steeef } from './steeef.js';
|
|
15
|
+
/**
|
|
16
|
+
* Every built-in theme, keyed by its settings name. Keys must equal their file
|
|
17
|
+
* names (minus `.ts`), mirroring how oh-my-zsh discovers `themes/<name>.zsh-theme`
|
|
18
|
+
* by `ZSH_THEME=<name>`; `tests/ui/theme.test.ts` enforces folder↔registry parity.
|
|
19
|
+
* See AGENTS.md in this folder for how to add/convert themes.
|
|
20
|
+
*/
|
|
21
|
+
export const BUILT_IN_THEME_SPECS = {
|
|
22
|
+
purple,
|
|
23
|
+
light,
|
|
24
|
+
'af-magic': afMagic,
|
|
25
|
+
agnoster,
|
|
26
|
+
bira,
|
|
27
|
+
bureau,
|
|
28
|
+
clean,
|
|
29
|
+
cloud,
|
|
30
|
+
dst,
|
|
31
|
+
fishy,
|
|
32
|
+
robbyrussell,
|
|
33
|
+
'solarized-dark': solarizedDark,
|
|
34
|
+
'solarized-light': solarizedLight,
|
|
35
|
+
steeef,
|
|
36
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Light-terminal variant of the haze `purple` palette: every fg/bg pair re-tuned together. */
|
|
2
|
+
export const light = {
|
|
3
|
+
roles: {
|
|
4
|
+
// Pure white terminal background; layered surfaces stay slightly off-white.
|
|
5
|
+
background: '#ffffff',
|
|
6
|
+
accent: '#a78bfa',
|
|
7
|
+
accentDim: '#c4b5fd',
|
|
8
|
+
border: '#6b7280',
|
|
9
|
+
info: '#3b82f6',
|
|
10
|
+
muted: '#6b7280',
|
|
11
|
+
foreground: '#1e293b',
|
|
12
|
+
command: '#f59e0b',
|
|
13
|
+
success: '#10b981',
|
|
14
|
+
successBg: '#f0fdf4',
|
|
15
|
+
danger: '#ef4444',
|
|
16
|
+
dangerBg: '#fef2f2',
|
|
17
|
+
warning: '#f59e0b',
|
|
18
|
+
surfaceBg: '#f8fafc',
|
|
19
|
+
codeBg: '#f1f5f9',
|
|
20
|
+
},
|
|
21
|
+
};
|