@wrongstack/tui 0.306.4 → 0.307.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.
Files changed (42) hide show
  1. package/dist/app-view-pickers.d.ts +13 -0
  2. package/dist/app-view-sidebar.d.ts +19 -0
  3. package/dist/app.d.ts +1 -1
  4. package/dist/components/context-panel.d.ts +18 -0
  5. package/dist/components/history/copy-registry.d.ts +28 -0
  6. package/dist/components/history/entry-helpers.d.ts +63 -0
  7. package/dist/components/history/entry.d.ts +1 -15
  8. package/dist/components/history/sage-memory-block.d.ts +44 -0
  9. package/dist/components/history/tool-entry.d.ts +11 -0
  10. package/dist/components/history/use-history-controller.d.ts +66 -0
  11. package/dist/components/scrollable-history.d.ts +0 -24
  12. package/dist/components/sidebar-content.d.ts +15 -1
  13. package/dist/components/sidebar-panels-shared.d.ts +20 -0
  14. package/dist/components/sidebar-panels-task.d.ts +65 -0
  15. package/dist/components/sidebar-panels-workspace.d.ts +50 -0
  16. package/dist/components/sidebar-panels.d.ts +3 -139
  17. package/dist/components/status-bar-icons.d.ts +45 -0
  18. package/dist/components/status-bar-rails.d.ts +89 -0
  19. package/dist/components/status-bar.d.ts +1 -2
  20. package/dist/hooks/use-active-theme.d.ts +1 -1
  21. package/dist/hooks/use-app-event-bridges.d.ts +46 -0
  22. package/dist/hooks/use-app-execution-pipeline.d.ts +24 -0
  23. package/dist/hooks/use-app-panels-state.d.ts +34 -0
  24. package/dist/hooks/use-app-pipeline-builders.d.ts +101 -0
  25. package/dist/hooks/use-picker-keys-auth-model.d.ts +4 -0
  26. package/dist/hooks/use-picker-keys-tools-settings.d.ts +4 -0
  27. package/dist/hooks/use-session-rewind.d.ts +14 -0
  28. package/dist/hooks/use-status-sync-interval.d.ts +23 -0
  29. package/dist/hooks/use-statusbar-view-model.d.ts +25 -1
  30. package/dist/hooks/use-theme-picker-handler.d.ts +13 -0
  31. package/dist/index.js +29438 -28740
  32. package/dist/input-tokens.d.ts +1 -1
  33. package/dist/memory-slash-gather.d.ts +8 -0
  34. package/dist/memory-slash-render.d.ts +62 -0
  35. package/dist/memory-slash-renderers.d.ts +16 -0
  36. package/dist/memory-slash-types.d.ts +91 -0
  37. package/dist/memory-slash-write.d.ts +38 -0
  38. package/dist/theme-presets.d.ts +6 -0
  39. package/dist/theme-types.d.ts +42 -0
  40. package/dist/theme-utils.d.ts +63 -0
  41. package/dist/theme.d.ts +5 -215
  42. package/package.json +11 -11
@@ -6,7 +6,7 @@
6
6
  * e.g. `, 123 lines`, is tolerated; legacy `[file #N]` is included)
7
7
  * - path-keyed `[file:<path>]`
8
8
  */
