@linxiraos/pi-tui 1.4.11 → 1.4.13
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 +30 -233
- package/README.md +4 -1
- package/THIRD-PARTY-NOTICES.txt +4 -5
- package/dist/types/apps/shell-visualizer.d.ts +24 -0
- package/dist/types/autocomplete.d.ts +20 -0
- package/dist/types/chat/cache-invalidation-marker.d.ts +15 -7
- package/dist/types/chat/chat-transcript-builder.d.ts +5 -3
- package/dist/types/chat/display-preferences.d.ts +2 -0
- package/dist/types/chat/extension-types.d.ts +72 -1
- package/dist/types/chat/image-loading.d.ts +2 -2
- package/dist/types/chat/messages.d.ts +2 -3
- package/dist/types/chat/read-tool-group.d.ts +15 -2
- package/dist/types/chat/skill-message.d.ts +1 -0
- package/dist/types/chat/spotlight.d.ts +203 -0
- package/dist/types/chat/tool-execution.d.ts +26 -5
- package/dist/types/chat/transcript-actions.d.ts +11 -0
- package/dist/types/chat/transcript-browser.d.ts +9 -0
- package/dist/types/chat/transcript-presentation.d.ts +164 -0
- package/dist/types/chat/ttsr-notification.d.ts +2 -0
- package/dist/types/chrome/message-frame.d.ts +2 -0
- package/dist/types/chrome/transcript-container.d.ts +27 -6
- package/dist/types/components/loader.d.ts +0 -2
- package/dist/types/components/markdown.d.ts +11 -1
- package/dist/types/components/settings-list.d.ts +12 -2
- package/dist/types/frame-rate.d.ts +18 -0
- package/dist/types/hotkeys-markdown.d.ts +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/keybinding-matchers.d.ts +4 -1
- package/dist/types/kitty-graphics.d.ts +1 -1
- package/dist/types/motion-effects.d.ts +10 -0
- package/dist/types/native/encode.d.ts +2 -0
- package/dist/types/native/measure.d.ts +10 -0
- package/dist/types/native/overlay.d.ts +1 -1
- package/dist/types/native/quiet.d.ts +5 -0
- package/dist/types/native/reconcile.d.ts +6 -1
- package/dist/types/native/spans.d.ts +6 -0
- package/dist/types/native/state.d.ts +4 -0
- package/dist/types/overlays/agent-hub.d.ts +6 -0
- package/dist/types/overlays/link-browser.d.ts +55 -0
- package/dist/types/overlays/running-subagent-badge.d.ts +1 -4
- package/dist/types/overlays/spotlight-sheet.d.ts +36 -0
- package/dist/types/prompt/composer-attachments.d.ts +5 -2
- package/dist/types/prompt/composer-cache.d.ts +7 -2
- package/dist/types/prompt/composer.d.ts +6 -11
- package/dist/types/prompt/custom-editor.d.ts +8 -2
- package/dist/types/prompt/gradient-highlight.d.ts +2 -2
- package/dist/types/prompt/magic-keywords.d.ts +2 -0
- package/dist/types/prompt/model-mention-autocomplete.d.ts +9 -7
- package/dist/types/prompt/model-mention-syntax.d.ts +6 -0
- package/dist/types/prompt/prompt-action-autocomplete.d.ts +2 -1
- package/dist/types/prompt/welcome.d.ts +19 -0
- package/dist/types/render/extension-links.d.ts +0 -6
- package/dist/types/render/index.d.ts +1 -0
- package/dist/types/render/link-hints.d.ts +78 -0
- package/dist/types/render/render-utils.d.ts +0 -2
- package/dist/types/setup/scenes/types.d.ts +8 -0
- package/dist/types/setup/scenes/updates.d.ts +6 -0
- package/dist/types/setup/wizard.d.ts +7 -2
- package/dist/types/spinner-clock.d.ts +34 -0
- package/dist/types/status-line/component.d.ts +8 -4
- package/dist/types/status-line/host.d.ts +62 -0
- package/dist/types/status-line/index.d.ts +1 -0
- package/dist/types/status-line/prompt-cache.d.ts +14 -0
- package/dist/types/status-line/schema.d.ts +1 -1
- package/dist/types/status-line/startup.d.ts +6 -0
- package/dist/types/status-line/types.d.ts +8 -21
- package/dist/types/theme/schema.d.ts +28 -1
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme-class.d.ts +12 -2
- package/dist/types/theme/theme.d.ts +1 -1
- package/dist/types/theme/tui-adapters.d.ts +7 -0
- package/dist/types/thinking.d.ts +12 -0
- package/dist/types/tools/ask.d.ts +1 -1
- package/dist/types/tools/bash.d.ts +21 -0
- package/dist/types/tools/find.d.ts +9 -1
- package/dist/types/tools/grep.d.ts +2 -1
- package/dist/types/tools/grouped-file-output.d.ts +17 -0
- package/dist/types/tools/job-widget.d.ts +2 -2
- package/dist/types/tools/lsp.d.ts +4 -2
- package/dist/types/tools/native-view.d.ts +4 -0
- package/dist/types/tools/renderer.d.ts +9 -1
- package/dist/types/tools/shell-trace.d.ts +10 -0
- package/dist/types/tools/shell-viz-render.d.ts +6 -0
- package/dist/types/tools/shell-viz.d.ts +16 -0
- package/dist/types/tools/wait.d.ts +2 -2
- package/dist/types/tools/web-search-types.d.ts +1 -0
- package/dist/types/tools/write.d.ts +2 -0
- package/dist/types/tui.d.ts +15 -1
- package/package.json +15 -11
- package/src/apps/shell-visualizer.d.ts +24 -0
- package/src/apps/shell-visualizer.ts +167 -0
- package/src/autocomplete.d.ts +20 -0
- package/src/autocomplete.ts +14 -0
- package/src/chat/assistant-message.ts +11 -6
- package/src/chat/cache-invalidation-marker.d.ts +15 -7
- package/src/chat/cache-invalidation-marker.ts +18 -9
- package/src/chat/chat-transcript-builder.d.ts +5 -3
- package/src/chat/chat-transcript-builder.ts +16 -12
- package/src/chat/display-preferences.d.ts +2 -0
- package/src/chat/display-preferences.ts +3 -0
- package/src/chat/extension-types.d.ts +72 -1
- package/src/chat/extension-types.ts +74 -1
- package/src/chat/image-loading.d.ts +2 -2
- package/src/chat/image-loading.ts +2 -2
- package/src/chat/messages.d.ts +2 -3
- package/src/chat/messages.ts +3 -8
- package/src/chat/read-tool-group.d.ts +15 -2
- package/src/chat/read-tool-group.ts +201 -41
- package/src/chat/skill-message.d.ts +1 -0
- package/src/chat/skill-message.ts +4 -0
- package/src/chat/spotlight.d.ts +203 -0
- package/src/chat/spotlight.ts +460 -0
- package/src/chat/tool-execution.d.ts +26 -5
- package/src/chat/tool-execution.ts +360 -38
- package/src/chat/transcript-actions.d.ts +11 -0
- package/src/chat/transcript-actions.ts +13 -1
- package/src/chat/transcript-browser.d.ts +9 -0
- package/src/chat/transcript-browser.ts +18 -0
- package/src/chat/transcript-presentation.d.ts +164 -0
- package/src/chat/transcript-presentation.ts +642 -0
- package/src/chat/ttsr-notification.d.ts +25 -0
- package/src/chat/ttsr-notification.ts +5 -0
- package/src/chrome/message-frame.d.ts +2 -0
- package/src/chrome/message-frame.ts +7 -0
- package/src/chrome/message-notice.d.ts +58 -0
- package/src/chrome/transcript-container.d.ts +27 -6
- package/src/chrome/transcript-container.ts +317 -66
- package/src/components/editor.ts +25 -1
- package/src/components/loader.d.ts +0 -2
- package/src/components/loader.ts +30 -18
- package/src/components/markdown.d.ts +11 -1
- package/src/components/markdown.ts +41 -16
- package/src/components/settings-list.d.ts +12 -2
- package/src/components/settings-list.ts +29 -13
- package/src/frame-rate.d.ts +18 -0
- package/src/frame-rate.ts +36 -0
- package/src/hotkeys-markdown.ts +9 -2
- package/src/index.d.ts +3 -0
- package/src/index.ts +3 -0
- package/src/keybinding-matchers.d.ts +4 -1
- package/src/keybinding-matchers.ts +13 -12
- package/src/kitty-graphics.d.ts +1 -1
- package/src/kitty-graphics.ts +3 -2
- package/src/motion-effects.d.ts +10 -0
- package/src/motion-effects.ts +27 -0
- package/src/native/backend.ts +66 -7
- package/src/native/encode.d.ts +2 -0
- package/src/native/encode.ts +2 -0
- package/src/native/measure.d.ts +10 -0
- package/src/native/measure.ts +185 -0
- package/src/native/overlay.d.ts +1 -1
- package/src/native/overlay.ts +1 -1
- package/src/native/quiet.d.ts +5 -0
- package/src/native/quiet.ts +105 -0
- package/src/native/reconcile.d.ts +6 -1
- package/src/native/reconcile.ts +16 -10
- package/src/native/spans.d.ts +6 -0
- package/src/native/spans.ts +40 -0
- package/src/native/state.d.ts +4 -0
- package/src/native/state.ts +18 -0
- package/src/overlays/agent-hub.ts +15 -2
- package/src/overlays/ask-dialog.ts +1 -0
- package/src/overlays/btw-history-panel.ts +73 -6
- package/src/overlays/link-browser.ts +295 -0
- package/src/overlays/running-subagent-badge.ts +2 -9
- package/src/overlays/settings-defs.ts +1 -1
- package/src/overlays/settings-selector.ts +17 -3
- package/src/overlays/spotlight-sheet.ts +478 -0
- package/src/overlays/usage-dashboard.ts +6 -5
- package/src/prompt/composer-attachments.d.ts +5 -2
- package/src/prompt/composer-attachments.ts +6 -6
- package/src/prompt/composer-cache.ts +17 -16
- package/src/prompt/composer.ts +30 -123
- package/src/prompt/custom-editor.ts +17 -13
- package/src/prompt/gradient-highlight.d.ts +2 -2
- package/src/prompt/gradient-highlight.ts +5 -4
- package/src/prompt/magic-keywords.d.ts +2 -0
- package/src/prompt/magic-keywords.ts +4 -1
- package/src/prompt/model-mention-autocomplete.ts +73 -20
- package/src/prompt/model-mention-syntax.d.ts +6 -0
- package/src/prompt/model-mention-syntax.ts +9 -0
- package/src/prompt/prompt-action-autocomplete.ts +49 -33
- package/src/prompt/tips.txt +1 -0
- package/src/prompt/welcome.ts +104 -2
- package/src/render/extension-links.d.ts +0 -6
- package/src/render/extension-links.ts +0 -20
- package/src/render/index.d.ts +1 -0
- package/src/render/index.ts +1 -0
- package/src/render/link-hints.d.ts +78 -0
- package/src/render/link-hints.ts +299 -0
- package/src/render/render-utils.d.ts +0 -2
- package/src/render/render-utils.ts +0 -5
- package/src/setup/scenes/glyph.ts +1 -1
- package/src/setup/scenes/types.ts +8 -0
- package/src/setup/scenes/updates.ts +116 -0
- package/src/setup/wizard.ts +19 -8
- package/src/spinner-clock.d.ts +34 -0
- package/src/spinner-clock.ts +79 -0
- package/src/status-line/component.ts +145 -53
- package/src/status-line/host.ts +51 -0
- package/src/status-line/index.ts +1 -0
- package/src/status-line/presets.ts +3 -1
- package/src/status-line/prompt-cache.ts +154 -0
- package/src/status-line/schema.ts +1 -1
- package/src/status-line/segments.ts +33 -22
- package/src/status-line/startup.ts +22 -4
- package/src/status-line/types.ts +8 -22
- package/src/stdin-buffer.ts +89 -46
- package/src/terminal-capabilities.ts +3 -3
- package/src/terminal.ts +1 -8
- package/src/theme/loader.ts +3 -2
- package/src/theme/schema.d.ts +28 -1
- package/src/theme/schema.ts +30 -1
- package/src/theme/symbols.d.ts +1 -1
- package/src/theme/symbols.ts +15 -3
- package/src/theme/theme-class.d.ts +12 -2
- package/src/theme/theme-class.ts +23 -0
- package/src/theme/theme-schema.json +1 -1
- package/src/theme/theme.d.ts +1 -1
- package/src/theme/theme.ts +3 -7
- package/src/theme/tui-adapters.d.ts +7 -0
- package/src/theme/tui-adapters.ts +33 -1
- package/src/thinking.d.ts +12 -0
- package/src/thinking.ts +31 -0
- package/src/tools/ask.d.ts +1 -1
- package/src/tools/ask.ts +99 -38
- package/src/tools/ast-edit.ts +51 -32
- package/src/tools/ast-grep.ts +31 -19
- package/src/tools/bash.d.ts +21 -0
- package/src/tools/bash.ts +166 -24
- package/src/tools/find.d.ts +9 -1
- package/src/tools/find.ts +23 -2
- package/src/tools/grep.d.ts +2 -1
- package/src/tools/grep.ts +52 -36
- package/src/tools/grouped-file-output.d.ts +17 -0
- package/src/tools/grouped-file-output.ts +20 -2
- package/src/tools/job-widget.d.ts +2 -2
- package/src/tools/job-widget.ts +2 -2
- package/src/tools/lsp.d.ts +4 -2
- package/src/tools/lsp.ts +537 -642
- package/src/tools/native-view.d.ts +4 -0
- package/src/tools/native-view.ts +8 -2
- package/src/tools/renderer.d.ts +9 -1
- package/src/tools/renderer.ts +9 -1
- package/src/tools/shell-trace.d.ts +10 -0
- package/src/tools/shell-trace.ts +80 -0
- package/src/tools/shell-viz-render.d.ts +6 -0
- package/src/tools/shell-viz-render.ts +156 -0
- package/src/tools/shell-viz.d.ts +16 -0
- package/src/tools/shell-viz.ts +181 -0
- package/src/tools/streaming-output.ts +18 -8
- package/src/tools/wait.d.ts +2 -2
- package/src/tools/wait.ts +39 -34
- package/src/tools/web-search-types.d.ts +1 -0
- package/src/tools/web-search-types.ts +1 -0
- package/src/tools/write.d.ts +2 -0
- package/src/tools/write.ts +2 -0
- package/src/tui.d.ts +15 -1
- package/src/tui.ts +63 -6
- package/src/windows-input-mode.ts +7 -1
- package/dist/types/chat/collab-prompt-message.d.ts +0 -14
- package/dist/types/chrome/collab-qrcode.d.ts +0 -35
- package/src/chat/collab-prompt-message.d.ts +0 -14
- package/src/chat/collab-prompt-message.ts +0 -46
- package/src/chrome/collab-qrcode.ts +0 -99
|
@@ -2,7 +2,7 @@ import * as os from "node:os";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { ThinkingLevel } from "@linxiraos/pi-agent-core";
|
|
4
4
|
import { getTimeBasedPricingPeriod } from "@linxiraos/pi-catalog/models";
|
|
5
|
-
import {
|
|
5
|
+
import { sharedSpinnerFrame, TERMINAL } from "../index";
|
|
6
6
|
import {
|
|
7
7
|
formatDuration,
|
|
8
8
|
formatNumber,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
relativePathWithinNormalizedRoot,
|
|
13
13
|
} from "@linxiraos/pi-utils";
|
|
14
14
|
import { type SymbolKey, type Theme, type ThemeColor, theme } from "../theme";
|
|
15
|
+
import { SYMBOL_PRESETS } from "../theme/symbols";
|
|
15
16
|
import { shortenPath, TRUNCATE_LENGTHS, truncateToWidth } from "../render/render-utils";
|
|
16
17
|
import { fileHyperlink } from "../render/hyperlink";
|
|
17
18
|
import { getSessionAccentAnsi, getSessionAccentHex } from "../theme/session-color";
|
|
@@ -245,10 +246,10 @@ function brandMark(glyph: string, profile: string | undefined): string {
|
|
|
245
246
|
if (!profile) return glyph;
|
|
246
247
|
return glyph ? `${glyph}-${profile}` : profile;
|
|
247
248
|
}
|
|
248
|
-
/** Current braille-spinner glyph on the shared clock
|
|
249
|
+
/** Current braille-spinner glyph on the shared spinner clock (frame 0 when spinners are static). */
|
|
249
250
|
function brandSpinnerFrame(nowMs = Date.now()): string {
|
|
250
251
|
const frames = theme.getSpinnerFrames("activity");
|
|
251
|
-
return frames[
|
|
252
|
+
return frames[sharedSpinnerFrame(frames.length, nowMs)] ?? "";
|
|
252
253
|
}
|
|
253
254
|
|
|
254
255
|
/** Turn timer in zeta's brand format: whole seconds → minutes → hours (capped at 99h). */
|
|
@@ -1036,6 +1037,31 @@ const cacheHitSegment: StatusLineSegment = {
|
|
|
1036
1037
|
},
|
|
1037
1038
|
};
|
|
1038
1039
|
|
|
1040
|
+
/**
|
|
1041
|
+
* One glyph, no words: the cache icon dim while cached, the same icon struck
|
|
1042
|
+
* through in the warning colour once the next message re-sends the prefix.
|
|
1043
|
+
* Tern draws the Nerd Font pair whatever the symbol preset, as it draws named
|
|
1044
|
+
* icons; its icon slot takes no tone in the composer facts, so the glyph rides
|
|
1045
|
+
* as a span.
|
|
1046
|
+
*/
|
|
1047
|
+
const cacheSegment: StatusLineSegment = {
|
|
1048
|
+
id: "cache",
|
|
1049
|
+
render(ctx) {
|
|
1050
|
+
const status = ctx.promptCache;
|
|
1051
|
+
if (!status) return { content: "", visible: false };
|
|
1052
|
+
const content =
|
|
1053
|
+
status.state === "warm" ? theme.fg("dim", theme.icon.cacheWarm) : theme.fg("warning", theme.icon.cacheCold);
|
|
1054
|
+
return { content, visible: true };
|
|
1055
|
+
},
|
|
1056
|
+
describe(ctx) {
|
|
1057
|
+
const status = ctx.promptCache;
|
|
1058
|
+
if (!status) return null;
|
|
1059
|
+
return status.state === "warm"
|
|
1060
|
+
? segView([span(SYMBOL_PRESETS.nerd["icon.cacheWarm"])])
|
|
1061
|
+
: segView([span(SYMBOL_PRESETS.nerd["icon.cacheCold"], "warning")], undefined, "warning");
|
|
1062
|
+
},
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1039
1065
|
const sessionNameSegment: StatusLineSegment = {
|
|
1040
1066
|
id: "session_name",
|
|
1041
1067
|
render(ctx) {
|
|
@@ -1043,30 +1069,15 @@ const sessionNameSegment: StatusLineSegment = {
|
|
|
1043
1069
|
const name = sessionManager?.getSessionName() || ctx.previewTitle;
|
|
1044
1070
|
if (!name) return { content: "", visible: false };
|
|
1045
1071
|
|
|
1046
|
-
const
|
|
1072
|
+
const title = sanitizeStatusText(name);
|
|
1073
|
+
const content = ctx.isPinned ? withIcon(theme.icon.pin, title) : title;
|
|
1047
1074
|
return { content: accentFg(ctx, "accent", content), visible: true };
|
|
1048
1075
|
},
|
|
1049
1076
|
describe(ctx) {
|
|
1050
1077
|
const name = ctx.session.sessionManager?.getSessionName() || ctx.previewTitle;
|
|
1051
1078
|
const content = name ? sanitizeStatusText(name) : "";
|
|
1052
1079
|
// Plain: the terminal styles the title by its role.
|
|
1053
|
-
return content ? segView([span(content)]) : null;
|
|
1054
|
-
},
|
|
1055
|
-
};
|
|
1056
|
-
|
|
1057
|
-
const collabSegment: StatusLineSegment = {
|
|
1058
|
-
id: "collab",
|
|
1059
|
-
render(ctx) {
|
|
1060
|
-
if (!ctx.collab) return { content: "", visible: false };
|
|
1061
|
-
const participants = `${ctx.collab.participantCount}`;
|
|
1062
|
-
const label = ctx.collab.role === "host" ? `⇄ collab:${participants}` : `⇄ collab guest:${participants}`;
|
|
1063
|
-
return { content: accentFg(ctx, "accent", label), visible: true };
|
|
1064
|
-
},
|
|
1065
|
-
describe(ctx) {
|
|
1066
|
-
if (!ctx.collab) return null;
|
|
1067
|
-
const participants = `${ctx.collab.participantCount}`;
|
|
1068
|
-
const label = ctx.collab.role === "host" ? `collab:${participants}` : `collab guest:${participants}`;
|
|
1069
|
-
return segView([span(label, accentToken(ctx, "accent"))], "collab");
|
|
1080
|
+
return content ? segView([span(content)], ctx.isPinned ? "pin" : undefined) : null;
|
|
1070
1081
|
},
|
|
1071
1082
|
};
|
|
1072
1083
|
|
|
@@ -1341,10 +1352,10 @@ export const SEGMENTS: Record<StatusLineSegmentId, StatusLineSegment> = {
|
|
|
1341
1352
|
cache_read: cacheReadSegment,
|
|
1342
1353
|
cache_write: cacheWriteSegment,
|
|
1343
1354
|
cache_hit: cacheHitSegment,
|
|
1355
|
+
cache: cacheSegment,
|
|
1344
1356
|
session_name: sessionNameSegment,
|
|
1345
1357
|
usage: usageSegment,
|
|
1346
1358
|
turn_stats: turnStatsSegment,
|
|
1347
|
-
collab: collabSegment,
|
|
1348
1359
|
stream: streamSegment,
|
|
1349
1360
|
vim: vimSegment,
|
|
1350
1361
|
};
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
import { type } from "@linxiraos/zeta-schema";
|
|
17
17
|
import type { ThinkingLevel } from "@linxiraos/pi-agent-core";
|
|
18
18
|
import type { Model } from "@linxiraos/pi-catalog/types";
|
|
19
|
+
import type { ComposerNativeState } from "../prompt/custom-editor";
|
|
19
20
|
import { parseThinkingLevel } from "../thinking";
|
|
20
21
|
import { StatusLineComponent } from "./component";
|
|
21
22
|
import type { CompactionBoundaries } from "./context-usage";
|
|
22
23
|
import type { StatusLineHost, StatusLineSession } from "./host";
|
|
24
|
+
import { thinkingLevelWord } from "./segments";
|
|
23
25
|
import {
|
|
24
26
|
CONTEXT_LINE_MODE_VALUES,
|
|
25
27
|
STATUS_LINE_PRESET_VALUES,
|
|
@@ -57,9 +59,9 @@ const NO_USAGE = {
|
|
|
57
59
|
cost: 0,
|
|
58
60
|
};
|
|
59
61
|
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
/** A fresh, unnamed session on the cached model and thinking state. */
|
|
63
|
+
function startupSession(data: StatusLineStartupData): StatusLineSession {
|
|
64
|
+
return {
|
|
63
65
|
state: { model: data.model, thinkingLevel: data.thinkingLevel, messages: NO_MESSAGES },
|
|
64
66
|
model: data.model,
|
|
65
67
|
messages: NO_MESSAGES,
|
|
@@ -78,6 +80,22 @@ export function createStartupStatusLine(data: StatusLineStartupData): StatusLine
|
|
|
78
80
|
getAsyncJobSnapshot: () => null,
|
|
79
81
|
getGoalModeState: () => undefined,
|
|
80
82
|
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* TSP composer state for the first frame: the cached thinking level on the
|
|
87
|
+
* effort chip (or as the model chip's icon), until InteractiveMode wires the live one.
|
|
88
|
+
*/
|
|
89
|
+
export function startupComposerState(data: StatusLineStartupData): ComposerNativeState {
|
|
90
|
+
return {
|
|
91
|
+
running: false,
|
|
92
|
+
thinking: thinkingLevelWord(startupSession(data)),
|
|
93
|
+
thinkingInModel: data.settings.compactThinkingLevel,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Build the prepaint status line; the caller disposes it once the session-bound bar mounts. */
|
|
98
|
+
export function createStartupStatusLine(data: StatusLineStartupData): StatusLineComponent {
|
|
81
99
|
const host: StatusLineHost = {
|
|
82
100
|
getSettings: () => data.settings,
|
|
83
101
|
gitEnabled: () => data.gitEnabled,
|
|
@@ -95,7 +113,7 @@ export function createStartupStatusLine(data: StatusLineStartupData): StatusLine
|
|
|
95
113
|
limitMatchesActiveAccount: () => false,
|
|
96
114
|
computeCompactionBoundaries: () => data.compactionBoundaries,
|
|
97
115
|
};
|
|
98
|
-
const statusLine = new StatusLineComponent(
|
|
116
|
+
const statusLine = new StatusLineComponent(startupSession(data), host);
|
|
99
117
|
statusLine.setAutoCompactEnabled(data.autoCompactEnabled);
|
|
100
118
|
return statusLine;
|
|
101
119
|
}
|
package/src/status-line/types.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Model } from "@linxiraos/pi-ai";
|
|
2
|
-
import type {
|
|
2
|
+
import type { TspSpan, TspTone } from "@linxiraos/pi-wire";
|
|
3
3
|
import type { NativeNode, NativeUiEvent } from "../native/node";
|
|
4
4
|
import type { ContextLineMode, StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "./schema";
|
|
5
|
-
import type { ActiveRepoContext, StatusLineSession } from "./host";
|
|
5
|
+
import type { ActiveRepoContext, PromptCacheStatus, StatusLineSession } from "./host";
|
|
6
6
|
import type { LoopConditionConfig, LoopLimitRuntime } from "./loop";
|
|
7
7
|
|
|
8
8
|
export type { ContextLineMode, StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle };
|
|
@@ -16,25 +16,6 @@ export interface ContextUsage {
|
|
|
16
16
|
percent: number;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/** Debounced footer snapshot a collab host broadcasts to guests. */
|
|
20
|
-
export type CollabSessionState = SessionState & {
|
|
21
|
-
/**
|
|
22
|
-
* Host model (full catalog object). Guests apply it to their replica
|
|
23
|
-
* agent state so model display and context-window math are native.
|
|
24
|
-
*/
|
|
25
|
-
model?: Model;
|
|
26
|
-
/** Host status-line context numbers (guest system prompt/tools differ, so local estimates drift). */
|
|
27
|
-
contextUsage?: ContextUsage;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/** Collab session indicator + (guest-only) host-state override for segments. */
|
|
31
|
-
export interface CollabStatus {
|
|
32
|
-
role: "host" | "guest";
|
|
33
|
-
participantCount: number;
|
|
34
|
-
/** Guest only: host footer snapshot that overrides locally computed values. */
|
|
35
|
-
stateOverride?: CollabSessionState | null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
19
|
export interface StatusLineSegmentOptions {
|
|
39
20
|
pi?: { showProfile?: boolean };
|
|
40
21
|
model?: { showThinkingLevel?: boolean };
|
|
@@ -86,6 +67,8 @@ export interface SegmentContext {
|
|
|
86
67
|
sessionAccent?: boolean;
|
|
87
68
|
/** Stand-in session title for previews; `session_name` renders it when the session is unnamed. */
|
|
88
69
|
previewTitle?: string;
|
|
70
|
+
/** The viewed session is pinned; `session_name` prefixes the pin icon. */
|
|
71
|
+
isPinned?: boolean;
|
|
89
72
|
activeRepo: ActiveRepoContext | null;
|
|
90
73
|
width: number;
|
|
91
74
|
options: StatusLineSegmentOptions;
|
|
@@ -125,7 +108,6 @@ export interface SegmentContext {
|
|
|
125
108
|
/** `tui.vimModeDisplay`: how the mode renders in the status line. */
|
|
126
109
|
display: "text" | "icon" | "none";
|
|
127
110
|
} | null;
|
|
128
|
-
collab: CollabStatus | null;
|
|
129
111
|
stream: { viewers: number } | null;
|
|
130
112
|
/** A `/record` capture of this screen is running. */
|
|
131
113
|
recording: boolean;
|
|
@@ -208,6 +190,8 @@ export interface SegmentContext {
|
|
|
208
190
|
expiring?: StatusResetExpiry;
|
|
209
191
|
};
|
|
210
192
|
} | null;
|
|
193
|
+
/** What the next request finds in the prompt cache; read only when the `cache` segment is configured. */
|
|
194
|
+
promptCache?: PromptCacheStatus;
|
|
211
195
|
}
|
|
212
196
|
|
|
213
197
|
/** How close an account's saved resets are to expiring, when it is worth a warning. */
|
|
@@ -255,6 +239,8 @@ export interface ComposerFacts {
|
|
|
255
239
|
/**
|
|
256
240
|
* `status` (role `zeta.composer.extras`, `grow: 1`) of the other configured
|
|
257
241
|
* segments as `seg`s; the bar's flexible space, so present even when empty.
|
|
242
|
+
* The prompt cache's (role `zeta.composer.cache`) sits on its right side, beside
|
|
243
|
+
* the usage, with a hover card and a click opening `/session`.
|
|
258
244
|
*/
|
|
259
245
|
readonly extras: NativeNode;
|
|
260
246
|
/** `text` (role `zeta.composer.usage`): the session cost (empty when there is none). */
|
package/src/stdin-buffer.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { EventEmitter } from "events";
|
|
20
20
|
import { isKittyProtocolActive } from "./keys";
|
|
21
|
+
import { TSP_OSC_PREFIX } from "./native/encode";
|
|
21
22
|
|
|
22
23
|
const ESC = "\x1b";
|
|
23
24
|
/** Terminal bracketed-paste open marker wrapping pasted input. */
|
|
@@ -131,6 +132,10 @@ const OSC5522_PREFIX = "\x1b]5522;";
|
|
|
131
132
|
// short; bounding the `;` search keeps a malformed packet O(n).
|
|
132
133
|
const MAX_OSC5522_METADATA = 1024;
|
|
133
134
|
|
|
135
|
+
function isPasteReport(buffer: string, pos = 0): boolean {
|
|
136
|
+
return buffer.startsWith("\x1b_", pos) || buffer.startsWith(TSP_OSC_PREFIX, pos);
|
|
137
|
+
}
|
|
138
|
+
|
|
134
139
|
/**
|
|
135
140
|
* Resolve an OSC/DCS/APC string sequence by its grammar, not by time. A
|
|
136
141
|
* string ends at ST (`ESC \`), or BEL for OSC. Its payload never contains
|
|
@@ -486,7 +491,6 @@ export class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
486
491
|
readonly #pasteByteLimit: number;
|
|
487
492
|
#pasteMode: boolean = false;
|
|
488
493
|
#pasteChunks: string[] = [];
|
|
489
|
-
#pasteOverlap: string = "";
|
|
490
494
|
#pasteBytes = 0;
|
|
491
495
|
#pasteWatchdog?: NodeJS.Timeout;
|
|
492
496
|
#pendingKittyPrintableCodepoint: number | undefined;
|
|
@@ -557,6 +561,10 @@ export class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
557
561
|
str = this.#consumeStringDiscard(str);
|
|
558
562
|
if (str.length === 0) return;
|
|
559
563
|
}
|
|
564
|
+
if (this.#pasteMode) {
|
|
565
|
+
this.#consumePasteChunk(str);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
560
568
|
if (this.#dormantString !== undefined && this.#buffer.length === 0) {
|
|
561
569
|
if (Date.now() < this.#dormantUntilMs) this.#resumeDormantString(str);
|
|
562
570
|
else this.#dormantString = undefined;
|
|
@@ -578,11 +586,6 @@ export class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
578
586
|
return;
|
|
579
587
|
}
|
|
580
588
|
|
|
581
|
-
if (this.#pasteMode) {
|
|
582
|
-
this.#consumePasteChunk(str);
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
589
|
if (this.#rawPasteCandidate.length > 0) {
|
|
587
590
|
if (str.indexOf(ESC) !== -1) {
|
|
588
591
|
// Escape-bearing input cannot belong to an unmarked raw paste.
|
|
@@ -635,7 +638,6 @@ export class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
635
638
|
this.#buffer = "";
|
|
636
639
|
this.#pasteMode = true;
|
|
637
640
|
this.#pasteChunks = [];
|
|
638
|
-
this.#pasteOverlap = "";
|
|
639
641
|
this.#pasteBytes = 0;
|
|
640
642
|
this.#consumePasteChunk(firstChunk);
|
|
641
643
|
return;
|
|
@@ -682,55 +684,96 @@ export class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
682
684
|
}
|
|
683
685
|
|
|
684
686
|
/**
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
* re-concatenating and rescanning the whole buffer on every chunk. A short
|
|
689
|
-
* overlap tail (end-marker length - 1) is carried across chunk boundaries so
|
|
690
|
-
* a marker split between two reads is still detected without rescanning.
|
|
687
|
+
* Accumulate pasted text while routing APC and ConPTY TSP reports through the data
|
|
688
|
+
* path. Only an undecided escape suffix stays in the input buffer, so text
|
|
689
|
+
* chunks are joined once and string scans resume where the last read ended.
|
|
691
690
|
*/
|
|
692
691
|
#consumePasteChunk(chunk: string): void {
|
|
693
|
-
const
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
692
|
+
const input = this.#buffer + chunk;
|
|
693
|
+
const searchOffset = this.#escapeSearchOffset;
|
|
694
|
+
const previousBytes = this.#pasteBytes;
|
|
695
|
+
this.#buffer = "";
|
|
696
|
+
this.#escapeSearchOffset = 0;
|
|
697
|
+
let textStart = 0;
|
|
698
|
+
let searchFrom = 0;
|
|
699
|
+
|
|
700
|
+
while (searchFrom < input.length) {
|
|
701
|
+
const escape = input.indexOf(ESC, searchFrom);
|
|
702
|
+
if (escape === -1) break;
|
|
703
|
+
|
|
704
|
+
if (input.startsWith(BRACKETED_PASTE_END, escape)) {
|
|
705
|
+
this.#appendPasteText(input.slice(textStart, escape));
|
|
706
|
+
this.#finishPaste(input.slice(escape + BRACKETED_PASTE_END.length));
|
|
701
707
|
return;
|
|
702
708
|
}
|
|
709
|
+
if (input.length - escape < TSP_OSC_PREFIX.length) {
|
|
710
|
+
const tail = input.slice(escape);
|
|
711
|
+
if (BRACKETED_PASTE_END.startsWith(tail) || TSP_OSC_PREFIX.startsWith(tail)) {
|
|
712
|
+
this.#appendPasteText(input.slice(textStart, escape));
|
|
713
|
+
this.#buffer = tail;
|
|
714
|
+
textStart = input.length;
|
|
715
|
+
break;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
if (!isPasteReport(input, escape)) {
|
|
719
|
+
searchFrom = escape + 1;
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
this.#appendPasteText(input.slice(textStart, escape));
|
|
724
|
+
const end = resolveEscapeEnd(input, escape, input.length, escape === 0 ? searchOffset : 0);
|
|
725
|
+
if (end === -1) {
|
|
726
|
+
this.#buffer = input.slice(escape);
|
|
727
|
+
this.#escapeSearchOffset = input.length - escape;
|
|
728
|
+
textStart = input.length;
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
if (end === -2) {
|
|
732
|
+
this.#enterStringDiscard();
|
|
733
|
+
this.#consumePasteChunk(this.#consumeStringDiscard(input.slice(escape)));
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
if (end <= STRING_ABORTED) {
|
|
737
|
+
searchFrom = STRING_ABORTED - end;
|
|
738
|
+
} else {
|
|
739
|
+
this.#emitDataSequence(input.slice(escape, end));
|
|
740
|
+
searchFrom = end;
|
|
741
|
+
}
|
|
742
|
+
textStart = searchFrom;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
this.#appendPasteText(input.slice(textStart));
|
|
746
|
+
const pendingText = isPasteReport(this.#buffer) ? "" : this.#buffer;
|
|
747
|
+
if (this.#pasteBytes + Buffer.byteLength(pendingText, "utf8") > this.#pasteByteLimit) {
|
|
748
|
+
this.#abortPaste();
|
|
749
|
+
} else if (!this.#pasteWatchdog || this.#pasteBytes !== previousBytes || pendingText.length > 0) {
|
|
750
|
+
// Terminal replies do not keep a paste with a lost end marker alive.
|
|
703
751
|
this.#armPasteWatchdog();
|
|
704
|
-
return;
|
|
705
752
|
}
|
|
753
|
+
}
|
|
706
754
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
const remaining = flat.slice(endIndex + BRACKETED_PASTE_END.length);
|
|
755
|
+
#appendPasteText(text: string): void {
|
|
756
|
+
if (text.length === 0) return;
|
|
757
|
+
this.#pasteChunks.push(text);
|
|
758
|
+
this.#pasteBytes += Buffer.byteLength(text, "utf8");
|
|
759
|
+
}
|
|
713
760
|
|
|
761
|
+
#finishPaste(remaining: string): void {
|
|
762
|
+
const content = this.#pasteChunks.join("");
|
|
714
763
|
this.#clearPasteWatchdog();
|
|
715
764
|
this.#pasteMode = false;
|
|
716
765
|
this.#pasteChunks = [];
|
|
717
|
-
this.#pasteOverlap = "";
|
|
718
766
|
this.#pasteBytes = 0;
|
|
719
767
|
this.#pendingKittyPrintableCodepoint = undefined;
|
|
720
768
|
|
|
721
|
-
//
|
|
722
|
-
// not split into two dispatches: the paste may open an overlay that
|
|
723
|
-
// would then swallow the Enter meant to submit it.
|
|
769
|
+
// Keep paste-and-Enter on the same focus owner if the paste opens an overlay.
|
|
724
770
|
const enter = leadingEnter(remaining);
|
|
725
|
-
this.emit("paste",
|
|
726
|
-
|
|
771
|
+
this.emit("paste", content, enter);
|
|
727
772
|
const rest = enter === undefined ? remaining : remaining.slice(enter.length);
|
|
728
|
-
if (rest.length > 0)
|
|
729
|
-
this.process(rest);
|
|
730
|
-
}
|
|
773
|
+
if (rest.length > 0) this.process(rest);
|
|
731
774
|
}
|
|
732
775
|
|
|
733
|
-
/** Re-arm the paste-mode inactivity watchdog after
|
|
776
|
+
/** Re-arm the paste-mode inactivity watchdog after pasted text arrives. */
|
|
734
777
|
#armPasteWatchdog(): void {
|
|
735
778
|
if (this.#pasteWatchdog) clearTimeout(this.#pasteWatchdog);
|
|
736
779
|
this.#pasteWatchdog = setTimeout(() => {
|
|
@@ -753,13 +796,14 @@ export class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
753
796
|
* keystrokes, nor accumulated forever while input appears dead.
|
|
754
797
|
*/
|
|
755
798
|
#abortPaste(): void {
|
|
756
|
-
this.#
|
|
757
|
-
|
|
758
|
-
this.#
|
|
759
|
-
|
|
760
|
-
this.#
|
|
761
|
-
this.#
|
|
762
|
-
|
|
799
|
+
const pending = this.#buffer;
|
|
800
|
+
this.#buffer = "";
|
|
801
|
+
this.#escapeSearchOffset = 0;
|
|
802
|
+
const reply = isPasteReport(pending);
|
|
803
|
+
if (!reply) this.#appendPasteText(pending);
|
|
804
|
+
this.#finishPaste("");
|
|
805
|
+
// A reply split across paste recovery still belongs to the terminal.
|
|
806
|
+
if (reply) this.process(pending);
|
|
763
807
|
}
|
|
764
808
|
|
|
765
809
|
/**
|
|
@@ -1162,7 +1206,6 @@ export class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
1162
1206
|
this.#rawPasteCandidate = "";
|
|
1163
1207
|
this.#pasteMode = false;
|
|
1164
1208
|
this.#pasteChunks = [];
|
|
1165
|
-
this.#pasteOverlap = "";
|
|
1166
1209
|
this.#pasteBytes = 0;
|
|
1167
1210
|
this.#pendingKittyPrintableCodepoint = undefined;
|
|
1168
1211
|
this.#partialHoldStartMs = 0;
|
|
@@ -648,9 +648,9 @@ const KNOWN_TERMINALS = Object.freeze({
|
|
|
648
648
|
// Rex (TERM_PROGRAM=rex / TERM=xterm-rex): only Kitty graphics is confirmed.
|
|
649
649
|
rex: new TerminalInfo("rex", ImageProtocol.Kitty, true, false),
|
|
650
650
|
// Tern (Stencil's terminal, `stencil-term`) sets TERM_PROGRAM=tern and
|
|
651
|
-
// implements Kitty graphics, OSC 8 and
|
|
652
|
-
// renders natively (Tern Surface
|
|
653
|
-
// handshake alone, never by this identity.
|
|
651
|
+
// implements Kitty graphics (Unicode placeholders included), OSC 8 and
|
|
652
|
+
// OSC 9/99 notifications. Whether omp renders natively (Tern Surface
|
|
653
|
+
// Protocol) is decided by the `hello` handshake alone, never by this identity.
|
|
654
654
|
tern: new TerminalInfo("tern", ImageProtocol.Kitty, true, true, NotifyProtocol.Osc99),
|
|
655
655
|
// Monstar (rockorager/monstar) is a Wayland terminal built on libghostty. It
|
|
656
656
|
// sets TERM=monstar and answers XTVERSION with `monstar <version>`. It
|
package/src/terminal.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
parseGlyphProtocolReply,
|
|
18
18
|
} from "./glyph-protocol";
|
|
19
19
|
import { setKittyProtocolActive } from "./keys";
|
|
20
|
-
import { encodeTspHelloQuery, parseTspMessage, TSP_PREFIX, type TspHello } from "./native/encode";
|
|
20
|
+
import { encodeTspHelloQuery, parseTspMessage, TSP_OSC_PREFIX, TSP_PREFIX, type TspHello } from "./native/encode";
|
|
21
21
|
import { StdinBuffer } from "./stdin-buffer";
|
|
22
22
|
import {
|
|
23
23
|
isInsideTerminalMultiplexer,
|
|
@@ -46,13 +46,6 @@ const WINDOWS_TERMINAL_OSC11_POLL_MS = 30_000;
|
|
|
46
46
|
/** How long a relayed ESC record waits for the rest of its sequence before acting as Escape (matches StdinBuffer). */
|
|
47
47
|
const WIN32_RELAYED_ESCAPE_TIMEOUT_MS = 75;
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* Terminal → program TSP messages through a Windows ConPTY: its input parser
|
|
51
|
-
* discards APC strings but passes OSC through, so Tern writes
|
|
52
|
-
* `ESC ] 877 ; tsp;… ESC \` there instead of `ESC _ tsp;… ESC \`.
|
|
53
|
-
*/
|
|
54
|
-
const TSP_OSC_PREFIX = `\x1b]877;${TSP_PREFIX.slice(2)}`;
|
|
55
|
-
|
|
56
49
|
/** How long a TSP hello waits for its reply inside tmux, which answers DA1 itself. */
|
|
57
50
|
const TSP_TMUX_HELLO_TIMEOUT_MS = 1000;
|
|
58
51
|
|
package/src/theme/loader.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as path from "node:path";
|
|
|
3
3
|
import { adjustHsv } from "@linxiraos/pi-utils/color";
|
|
4
4
|
import { getCustomThemesDir } from "@linxiraos/pi-utils/dirs";
|
|
5
5
|
import { isEnoent } from "@linxiraos/pi-utils/fs-error";
|
|
6
|
-
import { detectColorMode, resolveThemeColors } from "./color";
|
|
6
|
+
import { detectColorMode, resolveThemeColors, resolveVarRefs } from "./color";
|
|
7
7
|
import darkThemeJson from "./dark.json" with { type: "json" };
|
|
8
8
|
import defaultThemes from "./defaults.json" with { type: "json" };
|
|
9
9
|
import lightThemeJson from "./light.json" with { type: "json" };
|
|
@@ -179,7 +179,8 @@ export function createTheme(themeJson: ThemeJson, options: CreateThemeOptions =
|
|
|
179
179
|
const symbolPreset: SymbolPreset = symbolPresetOverride ?? themeJson.symbols?.preset ?? "unicode";
|
|
180
180
|
const symbolOverrides = themeJson.symbols?.overrides ?? {};
|
|
181
181
|
const spinnerFramesOverrides = normalizeSpinnerFramesOverride(themeJson.symbols?.spinnerFrames);
|
|
182
|
-
|
|
182
|
+
const ansiPalette = themeJson.terminal?.ansi?.map(color => resolveVarRefs(color, themeJson.vars ?? {}));
|
|
183
|
+
return new Theme(fgColors, bgColors, colorMode, symbolPreset, symbolOverrides, spinnerFramesOverrides, ansiPalette);
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
export async function loadTheme(name: string, options: CreateThemeOptions = {}): Promise<Theme> {
|
package/src/theme/schema.d.ts
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import type { SpinnerFramesOverride } from "./symbols";
|
|
2
2
|
export type ColorValue = string | number;
|
|
3
|
+
/**
|
|
4
|
+
* Index of each slot in a theme's 16-color `terminal.ansi` palette (0–7
|
|
5
|
+
* normal, 8–15 bright). `Theme.ansiFg()` paints by slot name.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ANSI_COLOR_INDEX: {
|
|
8
|
+
readonly black: 0;
|
|
9
|
+
readonly red: 1;
|
|
10
|
+
readonly green: 2;
|
|
11
|
+
readonly yellow: 3;
|
|
12
|
+
readonly blue: 4;
|
|
13
|
+
readonly magenta: 5;
|
|
14
|
+
readonly cyan: 6;
|
|
15
|
+
readonly white: 7;
|
|
16
|
+
readonly brightBlack: 8;
|
|
17
|
+
readonly brightRed: 9;
|
|
18
|
+
readonly brightGreen: 10;
|
|
19
|
+
readonly brightYellow: 11;
|
|
20
|
+
readonly brightBlue: 12;
|
|
21
|
+
readonly brightMagenta: 13;
|
|
22
|
+
readonly brightCyan: 14;
|
|
23
|
+
readonly brightWhite: 15;
|
|
24
|
+
};
|
|
25
|
+
export type AnsiColor = keyof typeof ANSI_COLOR_INDEX;
|
|
3
26
|
/**
|
|
4
27
|
* Tokens a theme is allowed to omit. They resolve to the terminal default
|
|
5
28
|
* foreground, so `Theme.fg()` stays total for callers that paint a token a theme
|
|
@@ -36,7 +59,11 @@ export interface ThemeJson {
|
|
|
36
59
|
chrome?: ColorValue;
|
|
37
60
|
/** Lifted surfaces: popovers, menus, buttons. */
|
|
38
61
|
widget?: ColorValue;
|
|
39
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* ANSI colors 0–15: exactly 16. omp also paints colorful Markdown
|
|
64
|
+
* (headings, emphasis, table headers) from this palette; slots it
|
|
65
|
+
* omits fall back to the terminal's own palette.
|
|
66
|
+
*/
|
|
40
67
|
ansi?: ColorValue[];
|
|
41
68
|
};
|
|
42
69
|
symbols?: {
|
package/src/theme/schema.ts
CHANGED
|
@@ -6,6 +6,31 @@ import type { SpinnerFramesOverride } from "./symbols";
|
|
|
6
6
|
|
|
7
7
|
export type ColorValue = string | number;
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Index of each slot in a theme's 16-color `terminal.ansi` palette (0–7
|
|
11
|
+
* normal, 8–15 bright). `Theme.ansiFg()` paints by slot name.
|
|
12
|
+
*/
|
|
13
|
+
export const ANSI_COLOR_INDEX = {
|
|
14
|
+
black: 0,
|
|
15
|
+
red: 1,
|
|
16
|
+
green: 2,
|
|
17
|
+
yellow: 3,
|
|
18
|
+
blue: 4,
|
|
19
|
+
magenta: 5,
|
|
20
|
+
cyan: 6,
|
|
21
|
+
white: 7,
|
|
22
|
+
brightBlack: 8,
|
|
23
|
+
brightRed: 9,
|
|
24
|
+
brightGreen: 10,
|
|
25
|
+
brightYellow: 11,
|
|
26
|
+
brightBlue: 12,
|
|
27
|
+
brightMagenta: 13,
|
|
28
|
+
brightCyan: 14,
|
|
29
|
+
brightWhite: 15,
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export type AnsiColor = keyof typeof ANSI_COLOR_INDEX;
|
|
33
|
+
|
|
9
34
|
/**
|
|
10
35
|
* Tokens a theme is allowed to omit. They resolve to the terminal default
|
|
11
36
|
* foreground, so `Theme.fg()` stays total for callers that paint a token a theme
|
|
@@ -42,7 +67,11 @@ export interface ThemeJson {
|
|
|
42
67
|
chrome?: ColorValue;
|
|
43
68
|
/** Lifted surfaces: popovers, menus, buttons. */
|
|
44
69
|
widget?: ColorValue;
|
|
45
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* ANSI colors 0–15: exactly 16. omp also paints colorful Markdown
|
|
72
|
+
* (headings, emphasis, table headers) from this palette; slots it
|
|
73
|
+
* omits fall back to the terminal's own palette.
|
|
74
|
+
*/
|
|
46
75
|
ansi?: ColorValue[];
|
|
47
76
|
};
|
|
48
77
|
symbols?: {
|
package/src/theme/symbols.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
|
4
4
|
*/
|
|
5
5
|
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted"
|
|
6
6
|
/** @deprecated Alias of `status.success`; kept so extensions and theme overrides that name it keep working. */
|
|
7
|
-
| "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "progress.filled" | "progress.empty" | "context.speculation" | "context.compaction" | "context.content" | "context.messages" | "context.buffer" | "context.free" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxDotted.horizontal" | "boxDotted.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.powerlineCapLeft" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.prewalk" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.pin" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.subscription" | "icon.advisor" | "icon.advisorClosed" | "icon.time" | "icon.omp" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "icon.intelligence" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.vimNormal" | "icon.vimInsert" | "icon.vimVisual" | "icon.vimVisualLine" | "icon.vimReplace" | "cmd.action" | "cmd.prompt" | "cmd.extension" | "cmd.settings" | "cmd.gear" | "cmd.shield" | "cmd.wave" | "cmd.compass" | "cmd.inbox" | "cmd.swap" | "cmd.expand" | "cmd.computer" | "cmd.eye" | "cmd.todo" | "cmd.stats" | "cmd.news" | "cmd.keyboard" | "cmd.export" | "cmd.clipboard" | "cmd.share" | "cmd.broadcast" | "cmd.globe" | "cmd.copy" | "cmd.plus" | "cmd.restart" | "cmd.eraser" | "cmd.trash" | "cmd.compress" | "cmd.vibrate" | "cmd.handoff" | "cmd.history" | "cmd.question" | "cmd.rocket" | "cmd.stethoscope" | "cmd.redo" | "cmd.bug" | "cmd.memory" | "cmd.pencil" | "cmd.folderMove" | "cmd.folderPlus" | "cmd.folderMinus" | "cmd.hammer" | "cmd.power" | "cmd.cart" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "skill.rail" | "btw.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "chip.image" | "chip.video" | "chip.paste" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.launch" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move" | "key.ctrl" | "key.ctrlMac" | "key.shift" | "key.alt" | "key.altMac" | "key.super" | "key.superMac" | "key.joiner" | "key.enter" | "key.esc" | "key.tab" | "key.backspace" | "key.delete" | "key.space" | "key.up" | "key.down" | "key.left" | "key.right";
|
|
7
|
+
| "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "progress.filled" | "progress.empty" | "context.speculation" | "context.compaction" | "context.content" | "context.messages" | "context.buffer" | "context.free" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxDotted.horizontal" | "boxDotted.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.powerlineCapLeft" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.prewalk" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.pin" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.subscription" | "icon.advisor" | "icon.advisorClosed" | "icon.time" | "icon.omp" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.cacheWarm" | "icon.cacheCold" | "icon.input" | "icon.output" | "icon.throughput" | "icon.intelligence" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.vimNormal" | "icon.vimInsert" | "icon.vimVisual" | "icon.vimVisualLine" | "icon.vimReplace" | "cmd.action" | "cmd.prompt" | "cmd.extension" | "cmd.settings" | "cmd.gear" | "cmd.shield" | "cmd.wave" | "cmd.compass" | "cmd.inbox" | "cmd.swap" | "cmd.expand" | "cmd.computer" | "cmd.eye" | "cmd.todo" | "cmd.stats" | "cmd.news" | "cmd.keyboard" | "cmd.export" | "cmd.clipboard" | "cmd.share" | "cmd.broadcast" | "cmd.globe" | "cmd.copy" | "cmd.plus" | "cmd.restart" | "cmd.eraser" | "cmd.trash" | "cmd.compress" | "cmd.vibrate" | "cmd.handoff" | "cmd.history" | "cmd.question" | "cmd.rocket" | "cmd.stethoscope" | "cmd.redo" | "cmd.bug" | "cmd.memory" | "cmd.pencil" | "cmd.folderMove" | "cmd.folderPlus" | "cmd.folderMinus" | "cmd.hammer" | "cmd.power" | "cmd.cart" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "skill.rail" | "btw.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "chip.image" | "chip.video" | "chip.paste" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.launch" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move" | "key.ctrl" | "key.ctrlMac" | "key.shift" | "key.alt" | "key.altMac" | "key.super" | "key.superMac" | "key.joiner" | "key.enter" | "key.esc" | "key.tab" | "key.backspace" | "key.delete" | "key.space" | "key.up" | "key.down" | "key.left" | "key.right";
|
|
8
8
|
export type SymbolMap = Record<SymbolKey, string>;
|
|
9
9
|
/**
|
|
10
10
|
* Icon vocabulary for slash-command autocomplete type indicators. Each name
|