@sagmans/dsh-tui 0.1.2 → 0.3.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/README.md +196 -17
- package/cordis.patch.yml +4 -2
- package/lib/agent/host.d.ts +14 -0
- package/lib/agent/host.d.ts.map +1 -1
- package/lib/agent/host.js +20 -4
- package/lib/agent/host.js.map +1 -1
- package/lib/agent/model.d.ts +50 -0
- package/lib/agent/model.d.ts.map +1 -1
- package/lib/agent/model.js +87 -1
- package/lib/agent/model.js.map +1 -1
- package/lib/agent/present.d.ts +7 -1
- package/lib/agent/present.d.ts.map +1 -1
- package/lib/agent/present.js +33 -4
- package/lib/agent/present.js.map +1 -1
- package/lib/agent/presets.d.ts +7 -1
- package/lib/agent/presets.d.ts.map +1 -1
- package/lib/agent/presets.js +7 -3
- package/lib/agent/presets.js.map +1 -1
- package/lib/agent/status.d.ts +10 -0
- package/lib/agent/status.d.ts.map +1 -1
- package/lib/agent/status.js +2 -0
- package/lib/agent/status.js.map +1 -1
- package/lib/cards.d.ts +127 -7
- package/lib/cards.d.ts.map +1 -1
- package/lib/cards.js +381 -52
- package/lib/cards.js.map +1 -1
- package/lib/export.d.ts +5 -4
- package/lib/export.d.ts.map +1 -1
- package/lib/export.js +62 -13
- package/lib/export.js.map +1 -1
- package/lib/fold-cursor.d.ts +23 -0
- package/lib/fold-cursor.d.ts.map +1 -0
- package/lib/fold-cursor.js +31 -0
- package/lib/fold-cursor.js.map +1 -0
- package/lib/gates.d.ts +145 -2
- package/lib/gates.d.ts.map +1 -1
- package/lib/gates.js +335 -40
- package/lib/gates.js.map +1 -1
- package/lib/index.d.ts +7 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +651 -92
- package/lib/index.js.map +1 -1
- package/lib/input/actions.d.ts +136 -0
- package/lib/input/actions.d.ts.map +1 -0
- package/lib/input/actions.js +740 -0
- package/lib/input/actions.js.map +1 -0
- package/lib/input/keymap-settings.d.ts +21 -0
- package/lib/input/keymap-settings.d.ts.map +1 -0
- package/lib/input/keymap-settings.js +28 -0
- package/lib/input/keymap-settings.js.map +1 -0
- package/lib/input/keymap.d.ts +91 -0
- package/lib/input/keymap.d.ts.map +1 -0
- package/lib/input/keymap.js +170 -0
- package/lib/input/keymap.js.map +1 -0
- package/lib/input/match.d.ts +10 -0
- package/lib/input/match.d.ts.map +1 -0
- package/lib/input/match.js +83 -0
- package/lib/input/match.js.map +1 -0
- package/lib/input/submission.d.ts +8 -1
- package/lib/input/submission.d.ts.map +1 -1
- package/lib/input/submission.js +9 -2
- package/lib/input/submission.js.map +1 -1
- package/lib/input.d.ts +17 -0
- package/lib/input.d.ts.map +1 -0
- package/lib/input.js +27 -0
- package/lib/input.js.map +1 -0
- package/lib/keys-command.d.ts +16 -0
- package/lib/keys-command.d.ts.map +1 -0
- package/lib/keys-command.js +60 -0
- package/lib/keys-command.js.map +1 -0
- package/lib/queue.d.ts +6 -0
- package/lib/queue.d.ts.map +1 -0
- package/lib/queue.js +68 -0
- package/lib/queue.js.map +1 -0
- package/lib/settings-notice.d.ts +19 -0
- package/lib/settings-notice.d.ts.map +1 -0
- package/lib/settings-notice.js +30 -0
- package/lib/settings-notice.js.map +1 -0
- package/lib/terminal/warning-screen.d.ts +8 -0
- package/lib/terminal/warning-screen.d.ts.map +1 -0
- package/lib/terminal/warning-screen.js +66 -0
- package/lib/terminal/warning-screen.js.map +1 -0
- package/lib/theme-capability.d.ts +36 -0
- package/lib/theme-capability.d.ts.map +1 -0
- package/lib/theme-capability.js +190 -0
- package/lib/theme-capability.js.map +1 -0
- package/lib/theme-command.d.ts +10 -0
- package/lib/theme-command.d.ts.map +1 -0
- package/lib/theme-command.js +61 -0
- package/lib/theme-command.js.map +1 -0
- package/lib/theme-settings.d.ts +196 -0
- package/lib/theme-settings.d.ts.map +1 -0
- package/lib/theme-settings.js +229 -0
- package/lib/theme-settings.js.map +1 -0
- package/lib/theme-tokens.d.ts +110 -0
- package/lib/theme-tokens.d.ts.map +1 -0
- package/lib/theme-tokens.js +427 -0
- package/lib/theme-tokens.js.map +1 -0
- package/lib/theme.d.ts +32 -35
- package/lib/theme.d.ts.map +1 -1
- package/lib/theme.js +112 -63
- package/lib/theme.js.map +1 -1
- package/lib/tokens.d.ts +15 -0
- package/lib/tokens.d.ts.map +1 -0
- package/lib/tokens.js +29 -0
- package/lib/tokens.js.map +1 -0
- package/lib/transcript.d.ts +26 -1
- package/lib/transcript.d.ts.map +1 -1
- package/lib/transcript.js +153 -25
- package/lib/transcript.js.map +1 -1
- package/lib/ui/dock.d.ts.map +1 -1
- package/lib/ui/dock.js +67 -28
- package/lib/ui/dock.js.map +1 -1
- package/lib/ui/editor.d.ts +51 -0
- package/lib/ui/editor.d.ts.map +1 -0
- package/lib/ui/editor.js +159 -0
- package/lib/ui/editor.js.map +1 -0
- package/lib/ui/frame.d.ts +54 -0
- package/lib/ui/frame.d.ts.map +1 -0
- package/lib/ui/frame.js +79 -0
- package/lib/ui/frame.js.map +1 -0
- package/lib/ui/gate-input.d.ts +20 -0
- package/lib/ui/gate-input.d.ts.map +1 -0
- package/lib/ui/gate-input.js +96 -0
- package/lib/ui/gate-input.js.map +1 -0
- package/lib/ui/markdown.d.ts +19 -2
- package/lib/ui/markdown.d.ts.map +1 -1
- package/lib/ui/markdown.js +37 -6
- package/lib/ui/markdown.js.map +1 -1
- package/lib/ui/mermaid.d.ts +44 -0
- package/lib/ui/mermaid.d.ts.map +1 -0
- package/lib/ui/mermaid.js +178 -0
- package/lib/ui/mermaid.js.map +1 -0
- package/lib/ui/picker.d.ts +66 -7
- package/lib/ui/picker.d.ts.map +1 -1
- package/lib/ui/picker.js +112 -19
- package/lib/ui/picker.js.map +1 -1
- package/lib/ui/prompt.d.ts +30 -0
- package/lib/ui/prompt.d.ts.map +1 -0
- package/lib/ui/prompt.js +45 -0
- package/lib/ui/prompt.js.map +1 -0
- package/lib/ui/queue.d.ts +24 -0
- package/lib/ui/queue.d.ts.map +1 -0
- package/lib/ui/queue.js +57 -0
- package/lib/ui/queue.js.map +1 -0
- package/lib/ui/status.d.ts +7 -1
- package/lib/ui/status.d.ts.map +1 -1
- package/lib/ui/status.js +84 -24
- package/lib/ui/status.js.map +1 -1
- package/lib/ui/view.d.ts +65 -2
- package/lib/ui/view.d.ts.map +1 -1
- package/lib/ui/view.js +319 -59
- package/lib/ui/view.js.map +1 -1
- package/lib/work.d.ts +48 -0
- package/lib/work.d.ts.map +1 -1
- package/lib/work.js +44 -0
- package/lib/work.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type ColourMode } from './theme-capability.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The reset sequence, for the code that has to recognise one.
|
|
4
|
+
*
|
|
5
|
+
* pi-tui closes a truncated row with a reset whether or not it opened a style,
|
|
6
|
+
* so a renderer that turns styling off still has to remove the ones it did not
|
|
7
|
+
* ask for.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resetSequence(): string;
|
|
10
|
+
/**
|
|
11
|
+
* The muted shade every receding element shares.
|
|
12
|
+
*
|
|
13
|
+
* An explicit grey rather than a palette slot: slot 8 is whatever the reader's
|
|
14
|
+
* terminal maps it to, which on the reader's own phone was close enough to
|
|
15
|
+
* ordinary text that dimming looked like it had not been applied at all.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MUTED_GREY = "#8a8a8a";
|
|
18
|
+
/**
|
|
19
|
+
* The shade a tool's argument takes.
|
|
20
|
+
*
|
|
21
|
+
* A call's argument is the one part of a card the reader scans for, and it must
|
|
22
|
+
* read as neither the tool's own label (warn) nor ordinary output (the default
|
|
23
|
+
* foreground); a pale blue sits between them without competing for attention.
|
|
24
|
+
*/
|
|
25
|
+
export declare const ARGUMENT_BLUE = "#8db3d9";
|
|
26
|
+
/**
|
|
27
|
+
* The shade a submitted prompt takes.
|
|
28
|
+
*
|
|
29
|
+
* A reader's own turns and the assistant's reply both shipped on the default
|
|
30
|
+
* foreground, so telling the two apart meant reading them; a mint keeps them
|
|
31
|
+
* apart at a glance without the pink cast a rose gave every prompt.
|
|
32
|
+
*/
|
|
33
|
+
export declare const USER_PROMPT_MINT = "#27F5C8";
|
|
34
|
+
/** Palette entries a token may name instead of a literal colour. */
|
|
35
|
+
export declare const PALETTE_NAMES: readonly ["default", "muted", "accent", "arg", "warn", "added", "removed", "user", "assistant"];
|
|
36
|
+
/** A named palette entry. */
|
|
37
|
+
export type PaletteName = (typeof PALETTE_NAMES)[number];
|
|
38
|
+
/** A colour: an explicit hex value, or a palette entry. */
|
|
39
|
+
export type ColourSpec = string | number | PaletteName;
|
|
40
|
+
/** One element's appearance, every field optional so a reader sets only what they mean. */
|
|
41
|
+
export interface StyleSpec {
|
|
42
|
+
readonly fg?: ColourSpec;
|
|
43
|
+
readonly bg?: ColourSpec;
|
|
44
|
+
readonly bold?: boolean;
|
|
45
|
+
readonly dim?: boolean;
|
|
46
|
+
readonly italic?: boolean;
|
|
47
|
+
readonly underline?: boolean;
|
|
48
|
+
readonly strike?: boolean;
|
|
49
|
+
/** Rendered before the element when set; empty ships nothing. */
|
|
50
|
+
readonly glyph?: string;
|
|
51
|
+
/** The element renders nothing at all when true. */
|
|
52
|
+
readonly hidden?: boolean;
|
|
53
|
+
/** Start from another token's fields instead of this token's own defaults. */
|
|
54
|
+
readonly inherit?: TuiToken;
|
|
55
|
+
}
|
|
56
|
+
/** The resolved escape pair and marks one element needs. */
|
|
57
|
+
export interface ResolvedStyle {
|
|
58
|
+
readonly prefix: string;
|
|
59
|
+
readonly suffix: string;
|
|
60
|
+
readonly glyph: string;
|
|
61
|
+
readonly hidden: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** A row class a tool card can carry, so styling follows what the row means. */
|
|
64
|
+
export declare const CARD_ROW_CLASSES: readonly ["header", "hunk", "added", "removed", "line", "lineNumber", "path", "match", "truncated", "output", "cwd", "status", "source", "url", "detail"];
|
|
65
|
+
/** What a tool card row is, which is what decides how it is drawn. */
|
|
66
|
+
export type CardRowClass = (typeof CARD_ROW_CLASSES)[number];
|
|
67
|
+
/**
|
|
68
|
+
* Every styled element on the surface, grouped by the region that draws it.
|
|
69
|
+
*
|
|
70
|
+
* The list is the contract: a renderer names a token, and the coverage sweep
|
|
71
|
+
* fails if a token loses its default, so "every element" cannot quietly drift
|
|
72
|
+
* as the surface grows.
|
|
73
|
+
*/
|
|
74
|
+
export declare const TUI_TOKENS: readonly ["transcript.user", "transcript.notice", "transcript.marker", "transcript.reasoning.summary", "transcript.reasoning.body", "transcript.reasoning.hint", "tool.title", "tool.glyph", "tool.args", "tool.stat.added", "tool.stat.changed", "tool.stat.removed", "tool.stat.size", "tool.stat.separator", "tool.detail", "tool.hint", "tool.failed.title", "tool.failed.glyph", "tool.subcall.title", "tool.subcall.args", "tool.diff.header", "tool.diff.hunk", "tool.diff.added", "tool.diff.removed", "tool.read.header", "tool.read.lineNumber", "tool.read.line", "tool.search.path", "tool.search.lineNumber", "tool.search.match", "tool.search.truncated", "tool.terminal.cwd", "tool.terminal.status", "tool.terminal.output", "tool.web.url", "tool.web.source", "tool.web.truncated", "tool.generic.detail", "markdown.heading", "markdown.link", "markdown.linkUrl", "markdown.code", "markdown.codeBlock", "markdown.codeBlockBorder", "markdown.quote", "markdown.quoteBorder", "markdown.hr", "markdown.listBullet", "markdown.bold", "markdown.italic", "markdown.strikethrough", "markdown.underline", "markdown.diagram.border", "markdown.diagram.text", "markdown.diagram.edge", "markdown.diagram.edgeLabel", "markdown.diagram.title", "markdown.diagram.warning", "picker.title", "picker.glyph", "picker.note", "picker.filter", "picker.row", "picker.rowCurrent", "picker.scrollNewer", "picker.scrollOlder", "picker.hint", "picker.cursor", "gate.title", "gate.glyphApproval", "gate.glyphQuestion", "gate.detail", "gate.option", "gate.optionCurrent", "gate.cursor", "gate.hint", "dock.goal", "dock.planMode", "dock.todos.heading", "dock.todos.pending", "dock.todos.inProgress", "dock.todos.overflow", "dock.subagents.heading", "dock.subagents.running", "dock.subagents.overflow", "dock.jobs.heading", "dock.jobs.running", "dock.jobs.overflow", "status.prefix", "status.back", "status.activity.working", "status.activity.ready", "status.elapsed", "status.agentPreset", "status.model", "status.effort", "status.permission", "status.context", "status.cache", "status.cwd", "status.separator", "editor.border", "editor.queued", "editor.queued.more", "editor.selectList.selectedPrefix", "editor.selectList.selectedText", "editor.selectList.description", "editor.selectList.scrollInfo", "editor.selectList.noMatch"];
|
|
75
|
+
/** A name for one styled element on the surface. */
|
|
76
|
+
export type TuiToken = (typeof TUI_TOKENS)[number];
|
|
77
|
+
/**
|
|
78
|
+
* Which token draws a card row, by the card's kind and the row's class.
|
|
79
|
+
*
|
|
80
|
+
* Two lookups rather than one because `header` means a different element on a
|
|
81
|
+
* diff than on a read: the kind is half of what a row is.
|
|
82
|
+
*/
|
|
83
|
+
export declare const CARD_ROW_TOKEN: Readonly<Record<string, Readonly<Partial<Record<CardRowClass, TuiToken>>>>>;
|
|
84
|
+
/** The colours a token can name, so a shade is changed in one place. */
|
|
85
|
+
export declare const DEFAULT_PALETTE: Readonly<Record<PaletteName, string>>;
|
|
86
|
+
/**
|
|
87
|
+
* The shipped appearance of every token.
|
|
88
|
+
*
|
|
89
|
+
* Defaults reproduce the surface as it looked before tokens existed, except the
|
|
90
|
+
* muted family, which moves from faint-on-a-palette-slot to an explicit grey.
|
|
91
|
+
* A test asserts every token in {@link TUI_TOKENS} appears here.
|
|
92
|
+
*/
|
|
93
|
+
export declare const DEFAULT_TOKENS: Readonly<Record<TuiToken, StyleSpec>>;
|
|
94
|
+
/**
|
|
95
|
+
* Merge one token's default, its `inherit` target, and the reader's override.
|
|
96
|
+
*
|
|
97
|
+
* The inherited token's fields replace this token's defaults, because that is
|
|
98
|
+
* what "start from another token" means; the reader's own fields still win.
|
|
99
|
+
* A path-scoped set turns a cycle into a stop, and still lets two branches
|
|
100
|
+
* inherit one token rather than sharing a single visit.
|
|
101
|
+
*/
|
|
102
|
+
export declare function mergeTokenSpec(token: TuiToken, overrides: ReadonlyMap<TuiToken, StyleSpec>): StyleSpec;
|
|
103
|
+
/**
|
|
104
|
+
* Resolve one token into the escapes a renderer needs.
|
|
105
|
+
*
|
|
106
|
+
* Faint is dropped once a colour is chosen: stacking it on a deliberate grey is
|
|
107
|
+
* what made the old output differ per terminal.
|
|
108
|
+
*/
|
|
109
|
+
export declare function resolveToken(token: TuiToken, overrides: ReadonlyMap<TuiToken, StyleSpec>, palette: Readonly<Record<PaletteName, string>>, mode: ColourMode): ResolvedStyle;
|
|
110
|
+
//# sourceMappingURL=theme-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-tokens.d.ts","sourceRoot":"","sources":["../src/theme-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAkC,MAAM,uBAAuB,CAAA;AAIvF;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,YAAY,CAAA;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,YAAY,CAAA;AAEzC,oEAAoE;AACpE,eAAO,MAAM,aAAa,iGAAkG,CAAA;AAE5H,6BAA6B;AAC7B,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAExD,2DAA2D;AAC3D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAA;AAEtD,2FAA2F;AAC3F,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,CAAA;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CA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;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,SAAS,CAatG;AAOD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,EAC3C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,EAC9C,IAAI,EAAE,UAAU,GACf,aAAa,CA0Bf"}
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { sgrBackgroundPrefix, sgrPrefix } from "./theme-capability.js";
|
|
2
|
+
const RESET = '\u001B[0m';
|
|
3
|
+
/**
|
|
4
|
+
* The reset sequence, for the code that has to recognise one.
|
|
5
|
+
*
|
|
6
|
+
* pi-tui closes a truncated row with a reset whether or not it opened a style,
|
|
7
|
+
* so a renderer that turns styling off still has to remove the ones it did not
|
|
8
|
+
* ask for.
|
|
9
|
+
*/
|
|
10
|
+
export function resetSequence() {
|
|
11
|
+
return RESET;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The muted shade every receding element shares.
|
|
15
|
+
*
|
|
16
|
+
* An explicit grey rather than a palette slot: slot 8 is whatever the reader's
|
|
17
|
+
* terminal maps it to, which on the reader's own phone was close enough to
|
|
18
|
+
* ordinary text that dimming looked like it had not been applied at all.
|
|
19
|
+
*/
|
|
20
|
+
export const MUTED_GREY = '#8a8a8a';
|
|
21
|
+
/**
|
|
22
|
+
* The shade a tool's argument takes.
|
|
23
|
+
*
|
|
24
|
+
* A call's argument is the one part of a card the reader scans for, and it must
|
|
25
|
+
* read as neither the tool's own label (warn) nor ordinary output (the default
|
|
26
|
+
* foreground); a pale blue sits between them without competing for attention.
|
|
27
|
+
*/
|
|
28
|
+
export const ARGUMENT_BLUE = '#8db3d9';
|
|
29
|
+
/**
|
|
30
|
+
* The shade a submitted prompt takes.
|
|
31
|
+
*
|
|
32
|
+
* A reader's own turns and the assistant's reply both shipped on the default
|
|
33
|
+
* foreground, so telling the two apart meant reading them; a mint keeps them
|
|
34
|
+
* apart at a glance without the pink cast a rose gave every prompt.
|
|
35
|
+
*/
|
|
36
|
+
export const USER_PROMPT_MINT = '#27F5C8';
|
|
37
|
+
/** Palette entries a token may name instead of a literal colour. */
|
|
38
|
+
export const PALETTE_NAMES = ['default', 'muted', 'accent', 'arg', 'warn', 'added', 'removed', 'user', 'assistant'];
|
|
39
|
+
/** A row class a tool card can carry, so styling follows what the row means. */
|
|
40
|
+
export const CARD_ROW_CLASSES = [
|
|
41
|
+
'header', 'hunk', 'added', 'removed', 'line', 'lineNumber', 'path', 'match', 'truncated', 'output', 'cwd', 'status', 'source', 'url', 'detail',
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Every styled element on the surface, grouped by the region that draws it.
|
|
45
|
+
*
|
|
46
|
+
* The list is the contract: a renderer names a token, and the coverage sweep
|
|
47
|
+
* fails if a token loses its default, so "every element" cannot quietly drift
|
|
48
|
+
* as the surface grows.
|
|
49
|
+
*/
|
|
50
|
+
export const TUI_TOKENS = [
|
|
51
|
+
// Transcript rows
|
|
52
|
+
'transcript.user',
|
|
53
|
+
'transcript.notice',
|
|
54
|
+
'transcript.marker',
|
|
55
|
+
'transcript.reasoning.summary',
|
|
56
|
+
'transcript.reasoning.body',
|
|
57
|
+
'transcript.reasoning.hint',
|
|
58
|
+
// A reply is markdown, so the markdown tokens are what address it.
|
|
59
|
+
// Tool cards: the generic layer
|
|
60
|
+
'tool.title',
|
|
61
|
+
'tool.glyph',
|
|
62
|
+
'tool.args',
|
|
63
|
+
'tool.stat.added',
|
|
64
|
+
'tool.stat.changed',
|
|
65
|
+
'tool.stat.removed',
|
|
66
|
+
'tool.stat.size',
|
|
67
|
+
'tool.stat.separator',
|
|
68
|
+
'tool.detail',
|
|
69
|
+
'tool.hint',
|
|
70
|
+
'tool.failed.title',
|
|
71
|
+
'tool.failed.glyph',
|
|
72
|
+
'tool.subcall.title',
|
|
73
|
+
'tool.subcall.args',
|
|
74
|
+
// Tool cards: per kind
|
|
75
|
+
'tool.diff.header',
|
|
76
|
+
'tool.diff.hunk',
|
|
77
|
+
'tool.diff.added',
|
|
78
|
+
'tool.diff.removed',
|
|
79
|
+
'tool.read.header',
|
|
80
|
+
'tool.read.lineNumber',
|
|
81
|
+
'tool.read.line',
|
|
82
|
+
'tool.search.path',
|
|
83
|
+
'tool.search.lineNumber',
|
|
84
|
+
'tool.search.match',
|
|
85
|
+
'tool.search.truncated',
|
|
86
|
+
'tool.terminal.cwd',
|
|
87
|
+
'tool.terminal.status',
|
|
88
|
+
'tool.terminal.output',
|
|
89
|
+
'tool.web.url',
|
|
90
|
+
'tool.web.source',
|
|
91
|
+
'tool.web.truncated',
|
|
92
|
+
'tool.generic.detail',
|
|
93
|
+
// Markdown
|
|
94
|
+
'markdown.heading',
|
|
95
|
+
'markdown.link',
|
|
96
|
+
'markdown.linkUrl',
|
|
97
|
+
'markdown.code',
|
|
98
|
+
'markdown.codeBlock',
|
|
99
|
+
'markdown.codeBlockBorder',
|
|
100
|
+
'markdown.quote',
|
|
101
|
+
'markdown.quoteBorder',
|
|
102
|
+
'markdown.hr',
|
|
103
|
+
'markdown.listBullet',
|
|
104
|
+
'markdown.bold',
|
|
105
|
+
'markdown.italic',
|
|
106
|
+
'markdown.strikethrough',
|
|
107
|
+
'markdown.underline',
|
|
108
|
+
// A drawn mermaid diagram: the renderer reports what each run *is*, so every
|
|
109
|
+
// role a drawing can be made of is addressable on its own.
|
|
110
|
+
'markdown.diagram.border',
|
|
111
|
+
'markdown.diagram.text',
|
|
112
|
+
'markdown.diagram.edge',
|
|
113
|
+
'markdown.diagram.edgeLabel',
|
|
114
|
+
'markdown.diagram.title',
|
|
115
|
+
'markdown.diagram.warning',
|
|
116
|
+
// No markdown.tableHeader: pi-tui styles table headers through the bold hook
|
|
117
|
+
// it already owns, so a token here would be a setting with no call site.
|
|
118
|
+
// Picker
|
|
119
|
+
'picker.title',
|
|
120
|
+
'picker.glyph',
|
|
121
|
+
'picker.note',
|
|
122
|
+
'picker.filter',
|
|
123
|
+
'picker.row',
|
|
124
|
+
'picker.rowCurrent',
|
|
125
|
+
'picker.scrollNewer',
|
|
126
|
+
'picker.scrollOlder',
|
|
127
|
+
'picker.hint',
|
|
128
|
+
'picker.cursor',
|
|
129
|
+
// Gate
|
|
130
|
+
'gate.title',
|
|
131
|
+
'gate.glyphApproval',
|
|
132
|
+
'gate.glyphQuestion',
|
|
133
|
+
'gate.detail',
|
|
134
|
+
'gate.option',
|
|
135
|
+
'gate.optionCurrent',
|
|
136
|
+
'gate.cursor',
|
|
137
|
+
'gate.hint',
|
|
138
|
+
// Dock
|
|
139
|
+
'dock.goal',
|
|
140
|
+
'dock.planMode',
|
|
141
|
+
'dock.todos.heading',
|
|
142
|
+
'dock.todos.pending',
|
|
143
|
+
'dock.todos.inProgress',
|
|
144
|
+
'dock.todos.overflow',
|
|
145
|
+
'dock.subagents.heading',
|
|
146
|
+
'dock.subagents.running',
|
|
147
|
+
'dock.subagents.overflow',
|
|
148
|
+
'dock.jobs.heading',
|
|
149
|
+
'dock.jobs.running',
|
|
150
|
+
'dock.jobs.overflow',
|
|
151
|
+
// Status bar
|
|
152
|
+
'status.prefix',
|
|
153
|
+
'status.back',
|
|
154
|
+
'status.activity.working',
|
|
155
|
+
'status.activity.ready',
|
|
156
|
+
'status.elapsed',
|
|
157
|
+
'status.agentPreset',
|
|
158
|
+
'status.model',
|
|
159
|
+
'status.effort',
|
|
160
|
+
'status.permission',
|
|
161
|
+
'status.context',
|
|
162
|
+
'status.cache',
|
|
163
|
+
'status.cwd',
|
|
164
|
+
'status.separator',
|
|
165
|
+
// Editor
|
|
166
|
+
'editor.border',
|
|
167
|
+
'editor.queued',
|
|
168
|
+
'editor.queued.more',
|
|
169
|
+
'editor.selectList.selectedPrefix',
|
|
170
|
+
'editor.selectList.selectedText',
|
|
171
|
+
'editor.selectList.description',
|
|
172
|
+
'editor.selectList.scrollInfo',
|
|
173
|
+
'editor.selectList.noMatch',
|
|
174
|
+
];
|
|
175
|
+
/**
|
|
176
|
+
* Which token draws a card row, by the card's kind and the row's class.
|
|
177
|
+
*
|
|
178
|
+
* Two lookups rather than one because `header` means a different element on a
|
|
179
|
+
* diff than on a read: the kind is half of what a row is.
|
|
180
|
+
*/
|
|
181
|
+
export const CARD_ROW_TOKEN = {
|
|
182
|
+
diff: { header: 'tool.diff.header', hunk: 'tool.diff.hunk', added: 'tool.diff.added', removed: 'tool.diff.removed' },
|
|
183
|
+
read: { header: 'tool.read.header', lineNumber: 'tool.read.lineNumber', line: 'tool.read.line' },
|
|
184
|
+
search: {
|
|
185
|
+
path: 'tool.search.path',
|
|
186
|
+
lineNumber: 'tool.search.lineNumber',
|
|
187
|
+
match: 'tool.search.match',
|
|
188
|
+
truncated: 'tool.search.truncated',
|
|
189
|
+
},
|
|
190
|
+
terminal: { cwd: 'tool.terminal.cwd', status: 'tool.terminal.status', output: 'tool.terminal.output' },
|
|
191
|
+
web: { url: 'tool.web.url', source: 'tool.web.source', truncated: 'tool.web.truncated' },
|
|
192
|
+
generic: { detail: 'tool.generic.detail' },
|
|
193
|
+
};
|
|
194
|
+
/** The colours a token can name, so a shade is changed in one place. */
|
|
195
|
+
export const DEFAULT_PALETTE = {
|
|
196
|
+
default: '#d0d0d0',
|
|
197
|
+
muted: MUTED_GREY,
|
|
198
|
+
accent: '#5fafd7',
|
|
199
|
+
arg: ARGUMENT_BLUE,
|
|
200
|
+
warn: '#d7af5f',
|
|
201
|
+
added: '#5faf5f',
|
|
202
|
+
removed: '#d75f5f',
|
|
203
|
+
user: USER_PROMPT_MINT,
|
|
204
|
+
assistant: '#d0d0d0',
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Muted elements share one shade, which is what makes the surface coherent.
|
|
208
|
+
*
|
|
209
|
+
* It names the palette entry rather than repeating the hex, so a reader who
|
|
210
|
+
* changes `palette.muted` once quiets every receding element together instead
|
|
211
|
+
* of hunting the tokens down. No `dim` either: faint is dropped the moment a
|
|
212
|
+
* colour is named, so carrying it would be a setting that does nothing.
|
|
213
|
+
*/
|
|
214
|
+
const muted = { fg: 'muted' };
|
|
215
|
+
const plain = {};
|
|
216
|
+
/**
|
|
217
|
+
* The shipped appearance of every token.
|
|
218
|
+
*
|
|
219
|
+
* Defaults reproduce the surface as it looked before tokens existed, except the
|
|
220
|
+
* muted family, which moves from faint-on-a-palette-slot to an explicit grey.
|
|
221
|
+
* A test asserts every token in {@link TUI_TOKENS} appears here.
|
|
222
|
+
*/
|
|
223
|
+
export const DEFAULT_TOKENS = {
|
|
224
|
+
'transcript.user': { fg: 'user' },
|
|
225
|
+
'transcript.notice': muted,
|
|
226
|
+
'transcript.marker': muted,
|
|
227
|
+
'transcript.reasoning.summary': muted,
|
|
228
|
+
'transcript.reasoning.body': muted,
|
|
229
|
+
'transcript.reasoning.hint': muted,
|
|
230
|
+
'tool.title': { fg: 'warn' },
|
|
231
|
+
'tool.glyph': { fg: 'warn' },
|
|
232
|
+
'tool.args': { fg: 'arg' },
|
|
233
|
+
'tool.stat.added': { fg: 'added' },
|
|
234
|
+
'tool.stat.changed': { fg: 'warn' },
|
|
235
|
+
'tool.stat.removed': { fg: 'removed' },
|
|
236
|
+
'tool.stat.size': muted,
|
|
237
|
+
'tool.stat.separator': muted,
|
|
238
|
+
'tool.detail': muted,
|
|
239
|
+
'tool.hint': muted,
|
|
240
|
+
'tool.failed.title': { fg: 'removed' },
|
|
241
|
+
'tool.failed.glyph': { fg: 'removed' },
|
|
242
|
+
'tool.subcall.title': muted,
|
|
243
|
+
'tool.subcall.args': { fg: 'arg' },
|
|
244
|
+
'tool.diff.header': muted,
|
|
245
|
+
'tool.diff.hunk': muted,
|
|
246
|
+
'tool.diff.added': { fg: 'added' },
|
|
247
|
+
'tool.diff.removed': { fg: 'removed' },
|
|
248
|
+
'tool.read.header': muted,
|
|
249
|
+
'tool.read.lineNumber': muted,
|
|
250
|
+
'tool.read.line': muted,
|
|
251
|
+
'tool.search.path': muted,
|
|
252
|
+
'tool.search.lineNumber': muted,
|
|
253
|
+
'tool.search.match': muted,
|
|
254
|
+
'tool.search.truncated': muted,
|
|
255
|
+
'tool.terminal.cwd': muted,
|
|
256
|
+
'tool.terminal.status': muted,
|
|
257
|
+
'tool.terminal.output': muted,
|
|
258
|
+
'tool.web.url': muted,
|
|
259
|
+
'tool.web.source': muted,
|
|
260
|
+
'tool.web.truncated': muted,
|
|
261
|
+
'tool.generic.detail': muted,
|
|
262
|
+
'markdown.heading': { fg: 'accent', bold: true },
|
|
263
|
+
'markdown.link': { fg: 'accent', underline: true },
|
|
264
|
+
'markdown.linkUrl': muted,
|
|
265
|
+
'markdown.code': { fg: 'accent' },
|
|
266
|
+
'markdown.codeBlock': plain,
|
|
267
|
+
'markdown.codeBlockBorder': muted,
|
|
268
|
+
'markdown.quote': muted,
|
|
269
|
+
'markdown.quoteBorder': muted,
|
|
270
|
+
'markdown.hr': muted,
|
|
271
|
+
'markdown.listBullet': { fg: 'accent' },
|
|
272
|
+
'markdown.bold': { bold: true },
|
|
273
|
+
'markdown.italic': { italic: true },
|
|
274
|
+
'markdown.strikethrough': { strike: true },
|
|
275
|
+
'markdown.underline': { underline: true },
|
|
276
|
+
'markdown.diagram.border': muted,
|
|
277
|
+
'markdown.diagram.text': plain,
|
|
278
|
+
'markdown.diagram.edge': { fg: 'accent' },
|
|
279
|
+
'markdown.diagram.edgeLabel': muted,
|
|
280
|
+
'markdown.diagram.title': { fg: 'accent', bold: true },
|
|
281
|
+
'markdown.diagram.warning': { fg: 'warn' },
|
|
282
|
+
'picker.title': { bold: true },
|
|
283
|
+
'picker.glyph': { bold: true },
|
|
284
|
+
'picker.note': { bold: true },
|
|
285
|
+
'picker.filter': muted,
|
|
286
|
+
'picker.row': plain,
|
|
287
|
+
'picker.rowCurrent': { bold: true },
|
|
288
|
+
'picker.scrollNewer': muted,
|
|
289
|
+
'picker.scrollOlder': muted,
|
|
290
|
+
'picker.hint': muted,
|
|
291
|
+
'picker.cursor': plain,
|
|
292
|
+
'gate.title': { bold: true },
|
|
293
|
+
'gate.glyphApproval': { bold: true },
|
|
294
|
+
'gate.glyphQuestion': { bold: true },
|
|
295
|
+
'gate.detail': muted,
|
|
296
|
+
'gate.option': plain,
|
|
297
|
+
'gate.optionCurrent': { bold: true },
|
|
298
|
+
'gate.cursor': plain,
|
|
299
|
+
'gate.hint': muted,
|
|
300
|
+
'dock.goal': { bold: true },
|
|
301
|
+
'dock.planMode': { bold: true },
|
|
302
|
+
'dock.todos.heading': { bold: true },
|
|
303
|
+
'dock.todos.pending': muted,
|
|
304
|
+
'dock.todos.inProgress': muted,
|
|
305
|
+
'dock.todos.overflow': muted,
|
|
306
|
+
'dock.subagents.heading': { bold: true },
|
|
307
|
+
'dock.subagents.running': muted,
|
|
308
|
+
'dock.subagents.overflow': muted,
|
|
309
|
+
'dock.jobs.heading': { bold: true },
|
|
310
|
+
'dock.jobs.running': muted,
|
|
311
|
+
'dock.jobs.overflow': muted,
|
|
312
|
+
'status.prefix': { fg: 'accent' },
|
|
313
|
+
// The way back is a key the reader presses, so it carries the weight of an
|
|
314
|
+
// armed chord rather than toning down with the facts.
|
|
315
|
+
'status.back': { fg: 'accent' },
|
|
316
|
+
'status.activity.working': muted,
|
|
317
|
+
'status.activity.ready': muted,
|
|
318
|
+
'status.elapsed': muted,
|
|
319
|
+
'status.agentPreset': muted,
|
|
320
|
+
'status.model': muted,
|
|
321
|
+
'status.effort': muted,
|
|
322
|
+
'status.permission': muted,
|
|
323
|
+
'status.context': muted,
|
|
324
|
+
'status.cache': muted,
|
|
325
|
+
'status.cwd': muted,
|
|
326
|
+
'status.separator': muted,
|
|
327
|
+
'editor.border': muted,
|
|
328
|
+
// No colour: a faint is dropped the moment a colour is named, and faint is
|
|
329
|
+
// what makes queued text read as not-yet-sent rather than as being typed.
|
|
330
|
+
'editor.queued': { dim: true, italic: true },
|
|
331
|
+
'editor.queued.more': muted,
|
|
332
|
+
'editor.selectList.selectedPrefix': { fg: 'accent' },
|
|
333
|
+
'editor.selectList.selectedText': { bold: true },
|
|
334
|
+
'editor.selectList.description': muted,
|
|
335
|
+
'editor.selectList.scrollInfo': muted,
|
|
336
|
+
'editor.selectList.noMatch': muted,
|
|
337
|
+
};
|
|
338
|
+
/** Map a colour specification through the palette, leaving literals alone. */
|
|
339
|
+
function resolveColour(spec, palette) {
|
|
340
|
+
if (typeof spec === 'string' && PALETTE_NAMES.includes(spec)) {
|
|
341
|
+
return palette[spec];
|
|
342
|
+
}
|
|
343
|
+
return spec;
|
|
344
|
+
}
|
|
345
|
+
/** Drop the routing field, so a merged spec carries only what it draws. */
|
|
346
|
+
function withoutInherit(spec) {
|
|
347
|
+
const { inherit: _routing, ...rest } = spec;
|
|
348
|
+
return rest;
|
|
349
|
+
}
|
|
350
|
+
/** The fields an override really wrote, so an explicit `undefined` cannot shadow a default. */
|
|
351
|
+
function writtenFields(spec) {
|
|
352
|
+
if (spec === undefined)
|
|
353
|
+
return {};
|
|
354
|
+
const written = {};
|
|
355
|
+
for (const [key, value] of Object.entries(spec)) {
|
|
356
|
+
if (value !== undefined)
|
|
357
|
+
written[key] = value;
|
|
358
|
+
}
|
|
359
|
+
return written;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Merge one token's default, its `inherit` target, and the reader's override.
|
|
363
|
+
*
|
|
364
|
+
* The inherited token's fields replace this token's defaults, because that is
|
|
365
|
+
* what "start from another token" means; the reader's own fields still win.
|
|
366
|
+
* A path-scoped set turns a cycle into a stop, and still lets two branches
|
|
367
|
+
* inherit one token rather than sharing a single visit.
|
|
368
|
+
*/
|
|
369
|
+
export function mergeTokenSpec(token, overrides) {
|
|
370
|
+
const visiting = new Set();
|
|
371
|
+
const merge = (name) => {
|
|
372
|
+
if (visiting.has(name))
|
|
373
|
+
return {};
|
|
374
|
+
visiting.add(name);
|
|
375
|
+
const own = DEFAULT_TOKENS[name];
|
|
376
|
+
const override = overrides.get(name);
|
|
377
|
+
const parent = override?.inherit ?? own.inherit;
|
|
378
|
+
const inherited = parent === undefined ? {} : merge(parent);
|
|
379
|
+
visiting.delete(name);
|
|
380
|
+
return { ...withoutInherit(own), ...inherited, ...withoutInherit(writtenFields(override)) };
|
|
381
|
+
};
|
|
382
|
+
return merge(token);
|
|
383
|
+
}
|
|
384
|
+
/** Turn a colour SGR sequence into the parameter list it belongs to. */
|
|
385
|
+
function colourParams(sequence) {
|
|
386
|
+
return sequence === '' ? undefined : sequence.slice('\u001B['.length, -1);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Resolve one token into the escapes a renderer needs.
|
|
390
|
+
*
|
|
391
|
+
* Faint is dropped once a colour is chosen: stacking it on a deliberate grey is
|
|
392
|
+
* what made the old output differ per terminal.
|
|
393
|
+
*/
|
|
394
|
+
export function resolveToken(token, overrides, palette, mode) {
|
|
395
|
+
const merged = mergeTokenSpec(token, overrides);
|
|
396
|
+
if (merged.hidden === true)
|
|
397
|
+
return { prefix: '', suffix: '', glyph: '', hidden: true };
|
|
398
|
+
// With no colour capability the whole promise is "emit nothing", which
|
|
399
|
+
// includes attributes: a bold word is still styling a reader turned off.
|
|
400
|
+
if (mode === 'none')
|
|
401
|
+
return { prefix: '', suffix: '', glyph: merged.glyph ?? '', hidden: false };
|
|
402
|
+
const fg = merged.fg;
|
|
403
|
+
const bg = merged.bg;
|
|
404
|
+
const codes = [];
|
|
405
|
+
if (merged.bold === true)
|
|
406
|
+
codes.push('1');
|
|
407
|
+
if (merged.dim === true && fg === undefined)
|
|
408
|
+
codes.push('2');
|
|
409
|
+
if (merged.italic === true)
|
|
410
|
+
codes.push('3');
|
|
411
|
+
if (merged.underline === true)
|
|
412
|
+
codes.push('4');
|
|
413
|
+
if (merged.strike === true)
|
|
414
|
+
codes.push('9');
|
|
415
|
+
for (const params of [
|
|
416
|
+
fg === undefined ? undefined : colourParams(sgrPrefix(resolveColour(fg, palette), mode)),
|
|
417
|
+
bg === undefined ? undefined : colourParams(sgrBackgroundPrefix(resolveColour(bg, palette), mode)),
|
|
418
|
+
]) {
|
|
419
|
+
if (params !== undefined)
|
|
420
|
+
codes.push(params);
|
|
421
|
+
}
|
|
422
|
+
// One sequence for attributes and colours together: two escapes in a row would
|
|
423
|
+
// let a renderer that re-orders them drop half the style.
|
|
424
|
+
const prefix = codes.length === 0 ? '' : `\u001B[${codes.join(';')}m`;
|
|
425
|
+
return { prefix, suffix: prefix === '' ? '' : RESET, glyph: merged.glyph ?? '', hidden: false };
|
|
426
|
+
}
|
|
427
|
+
//# sourceMappingURL=theme-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-tokens.js","sourceRoot":"","sources":["../src/theme-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,mBAAmB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEvF,MAAM,KAAK,GAAG,WAAW,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAA;AAEnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAEzC,oEAAoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,CAAU,CAAA;AAiC5H,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,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CAAC,GAAG,CAAC,CAAA;IAC9C,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3C,KAAK,MAAM,MAAM,IAAI;QACnB,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;QACxF,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,mBAAmB,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;KACnG,EAAE,CAAC;QACF,IAAI,MAAM,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC9C,CAAC;IACD,+EAA+E;IAC/E,0DAA0D;IAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAA;IACrE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAG,MAAM,CAAC,KAA4B,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AACzH,CAAC"}
|
package/lib/theme.d.ts
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/** Styling the surface applies, and the editor/select themes pi-tui needs. */
|
|
1
|
+
import { type EditorTheme, type MarkdownTheme } from '@earendil-works/pi-tui';
|
|
2
|
+
import { type ColourMode } from './theme-capability.ts';
|
|
3
|
+
import { type TuiToken } from './theme-tokens.ts';
|
|
4
|
+
import type { ThemeOverrides } from './theme-settings.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Styling the surface applies, and the editor/select themes pi-tui needs.
|
|
7
|
+
*
|
|
8
|
+
* Every element is drawn by naming its token, so a reader's override reaches
|
|
9
|
+
* it without the renderer knowing what the element is for.
|
|
10
|
+
*/
|
|
12
11
|
export interface TuiTheme {
|
|
12
|
+
readonly revision: number;
|
|
13
13
|
readonly color: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/** A boundary in the conversation rather than something anyone said. */
|
|
23
|
-
marker(text: string): string;
|
|
24
|
-
/** Structure the reader scans for: headings, links, inline code, list bullets. */
|
|
25
|
-
accent(text: string): string;
|
|
26
|
-
italic(text: string): string;
|
|
14
|
+
/** Draw one named element. */
|
|
15
|
+
style(token: TuiToken, text: string): string;
|
|
16
|
+
/** Cut a row to a width, so no renderer has to reach for the raw helper. */
|
|
17
|
+
cut(text: string, width: number, ellipsis?: string): string;
|
|
18
|
+
/** The mark that introduces an element, empty unless the reader set one. */
|
|
19
|
+
glyph(token: TuiToken): string;
|
|
20
|
+
/** Whether an element is drawn at all. */
|
|
21
|
+
visible(token: TuiToken): boolean;
|
|
27
22
|
readonly editor: EditorTheme;
|
|
28
23
|
readonly markdown: MarkdownTheme;
|
|
29
24
|
}
|
|
30
25
|
/**
|
|
31
|
-
*
|
|
26
|
+
* Build the surface theme.
|
|
32
27
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
28
|
+
* Every token is resolved once, when the theme is built, rather than per frame:
|
|
29
|
+
* a repaint walks the whole transcript and re-resolving a palette chain for
|
|
30
|
+
* every row would pay for the same answer thousands of times. A settings change
|
|
31
|
+
* builds a new theme instead, which is also what makes the swap atomic.
|
|
37
32
|
*/
|
|
38
|
-
export declare function
|
|
33
|
+
export declare function createTheme(mode?: ColourMode, overrides?: ThemeOverrides): TuiTheme;
|
|
39
34
|
/**
|
|
40
|
-
*
|
|
35
|
+
* An editor theme that follows a moving source.
|
|
41
36
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
37
|
+
* The editor keeps the theme it was built with for the life of the session, so
|
|
38
|
+
* a settings change has to reach it through a stable object instead of by
|
|
39
|
+
* replacing the one it captured.
|
|
45
40
|
*/
|
|
46
|
-
export declare function
|
|
41
|
+
export declare function forwardEditorTheme(source: () => EditorTheme): EditorTheme;
|
|
42
|
+
/** The markdown counterpart of {@link forwardEditorTheme}. */
|
|
43
|
+
export declare function forwardMarkdownTheme(source: () => MarkdownTheme): MarkdownTheme;
|
|
47
44
|
//# sourceMappingURL=theme.d.ts.map
|