9
- export declare const INLINE_TOKEN_SRC = "\\[(?:pasted|image|file) #\\d+[^\\]]*\\]|\\[file:[^\\]]+\\]";
9
+ export declare const INLINE_TOKEN_SRC = "\\[(?:pasted|image|file) #\\d+[^\\]]*\\]|\\[file:[^\\]]+\\]|\\[VIBE\\]";
10
10
  /**
11
11
  * If a whole chip ends immediately before `cursor`, return the buffer and
12
12
  * cursor with that chip removed (so one backspace deletes the entire token,
@@ -0,0 +1,8 @@
1
+ import type { MemoryPort } from '@wrongstack/core/types';
2
+ export declare function handleGraphSubcommand(store: MemoryPort, tokens: string[]): Promise<{
3
+ message: string;
4
+ }>;
5
+ export declare function handleGatherSubcommand(store: MemoryPort, tokens: string[]): Promise<{
6
+ message: string;
7
+ }>;
8
+ //# sourceMappingURL=memory-slash-gather.d.ts.map
@@ -0,0 +1,62 @@
1
+ import type { MemoryEntry, MemoryScope, MemoryType, MemoryPriority } from '@wrongstack/core/types';
2
+ export interface SageLike {
3
+ id: string;
4
+ kind: string;
5
+ status: string;
6
+ text: string;
7
+ tags: string[];
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ importance: number;
11
+ confidence: number;
12
+ anchors: Array<{
13
+ type: string;
14
+ path?: string | undefined;
15
+ symbol?: string | undefined;
16
+ command?: string | undefined;
17
+ }>;
18
+ sources: Array<{
19
+ type: string;
20
+ }>;
21
+ }
22
+ export interface SageStatsLike {
23
+ total: number;
24
+ byStatus: Record<string, number>;
25
+ byKind: Partial<Record<string, number>>;
26
+ edges: number;
27
+ }
28
+ export interface MemoryAnchorLike {
29
+ type: string;
30
+ path?: string | undefined;
31
+ symbol?: string | undefined;
32
+ command?: string | undefined;
33
+ }
34
+ export interface Stats {
35
+ total: number;
36
+ perScope: Record<MemoryScope, number>;
37
+ perType: Partial<Record<MemoryType, number>>;
38
+ perPriority: Partial<Record<MemoryPriority, number>>;
39
+ recency: {
40
+ week: number;
41
+ month: number;
42
+ older: number;
43
+ };
44
+ tagCounts: Map<string, number>;
45
+ noTypeCount: number;
46
+ noPriorityCount: number;
47
+ sources: Set<string>;
48
+ }
49
+ export declare function computeStats(entries: MemoryEntry[], now?: number): Stats;
50
+ /**
51
+ * Render a simple ASCII sparkbar: a string of █ chars proportional to the ratio
52
+ * of `value / total`. Always at least 1 block when value > 0, max 10 blocks.
53
+ * Returns empty string when value is 0.
54
+ */
55
+ export declare function sparkbar(value: number, total: number): string;
56
+ export declare function renderSageStats(stats: SageStatsLike, memories: SageLike[], tagFilter?: string, pathFilter?: string): string[];
57
+ export declare function renderSageEntries(memories: SageLike[], compact?: boolean, now?: number): string[];
58
+ export declare function renderLegacySummary(stats: Stats): string[];
59
+ export declare function renderLegacyEntry(e: MemoryEntry, now?: number): string;
60
+ export declare function renderLegacyCompactList(entries: MemoryEntry[]): string[];
61
+ export declare function renderLegacyScopeSection(scope: MemoryScope, entries: MemoryEntry[], now?: number): string[];
62
+ //# sourceMappingURL=memory-slash-render.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { MemoryEntry, MemoryPort } from '@wrongstack/core/types';
2
+ import { type ParsedArgs, type ParsedMemoryFlags, type SageLike, type SageStatsLike, type Stats } from './memory-slash-types.js';
3
+ export declare function computeStats(entries: MemoryEntry[], now?: number): Stats;
4
+ export declare function renderSageStats(stats: SageStatsLike, memories: SageLike[], tagFilter?: string, pathFilter?: string): string[];
5
+ export declare function renderSageEntries(memories: SageLike[], compact?: boolean, now?: number): string[];
6
+ export declare function renderLegacySummary(stats: Stats): string[];
7
+ export declare function renderLegacyEntry(e: MemoryEntry, now?: number): string;
8
+ export declare function renderLegacyCompactList(entries: MemoryEntry[]): string[];
9
+ export declare function sparkbar(value: number, total: number): string;
10
+ export declare function parseArgs(raw: string): ParsedArgs;
11
+ export declare function parseMemoryFlags(tokens: string[]): ParsedMemoryFlags;
12
+ export declare function memErr(err: unknown): string;
13
+ export declare function handleMemoryWrite(store: MemoryPort, sub: string, rest: string[]): Promise<{
14
+ message: string;
15
+ }>;
16
+ //# sourceMappingURL=memory-slash-renderers.d.ts.map
@@ -0,0 +1,91 @@
1
+ import type { MemoryPort, MemoryPriority, MemoryScope, MemoryType } from '@wrongstack/core/types';
2
+ export interface MemorySlashDeps {
3
+ memoryStore: MemoryPort;
4
+ }
5
+ export declare const DEFAULT_MEMORY_LIMIT = 50;
6
+ export declare const MAX_MEMORY_LIMIT = 500;
7
+ export interface SageLike {
8
+ id: string;
9
+ kind: string;
10
+ status: string;
11
+ text: string;
12
+ tags: string[];
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ importance: number;
16
+ confidence: number;
17
+ anchors: Array<{
18
+ type: string;
19
+ path?: string | undefined;
20
+ symbol?: string | undefined;
21
+ command?: string | undefined;
22
+ }>;
23
+ sources: Array<{
24
+ type: string;
25
+ }>;
26
+ }
27
+ export interface SageStatsLike {
28
+ total: number;
29
+ byStatus: Record<string, number>;
30
+ byKind: Partial<Record<string, number>>;
31
+ edges: number;
32
+ }
33
+ export interface MemoryAnchorLike {
34
+ type: string;
35
+ path?: string | undefined;
36
+ symbol?: string | undefined;
37
+ command?: string | undefined;
38
+ }
39
+ export interface UpdateSageInput {
40
+ text?: string | undefined;
41
+ kind?: string | undefined;
42
+ tags?: string[] | undefined;
43
+ anchors?: MemoryAnchorLike[] | undefined;
44
+ importance?: number | undefined;
45
+ confidence?: number | undefined;
46
+ freshness?: number | undefined;
47
+ status?: string | undefined;
48
+ supersedes?: string[] | undefined;
49
+ contradicts?: string[] | undefined;
50
+ }
51
+ export interface Stats {
52
+ total: number;
53
+ perScope: Record<MemoryScope, number>;
54
+ perType: Partial<Record<MemoryType, number>>;
55
+ perPriority: Partial<Record<MemoryPriority, number>>;
56
+ recency: {
57
+ week: number;
58
+ month: number;
59
+ older: number;
60
+ };
61
+ tagCounts: Map<string, number>;
62
+ noTypeCount: number;
63
+ noPriorityCount: number;
64
+ sources: Set<string>;
65
+ }
66
+ export interface ParsedArgs {
67
+ tag?: string;
68
+ path?: string;
69
+ compact: boolean;
70
+ limit: number;
71
+ positional: string;
72
+ }
73
+ export declare const MEMORY_WRITE_SUBS: Set<string>;
74
+ export declare const MEMORY_KIND_VALUES: string[];
75
+ export declare const MEMORY_SCOPE_VALUES: string[];
76
+ export declare const MEMORY_STATUS_VALUES: readonly ['active', 'stale', 'superseded', 'contradicted', 'archived', 'deleted'];
77
+ export interface ParsedMemoryFlags {
78
+ text: string;
79
+ kind?: string;
80
+ scope?: string;
81
+ status?: string;
82
+ tags?: string[];
83
+ anchors?: MemoryAnchorLike[];
84
+ importance?: number | undefined;
85
+ confidence?: number | undefined;
86
+ freshness?: number | undefined;
87
+ supersedes?: string[];
88
+ contradicts?: string[];
89
+ errors: string[];
90
+ }
91
+ //# sourceMappingURL=memory-slash-types.d.ts.map
@@ -0,0 +1,38 @@
1
+ import type { MemoryPort } from '@wrongstack/core/types';
2
+ import type { MemoryAnchorLike } from './memory-slash-render.js';
3
+ export declare const MEMORY_WRITE_SUBS: Set<string>;
4
+ export declare const MEMORY_KIND_VALUES: string[];
5
+ export declare const MEMORY_SCOPE_VALUES: string[];
6
+ export declare const MEMORY_STATUS_VALUES: readonly ['active', 'stale', 'superseded', 'contradicted', 'archived', 'deleted'];
7
+ export interface UpdateSageInput {
8
+ text?: string | undefined;
9
+ kind?: string | undefined;
10
+ tags?: string[] | undefined;
11
+ anchors?: MemoryAnchorLike[] | undefined;
12
+ importance?: number | undefined;
13
+ confidence?: number | undefined;
14
+ freshness?: number | undefined;
15
+ status?: string | undefined;
16
+ supersedes?: string[] | undefined;
17
+ contradicts?: string[] | undefined;
18
+ }
19
+ export interface ParsedMemoryFlags {
20
+ text: string;
21
+ kind?: string;
22
+ scope?: string;
23
+ status?: string;
24
+ tags?: string[];
25
+ anchors?: MemoryAnchorLike[];
26
+ importance?: number | undefined;
27
+ confidence?: number | undefined;
28
+ freshness?: number | undefined;
29
+ supersedes?: string[];
30
+ contradicts?: string[];
31
+ errors: string[];
32
+ }
33
+ export declare function parseMemoryFlags(tokens: string[]): ParsedMemoryFlags;
34
+ export declare function memErr(err: unknown): string;
35
+ export declare function handleMemoryWrite(store: MemoryPort, sub: string, rest: string[]): Promise<{
36
+ message: string;
37
+ }>;
38
+ //# sourceMappingURL=memory-slash-write.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { Theme, ThemeName, ThemePickerOption } from './theme-types.js';
2
+ export declare const baseTheme: Theme;
3
+ export declare const themePresets: Record<ThemeName, Theme>;
4
+ export declare const THEME_OPTIONS: readonly ThemePickerOption[];
5
+ export declare const themePickerOptions: readonly ThemePickerOption[];
6
+ //# sourceMappingURL=theme-presets.d.ts.map
@@ -0,0 +1,42 @@
1
+ import type { ThemePresetId } from '@wrongstack/core/types';
2
+ export type SyntaxRole = 'keyword' | 'string' | 'comment' | 'commentOnWash' | 'number' | 'literal' | 'property' | 'variable' | 'command' | 'flag' | 'decorator' | 'diffAdd' | 'diffDel' | 'diffMeta';
3
+ export type SyntaxPalette = Record<SyntaxRole, string>;
4
+ export type ThemeName = ThemePresetId;
5
+ export interface ThemePickerOption {
6
+ id: ThemeName;
7
+ name: string;
8
+ description: string;
9
+ }
10
+ export interface Theme {
11
+ textPrimary: string;
12
+ textSecondary: string;
13
+ textMuted: string;
14
+ brandPrimary: string;
15
+ brandAccent: string;
16
+ surface: string;
17
+ surfaceRaised: string;
18
+ accent: string;
19
+ user: string;
20
+ assistant: string;
21
+ tool: string;
22
+ success: string;
23
+ warn: string;
24
+ error: string;
25
+ dim: true | string;
26
+ supportsBackground: boolean;
27
+ borderDefault: string;
28
+ borderSubtle: string;
29
+ borderActive: string;
30
+ brand: string;
31
+ monitor: {
32
+ fleet: string;
33
+ agents: string;
34
+ worktree: string;
35
+ phase: string;
36
+ };
37
+ diffAddBg: string;
38
+ diffDelBg: string;
39
+ syntax?: Partial<SyntaxPalette> | undefined;
40
+ }
41
+ export type ThemeListener = (name: ThemeName) => void;
42
+ //# sourceMappingURL=theme-types.d.ts.map
@@ -0,0 +1,63 @@
1
+ import type { SyntaxPalette, SyntaxRole, Theme } from './theme-types.js';
2
+ export declare const pastel: Readonly<{
3
+ readonly black: '#11111b';
4
+ readonly red: '#f38ba8';
5
+ readonly green: '#a6e3a1';
6
+ readonly yellow: '#f9e2af';
7
+ readonly blue: '#89b4fa';
8
+ readonly magenta: '#cba6f7';
9
+ readonly cyan: '#94e2d5';
10
+ readonly white: '#cdd6f4';
11
+ readonly gray: '#7f849c';
12
+ readonly grey: '#7f849c';
13
+ readonly grayBright: '#a6adc8';
14
+ readonly greyBright: '#a6adc8';
15
+ readonly blackBright: '#585b70';
16
+ readonly redBright: '#eba0ac';
17
+ readonly greenBright: '#b8e8b0';
18
+ readonly yellowBright: '#f5e6b8';
19
+ readonly blueBright: '#89dceb';
20
+ readonly magentaBright: '#b4befe';
21
+ readonly cyanBright: '#99e6da';
22
+ readonly whiteBright: '#ffffff';
23
+ readonly peach: '#fab387';
24
+ readonly pink: '#f5c2e7';
25
+ readonly surface0: '#313244';
26
+ readonly surface1: '#45475a';
27
+ readonly subtext0: '#a6adc8';
28
+ readonly flamingo: '#f2cdcd';
29
+ }>;
30
+ export declare const catppuccin: Readonly<{
31
+ readonly black: '#11111b';
32
+ readonly red: '#f38ba8';
33
+ readonly green: '#a6e3a1';
34
+ readonly yellow: '#f9e2af';
35
+ readonly blue: '#89b4fa';
36
+ readonly magenta: '#cba6f7';
37
+ readonly cyan: '#94e2d5';
38
+ readonly white: '#cdd6f4';
39
+ readonly gray: '#7f849c';
40
+ readonly grey: '#7f849c';
41
+ readonly grayBright: '#a6adc8';
42
+ readonly greyBright: '#a6adc8';
43
+ readonly blackBright: '#585b70';
44
+ readonly redBright: '#eba0ac';
45
+ readonly greenBright: '#b8e8b0';
46
+ readonly yellowBright: '#f5e6b8';
47
+ readonly blueBright: '#89dceb';
48
+ readonly magentaBright: '#b4befe';
49
+ readonly cyanBright: '#99e6da';
50
+ readonly whiteBright: '#ffffff';
51
+ readonly peach: '#fab387';
52
+ readonly pink: '#f5c2e7';
53
+ readonly surface0: '#313244';
54
+ readonly surface1: '#45475a';
55
+ readonly subtext0: '#a6adc8';
56
+ readonly flamingo: '#f2cdcd';
57
+ }>;
58
+ export declare const SYNTAX_TOKEN: Readonly<Record<SyntaxRole, keyof Theme>>;
59
+ export declare function resolveSyntaxColor(role: SyntaxRole, palette: Theme): string;
60
+ export declare function resolveSyntaxPalette(palette: Theme): SyntaxPalette;
61
+ export declare function softColorWithTheme(color: string | undefined, currentTheme: Theme): string | undefined;
62
+ export declare function detectSupportsBackground(env?: NodeJS.ProcessEnv, isTTY?: boolean): boolean;
63
+ //# sourceMappingURL=theme-utils.d.ts.map
package/dist/theme.d.ts CHANGED
@@ -1,224 +1,14 @@
1
- import type { ThemePresetId } from '@wrongstack/core/types';
2
- export declare const pastel: Readonly<{
3
- readonly black: '#11111b';
4
- readonly red: '#f38ba8';
5
- readonly green: '#a6e3a1';
6
- readonly yellow: '#f9e2af';
7
- readonly blue: '#89b4fa';
8
- readonly magenta: '#cba6f7';
9
- readonly cyan: '#94e2d5';
10
- readonly white: '#cdd6f4';
11
- readonly gray: '#7f849c';
12
- readonly grey: '#7f849c';
13
- readonly grayBright: '#a6adc8';
14
- readonly greyBright: '#a6adc8';
15
- readonly blackBright: '#585b70';
16
- readonly redBright: '#eba0ac';
17
- readonly greenBright: '#b8e8b0';
18
- readonly yellowBright: '#f5e6b8';
19
- readonly blueBright: '#89dceb';
20
- readonly magentaBright: '#b4befe';
21
- readonly cyanBright: '#99e6da';
22
- readonly whiteBright: '#ffffff';
23
- readonly peach: '#fab387';
24
- readonly pink: '#f5c2e7';
25
- readonly surface0: '#313244';
26
- readonly surface1: '#45475a';
27
- readonly subtext0: '#a6adc8';
28
- readonly flamingo: '#f2cdcd';
29
- }>;
30
- /**
31
- * Convenience re-export of individual Catppuccin hex values so themed
32
- * components (e.g. banner, auth panel) can import them without hardcoding.
33
- */
34
- export declare const catppuccin: Readonly<{
35
- readonly black: '#11111b';
36
- readonly red: '#f38ba8';
37
- readonly green: '#a6e3a1';
38
- readonly yellow: '#f9e2af';
39
- readonly blue: '#89b4fa';
40
- readonly magenta: '#cba6f7';
41
- readonly cyan: '#94e2d5';
42
- readonly white: '#cdd6f4';
43
- readonly gray: '#7f849c';
44
- readonly grey: '#7f849c';
45
- readonly grayBright: '#a6adc8';
46
- readonly greyBright: '#a6adc8';
47
- readonly blackBright: '#585b70';
48
- readonly redBright: '#eba0ac';
49
- readonly greenBright: '#b8e8b0';
50
- readonly yellowBright: '#f5e6b8';
51
- readonly blueBright: '#89dceb';
52
- readonly magentaBright: '#b4befe';
53
- readonly cyanBright: '#99e6da';
54
- readonly whiteBright: '#ffffff';
55
- readonly peach: '#fab387';
56
- readonly pink: '#f5c2e7';
57
- readonly surface0: '#313244';
58
- readonly surface1: '#45475a';
59
- readonly subtext0: '#a6adc8';
60
- readonly flamingo: '#f2cdcd';
61
- }>;
62
- /** The distinct things `highlightLine` can color. */
63
- export type SyntaxRole = 'keyword' | 'string' | 'comment' | 'commentOnWash' | 'number' | 'literal' | 'property' | 'variable' | 'command' | 'flag' | 'decorator' | 'diffAdd' | 'diffDel' | 'diffMeta';
64
- export type SyntaxPalette = Record<SyntaxRole, string>;
65
- /**
66
- * Resolve one syntax role against a palette. A preset may pin any role
67
- * explicitly via its optional `syntax` field (e.g. a scheme whose strings are
68
- * orange rather than green); otherwise the role borrows the token named in
69
- * {@link SYNTAX_TOKEN}. O(1) and allocation-free — this runs once per token
70
- * per rendered line.
71
- */
1
+ import type { SyntaxPalette, SyntaxRole, Theme, ThemeName } from './theme-types.js';
2
+ export { catppuccin, detectSupportsBackground, pastel, SYNTAX_TOKEN } from './theme-utils.js';
3
+ export { baseTheme, THEME_OPTIONS, themePickerOptions, themePresets } from './theme-presets.js';
4
+ export type { SyntaxPalette, SyntaxRole, Theme, ThemeName, ThemePickerOption } from './theme-types.js';
5
+ export declare const theme: Theme;
72
6
  export declare function resolveSyntaxColor(role: SyntaxRole, palette?: Theme): string;
