@kenkaiiii/ggcoder 4.3.230 → 4.3.232
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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -1
- package/dist/config.js.map +1 -1
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +29 -0
- package/dist/config.test.js.map +1 -0
- package/dist/core/goal-controller.d.ts +27 -6
- package/dist/core/goal-controller.d.ts.map +1 -1
- package/dist/core/goal-controller.js +246 -141
- package/dist/core/goal-controller.js.map +1 -1
- package/dist/core/goal-controller.test.js +210 -79
- package/dist/core/goal-controller.test.js.map +1 -1
- package/dist/core/goal-engine.d.ts +61 -0
- package/dist/core/goal-engine.d.ts.map +1 -0
- package/dist/core/goal-engine.js +123 -0
- package/dist/core/goal-engine.js.map +1 -0
- package/dist/core/goal-engine.test.d.ts +2 -0
- package/dist/core/goal-engine.test.d.ts.map +1 -0
- package/dist/core/goal-engine.test.js +295 -0
- package/dist/core/goal-engine.test.js.map +1 -0
- package/dist/core/goal-integration.d.ts +80 -0
- package/dist/core/goal-integration.d.ts.map +1 -0
- package/dist/core/goal-integration.js +296 -0
- package/dist/core/goal-integration.js.map +1 -0
- package/dist/core/goal-integration.test.d.ts +2 -0
- package/dist/core/goal-integration.test.d.ts.map +1 -0
- package/dist/core/goal-integration.test.js +369 -0
- package/dist/core/goal-integration.test.js.map +1 -0
- package/dist/core/goal-prerequisites.test.js +37 -1
- package/dist/core/goal-prerequisites.test.js.map +1 -1
- package/dist/core/goal-store.d.ts +80 -1
- package/dist/core/goal-store.d.ts.map +1 -1
- package/dist/core/goal-store.js +232 -65
- package/dist/core/goal-store.js.map +1 -1
- package/dist/core/goal-store.test.js +111 -2
- package/dist/core/goal-store.test.js.map +1 -1
- package/dist/core/goal-worker.d.ts.map +1 -1
- package/dist/core/goal-worker.js +55 -4
- package/dist/core/goal-worker.js.map +1 -1
- package/dist/core/goal-worker.test.js +75 -6
- package/dist/core/goal-worker.test.js.map +1 -1
- package/dist/core/goal-worktree.d.ts +55 -1
- package/dist/core/goal-worktree.d.ts.map +1 -1
- package/dist/core/goal-worktree.js +164 -1
- package/dist/core/goal-worktree.js.map +1 -1
- package/dist/core/goal-worktree.test.js +226 -4
- package/dist/core/goal-worktree.test.js.map +1 -1
- package/dist/core/ideal-review.d.ts +20 -0
- package/dist/core/ideal-review.d.ts.map +1 -0
- package/dist/core/ideal-review.js +55 -0
- package/dist/core/ideal-review.js.map +1 -0
- package/dist/core/ideal-review.test.d.ts +2 -0
- package/dist/core/ideal-review.test.d.ts.map +1 -0
- package/dist/core/ideal-review.test.js +59 -0
- package/dist/core/ideal-review.test.js.map +1 -0
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +2 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +9 -6
- package/dist/system-prompt.js.map +1 -1
- package/dist/system-prompt.test.js +1 -1
- package/dist/system-prompt.test.js.map +1 -1
- package/dist/tools/edit-diff.d.ts +17 -4
- package/dist/tools/edit-diff.d.ts.map +1 -1
- package/dist/tools/edit-diff.js +78 -16
- package/dist/tools/edit-diff.js.map +1 -1
- package/dist/tools/edit-diff.test.js +31 -1
- package/dist/tools/edit-diff.test.js.map +1 -1
- package/dist/tools/edit-robustness.test.d.ts +2 -0
- package/dist/tools/edit-robustness.test.d.ts.map +1 -0
- package/dist/tools/edit-robustness.test.js +415 -0
- package/dist/tools/edit-robustness.test.js.map +1 -0
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +15 -16
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/edit.test.js +23 -12
- package/dist/tools/edit.test.js.map +1 -1
- package/dist/tools/goals.d.ts +9 -1
- package/dist/tools/goals.d.ts.map +1 -1
- package/dist/tools/goals.js +78 -25
- package/dist/tools/goals.js.map +1 -1
- package/dist/tools/goals.test.js +142 -11
- package/dist/tools/goals.test.js.map +1 -1
- package/dist/tools/html-extract.d.ts +58 -0
- package/dist/tools/html-extract.d.ts.map +1 -0
- package/dist/tools/html-extract.js +130 -0
- package/dist/tools/html-extract.js.map +1 -0
- package/dist/tools/html-extract.test.d.ts +2 -0
- package/dist/tools/html-extract.test.d.ts.map +1 -0
- package/dist/tools/html-extract.test.js +60 -0
- package/dist/tools/html-extract.test.js.map +1 -0
- package/dist/tools/pdf-extract.d.ts +18 -0
- package/dist/tools/pdf-extract.d.ts.map +1 -0
- package/dist/tools/pdf-extract.js +43 -0
- package/dist/tools/pdf-extract.js.map +1 -0
- package/dist/tools/pdf-extract.test.d.ts +2 -0
- package/dist/tools/pdf-extract.test.d.ts.map +1 -0
- package/dist/tools/pdf-extract.test.js +15 -0
- package/dist/tools/pdf-extract.test.js.map +1 -0
- package/dist/tools/prompt-hints.d.ts.map +1 -1
- package/dist/tools/prompt-hints.js +2 -1
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/web-fetch.d.ts +16 -1
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +357 -45
- package/dist/tools/web-fetch.js.map +1 -1
- package/dist/tools/web-fetch.test.js +263 -2
- package/dist/tools/web-fetch.test.js.map +1 -1
- package/dist/tools/web-search.d.ts +14 -0
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +321 -35
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/web-search.test.js +144 -1
- package/dist/tools/web-search.test.js.map +1 -1
- package/dist/ui/App.d.ts +11 -1
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +132 -17
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/app-items.d.ts +14 -1
- package/dist/ui/app-items.d.ts.map +1 -1
- package/dist/ui/app-items.js +2 -0
- package/dist/ui/app-items.js.map +1 -1
- package/dist/ui/components/ChatLayout.d.ts +8 -1
- package/dist/ui/components/ChatLayout.d.ts.map +1 -1
- package/dist/ui/components/ChatLayout.js +4 -1
- package/dist/ui/components/ChatLayout.js.map +1 -1
- package/dist/ui/components/ChatScreen.d.ts +14 -1
- package/dist/ui/components/ChatScreen.d.ts.map +1 -1
- package/dist/ui/components/ChatScreen.js +3 -2
- package/dist/ui/components/ChatScreen.js.map +1 -1
- package/dist/ui/components/IdealHookMessage.d.ts +12 -0
- package/dist/ui/components/IdealHookMessage.d.ts.map +1 -0
- package/dist/ui/components/IdealHookMessage.js +24 -0
- package/dist/ui/components/IdealHookMessage.js.map +1 -0
- package/dist/ui/components/InputArea.d.ts +13 -1
- package/dist/ui/components/InputArea.d.ts.map +1 -1
- package/dist/ui/components/InputArea.js +96 -12
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/TranscriptViewport.d.ts +34 -0
- package/dist/ui/components/TranscriptViewport.d.ts.map +1 -0
- package/dist/ui/components/TranscriptViewport.js +45 -0
- package/dist/ui/components/TranscriptViewport.js.map +1 -0
- package/dist/ui/footer-jump-regression.test.d.ts +2 -0
- package/dist/ui/footer-jump-regression.test.d.ts.map +1 -0
- package/dist/ui/footer-jump-regression.test.js +167 -0
- package/dist/ui/footer-jump-regression.test.js.map +1 -0
- package/dist/ui/goal-events.d.ts +1 -1
- package/dist/ui/goal-events.d.ts.map +1 -1
- package/dist/ui/goal-events.js +2 -2
- package/dist/ui/goal-events.js.map +1 -1
- package/dist/ui/goal-events.test.js +2 -2
- package/dist/ui/goal-events.test.js.map +1 -1
- package/dist/ui/goal-lifecycle-orchestration.test.js +13 -97
- package/dist/ui/goal-lifecycle-orchestration.test.js.map +1 -1
- package/dist/ui/goal-progress.d.ts.map +1 -1
- package/dist/ui/goal-progress.js +0 -1
- package/dist/ui/goal-progress.js.map +1 -1
- package/dist/ui/goal-run-helpers.d.ts +0 -4
- package/dist/ui/goal-run-helpers.d.ts.map +1 -1
- package/dist/ui/goal-run-helpers.js +2 -21
- package/dist/ui/goal-run-helpers.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +2 -0
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +45 -1
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +8 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts.map +1 -1
- package/dist/ui/hooks/useChatLayoutMeasurements.js +2 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.js.map +1 -1
- package/dist/ui/hooks/useGoalOrchestration.d.ts +2 -1
- package/dist/ui/hooks/useGoalOrchestration.d.ts.map +1 -1
- package/dist/ui/hooks/useGoalOrchestration.js +198 -80
- package/dist/ui/hooks/useGoalOrchestration.js.map +1 -1
- package/dist/ui/hooks/useTerminalSize.d.ts +8 -1
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -1
- package/dist/ui/hooks/useTerminalSize.js +12 -2
- package/dist/ui/hooks/useTerminalSize.js.map +1 -1
- package/dist/ui/hooks/useTranscriptHistory.d.ts +1 -1
- package/dist/ui/hooks/useTranscriptHistory.d.ts.map +1 -1
- package/dist/ui/hooks/useTranscriptHistory.js +23 -9
- package/dist/ui/hooks/useTranscriptHistory.js.map +1 -1
- package/dist/ui/hooks/useTranscriptHistory.test.d.ts +2 -0
- package/dist/ui/hooks/useTranscriptHistory.test.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptHistory.test.js +61 -0
- package/dist/ui/hooks/useTranscriptHistory.test.js.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.d.ts +30 -0
- package/dist/ui/hooks/useTranscriptScroll.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.js +44 -0
- package/dist/ui/hooks/useTranscriptScroll.js.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.test.d.ts +2 -0
- package/dist/ui/hooks/useTranscriptScroll.test.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.test.js +119 -0
- package/dist/ui/hooks/useTranscriptScroll.test.js.map +1 -0
- package/dist/ui/live-area-clamp.test.js +11 -2
- package/dist/ui/live-area-clamp.test.js.map +1 -1
- package/dist/ui/render.d.ts +11 -0
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +71 -7
- package/dist/ui/render.js.map +1 -1
- package/dist/ui/stores/transcript-scroll-store.d.ts +27 -0
- package/dist/ui/stores/transcript-scroll-store.d.ts.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.js +73 -0
- package/dist/ui/stores/transcript-scroll-store.js.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.test.d.ts +2 -0
- package/dist/ui/stores/transcript-scroll-store.test.d.ts.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.test.js +73 -0
- package/dist/ui/stores/transcript-scroll-store.test.js.map +1 -0
- package/dist/ui/terminal-history.d.ts.map +1 -1
- package/dist/ui/terminal-history.js +8 -0
- package/dist/ui/terminal-history.js.map +1 -1
- package/dist/ui/testing/screen-recorder.d.ts +29 -0
- package/dist/ui/testing/screen-recorder.d.ts.map +1 -0
- package/dist/ui/testing/screen-recorder.js +179 -0
- package/dist/ui/testing/screen-recorder.js.map +1 -0
- package/dist/ui/transcript/TranscriptRenderer.d.ts.map +1 -1
- package/dist/ui/transcript/TranscriptRenderer.js +4 -1
- package/dist/ui/transcript/TranscriptRenderer.js.map +1 -1
- package/dist/ui/transcript/spacing.d.ts +3 -2
- package/dist/ui/transcript/spacing.d.ts.map +1 -1
- package/dist/ui/transcript/spacing.js +8 -0
- package/dist/ui/transcript/spacing.js.map +1 -1
- package/dist/ui/transcript/spacing.test.js +31 -0
- package/dist/ui/transcript/spacing.test.js.map +1 -1
- package/dist/ui/transcript/transcript-lines.d.ts +32 -0
- package/dist/ui/transcript/transcript-lines.d.ts.map +1 -0
- package/dist/ui/transcript/transcript-lines.js +82 -0
- package/dist/ui/transcript/transcript-lines.js.map +1 -0
- package/dist/ui/transcript/transcript-lines.test.d.ts +2 -0
- package/dist/ui/transcript/transcript-lines.test.d.ts.map +1 -0
- package/dist/ui/transcript/transcript-lines.test.js +76 -0
- package/dist/ui/transcript/transcript-lines.test.js.map +1 -0
- package/dist/ui/transcript-viewport-pinning.test.d.ts +2 -0
- package/dist/ui/transcript-viewport-pinning.test.d.ts.map +1 -0
- package/dist/ui/transcript-viewport-pinning.test.js +148 -0
- package/dist/ui/transcript-viewport-pinning.test.js.map +1 -0
- package/dist/ui/tui-history-parity.test.js +8 -0
- package/dist/ui/tui-history-parity.test.js.map +1 -1
- package/dist/ui/tui-simulation.test.d.ts +2 -0
- package/dist/ui/tui-simulation.test.d.ts.map +1 -0
- package/dist/ui/tui-simulation.test.js +138 -0
- package/dist/ui/tui-simulation.test.js.map +1 -0
- package/dist/ui/tui-terminal-recorder.test.d.ts +2 -0
- package/dist/ui/tui-terminal-recorder.test.d.ts.map +1 -0
- package/dist/ui/tui-terminal-recorder.test.js +134 -0
- package/dist/ui/tui-terminal-recorder.test.js.map +1 -0
- package/dist/utils/format.js +7 -0
- package/dist/utils/format.js.map +1 -1
- package/package.json +12 -6
package/dist/ui/render.js
CHANGED
|
@@ -28,6 +28,28 @@ const INK_OPTIONS = {
|
|
|
28
28
|
// exitOnCtrlC is true. Disable it so our InputArea handles Ctrl+C.
|
|
29
29
|
exitOnCtrlC: false,
|
|
30
30
|
};
|
|
31
|
+
// Fullscreen alt-screen render tuning. Two settings work together to make
|
|
32
|
+
// scrolling smooth instead of jumpy/flickery:
|
|
33
|
+
//
|
|
34
|
+
// - incrementalRendering: Ink's default "standard" renderer erases ALL of the
|
|
35
|
+
// previous frame's lines (ansiEscapes.eraseLines) and rewrites the whole
|
|
36
|
+
// frame every tick. For a full-height fullscreen frame that means redrawing
|
|
37
|
+
// the footer/input/status rows — which never change during a scroll — on
|
|
38
|
+
// every step, and that erase-then-refill is the visible flicker. Ink's
|
|
39
|
+
// incremental renderer rewrites ONLY the lines that actually changed (the
|
|
40
|
+
// transcript region), leaving the controls untouched. No erase pass = no
|
|
41
|
+
// flicker. It also has explicit handling for the no-trailing-newline
|
|
42
|
+
// fullscreen frame, so it's the intended mode for this layout.
|
|
43
|
+
//
|
|
44
|
+
// - maxFps: the default 30fps cap (~33ms/frame) makes the coalesced scroll
|
|
45
|
+
// updates feel stepped. A higher cap lets paints keep up for a smooth glide;
|
|
46
|
+
// combined with incremental rendering each paint is cheap (only the changed
|
|
47
|
+
// rows are written). Ink wraps each frame in synchronized output (BSU/ESU)
|
|
48
|
+
// on a TTY, so higher fps doesn't tear.
|
|
49
|
+
//
|
|
50
|
+
// The legacy scrollback path keeps the conservative defaults (it appends to
|
|
51
|
+
// native scrollback, so there's no repaint to optimize).
|
|
52
|
+
const FULLSCREEN_INK_OPTIONS = { ...INK_OPTIONS, maxFps: 120, incrementalRendering: true };
|
|
31
53
|
// XTMODKEYS "off" — turns off xterm's modifyOtherKeys=2 mode where Shift+Enter,
|
|
32
54
|
// Ctrl+letters, etc. arrive as ESC[27;<mod>;<keycode>~. Some terminals
|
|
33
55
|
// (Terminal.app, tmux passthrough, certain xterm configs) leave this enabled
|
|
@@ -42,15 +64,38 @@ const DISABLE_MODIFY_OTHER_KEYS = "\x1b[>4;0m";
|
|
|
42
64
|
const DISABLE_FOCUS_REPORTING = "\x1b[?1004l";
|
|
43
65
|
const SCREEN_CLEAR = DISABLE_MODIFY_OTHER_KEYS + "\x1b[2J\x1b[3J\x1b[H";
|
|
44
66
|
const VIEWPORT_CLEAR = DISABLE_MODIFY_OTHER_KEYS + "\x1b[2J\x1b[H";
|
|
67
|
+
// Alternate screen buffer (smcup/rmcup). Entering gives a fresh blank screen
|
|
68
|
+
// with no native scrollback, so nothing can ever scroll Ink's live frame —
|
|
69
|
+
// this is what makes the footer a truly fixed bottom region. Leaving restores
|
|
70
|
+
// the user's original shell screen + scrollback intact.
|
|
71
|
+
const ALT_SCREEN_ENTER = "\x1b[?1049h";
|
|
72
|
+
const ALT_SCREEN_LEAVE = "\x1b[?1049l";
|
|
73
|
+
/**
|
|
74
|
+
* Fullscreen alternate-screen viewport mode. Default OFF: native terminal
|
|
75
|
+
* scrollback is the default (smooth, GPU-accelerated, real mouse-wheel scroll).
|
|
76
|
+
* Set `GG_FULLSCREEN=1` to opt into the alternate-screen in-Ink viewport
|
|
77
|
+
* (pinned footer, but no native scrollback). Non-TTY / CI / print modes never
|
|
78
|
+
* use it.
|
|
79
|
+
*/
|
|
80
|
+
export function isFullscreenViewportEnabled() {
|
|
81
|
+
if (process.env.GG_FULLSCREEN === "1") {
|
|
82
|
+
return Boolean(process.stdout.isTTY && process.stdin.isTTY);
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
45
86
|
export function getResetClearMode(options) {
|
|
46
87
|
return options?.wipeSession || options?.history || options?.resizeRedraw ? "screen" : "viewport";
|
|
47
88
|
}
|
|
48
89
|
export async function renderApp(config) {
|
|
49
90
|
const themeSetting = config.theme ?? "auto";
|
|
50
91
|
const resolvedTheme = themeSetting === "auto" ? await detectTheme() : themeSetting;
|
|
92
|
+
const fullscreen = isFullscreenViewportEnabled();
|
|
51
93
|
// Clear screen + scrollback so old commands don't appear above the TUI.
|
|
52
|
-
// Also disables modifyOtherKeys (see DISABLE_MODIFY_OTHER_KEYS).
|
|
53
|
-
|
|
94
|
+
// Also disables modifyOtherKeys (see DISABLE_MODIFY_OTHER_KEYS). In fullscreen
|
|
95
|
+
// mode we first switch to the alternate screen buffer so the entire viewport
|
|
96
|
+
// (bounded transcript + pinned controls) is owned by Ink and nothing written
|
|
97
|
+
// around it can scroll the frame.
|
|
98
|
+
process.stdout.write((fullscreen ? ALT_SCREEN_ENTER : "") + SCREEN_CLEAR);
|
|
54
99
|
// Belt-and-suspenders cleanup: tmux can re-enable modifyOtherKeys when it
|
|
55
100
|
// forwards keyboard mode changes, and Ink's unmount path doesn't touch this
|
|
56
101
|
// mode (it manages kitty + alternate-screen but not XTMODKEYS). Re-disable
|
|
@@ -58,7 +103,9 @@ export async function renderApp(config) {
|
|
|
58
103
|
// that confuse the parent shell.
|
|
59
104
|
const onProcessExit = () => {
|
|
60
105
|
try {
|
|
61
|
-
|
|
106
|
+
// Leave the alternate screen LAST so the user's original shell scrollback
|
|
107
|
+
// returns intact, with no leftover artifacts from the fullscreen viewport.
|
|
108
|
+
process.stdout.write(DISABLE_MODIFY_OTHER_KEYS + DISABLE_FOCUS_REPORTING + (fullscreen ? ALT_SCREEN_LEAVE : ""));
|
|
62
109
|
}
|
|
63
110
|
catch {
|
|
64
111
|
// stdout may already be torn down; nothing useful to do here.
|
|
@@ -96,10 +143,12 @@ export async function renderApp(config) {
|
|
|
96
143
|
goalStatusEntries: [],
|
|
97
144
|
goalMode: config.goalModeRef?.current ?? "off",
|
|
98
145
|
planMode: config.planModeRef?.current ?? false,
|
|
146
|
+
idealReviewEnabled: config.idealReviewEnabled ?? true,
|
|
99
147
|
};
|
|
100
148
|
const terminalHistoryPrinter = createTerminalHistoryPrinter();
|
|
149
|
+
const inkOptions = fullscreen ? FULLSCREEN_INK_OPTIONS : INK_OPTIONS;
|
|
101
150
|
const ref = { instance: null };
|
|
102
|
-
const buildElement = () => React.createElement(ThemeProvider, { initial: resolvedTheme }, React.createElement(TerminalSizeProvider, { isAgentRunning: () => !!sessionStore.isAgentRunning }, React.createElement(AnimationProvider, null, React.createElement(App, {
|
|
151
|
+
const buildElement = () => React.createElement(ThemeProvider, { initial: resolvedTheme }, React.createElement(TerminalSizeProvider, { isAgentRunning: () => !!sessionStore.isAgentRunning, fullscreen }, React.createElement(AnimationProvider, null, React.createElement(App, {
|
|
103
152
|
provider: runtimeState.provider,
|
|
104
153
|
model: runtimeState.model,
|
|
105
154
|
tools: config.tools,
|
|
@@ -114,6 +163,7 @@ export async function renderApp(config) {
|
|
|
114
163
|
cwd: config.cwd,
|
|
115
164
|
version: config.version,
|
|
116
165
|
showTokenUsage: config.showTokenUsage,
|
|
166
|
+
idealReviewEnabled: sessionStore.idealReviewEnabled,
|
|
117
167
|
onSlashCommand: config.onSlashCommand,
|
|
118
168
|
loggedInProviders: config.loggedInProviders,
|
|
119
169
|
credentialsByProvider: config.credentialsByProvider,
|
|
@@ -135,6 +185,7 @@ export async function renderApp(config) {
|
|
|
135
185
|
connectInitialMcpTools: config.connectInitialMcpTools,
|
|
136
186
|
planCallbacks: config.planCallbacks,
|
|
137
187
|
terminalHistoryPrinter,
|
|
188
|
+
fullscreen,
|
|
138
189
|
resetUI,
|
|
139
190
|
onRuntimeStateChange,
|
|
140
191
|
sessionStore,
|
|
@@ -184,6 +235,14 @@ export async function renderApp(config) {
|
|
|
184
235
|
if (options?.resizeRedraw) {
|
|
185
236
|
terminalHistoryPrinter.resetPrinted();
|
|
186
237
|
}
|
|
238
|
+
// Fullscreen alt-screen mode owns the entire screen and renders the
|
|
239
|
+
// transcript inside Ink, so there is no native scrollback to preserve or
|
|
240
|
+
// repaint — "clear" is just a screen wipe + cursor home before re-render.
|
|
241
|
+
if (fullscreen) {
|
|
242
|
+
process.stdout.write(VIEWPORT_CLEAR);
|
|
243
|
+
ref.instance = render(buildElement(), inkOptions);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
187
246
|
// Resize can leave log-update frames at the old width in the visible viewport.
|
|
188
247
|
// Repaint the durable transcript after a full clear so messages don't appear
|
|
189
248
|
// to vanish on maximize and old input/status frames don't stack as duplicates.
|
|
@@ -199,9 +258,9 @@ export async function renderApp(config) {
|
|
|
199
258
|
cwd: config.cwd,
|
|
200
259
|
});
|
|
201
260
|
}
|
|
202
|
-
ref.instance = render(buildElement(),
|
|
261
|
+
ref.instance = render(buildElement(), inkOptions);
|
|
203
262
|
}
|
|
204
|
-
ref.instance = render(buildElement(),
|
|
263
|
+
ref.instance = render(buildElement(), inkOptions);
|
|
205
264
|
// Terminal resize → full unmount/remount. Completed transcript rows are real
|
|
206
265
|
// terminal output now, so resetUI() only rebuilds the live Ink controls unless
|
|
207
266
|
// a fresh-session path asked to wipe scrollback. Debounced 250ms (shorter than
|
|
@@ -209,6 +268,11 @@ export async function renderApp(config) {
|
|
|
209
268
|
// cancelled by its own useEffect cleanup when the old instance unmounts.
|
|
210
269
|
let resizeTimer = null;
|
|
211
270
|
const onTerminalResize = () => {
|
|
271
|
+
// Fullscreen alt-screen mode owns a full-height frame that Ink repaints in
|
|
272
|
+
// place on dimension changes (handled inside TerminalSizeProvider). No
|
|
273
|
+
// unmount/remount is needed — and doing one would flash the whole screen.
|
|
274
|
+
if (fullscreen)
|
|
275
|
+
return;
|
|
212
276
|
if (resizeTimer)
|
|
213
277
|
clearTimeout(resizeTimer);
|
|
214
278
|
resizeTimer = setTimeout(() => {
|
|
@@ -252,7 +316,7 @@ export async function renderApp(config) {
|
|
|
252
316
|
// but writing here ensures the disable lands before Node tears stdout
|
|
253
317
|
// down on process termination.
|
|
254
318
|
try {
|
|
255
|
-
process.stdout.write(DISABLE_MODIFY_OTHER_KEYS + DISABLE_FOCUS_REPORTING);
|
|
319
|
+
process.stdout.write(DISABLE_MODIFY_OTHER_KEYS + DISABLE_FOCUS_REPORTING + (fullscreen ? ALT_SCREEN_LEAVE : ""));
|
|
256
320
|
}
|
|
257
321
|
catch {
|
|
258
322
|
// ignored
|
package/dist/ui/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/ui/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAgC,MAAM,KAAK,CAAC;AAQ3D,OAAO,EAAE,GAAG,EAAuC,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS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AChC,qEAAqE;QACrE,sEAAsE;QACtE,+BAA+B;QAC/B,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,yBAAyB,GAAG,uBAAuB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3F,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,UAAU;QACZ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update the maximum scroll offset (total transcript lines − viewport rows).
|
|
3
|
+
* Called by App whenever content length or viewport height changes. Re-pins to
|
|
4
|
+
* the bottom when the user hasn't scrolled, otherwise clamps their offset into
|
|
5
|
+
* the new range. Emits only when the offset actually changes, so growing
|
|
6
|
+
* content during a scroll-locked read doesn't churn renders.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setTranscriptScrollBounds(nextMaxOffset: number): void;
|
|
9
|
+
/**
|
|
10
|
+
* Scroll by a signed number of lines. Positive scrolls UP (toward older
|
|
11
|
+
* output), negative scrolls DOWN (toward newest). No-op when clamped to an
|
|
12
|
+
* edge, so wheel jitter at the top/bottom can't churn renders.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scrollTranscriptByLines(deltaLines: number): void;
|
|
15
|
+
/** Set the absolute offset (used by PageUp/Down, Shift+Arrows, g/G). */
|
|
16
|
+
export declare function setTranscriptScrollOffset(targetOffset: number): void;
|
|
17
|
+
/** Page up/down relative to the current offset by `page` lines. */
|
|
18
|
+
export declare function pageTranscriptScroll(page: number): void;
|
|
19
|
+
/** Snap back to the newest output (offset 0) — e.g. on a new prompt submit. */
|
|
20
|
+
export declare function resetTranscriptScroll(): void;
|
|
21
|
+
/** Jump to the very top (oldest output). */
|
|
22
|
+
export declare function scrollTranscriptToTop(): void;
|
|
23
|
+
/** Current clamped offset, non-reactively (for tests / imperative reads). */
|
|
24
|
+
export declare function getTranscriptScrollOffset(): number;
|
|
25
|
+
/** Reactive hook: re-renders the caller only when the scroll offset changes. */
|
|
26
|
+
export declare function useTranscriptScrollOffset(): number;
|
|
27
|
+
//# sourceMappingURL=transcript-scroll-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-scroll-store.d.ts","sourceRoot":"","sources":["../../../src/ui/stores/transcript-scroll-store.ts"],"names":[],"mappings":"AAkCA;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAKrE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAMhE;AAED,wEAAwE;AACxE,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAKpE;AAED,mEAAmE;AACnE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED,+EAA+E;AAC/E,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAED,4CAA4C;AAC5C,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,IAAI,MAAM,CAElD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createStore, useStore } from "./create-store.js";
|
|
2
|
+
const store = createStore({ offset: 0, isUserScrolled: false });
|
|
3
|
+
/**
|
|
4
|
+
* Scroll bounds kept OUTSIDE the reactive store: they change as content/layout
|
|
5
|
+
* change (driven by App), but on their own they should not trigger a viewport
|
|
6
|
+
* re-render — only an actual offset change should. `setTranscriptScrollBounds`
|
|
7
|
+
* re-clamps the offset and emits only when the visible offset actually moves.
|
|
8
|
+
*/
|
|
9
|
+
let maxOffset = 0;
|
|
10
|
+
function clamp(value) {
|
|
11
|
+
return Math.min(Math.max(0, value), maxOffset);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Update the maximum scroll offset (total transcript lines − viewport rows).
|
|
15
|
+
* Called by App whenever content length or viewport height changes. Re-pins to
|
|
16
|
+
* the bottom when the user hasn't scrolled, otherwise clamps their offset into
|
|
17
|
+
* the new range. Emits only when the offset actually changes, so growing
|
|
18
|
+
* content during a scroll-locked read doesn't churn renders.
|
|
19
|
+
*/
|
|
20
|
+
export function setTranscriptScrollBounds(nextMaxOffset) {
|
|
21
|
+
maxOffset = Math.max(0, Math.floor(nextMaxOffset));
|
|
22
|
+
const { offset, isUserScrolled } = store.getSnapshot();
|
|
23
|
+
const next = isUserScrolled ? Math.min(offset, maxOffset) : 0;
|
|
24
|
+
if (next !== offset)
|
|
25
|
+
store.setState({ offset: next });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Scroll by a signed number of lines. Positive scrolls UP (toward older
|
|
29
|
+
* output), negative scrolls DOWN (toward newest). No-op when clamped to an
|
|
30
|
+
* edge, so wheel jitter at the top/bottom can't churn renders.
|
|
31
|
+
*/
|
|
32
|
+
export function scrollTranscriptByLines(deltaLines) {
|
|
33
|
+
if (deltaLines === 0)
|
|
34
|
+
return;
|
|
35
|
+
const { offset } = store.getSnapshot();
|
|
36
|
+
const next = clamp(offset + deltaLines);
|
|
37
|
+
if (next === offset)
|
|
38
|
+
return;
|
|
39
|
+
store.setState({ offset: next, isUserScrolled: next > 0 });
|
|
40
|
+
}
|
|
41
|
+
/** Set the absolute offset (used by PageUp/Down, Shift+Arrows, g/G). */
|
|
42
|
+
export function setTranscriptScrollOffset(targetOffset) {
|
|
43
|
+
const { offset } = store.getSnapshot();
|
|
44
|
+
const next = clamp(targetOffset);
|
|
45
|
+
if (next === offset)
|
|
46
|
+
return;
|
|
47
|
+
store.setState({ offset: next, isUserScrolled: next > 0 });
|
|
48
|
+
}
|
|
49
|
+
/** Page up/down relative to the current offset by `page` lines. */
|
|
50
|
+
export function pageTranscriptScroll(page) {
|
|
51
|
+
const { offset } = store.getSnapshot();
|
|
52
|
+
setTranscriptScrollOffset(offset + page);
|
|
53
|
+
}
|
|
54
|
+
/** Snap back to the newest output (offset 0) — e.g. on a new prompt submit. */
|
|
55
|
+
export function resetTranscriptScroll() {
|
|
56
|
+
const { offset, isUserScrolled } = store.getSnapshot();
|
|
57
|
+
if (offset === 0 && !isUserScrolled)
|
|
58
|
+
return;
|
|
59
|
+
store.setState({ offset: 0, isUserScrolled: false });
|
|
60
|
+
}
|
|
61
|
+
/** Jump to the very top (oldest output). */
|
|
62
|
+
export function scrollTranscriptToTop() {
|
|
63
|
+
setTranscriptScrollOffset(maxOffset);
|
|
64
|
+
}
|
|
65
|
+
/** Current clamped offset, non-reactively (for tests / imperative reads). */
|
|
66
|
+
export function getTranscriptScrollOffset() {
|
|
67
|
+
return clamp(store.getSnapshot().offset);
|
|
68
|
+
}
|
|
69
|
+
/** Reactive hook: re-renders the caller only when the scroll offset changes. */
|
|
70
|
+
export function useTranscriptScrollOffset() {
|
|
71
|
+
return useStore(store).offset;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=transcript-scroll-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-scroll-store.js","sourceRoot":"","sources":["../../../src/ui/stores/transcript-scroll-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAoB1D,MAAM,KAAK,GAAG,WAAW,CAAwB,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;AAEvF;;;;;GAKG;AACH,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAAqB;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AAM,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACvC,yBAAyB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,qBAAqB;IACnC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACvD,IAAI,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc;QAAE,OAAO;IAC5C,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,qBAAqB;IACnC,yBAAyB,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,yBAAyB;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,yBAAyB;IACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-scroll-store.test.d.ts","sourceRoot":"","sources":["../../../src/ui/stores/transcript-scroll-store.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
+
import { getTranscriptScrollOffset, pageTranscriptScroll, resetTranscriptScroll, scrollTranscriptByLines, scrollTranscriptToTop, setTranscriptScrollBounds, setTranscriptScrollOffset, } from "./transcript-scroll-store.js";
|
|
3
|
+
// The store is a module singleton; reset bounds + offset before each test.
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
setTranscriptScrollBounds(0);
|
|
6
|
+
resetTranscriptScroll();
|
|
7
|
+
});
|
|
8
|
+
describe("transcript-scroll-store", () => {
|
|
9
|
+
it("starts pinned to the bottom", () => {
|
|
10
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
11
|
+
});
|
|
12
|
+
it("scrolls up by a positive delta within bounds", () => {
|
|
13
|
+
setTranscriptScrollBounds(90);
|
|
14
|
+
scrollTranscriptByLines(3);
|
|
15
|
+
expect(getTranscriptScrollOffset()).toBe(3);
|
|
16
|
+
});
|
|
17
|
+
it("scrolls down toward the newest and clamps at 0", () => {
|
|
18
|
+
setTranscriptScrollBounds(90);
|
|
19
|
+
scrollTranscriptByLines(5);
|
|
20
|
+
scrollTranscriptByLines(-2);
|
|
21
|
+
expect(getTranscriptScrollOffset()).toBe(3);
|
|
22
|
+
scrollTranscriptByLines(-100);
|
|
23
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
24
|
+
});
|
|
25
|
+
it("clamps scroll-up to the maximum offset", () => {
|
|
26
|
+
setTranscriptScrollBounds(90);
|
|
27
|
+
scrollTranscriptByLines(9999);
|
|
28
|
+
expect(getTranscriptScrollOffset()).toBe(90);
|
|
29
|
+
});
|
|
30
|
+
it("pages relative to the current offset", () => {
|
|
31
|
+
setTranscriptScrollBounds(90);
|
|
32
|
+
pageTranscriptScroll(20);
|
|
33
|
+
expect(getTranscriptScrollOffset()).toBe(20);
|
|
34
|
+
pageTranscriptScroll(-5);
|
|
35
|
+
expect(getTranscriptScrollOffset()).toBe(15);
|
|
36
|
+
});
|
|
37
|
+
it("jumps to the top (max offset) and to the bottom (0)", () => {
|
|
38
|
+
setTranscriptScrollBounds(90);
|
|
39
|
+
scrollTranscriptToTop();
|
|
40
|
+
expect(getTranscriptScrollOffset()).toBe(90);
|
|
41
|
+
setTranscriptScrollOffset(0);
|
|
42
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
43
|
+
});
|
|
44
|
+
it("re-pins to the bottom on reset", () => {
|
|
45
|
+
setTranscriptScrollBounds(90);
|
|
46
|
+
scrollTranscriptByLines(40);
|
|
47
|
+
resetTranscriptScroll();
|
|
48
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
49
|
+
});
|
|
50
|
+
it("re-clamps the offset when bounds shrink while the user is scrolled", () => {
|
|
51
|
+
setTranscriptScrollBounds(90);
|
|
52
|
+
scrollTranscriptByLines(80);
|
|
53
|
+
expect(getTranscriptScrollOffset()).toBe(80);
|
|
54
|
+
// Content shrinks (e.g. compaction) — offset must clamp into the new range.
|
|
55
|
+
setTranscriptScrollBounds(50);
|
|
56
|
+
expect(getTranscriptScrollOffset()).toBe(50);
|
|
57
|
+
});
|
|
58
|
+
it("keeps the user pinned to the bottom as content grows when not scrolled", () => {
|
|
59
|
+
setTranscriptScrollBounds(10);
|
|
60
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
61
|
+
// New output arrives; an un-scrolled user stays at the bottom.
|
|
62
|
+
setTranscriptScrollBounds(40);
|
|
63
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
64
|
+
});
|
|
65
|
+
it("treats a no-op scroll at an edge without moving the offset", () => {
|
|
66
|
+
setTranscriptScrollBounds(0);
|
|
67
|
+
scrollTranscriptByLines(5);
|
|
68
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
69
|
+
scrollTranscriptByLines(-5);
|
|
70
|
+
expect(getTranscriptScrollOffset()).toBe(0);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=transcript-scroll-store.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-scroll-store.test.js","sourceRoot":"","sources":["../../../src/ui/stores/transcript-scroll-store.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;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MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,MAAuB,GACxB,GAAE,6BAAkC,GAAG,sBAAsB,CA+E7D;AAED,wBAAgB,uCAAuC,CACrD,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,sBAAsB,GAC9B,MAAM,CAiJR"}
|
|
@@ -141,6 +141,8 @@ export function serializeCompletedItemToTerminalHistory(item, context) {
|
|
|
141
141
|
return renderQueued(item.text, item.imageCount, context);
|
|
142
142
|
case "assistant":
|
|
143
143
|
return renderAssistant(item.text, context, item.continuation);
|
|
144
|
+
case "ideal_hook":
|
|
145
|
+
return renderIdealHook(item.text, context);
|
|
144
146
|
case "tool_start":
|
|
145
147
|
if (item.name === "enter_plan")
|
|
146
148
|
return "";
|
|
@@ -325,6 +327,12 @@ function renderAssistant(text, context, continuation = false) {
|
|
|
325
327
|
}
|
|
326
328
|
return lines.join("\n");
|
|
327
329
|
}
|
|
330
|
+
function renderIdealHook(text, context) {
|
|
331
|
+
// Same dot prefix + indent as an assistant row, but in the secondary color
|
|
332
|
+
// (bold) so the ideal-review hook visibly stands apart from normal output.
|
|
333
|
+
const body = color(context.theme.secondary, text, true);
|
|
334
|
+
return prefixFirstLine(body, ` ${color(context.theme.secondary, BLACK_CIRCLE)} `, " ");
|
|
335
|
+
}
|
|
328
336
|
function renderPlanModeLogo(_context) {
|
|
329
337
|
return PLAN_MODE_LOGO.map((line) => ` ${gradientLine(line, PLAN_MODE_GRADIENT)}`).join("\n");
|
|
330
338
|
}
|