73
- /** Materialize the full syntax palette for a theme. Used by tests and tooling. */
74
7
  export declare function resolveSyntaxPalette(palette?: Theme): SyntaxPalette;
75
- /**
76
- * Resolve a color value to a concrete color.
77
- *
78
- * Three cases, in order:
79
- * - `syntax.<role>` resolves against the ACTIVE theme, so highlighting
80
- * follows `/theme` (see {@link resolveSyntaxColor}).
81
- * - A known ANSI name maps to its {@link pastel} hex. This map is frozen and
82
- * theme-independent by design — it is the floor for the ~177 call sites
83
- * that still pass bare names like `color="red"`.
84
- * - Anything else (hex, rgb, Ink's `'dim'`, an unknown name) passes through.
85
- *
86
- * `undefined` stays `undefined` so callers can spread it without forcing a
87
- * color. NOTE: an unknown name that reaches Ink is silently DROPPED by chalk —
88
- * the token renders with no color at all. Never emit a name that isn't
89
- * resolvable here.
90
- */
91
8
  export declare function softColor(color?: string): string | undefined;
92
- /**
93
- * Whether the host terminal can render truecolor backgrounds.
94
- *
95
- * Surfaced as `theme.supportsBackground` so diff / status / progress
96
- * components can opt out of pastel background washes on plain terminals
97
- * (e.g. `TERM=xterm`, `NO_COLOR=1`, or a piped non-TTY). Detection follows
98
- * the chalk / supports-color convention: explicit `NO_COLOR` wins, then
99
- * `COLORTERM=truecolor|24bit`, then a `TERM` substring match. Default is
100
- * `true` (most modern terminals are truecolor); a missing TTY flips it to
101
- * `false` so captured output stays clean.
102
- *
103
- * Both `env` and `isTTY` are overridable so unit tests can exercise every
104
- * branch without mutating process state.
105
- */
106
- export declare function detectSupportsBackground(env?: NodeJS.ProcessEnv, isTTY?: boolean): boolean;
107
- /**
108
- * Canonical palette preset identifiers. The runtime palette is always one of
109
- * these five names; the key is also the public CLI/TUI slug (used in
110
- * `config.themePreset` and the `/theme <preset>` slash command).
111
- */
112
- export type ThemeName = ThemePresetId;
113
- export interface ThemePickerOption {
114
- id: ThemeName;
115
- name: string;
116
- description: string;
117
- }
118
- export interface Theme {
119
- /** Primary readable foreground used by framed chrome. */
120
- textPrimary: string;
121
- /** Secondary foreground for arguments and supporting labels. */
122
- textSecondary: string;
123
- /** Quiet metadata foreground that remains readable without ANSI dim quirks. */
124
- textMuted: string;
125
- /** Catppuccin peach — warm brand accent, shared with the startup wordmark. */
126
- brandPrimary: string;
127
- /** Catppuccin pink — brand companion accent. */
128
- brandAccent: string;
129
- /** Low-contrast panel surface (used only when background support is safe). */
130
- surface: string;
131
- /** Raised surface for focused chrome. */
132
- surfaceRaised: string;
133
- /** Primary accent — prompts, links, tool names, assistant label. */
134
- accent: string;
135
- /** USER: label + the user's own message text marker. */
136
- user: string;
137
- /** ASSISTANT: label. */
138
- assistant: string;
139
- /** Tool name / tool activity. */
140
- tool: string;
141
- /** Success states (✓, passing, added diff lines). */
142
- success: string;
143
- /** Warnings, queued items, the user-input label. */
144
- warn: string;
145
- /** Errors, failures, deleted diff lines, danger chips. */
146
- error: string;
147
- /** Muted/secondary text. `true` maps to Ink's `dimColor`; a color name also works. */
148
- dim: true | string;
149
- /**
150
- * Whether the host terminal can render truecolor backgrounds. Determined
151
- * at startup from `process.env.TERM` / `COLORTERM` / `NO_COLOR` plus
152
- * `process.stdout.isTTY`; passed to diff blocks so they can fall back to
153
- * marker-only colouring when the terminal strips backgrounds.
154
- */
155
- supportsBackground: boolean;
156
- /** Default (quiet) border color for panels. */
157
- borderDefault: string;
158
- /**
159
- * Near-invisible chrome for dense transcript frames (tool result rails).
160
- * Present enough to structure the block, never loud enough to compete
161
- * with content or status marks.
162
- */
163
- borderSubtle: string;
164
- /** Active/attention border (confirm prompts, focused frames). */
165
- borderActive: string;
166
- /** Banner / brand accent. */
167
- brand: string;
168
- /** Per-monitor accent borders so each overlay has a distinct identity. */
169
- monitor: {
170
- fleet: string;
171
- agents: string;
172
- worktree: string;
173
- phase: string;
174
- };
175
- /**
176
- * Diff add/delete row washes. Dark, low-luminance tints (deep green /
177
- * deep maroon) so the row reads as added/removed while the foreground
178
- * text — including syntax-highlight pastels — keeps full contrast on
179
- * top. Mirrors the Claude Code diff look rather than a light pastel
180
- * wash with dark text.
181
- */
182
- diffAddBg: string;
183
- diffDelBg: string;
184
- /**
185
- * Per-preset syntax-highlight overrides. OPTIONAL and normally omitted —
186
- * every role has a sensible default derived from the tokens above (see
187
- * `SYNTAX_TOKEN`), so a preset only pins a role when its scheme genuinely
188
- * disagrees. Example: VS Code Dark+ colors strings orange, not green, so
189
- * `dark-plus` pins `string`.
190
- */
191
- syntax?: Partial<SyntaxPalette> | undefined;
192
- }
193
- export declare const theme: Theme;
194
- /**
195
- * Snapshot of the active palette. The returned object is the *same* reference
196
- * the rest of the app sees, so identity checks (`===`) can tell when
197
- * `setActiveTheme` has actually swapped something. Cheap to call.
198
- */
199
9
  export declare function getActiveTheme(): Theme;
200
- /**
201
- * Mutate `theme` in place to the given preset's palette. Unknown names fall
202
- * back to `catppuccin` and report the fallback to the caller so the picker can
203
- * show a hint. Subscribers (see `subscribeToTheme`) are notified synchronously.
204
- *
205
- * Returns the name actually applied (always one of `ThemeName`).
206
- */
207
10
  export declare function setActiveTheme(name: string | undefined): ThemeName;
208
11
  type ThemeListener = (name: ThemeName) => void;
209
- /**
210
- * Subscribe to active-theme changes. Returns an unsubscribe function. Used by
211
- * `useActiveTheme()` so React re-renders when the palette swaps. Callers from
212
- * outside React (e.g. host boot wiring) can use it to persist + reapply.
213
- */
214
12
  export declare function subscribeToTheme(cb: ThemeListener): () => void;
215
- /**
216
- * Returns the name of the currently active theme preset, tracked via
217
- * `currentPresetName` (kept in lockstep with `setActiveTheme` mutations).
218
- * Cheap O(1). Always returns one of the canonical `ThemeName` values.
219
- */
220
13
  export declare function getActiveThemeName(): ThemeName;
221
- export declare const themePresets: Record<ThemeName, Theme>;
222
- export declare const THEME_OPTIONS: readonly ThemePickerOption[];
223
- export {};
224
14
  //# sourceMappingURL=theme.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/tui",
3
- "version": "0.306.4",
3
+ "version": "0.307.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack terminal UI: Ink-based interactive renderer with history, pickers, and slash menus.",
6
6
  "repository": {
@@ -29,21 +29,21 @@
29
29
  "ink": "7.1.1",
30
30
  "react": "^19.2.8",
31
31
  "string-width": "8.2.2",
32
- "@wrongstack/runtime": "0.306.4",
33
- "@wrongstack/core": "0.306.4",
34
- "@wrongstack/kanban": "0.306.4",
35
- "@wrongstack/sdd": "0.306.4",
36
- "@wrongstack/tools": "0.306.4",
37
- "@wrongstack/sage": "0.306.4"
32
+ "@wrongstack/core": "0.307.0",
33
+ "@wrongstack/sdd": "0.307.0",
34
+ "@wrongstack/runtime": "0.307.0",
35
+ "@wrongstack/tools": "0.307.0",
36
+ "@wrongstack/kanban": "0.307.0",
37
+ "@wrongstack/sage": "0.307.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@testing-library/dom": "^10.4.1",
41
41
  "@testing-library/react": "^16.3.2",
42
- "@types/node": "^26.1.2",
43
- "@types/react": "^19.2.17",
44
- "@types/react-dom": "^19.2.3",
42
+ "@types/node": "^26.2.0",
43
+ "@types/react": "^19.2.18",
44
+ "@types/react-dom": "^19.2.4",
45
45
  "ink-testing-library": "^4.0.0",
46
- "jsdom": "^29.1.1",
46
+ "jsdom": "^30.0.1",
47
47
  "react-dom": "^19.2.8",
48
48
  "typescript": "^7.0.2"
49
49
  },