gaunt-sloth 2.0.0-alpha.0 → 2.0.0-alpha.2
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/LICENSE +7 -0
- package/dist/cli.js +0 -0
- package/dist/commands/chatCommand.js +1 -1
- package/dist/commands/chatCommand.js.map +1 -1
- package/dist/commands/codeCommand.js +1 -1
- package/dist/commands/codeCommand.js.map +1 -1
- package/dist/tui/components/App.js +100 -9
- package/dist/tui/components/App.js.map +1 -1
- package/dist/tui/components/ClearBanner.d.ts +10 -0
- package/dist/tui/components/ClearBanner.js +17 -0
- package/dist/tui/components/ClearBanner.js.map +1 -0
- package/dist/tui/components/CommandNotice.d.ts +17 -0
- package/dist/tui/components/CommandNotice.js +17 -0
- package/dist/tui/components/CommandNotice.js.map +1 -0
- package/dist/tui/components/DebugPanel.d.ts +14 -0
- package/dist/tui/components/DebugPanel.js +30 -16
- package/dist/tui/components/DebugPanel.js.map +1 -1
- package/dist/tui/components/Transcript.js +4 -0
- package/dist/tui/components/Transcript.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +33 -3
- package/dist/tui/slashCommands.js +80 -10
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/terminal.d.ts +14 -0
- package/dist/tui/terminal.js +20 -0
- package/dist/tui/terminal.js.map +1 -0
- package/dist/tui/tuiSessionModule.js +26 -3
- package/dist/tui/tuiSessionModule.js.map +1 -1
- package/dist/tui/types.d.ts +20 -0
- package/package.json +11 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025-present Andrew Kondratev
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/cli.js
CHANGED
|
File without changes
|
|
@@ -6,7 +6,7 @@ export function chatCommand(program, commandLineConfigOverrides) {
|
|
|
6
6
|
readModePrompt: readChatPrompt,
|
|
7
7
|
description: 'Start an interactive chat session with Gaunt Sloth',
|
|
8
8
|
readyMessage: '\nGaunt Sloth is ready to chat. Type your prompt.',
|
|
9
|
-
exitMessage: "Type 'exit' or
|
|
9
|
+
exitMessage: "Type 'exit' or Ctrl+C to exit chat · /help for commands\n",
|
|
10
10
|
};
|
|
11
11
|
// Chat command (REL-3: the no-subcommand default is now `code`, registered in codeCommand)
|
|
12
12
|
program
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../src/commands/chatCommand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,MAAM,aAAa,GAAkB;QACnC,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,oDAAoD;QACjE,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../src/commands/chatCommand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,MAAM,aAAa,GAAkB;QACnC,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,oDAAoD;QACjE,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,2DAA2D;KACzE,CAAC;IACF,2FAA2F;IAC3F,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,oDAAoD,CAAC;SACjE,QAAQ,CAAC,WAAW,EAAE,mCAAmC,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;QAChC,MAAM,YAAY,CAAC,aAAa,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -6,7 +6,7 @@ export function codeCommand(program, commandLineConfigOverrides) {
|
|
|
6
6
|
readModePrompt: readCodePrompt,
|
|
7
7
|
description: 'Interactively write code with sloth (has full file system access within your project)',
|
|
8
8
|
readyMessage: '\nGaunt Sloth is ready to code. Type your prompt.',
|
|
9
|
-
exitMessage: "Type 'exit' or
|
|
9
|
+
exitMessage: "Type 'exit' or Ctrl+C to exit code session · /help for commands\n",
|
|
10
10
|
};
|
|
11
11
|
// REL-3: bare `gth` (no subcommand) now defaults to the agentic code session.
|
|
12
12
|
program.action(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeCommand.js","sourceRoot":"","sources":["../../src/commands/codeCommand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,MAAM,aAAa,GAAkB;QACnC,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE,cAAc;QAC9B,WAAW,EACT,uFAAuF;QACzF,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"codeCommand.js","sourceRoot":"","sources":["../../src/commands/codeCommand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,MAAM,aAAa,GAAkB;QACnC,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE,cAAc;QAC9B,WAAW,EACT,uFAAuF;QACzF,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,mEAAmE;KACjF,CAAC;IAEF,8EAA8E;IAC9E,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;QACxB,MAAM,YAAY,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CACV,uFAAuF,CACxF;SACA,QAAQ,CAAC,WAAW,EAAE,2CAA2C,CAAC;SAClE,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;QAChC,MAAM,YAAY,CAAC,aAAa,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -7,8 +7,10 @@ import { LiveTurn } from '#src/tui/components/LiveTurn.js';
|
|
|
7
7
|
import { StatusBar } from '#src/tui/components/StatusBar.js';
|
|
8
8
|
import { PromptInput } from '#src/tui/components/PromptInput.js';
|
|
9
9
|
import { Rule } from '#src/tui/components/Rule.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { ClearBanner } from '#src/tui/components/ClearBanner.js';
|
|
11
|
+
import { DebugPanel, debugPanelLines, DEBUG_TABS, } from '#src/tui/components/DebugPanel.js';
|
|
12
|
+
import { createCommandRegistry, dispatchSlashCommand, parseSlashCommand, toolsToggleNotice, } from '#src/tui/slashCommands.js';
|
|
13
|
+
import { viewportBumpSequence } from '#src/tui/terminal.js';
|
|
12
14
|
/** Rows of clipping viewport in the docked debug panel (default / restored size). */
|
|
13
15
|
const DEBUG_VIEWPORT_HEIGHT = 8;
|
|
14
16
|
/** Rows of chrome around the debug viewport we leave for when it is maximised (panel
|
|
@@ -54,6 +56,17 @@ export function App(props) {
|
|
|
54
56
|
// summary lines) so the transcript stays readable; Ctrl+T flips the whole turn's detail,
|
|
55
57
|
// mirroring the docked debug panel's single-key detail toggle.
|
|
56
58
|
const [toolsExpanded, setToolsExpanded] = useState(false);
|
|
59
|
+
// Whether to show the post-`/clear` "history cleared" banner. Lives in the live (non-Static)
|
|
60
|
+
// frame so it is reliably visible — pushing a system line right after setTranscript([]) is
|
|
61
|
+
// swallowed because clearing <Static>'s items resets its internal index (TUI-C12). Hidden
|
|
62
|
+
// again the moment the next user turn starts so it doesn't linger above a fresh conversation.
|
|
63
|
+
const [clearedBanner, setClearedBanner] = useState(false);
|
|
64
|
+
// Mirror of toolsExpanded for the slash-command handler (memoized without it in deps), so
|
|
65
|
+
// /tools can compute the next state without a stale closure or a side effect in the updater.
|
|
66
|
+
const toolsExpandedRef = useRef(false);
|
|
67
|
+
// Likewise a mirror of debugVisible, so the slash dispatch can pass the current panel state
|
|
68
|
+
// into the command context (for state-aware /debug copy) without a stale closure.
|
|
69
|
+
const debugVisibleRef = useRef(false);
|
|
57
70
|
const abortRef = useRef(null);
|
|
58
71
|
const idRef = useRef(0);
|
|
59
72
|
const runningRef = useRef(false);
|
|
@@ -68,6 +81,21 @@ export function App(props) {
|
|
|
68
81
|
const debugViewport = debugViewportHeight(debugMaximized, terminalRows);
|
|
69
82
|
// PageUp/PageDown step tracks the live viewport so maximise pages by (almost) a full screen.
|
|
70
83
|
const debugPageStep = Math.max(1, debugViewport - 1);
|
|
84
|
+
// The active section's line count drives the real maximum scroll offset, so neither the page
|
|
85
|
+
// step nor the arrow step can push the offset past the end (the over-scroll bug that left
|
|
86
|
+
// PgUp/↑ burning through phantom offset before anything moved — TUI-C11). Single-sourced with
|
|
87
|
+
// DebugPanel via the exported `debugPanelLines` so the clamp matches exactly what is rendered.
|
|
88
|
+
const debugLineCount = useMemo(() => debugPanelLines({
|
|
89
|
+
subagents,
|
|
90
|
+
historyLines: debugHistory,
|
|
91
|
+
requestLines: debugRequest,
|
|
92
|
+
responseLines: debugResponse,
|
|
93
|
+
activeTab: debugTab,
|
|
94
|
+
}).length, [subagents, debugHistory, debugRequest, debugResponse, debugTab]);
|
|
95
|
+
const debugMaxOffset = Math.max(0, debugLineCount - debugViewport);
|
|
96
|
+
// Clamp helper shared by every downward scroll (page + arrow) so the offset never exceeds the
|
|
97
|
+
// real maximum; the upward floor stays Math.max(0, …).
|
|
98
|
+
const clampDebugScroll = (next) => Math.min(Math.max(0, next), debugMaxOffset);
|
|
71
99
|
// Built once per session; a plain array so later layers (EXT-5) could append commands.
|
|
72
100
|
const registry = useMemo(() => createCommandRegistry(), []);
|
|
73
101
|
const nextId = () => (idRef.current += 1);
|
|
@@ -75,6 +103,9 @@ export function App(props) {
|
|
|
75
103
|
// Omit<TranscriptItem,'id'> collapses to the shared `kind` key only).
|
|
76
104
|
const push = (item) => setTranscript((t) => [...t, { ...item, id: nextId() }]);
|
|
77
105
|
const runTurn = useCallback(async (userInput) => {
|
|
106
|
+
// A new exchange supersedes the post-/clear banner; drop it so it doesn't sit above
|
|
107
|
+
// the fresh conversation.
|
|
108
|
+
setClearedBanner(false);
|
|
78
109
|
push({ kind: 'user', text: userInput });
|
|
79
110
|
const ac = new AbortController();
|
|
80
111
|
abortRef.current = ac;
|
|
@@ -117,6 +148,18 @@ export function App(props) {
|
|
|
117
148
|
void Promise.resolve(props.onExit?.()).finally(() => exit());
|
|
118
149
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
150
|
}, [exit]);
|
|
151
|
+
// Flip the tool-detail mode and commit the matching notice. Single-sourced so the `/tools`
|
|
152
|
+
// command and the Ctrl+T key handler give the user identical, state-aware feedback (TUI-C14).
|
|
153
|
+
// Committed turns are frozen in Ink's <Static> and never re-fold, so this only affects the
|
|
154
|
+
// live / next turn — the notice copy says exactly that.
|
|
155
|
+
const toggleTools = useCallback(() => {
|
|
156
|
+
const next = !toolsExpandedRef.current;
|
|
157
|
+
toolsExpandedRef.current = next;
|
|
158
|
+
setToolsExpanded(next);
|
|
159
|
+
const { title, lines, tone } = toolsToggleNotice(next);
|
|
160
|
+
push({ kind: 'notice', title, lines, tone: tone ?? 'info' });
|
|
161
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
162
|
+
}, []);
|
|
120
163
|
const handleSubmit = useCallback((value) => {
|
|
121
164
|
if (runningRef.current)
|
|
122
165
|
return;
|
|
@@ -135,6 +178,8 @@ export function App(props) {
|
|
|
135
178
|
mode,
|
|
136
179
|
modelDisplayName: modelDisplayName ?? '',
|
|
137
180
|
turnCount: turnCountRef.current,
|
|
181
|
+
toolsExpanded: toolsExpandedRef.current,
|
|
182
|
+
debugVisible: debugVisibleRef.current,
|
|
138
183
|
});
|
|
139
184
|
if (result.clearTranscript) {
|
|
140
185
|
setTranscript([]);
|
|
@@ -142,13 +187,36 @@ export function App(props) {
|
|
|
142
187
|
setDebugHistory([]);
|
|
143
188
|
setDebugRequest([]);
|
|
144
189
|
setDebugResponse([]);
|
|
190
|
+
// Show visible feedback for the clear. Rendered outside <Static> (see clearedBanner)
|
|
191
|
+
// so the known index-reset swallow quirk can't eat it (TUI-C12).
|
|
192
|
+
setClearedBanner(true);
|
|
193
|
+
// "Bump up" the screen the clear/Ctrl+L way: scroll the prior conversation up and out
|
|
194
|
+
// of the visible viewport (it stays in scrollback — we never emit ESC[3J), so the
|
|
195
|
+
// session restarts at the top. We write the sequence ourselves and then reset Ink's
|
|
196
|
+
// frame accounting (onResetFrame → instance.clear()) so the next render lands cleanly
|
|
197
|
+
// at the top with no leftover artifacts.
|
|
198
|
+
stdout?.write(viewportBumpSequence(stdout?.rows));
|
|
199
|
+
props.onResetFrame?.();
|
|
200
|
+
// Clearing only the on-screen transcript would leave the model's conversation
|
|
201
|
+
// thread intact (the LangGraph checkpointer replays it on the next turn), so the
|
|
202
|
+
// model would still "remember" everything. Reset the agent's thread too so the
|
|
203
|
+
// model context truly matches the now-empty transcript (TUI-C8).
|
|
204
|
+
agent.resetThread?.();
|
|
205
|
+
// The status-bar turn counter is part of the conversation state we just wiped, so
|
|
206
|
+
// reset it too — a cleared session starts back at "turns: 0".
|
|
207
|
+
turnCountRef.current = 0;
|
|
208
|
+
setTurnCount(0);
|
|
145
209
|
}
|
|
146
210
|
if (result.toggleTools) {
|
|
147
|
-
|
|
211
|
+
// Flip the fold mode and commit the notice via the shared helper (single-sourced with
|
|
212
|
+
// Ctrl+T). The command's own `result.notice` is intentionally not pushed for /tools —
|
|
213
|
+
// toggleTools owns the notice so the copy matches the state actually applied.
|
|
214
|
+
toggleTools();
|
|
148
215
|
}
|
|
149
216
|
if (result.toggleDebug) {
|
|
150
217
|
setDebugVisible((v) => {
|
|
151
218
|
const next = !v;
|
|
219
|
+
debugVisibleRef.current = next;
|
|
152
220
|
// Reset scroll + focus each time the panel is shown, so it opens at the top and
|
|
153
221
|
// focus never lingers on a hidden panel.
|
|
154
222
|
if (next) {
|
|
@@ -162,6 +230,12 @@ export function App(props) {
|
|
|
162
230
|
return next;
|
|
163
231
|
});
|
|
164
232
|
}
|
|
233
|
+
// Commit a structured notice (TUI-C14). /tools owns its notice via toggleTools above, so
|
|
234
|
+
// skip the result.notice in that case to avoid a duplicate.
|
|
235
|
+
if (result.notice && !result.toggleTools) {
|
|
236
|
+
const { title, lines, tone } = result.notice;
|
|
237
|
+
push({ kind: 'notice', title, lines, tone: tone ?? 'info' });
|
|
238
|
+
}
|
|
165
239
|
if (result.message) {
|
|
166
240
|
push({ kind: 'system', level: result.level ?? 'info', text: result.message });
|
|
167
241
|
}
|
|
@@ -172,12 +246,13 @@ export function App(props) {
|
|
|
172
246
|
void runTurn(value);
|
|
173
247
|
},
|
|
174
248
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
175
|
-
[runTurn, quit, registry, mode, modelDisplayName]);
|
|
249
|
+
[runTurn, quit, registry, mode, modelDisplayName, toggleTools]);
|
|
176
250
|
// Keyboard handling, in priority order:
|
|
177
251
|
// 1. Esc while running → abort the in-flight turn (stdin is uncontended here — the event
|
|
178
252
|
// path never registers gsloth's readline Esc handler, so Ink owns raw mode cleanly).
|
|
179
253
|
// 2. Tab while the panel is visible and idle → focus/cycle the panel.
|
|
180
|
-
// 3. While the panel is focused → Tab
|
|
254
|
+
// 3. While the panel is focused → Tab/Shift+Tab cycle sections, ↑/↓ scroll one line,
|
|
255
|
+
// PageUp/PageDown page-step, m maximises, Esc unfocuses.
|
|
181
256
|
useInput((input, key) => {
|
|
182
257
|
if (key.escape && runningRef.current) {
|
|
183
258
|
abortRef.current?.abort();
|
|
@@ -188,7 +263,8 @@ export function App(props) {
|
|
|
188
263
|
// because the prompt's <TextInput> (mounted only when idle) would otherwise also receive
|
|
189
264
|
// the keystroke and insert a stray 't'. The `/tools` slash command covers the idle case.
|
|
190
265
|
if (key.ctrl && input === 't' && runningRef.current) {
|
|
191
|
-
|
|
266
|
+
// Share the /tools helper so the same state-aware notice is committed (TUI-C14).
|
|
267
|
+
toggleTools();
|
|
192
268
|
return;
|
|
193
269
|
}
|
|
194
270
|
if (debugFocusedRef.current) {
|
|
@@ -197,8 +273,11 @@ export function App(props) {
|
|
|
197
273
|
debugFocusedRef.current = false;
|
|
198
274
|
return;
|
|
199
275
|
}
|
|
276
|
+
// Tab cycles sections forward; Shift+Tab steps back to the previous section (Ink reports
|
|
277
|
+
// a back-tab as key.tab with key.shift). Both reset the scroll to the top of the new section.
|
|
200
278
|
if (key.tab) {
|
|
201
|
-
|
|
279
|
+
const step = key.shift ? -1 : 1;
|
|
280
|
+
setDebugTab((t) => DEBUG_TABS[(DEBUG_TABS.indexOf(t) + step + DEBUG_TABS.length) % DEBUG_TABS.length]);
|
|
202
281
|
setDebugScroll(0);
|
|
203
282
|
return;
|
|
204
283
|
}
|
|
@@ -208,12 +287,24 @@ export function App(props) {
|
|
|
208
287
|
setDebugMaximized((m) => !m);
|
|
209
288
|
return;
|
|
210
289
|
}
|
|
290
|
+
// ↑/↓ scroll one line for fine control; PgUp/PgDn page-step for coarse. Arrows exist on
|
|
291
|
+
// every keyboard, so they are the universal scroll keys (Mac/compact keyboards lack
|
|
292
|
+
// dedicated PgUp/PgDn) — that is why the hint and overflow markers advertise the arrows
|
|
293
|
+
// (TUI-C11). Every downward move is clamped to the real maximum (see clampDebugScroll).
|
|
294
|
+
if (key.upArrow) {
|
|
295
|
+
setDebugScroll((s) => Math.max(0, s - 1));
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (key.downArrow) {
|
|
299
|
+
setDebugScroll((s) => clampDebugScroll(s + 1));
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
211
302
|
if (key.pageUp) {
|
|
212
303
|
setDebugScroll((s) => Math.max(0, s - debugPageStep));
|
|
213
304
|
return;
|
|
214
305
|
}
|
|
215
306
|
if (key.pageDown) {
|
|
216
|
-
setDebugScroll((s) => s + debugPageStep);
|
|
307
|
+
setDebugScroll((s) => clampDebugScroll(s + debugPageStep));
|
|
217
308
|
return;
|
|
218
309
|
}
|
|
219
310
|
return;
|
|
@@ -261,6 +352,6 @@ export function App(props) {
|
|
|
261
352
|
// The greeting is an intro, not a permanent fixture: show it only before the first
|
|
262
353
|
// exchange, so it stops padding the bottom dock once the conversation is underway.
|
|
263
354
|
const showIntro = !initialMessage && transcript.length === 0 && !live;
|
|
264
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Transcript, { items: transcript, toolsExpanded: toolsExpanded }), showIntro ? _jsx(Text, { dimColor: true, children: readyMessage.trim() }) : null, live ? _jsx(LiveTurn, { turn: live, toolsExpanded: toolsExpanded, streaming: true }) : null, debugVisible ? (_jsx(DebugPanel, { subagents: subagents, historyLines: debugHistory, requestLines: debugRequest, responseLines: debugResponse, activeTab: debugTab, scrollOffset: debugScroll, focused: debugFocused, viewportHeight: debugViewport, maximized: debugMaximized })) : null, _jsx(Rule, {}), _jsx(StatusBar, { running: running, mode: mode, modelDisplayName: modelDisplayName, turnCount: turnCount, debugHint: debugVisible && !debugFocused }), !running && !debugFocused ? _jsx(PromptInput, { onSubmit: handleSubmit }) : null, _jsx(Text, { dimColor: true, children: exitMessage.trim() }), _jsx(Rule, {})] }));
|
|
355
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Transcript, { items: transcript, toolsExpanded: toolsExpanded }), clearedBanner ? _jsx(ClearBanner, {}) : null, showIntro ? _jsx(Text, { dimColor: true, children: readyMessage.trim() }) : null, live ? _jsx(LiveTurn, { turn: live, toolsExpanded: toolsExpanded, streaming: true }) : null, debugVisible ? (_jsx(DebugPanel, { subagents: subagents, historyLines: debugHistory, requestLines: debugRequest, responseLines: debugResponse, activeTab: debugTab, scrollOffset: debugScroll, focused: debugFocused, viewportHeight: debugViewport, maximized: debugMaximized })) : null, _jsx(Rule, {}), _jsx(StatusBar, { running: running, mode: mode, modelDisplayName: modelDisplayName, turnCount: turnCount, debugHint: debugVisible && !debugFocused }), !running && !debugFocused ? _jsx(PromptInput, { onSubmit: handleSubmit }) : null, _jsx(Text, { dimColor: true, children: exitMessage.trim() }), _jsx(Rule, {})] }));
|
|
265
356
|
}
|
|
266
357
|
//# sourceMappingURL=App.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../../src/tui/components/App.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OA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EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,QAAQ,EACnB,YAAY,EAAE,WAAW,EACzB,OAAO,EAAE,YAAY,EACrB,cAAc,EAAE,aAAa,EAC7B,SAAS,EAAE,cAAc,GACzB,CACH,CAAC,CAAC,CAAC,IAAI,EAGR,KAAC,IAAI,KAAG,EACR,KAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,YAAY,IAAI,CAAC,YAAY,GACxC,EACD,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,QAAQ,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,IAAI,EAC3E,KAAC,IAAI,IAAC,QAAQ,kBAAE,WAAW,CAAC,IAAI,EAAE,GAAQ,EAC1C,KAAC,IAAI,KAAG,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Visible feedback for `/clear`. Rendered in the live (non-`<Static>`) frame rather than as a
|
|
4
|
+
* committed transcript line, which sidesteps the known quirk where `setTranscript([])` resets
|
|
5
|
+
* `<Static>`'s internal index and swallows the next pushed item (TUI-C12). Built on the shared
|
|
6
|
+
* {@link CommandNotice} so it matches every other command's feedback (TUI-C14): a title plus the
|
|
7
|
+
* line that the model no longer sees the prior conversation, and a hint that the earlier messages
|
|
8
|
+
* are still reachable by scrolling up in the terminal's scrollback.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ClearBanner(): React.ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CommandNotice } from '#src/tui/components/CommandNotice.js';
|
|
3
|
+
/**
|
|
4
|
+
* Visible feedback for `/clear`. Rendered in the live (non-`<Static>`) frame rather than as a
|
|
5
|
+
* committed transcript line, which sidesteps the known quirk where `setTranscript([])` resets
|
|
6
|
+
* `<Static>`'s internal index and swallows the next pushed item (TUI-C12). Built on the shared
|
|
7
|
+
* {@link CommandNotice} so it matches every other command's feedback (TUI-C14): a title plus the
|
|
8
|
+
* line that the model no longer sees the prior conversation, and a hint that the earlier messages
|
|
9
|
+
* are still reachable by scrolling up in the terminal's scrollback.
|
|
10
|
+
*/
|
|
11
|
+
export function ClearBanner() {
|
|
12
|
+
return (_jsx(CommandNotice, { title: "History cleared", lines: [
|
|
13
|
+
'The model no longer sees the prior conversation.',
|
|
14
|
+
'Scroll up to revisit the earlier conversation in your terminal.',
|
|
15
|
+
] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ClearBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClearBanner.js","sourceRoot":"","sources":["../../../src/tui/components/ClearBanner.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAC,iBAAiB,EACvB,KAAK,EAAE;YACL,kDAAkD;YAClD,iEAAiE;SAClE,GACD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Tone of a command notice; drives the title colour (info = cyan, warn = yellow). */
|
|
3
|
+
export type CommandNoticeTone = 'info' | 'warn';
|
|
4
|
+
/**
|
|
5
|
+
* A consistent, noticeable ~3-line feedback block for slash-command output (TUI-C14). Every
|
|
6
|
+
* command renders one so none reads as "does nothing": a coloured + bold title line that states
|
|
7
|
+
* WHAT happened, followed by dim body lines explaining HOW it affects the user. A dim rule
|
|
8
|
+
* brackets the block so it stands apart from the conversation.
|
|
9
|
+
*
|
|
10
|
+
* Single-sourced so committed notices (rendered from a `notice` transcript item) and the
|
|
11
|
+
* live-frame `/clear` banner share the exact same look.
|
|
12
|
+
*/
|
|
13
|
+
export declare function CommandNotice({ title, lines, tone, }: {
|
|
14
|
+
title: string;
|
|
15
|
+
lines: string[];
|
|
16
|
+
tone?: CommandNoticeTone;
|
|
17
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { Rule } from '#src/tui/components/Rule.js';
|
|
4
|
+
/**
|
|
5
|
+
* A consistent, noticeable ~3-line feedback block for slash-command output (TUI-C14). Every
|
|
6
|
+
* command renders one so none reads as "does nothing": a coloured + bold title line that states
|
|
7
|
+
* WHAT happened, followed by dim body lines explaining HOW it affects the user. A dim rule
|
|
8
|
+
* brackets the block so it stands apart from the conversation.
|
|
9
|
+
*
|
|
10
|
+
* Single-sourced so committed notices (rendered from a `notice` transcript item) and the
|
|
11
|
+
* live-frame `/clear` banner share the exact same look.
|
|
12
|
+
*/
|
|
13
|
+
export function CommandNotice({ title, lines, tone = 'info', }) {
|
|
14
|
+
const titleColor = tone === 'warn' ? 'yellow' : 'cyan';
|
|
15
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Rule, {}), _jsx(Text, { bold: true, color: titleColor, children: title }), lines.map((line, i) => (_jsx(Text, { dimColor: true, children: line }, i)))] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=CommandNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandNotice.js","sourceRoot":"","sources":["../../../src/tui/components/CommandNotice.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAKnD;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,IAAI,GAAG,MAAM,GAKd;IACC,MAAM,UAAU,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IACvD,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,KAAG,EACR,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,UAAU,YACzB,KAAK,GACD,EACN,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,KAAC,IAAI,IAAS,QAAQ,kBACnB,IAAI,IADI,CAAC,CAEL,CACR,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -23,6 +23,20 @@ export interface DebugPanelProps {
|
|
|
23
23
|
/** Whether the pane is maximised (grown to most of the terminal height). */
|
|
24
24
|
maximized: boolean;
|
|
25
25
|
}
|
|
26
|
+
/** The data a debug section needs to resolve into renderable lines. */
|
|
27
|
+
export interface DebugPanelLinesInput {
|
|
28
|
+
subagents: SubagentTreeViewModel;
|
|
29
|
+
historyLines: string[];
|
|
30
|
+
requestLines: string[];
|
|
31
|
+
responseLines: string[];
|
|
32
|
+
activeTab: DebugTab;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The exact lines the active section renders, including the empty-state placeholders. Exported
|
|
36
|
+
* (and pure) so `<App>` can compute the active section's length to clamp the scroll offset to
|
|
37
|
+
* its real maximum — keeping keyboard scrolling and the rendered viewport in agreement (TUI-C11).
|
|
38
|
+
*/
|
|
39
|
+
export declare function debugPanelLines({ subagents, historyLines, requestLines, responseLines, activeTab, }: DebugPanelLinesInput): string[];
|
|
26
40
|
/**
|
|
27
41
|
* Full-width docked panel below the transcript / above the status bar (lives in the live,
|
|
28
42
|
* non-static frame so it coexists with `<Static>` scrollback). Tabs select a section; the
|
|
@@ -8,6 +8,26 @@ const TAB_LABELS = {
|
|
|
8
8
|
request: 'Sent to model (system + tools)',
|
|
9
9
|
response: 'Raw model response',
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* The exact lines the active section renders, including the empty-state placeholders. Exported
|
|
13
|
+
* (and pure) so `<App>` can compute the active section's length to clamp the scroll offset to
|
|
14
|
+
* its real maximum — keeping keyboard scrolling and the rendered viewport in agreement (TUI-C11).
|
|
15
|
+
*/
|
|
16
|
+
export function debugPanelLines({ subagents, historyLines, requestLines, responseLines, activeTab, }) {
|
|
17
|
+
return activeTab === 'subagents'
|
|
18
|
+
? subagentLines(subagents)
|
|
19
|
+
: activeTab === 'history'
|
|
20
|
+
? historyLines.length
|
|
21
|
+
? historyLines
|
|
22
|
+
: ['(no model call captured yet)']
|
|
23
|
+
: activeTab === 'request'
|
|
24
|
+
? requestLines.length
|
|
25
|
+
? requestLines
|
|
26
|
+
: ['(no request details captured yet)']
|
|
27
|
+
: responseLines.length
|
|
28
|
+
? responseLines
|
|
29
|
+
: ['(no model response captured yet)'];
|
|
30
|
+
}
|
|
11
31
|
/** Flatten the subagent tree into renderable lines for the bounded viewport. */
|
|
12
32
|
function subagentLines(tree) {
|
|
13
33
|
if (tree.nodes.length === 0)
|
|
@@ -34,19 +54,13 @@ function subagentLines(tree) {
|
|
|
34
54
|
* Pure presentational: all state (tab, offset, focus) is owned by `<App>`.
|
|
35
55
|
*/
|
|
36
56
|
export function DebugPanel({ subagents, historyLines, requestLines, responseLines, activeTab, scrollOffset, focused, viewportHeight, maximized, }) {
|
|
37
|
-
const lines =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
? requestLines.length
|
|
45
|
-
? requestLines
|
|
46
|
-
: ['(no request details captured yet)']
|
|
47
|
-
: responseLines.length
|
|
48
|
-
? responseLines
|
|
49
|
-
: ['(no model response captured yet)'];
|
|
57
|
+
const lines = debugPanelLines({
|
|
58
|
+
subagents,
|
|
59
|
+
historyLines,
|
|
60
|
+
requestLines,
|
|
61
|
+
responseLines,
|
|
62
|
+
activeTab,
|
|
63
|
+
});
|
|
50
64
|
// Clamp the window into range so an offset left over from a longer section never blanks
|
|
51
65
|
// the viewport when switching to a shorter one.
|
|
52
66
|
const maxOffset = Math.max(0, lines.length - viewportHeight);
|
|
@@ -61,14 +75,14 @@ export function DebugPanel({ subagents, historyLines, requestLines, responseLine
|
|
|
61
75
|
// line range, an "N more below" / "— end —" marker, and an "▲ above" marker when scrolled.
|
|
62
76
|
const footer = overflow
|
|
63
77
|
? `${top + 1}-${bottom}/${lines.length}` +
|
|
64
|
-
(hasBelow ? ` ▼ ${lines.length - bottom} more below (
|
|
65
|
-
(hasAbove ? ' ▲ above (
|
|
78
|
+
(hasBelow ? ` ▼ ${lines.length - bottom} more below (↓)` : ' — end —') +
|
|
79
|
+
(hasAbove ? ' ▲ above (↑)' : '')
|
|
66
80
|
: `${lines.length} line${lines.length === 1 ? '' : 's'}`;
|
|
67
81
|
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: focused ? 'cyan' : 'gray', children: [_jsx(Box, { children: _jsx(Text, { children: DEBUG_TABS.map((tab) => {
|
|
68
82
|
const label = TAB_LABELS[tab];
|
|
69
83
|
return tab === activeTab ? (_jsx(Text, { color: "cyan", bold: true, children: ` ${label} ` }, tab)) : (_jsx(Text, { dimColor: true, children: ` ${label} ` }, tab));
|
|
70
84
|
}) }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: focused
|
|
71
|
-
? `[Tab: section ·
|
|
85
|
+
? `[Tab: section · ↑/↓: scroll · m: ${maximized ? 'restore' : 'maximise'} · Esc: unfocus]`
|
|
72
86
|
: '[/debug to hide]' }) }), _jsx(Box, { height: viewportHeight, overflow: "hidden", flexDirection: "column", children: visible.map((line, i) => (_jsx(Text, { children: line }, top + i))) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: footer }) })] }));
|
|
73
87
|
}
|
|
74
88
|
//# sourceMappingURL=DebugPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugPanel.js","sourceRoot":"","sources":["../../../src/tui/components/DebugPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAGnF,MAAM,UAAU,GAA6B;IAC3C,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE,gCAAgC;IACzC,QAAQ,EAAE,oBAAoB;CAC/B,CAAC;
|
|
1
|
+
{"version":3,"file":"DebugPanel.js","sourceRoot":"","sources":["../../../src/tui/components/DebugPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAGnF,MAAM,UAAU,GAA6B;IAC3C,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE,gCAAgC;IACzC,QAAQ,EAAE,oBAAoB;CAC/B,CAAC;AAgCF;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,SAAS,GACY;IACrB,OAAO,SAAS,KAAK,WAAW;QAC9B,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC;QAC1B,CAAC,CAAC,SAAS,KAAK,SAAS;YACvB,CAAC,CAAC,YAAY,CAAC,MAAM;gBACnB,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,CAAC,8BAA8B,CAAC;YACpC,CAAC,CAAC,SAAS,KAAK,SAAS;gBACvB,CAAC,CAAC,YAAY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CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,aACpF,KAAC,GAAG,cACF,KAAC,IAAI,cACF,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;wBACtB,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;wBAC9B,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CACzB,KAAC,IAAI,IAAW,KAAK,EAAC,MAAM,EAAC,IAAI,kBAC9B,IAAI,KAAK,GAAG,IADJ,GAAG,CAEP,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAW,QAAQ,kBACrB,IAAI,KAAK,GAAG,IADJ,GAAG,CAEP,CACR,CAAC;oBACJ,CAAC,CAAC,GACG,GACH,EAGN,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,QAAQ,kBACX,OAAO;wBACN,CAAC,CAAC,oCACE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAC1B,kBAAkB;wBACpB,CAAC,CAAC,kBAAkB,GACjB,GACH,EACN,KAAC,GAAG,IAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAC,QAAQ,EAAC,aAAa,EAAC,QAAQ,YAClE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,KAAC,IAAI,cAAgB,IAAI,IAAd,GAAG,GAAG,CAAC,CAAe,CAClC,CAAC,GACE,EAEN,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,QAAQ,kBAAE,MAAM,GAAQ,GAC1B,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Static, Text } from 'ink';
|
|
3
3
|
import { LiveTurn } from '#src/tui/components/LiveTurn.js';
|
|
4
4
|
import { Rule } from '#src/tui/components/Rule.js';
|
|
5
|
+
import { CommandNotice } from '#src/tui/components/CommandNotice.js';
|
|
5
6
|
/**
|
|
6
7
|
* Committed scrollback. Ink's `<Static>` writes each item exactly once, above the live
|
|
7
8
|
* region, so finished turns are never re-rendered (no flicker, native terminal scrollback).
|
|
@@ -28,6 +29,9 @@ function renderItem(item, toolsExpanded) {
|
|
|
28
29
|
return (_jsx(Box, { flexDirection: "column", children: _jsx(LiveTurn, { turn: item.turn, toolsExpanded: toolsExpanded }) }));
|
|
29
30
|
case 'system':
|
|
30
31
|
return (_jsx(Box, { children: _jsxs(Text, { dimColor: true, children: ["[", item.level, "] ", item.text] }) }));
|
|
32
|
+
case 'notice':
|
|
33
|
+
// Structured command feedback (TUI-C14): a noticeable title + explanatory body lines.
|
|
34
|
+
return _jsx(CommandNotice, { title: item.title, lines: item.lines, tone: item.tone });
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
//# sourceMappingURL=Transcript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transcript.js","sourceRoot":"","sources":["../../../src/tui/components/Transcript.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"Transcript.js","sourceRoot":"","sources":["../../../src/tui/components/Transcript.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,aAAa,GAAG,KAAK,GAKtB;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IAAI,CAAC,KAAK,QAAI,IAAI,CAAC,IAAI,IACpB,GACH,CACP,CAAC;QACJ,KAAK,QAAQ;YACX,sFAAsF;YACtF,OAAO,KAAC,aAAa,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CAAC;IACpF,CAAC;AACH,CAAC"}
|
|
@@ -15,13 +15,33 @@ export interface SlashCommandContext {
|
|
|
15
15
|
modelDisplayName: string;
|
|
16
16
|
/** Count of committed turns so far (for `/help`-style introspection if needed). */
|
|
17
17
|
turnCount: number;
|
|
18
|
+
/** Whether tool-call panels currently show their full args/result (drives `/tools` copy). */
|
|
19
|
+
toolsExpanded: boolean;
|
|
20
|
+
/** Whether the docked debug panel is currently shown (drives `/debug` copy). */
|
|
21
|
+
debugVisible: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A structured, noticeable command-feedback block (TUI-C14): a title that states WHAT happened
|
|
25
|
+
* plus body lines explaining HOW it affects the user. The component renders these via
|
|
26
|
+
* `<CommandNotice>` so every command gives consistent, explanatory feedback.
|
|
27
|
+
*/
|
|
28
|
+
export interface SlashCommandNotice {
|
|
29
|
+
title: string;
|
|
30
|
+
lines: string[];
|
|
31
|
+
/** Title tone; defaults to 'info' (cyan). Use 'warn' (yellow) for unknown commands. */
|
|
32
|
+
tone?: 'info' | 'warn';
|
|
18
33
|
}
|
|
19
34
|
/**
|
|
20
35
|
* The effects a dispatched command can request. The component interprets these; the command
|
|
21
36
|
* itself stays pure (no React, no I/O) so it is trivially testable.
|
|
22
37
|
*/
|
|
23
38
|
export interface SlashCommandResult {
|
|
24
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* A structured notice to commit into the transcript (the command's user-visible feedback).
|
|
41
|
+
* Preferred over `message` for all commands so feedback is consistent and noticeable (TUI-C14).
|
|
42
|
+
*/
|
|
43
|
+
notice?: SlashCommandNotice;
|
|
44
|
+
/** A terse system line (incidental/error output); commands prefer `notice`. */
|
|
25
45
|
message?: string;
|
|
26
46
|
/** Level for the system line; defaults to 'info'. */
|
|
27
47
|
level?: string;
|
|
@@ -53,13 +73,23 @@ export interface ParsedSlashCommand {
|
|
|
53
73
|
* whitespace-separated tokens are the args.
|
|
54
74
|
*/
|
|
55
75
|
export declare function parseSlashCommand(input: string): ParsedSlashCommand | null;
|
|
76
|
+
/**
|
|
77
|
+
* The notice for the tool-detail toggle, given the RESULTING (post-toggle) state. Shared by the
|
|
78
|
+
* `/tools` command and the Ctrl+T key handler so the copy is single-sourced (TUI-C14).
|
|
79
|
+
*/
|
|
80
|
+
export declare function toolsToggleNotice(expanded: boolean): SlashCommandNotice;
|
|
81
|
+
/**
|
|
82
|
+
* The notice for the debug-panel toggle, given the RESULTING (post-toggle) state. Shared so the
|
|
83
|
+
* command reports exactly the state the component will apply.
|
|
84
|
+
*/
|
|
85
|
+
export declare function debugToggleNotice(visible: boolean): SlashCommandNotice;
|
|
56
86
|
/**
|
|
57
87
|
* Build the default command registry. Returns a fresh array each call so callers may push
|
|
58
88
|
* extension commands onto it (EXT-5) without sharing mutable module state.
|
|
59
89
|
*/
|
|
60
90
|
export declare function createCommandRegistry(): SlashCommand[];
|
|
61
|
-
/**
|
|
62
|
-
export declare function formatHelp(registry: SlashCommand[]):
|
|
91
|
+
/** Build the `/help` notice from a registry: one body line per command (`/name — description`). */
|
|
92
|
+
export declare function formatHelp(registry: SlashCommand[]): SlashCommandNotice;
|
|
63
93
|
/**
|
|
64
94
|
* Dispatch a parsed command against a registry. Unknown commands return a friendly hint
|
|
65
95
|
* rather than throwing, so the component can render it as a system line and never forward
|
|
@@ -24,6 +24,48 @@ export function parseSlashCommand(input) {
|
|
|
24
24
|
const [name, ...args] = tokens;
|
|
25
25
|
return { name: name.toLowerCase(), args };
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The notice for the tool-detail toggle, given the RESULTING (post-toggle) state. Shared by the
|
|
29
|
+
* `/tools` command and the Ctrl+T key handler so the copy is single-sourced (TUI-C14).
|
|
30
|
+
*/
|
|
31
|
+
export function toolsToggleNotice(expanded) {
|
|
32
|
+
return expanded
|
|
33
|
+
? {
|
|
34
|
+
title: 'Tool details: on',
|
|
35
|
+
lines: [
|
|
36
|
+
'Tool calls now show their full inputs and results in the chat history.',
|
|
37
|
+
'Applies to new turns — run /tools again to collapse them to summaries.',
|
|
38
|
+
],
|
|
39
|
+
}
|
|
40
|
+
: {
|
|
41
|
+
title: 'Tool details: off',
|
|
42
|
+
lines: [
|
|
43
|
+
'Tool calls now show as a single summary line in the chat history.',
|
|
44
|
+
'Applies to new turns — run /tools again to show full inputs and results.',
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The notice for the debug-panel toggle, given the RESULTING (post-toggle) state. Shared so the
|
|
50
|
+
* command reports exactly the state the component will apply.
|
|
51
|
+
*/
|
|
52
|
+
export function debugToggleNotice(visible) {
|
|
53
|
+
return visible
|
|
54
|
+
? {
|
|
55
|
+
title: 'Debug panel: shown',
|
|
56
|
+
lines: [
|
|
57
|
+
'Docked panel with the subagent tree and sent-to-model / raw-response views.',
|
|
58
|
+
'Run /debug again to hide it; Tab cycles its views.',
|
|
59
|
+
],
|
|
60
|
+
}
|
|
61
|
+
: {
|
|
62
|
+
title: 'Debug panel: hidden',
|
|
63
|
+
lines: [
|
|
64
|
+
'The docked subagent + debug views are now closed.',
|
|
65
|
+
'Run /debug again to bring them back.',
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
27
69
|
/**
|
|
28
70
|
* Build the default command registry. Returns a fresh array each call so callers may push
|
|
29
71
|
* extension commands onto it (EXT-5) without sharing mutable module state.
|
|
@@ -40,17 +82,21 @@ export function createCommandRegistry() {
|
|
|
40
82
|
{
|
|
41
83
|
name: 'clear',
|
|
42
84
|
description: 'Clear the transcript',
|
|
43
|
-
|
|
85
|
+
// The visible feedback is the live-frame <ClearBanner> (rendered outside <Static> so it
|
|
86
|
+
// survives the transcript wipe), so no committed notice here.
|
|
87
|
+
run: () => ({ clearTranscript: true }),
|
|
44
88
|
},
|
|
45
89
|
{
|
|
46
90
|
name: 'debug',
|
|
47
91
|
description: 'Toggle the docked subagents + debug panel',
|
|
48
|
-
|
|
92
|
+
// State-aware: report the notice for the state the toggle will land on (the inverse of now).
|
|
93
|
+
run: (ctx) => ({ toggleDebug: true, notice: debugToggleNotice(!ctx.debugVisible) }),
|
|
49
94
|
},
|
|
50
95
|
{
|
|
51
96
|
name: 'tools',
|
|
52
97
|
description: 'Toggle tool-call detail (collapsed summary ⇄ expanded args/result)',
|
|
53
|
-
|
|
98
|
+
// State-aware: report the notice for the state the toggle will land on (the inverse of now).
|
|
99
|
+
run: (ctx) => ({ toggleTools: true, notice: toolsToggleNotice(!ctx.toolsExpanded) }),
|
|
54
100
|
},
|
|
55
101
|
{
|
|
56
102
|
name: 'exit',
|
|
@@ -60,19 +106,37 @@ export function createCommandRegistry() {
|
|
|
60
106
|
{
|
|
61
107
|
name: 'mode',
|
|
62
108
|
description: 'Show the current session mode',
|
|
63
|
-
run: (ctx) => ({
|
|
109
|
+
run: (ctx) => ({
|
|
110
|
+
notice: {
|
|
111
|
+
title: `Session mode: ${ctx.mode}`,
|
|
112
|
+
lines: [
|
|
113
|
+
'This is how the agent handles your messages this session.',
|
|
114
|
+
'Restart with a different subcommand to change it (e.g. `gth chat`).',
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
}),
|
|
64
118
|
},
|
|
65
119
|
{
|
|
66
120
|
name: 'model',
|
|
67
121
|
description: 'Show the current model / provider',
|
|
68
|
-
run: (ctx) => ({
|
|
122
|
+
run: (ctx) => ({
|
|
123
|
+
notice: {
|
|
124
|
+
title: `Model: ${ctx.modelDisplayName || 'unknown'}`,
|
|
125
|
+
lines: [
|
|
126
|
+
'This is the model answering your messages this session.',
|
|
127
|
+
'Change the default via `gth init` or your gsloth config.',
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
69
131
|
},
|
|
70
132
|
];
|
|
71
133
|
}
|
|
72
|
-
/**
|
|
134
|
+
/** Build the `/help` notice from a registry: one body line per command (`/name — description`). */
|
|
73
135
|
export function formatHelp(registry) {
|
|
74
|
-
|
|
75
|
-
|
|
136
|
+
return {
|
|
137
|
+
title: 'Slash commands',
|
|
138
|
+
lines: registry.map((c) => `/${c.name} — ${c.description}`),
|
|
139
|
+
};
|
|
76
140
|
}
|
|
77
141
|
/**
|
|
78
142
|
* Dispatch a parsed command against a registry. Unknown commands return a friendly hint
|
|
@@ -81,11 +145,17 @@ export function formatHelp(registry) {
|
|
|
81
145
|
*/
|
|
82
146
|
export function dispatchSlashCommand(parsed, registry, ctx) {
|
|
83
147
|
if (parsed.name === 'help') {
|
|
84
|
-
return {
|
|
148
|
+
return { notice: formatHelp(registry) };
|
|
85
149
|
}
|
|
86
150
|
const command = registry.find((c) => c.name === parsed.name);
|
|
87
151
|
if (!command) {
|
|
88
|
-
return {
|
|
152
|
+
return {
|
|
153
|
+
notice: {
|
|
154
|
+
title: `Unknown command: /${parsed.name}`,
|
|
155
|
+
lines: ["That isn't a recognized slash command.", 'Run /help to see everything available.'],
|
|
156
|
+
tone: 'warn',
|
|
157
|
+
},
|
|
158
|
+
};
|
|
89
159
|
}
|
|
90
160
|
return command.run(ctx, parsed.args);
|
|
91
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommands.js","sourceRoot":"","sources":["../../src/tui/slashCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"slashCommands.js","sourceRoot":"","sources":["../../src/tui/slashCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiEH;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC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;oBACpD,KAAK,EAAE;wBACL,yDAAyD;wBACzD,0DAA0D;qBAC3D;iBACF;aACF,CAAC;SACH;KACF,CAAC;AACJ,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,UAAU,CAAC,QAAwB;IACjD,OAAO;QACL,KAAK,EAAE,gBAAgB;QACvB,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAA0B,EAC1B,QAAwB,EACxB,GAAwB;IAExB,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3B,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC1C,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE;gBACN,KAAK,EAAE,qBAAqB,MAAM,CAAC,IAAI,EAAE;gBACzC,KAAK,EAAE,CAAC,wCAAwC,EAAE,wCAAwC,CAAC;gBAC3F,IAAI,EAAE,MAAM;aACb;SACF,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal sequence that "bumps up" the screen like `clear`/Ctrl+L while *preserving*
|
|
3
|
+
* scrollback. We deliberately do NOT emit the clear-scrollback escape `ESC[3J` (which would
|
|
4
|
+
* destroy history and defeat the point):
|
|
5
|
+
* - First push a screenful of newlines so the prior content scrolls up and out of the
|
|
6
|
+
* visible viewport — but stays reachable by scrolling/wheeling up (it lives in scrollback).
|
|
7
|
+
* - Then home the cursor (`ESC[H`) and clear from the cursor to the end of the *visible*
|
|
8
|
+
* screen (`ESC[J`, i.e. `ESC[0J`) so what re-renders lands cleanly at the top with no
|
|
9
|
+
* artifacts.
|
|
10
|
+
* `rows` is the live terminal height; we fall back to a sensible default when it is unknown.
|
|
11
|
+
*
|
|
12
|
+
* Used both by `/clear` (TUI-C12) and on interactive launch (TUI-C13).
|
|
13
|
+
*/
|
|
14
|
+
export declare function viewportBumpSequence(rows: number | undefined): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal sequence that "bumps up" the screen like `clear`/Ctrl+L while *preserving*
|
|
3
|
+
* scrollback. We deliberately do NOT emit the clear-scrollback escape `ESC[3J` (which would
|
|
4
|
+
* destroy history and defeat the point):
|
|
5
|
+
* - First push a screenful of newlines so the prior content scrolls up and out of the
|
|
6
|
+
* visible viewport — but stays reachable by scrolling/wheeling up (it lives in scrollback).
|
|
7
|
+
* - Then home the cursor (`ESC[H`) and clear from the cursor to the end of the *visible*
|
|
8
|
+
* screen (`ESC[J`, i.e. `ESC[0J`) so what re-renders lands cleanly at the top with no
|
|
9
|
+
* artifacts.
|
|
10
|
+
* `rows` is the live terminal height; we fall back to a sensible default when it is unknown.
|
|
11
|
+
*
|
|
12
|
+
* Used both by `/clear` (TUI-C12) and on interactive launch (TUI-C13).
|
|
13
|
+
*/
|
|
14
|
+
export function viewportBumpSequence(rows) {
|
|
15
|
+
const height = rows && rows > 0 ? rows : 24;
|
|
16
|
+
// newlines (bump prior content into scrollback) + cursor home + clear-to-end-of-visible-screen.
|
|
17
|
+
// NOTE: `\x1b[J` is clear-to-end-of-screen (NOT `\x1b[3J`, which would erase scrollback).
|
|
18
|
+
return '\n'.repeat(height) + '\x1b[H' + '\x1b[J';
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../src/tui/terminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAwB;IAC3D,MAAM,MAAM,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,gGAAgG;IAChG,0FAA0F;IAC1F,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACnD,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { GthAgentRunner } from '@gaunt-sloth/core/core/GthAgentRunner.js';
|
|
|
5
5
|
import { StatusLevel } from '@gaunt-sloth/core/core/types.js';
|
|
6
6
|
import { flushSessionLog, initSessionLogging, stopSessionLogging, } from '@gaunt-sloth/core/utils/consoleUtils.js';
|
|
7
7
|
import { appendToFile, getCommandOutputFilePath } from '@gaunt-sloth/core/utils/fileUtils.js';
|
|
8
|
-
import { env } from '@gaunt-sloth/core/utils/systemUtils.js';
|
|
8
|
+
import { env, stdout } from '@gaunt-sloth/core/utils/systemUtils.js';
|
|
9
9
|
import { HumanMessage } from '@langchain/core/messages';
|
|
10
10
|
import { MemorySaver } from '@langchain/langgraph';
|
|
11
11
|
import { createResolvers } from '@gaunt-sloth/agent/resolvers.js';
|
|
@@ -13,6 +13,7 @@ import { gthDeepAgentFactory } from '@gaunt-sloth/agent/core/gthDeepAgentFactory
|
|
|
13
13
|
import { GthDeepAgent } from '@gaunt-sloth/agent/core/GthDeepAgent.js';
|
|
14
14
|
import { App } from '#src/tui/components/App.js';
|
|
15
15
|
import { renderHistory, renderRequestDetails, renderResponse } from '#src/tui/debugRender.js';
|
|
16
|
+
import { viewportBumpSequence } from '#src/tui/terminal.js';
|
|
16
17
|
/** Fan-out so the runner's status callback can reach the mounted React app. */
|
|
17
18
|
function createStatusBridge() {
|
|
18
19
|
const listeners = new Set();
|
|
@@ -72,7 +73,11 @@ export async function createTuiSession(sessionConfig, commandLineConfigOverrides
|
|
|
72
73
|
const fixturePath = env.GTH_TUI_E2E_FIXTURE;
|
|
73
74
|
if (fixturePath) {
|
|
74
75
|
const { createFixtureTuiAgent } = await import('#src/tui/fixtureAgent.js');
|
|
75
|
-
|
|
76
|
+
// Holder so `onResetFrame` can reach the not-yet-created render instance (App writes the
|
|
77
|
+
// /clear scroll/clear escapes itself, then asks Ink to forget its last frame — TUI-C12).
|
|
78
|
+
let resetFrame;
|
|
79
|
+
const instance = render(_jsx(App, { agent: createFixtureTuiAgent(fixturePath), mode: sessionConfig.mode, readyMessage: sessionConfig.readyMessage, exitMessage: sessionConfig.exitMessage, initialMessage: message, onResetFrame: () => resetFrame?.() }));
|
|
80
|
+
resetFrame = () => instance.clear();
|
|
76
81
|
await instance.waitUntilExit();
|
|
77
82
|
return;
|
|
78
83
|
}
|
|
@@ -105,11 +110,29 @@ export async function createTuiSession(sessionConfig, commandLineConfigOverrides
|
|
|
105
110
|
async *runTurn(userInput, signal) {
|
|
106
111
|
yield* runner.processMessagesWithEvents([new HumanMessage(userInput)], signal);
|
|
107
112
|
},
|
|
113
|
+
// `/clear` rotates the runner's thread_id so the model context truly matches the
|
|
114
|
+
// cleared transcript (the checkpointer otherwise replays the whole prior conversation).
|
|
115
|
+
resetThread() {
|
|
116
|
+
runner.resetThread();
|
|
117
|
+
},
|
|
108
118
|
};
|
|
109
|
-
|
|
119
|
+
// "Bump up" the screen on launch the clear/Ctrl+L way (TUI-C13): scroll whatever was on
|
|
120
|
+
// screen before `gth`/`gsloth` ran up and out of the visible viewport (it stays in
|
|
121
|
+
// scrollback — we never emit ESC[3J) so the session opens at a clean top. We write this
|
|
122
|
+
// BEFORE render() so Ink paints its first frame at the top with no frame accounting to
|
|
123
|
+
// reset. Guarded on isTTY so piped/redirected/non-TTY runs (and tests) are not polluted.
|
|
124
|
+
if (stdout.isTTY) {
|
|
125
|
+
stdout.write(viewportBumpSequence(stdout.rows));
|
|
126
|
+
}
|
|
127
|
+
// Holder so `onResetFrame` can reach the not-yet-created render instance: on /clear the App
|
|
128
|
+
// writes the scroll/viewport-clear escapes, then calls this to make Ink forget its last
|
|
129
|
+
// frame so the re-render lands cleanly at the top (TUI-C12).
|
|
130
|
+
let resetFrame;
|
|
131
|
+
const instance = render(_jsx(App, { agent: tuiAgent, mode: sessionConfig.mode, modelDisplayName: config.modelDisplayName, readyMessage: sessionConfig.readyMessage, exitMessage: sessionConfig.exitMessage, initialMessage: message, subscribeStatus: bridge.subscribe, subscribeDebug: debugBridge.subscribe, onTurnComplete: logTurn, onResetFrame: () => resetFrame?.(), onExit: async () => {
|
|
110
132
|
await runner.cleanup();
|
|
111
133
|
stopSessionLogging();
|
|
112
134
|
} }));
|
|
135
|
+
resetFrame = () => instance.clear();
|
|
113
136
|
await instance.waitUntilExit();
|
|
114
137
|
}
|
|
115
138
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuiSessionModule.js","sourceRoot":"","sources":["../../src/tui/tuiSessionModule.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAmC,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,GAAG,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"tuiSessionModule.js","sourceRoot":"","sources":["../../src/tui/tuiSessionModule.tsx"],"names":[],"mappings":";AACA,OAAO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,CAAC,SAAS,EACjC,cAAc,EAAE,WAAW,CAAC,SAAS,EACrC,cAAc,EAAE,OAAO,EACvB,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE,EAClC,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;gBACvB,kBAAkB,EAAE,CAAC;YACvB,CAAC,GACD,CACH,CAAC;QACF,UAAU,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEpC,MAAM,QAAQ,CAAC,aAAa,EAAE,CAAC;IACjC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACvB,kBAAkB,EAAE,CAAC;QACrB,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/tui/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentStreamEvent } from '@gaunt-sloth/core/core/types.js';
|
|
2
2
|
import type { TurnViewModel } from '#src/tui/viewModel.js';
|
|
3
|
+
import type { CommandNoticeTone } from '#src/tui/components/CommandNotice.js';
|
|
3
4
|
/**
|
|
4
5
|
* The minimal agent surface the Ink `<App>` drives. Decoupling the component from
|
|
5
6
|
* `GthAgentRunner` keeps the UI unit-testable with a scripted fake (a generator that
|
|
@@ -8,6 +9,12 @@ import type { TurnViewModel } from '#src/tui/viewModel.js';
|
|
|
8
9
|
export interface TuiAgent {
|
|
9
10
|
/** Run one user turn, yielding typed events; aborts when `signal` fires (Esc). */
|
|
10
11
|
runTurn(userInput: string, signal: AbortSignal): AsyncGenerator<AgentStreamEvent>;
|
|
12
|
+
/**
|
|
13
|
+
* Reset the agent's conversation thread so subsequent turns start from an empty model
|
|
14
|
+
* context — wired to the TUI's `/clear`, which only clears the on-screen transcript.
|
|
15
|
+
* Optional so the fixture agent (no real checkpointer thread) may omit it.
|
|
16
|
+
*/
|
|
17
|
+
resetThread?(): void;
|
|
11
18
|
}
|
|
12
19
|
/**
|
|
13
20
|
* One debug capture from the deep agent's `wrapModelCall` middleware. `kind: 'request'`
|
|
@@ -38,6 +45,12 @@ export type TranscriptItem = {
|
|
|
38
45
|
id: number;
|
|
39
46
|
level: string;
|
|
40
47
|
text: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'notice';
|
|
50
|
+
id: number;
|
|
51
|
+
title: string;
|
|
52
|
+
lines: string[];
|
|
53
|
+
tone: CommandNoticeTone;
|
|
41
54
|
};
|
|
42
55
|
/** Props for the root `<App>`; the real session wires these to a `GthAgentRunner`. */
|
|
43
56
|
export interface TuiAppProps {
|
|
@@ -61,6 +74,13 @@ export interface TuiAppProps {
|
|
|
61
74
|
subscribeDebug?: (cb: (capture: TuiDebugCapture) => void) => () => void;
|
|
62
75
|
/** Called once a turn finishes, with the user input and the final assistant text. */
|
|
63
76
|
onTurnComplete?: (userInput: string, assistantText: string) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Reset Ink's frame accounting after `/clear` has scrolled the viewport (production wires this
|
|
79
|
+
* to the `render()` instance's `clear()`). The app writes the scroll/clear escapes itself, then
|
|
80
|
+
* calls this so Ink forgets its last-rendered output and re-renders cleanly at the top — without
|
|
81
|
+
* it Ink would diff against a now-stale frame and leave artifacts. Optional (tests / fixtures).
|
|
82
|
+
*/
|
|
83
|
+
onResetFrame?: () => void;
|
|
64
84
|
/** Called on `exit`/`/exit` (or quit) for cleanup before the app unmounts. */
|
|
65
85
|
onExit?: () => void | Promise<void>;
|
|
66
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gaunt-sloth",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Andrew Kondratev",
|
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
"node": ">=24.0.0",
|
|
27
27
|
"npm": ">=11.0.0"
|
|
28
28
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build": "tsc",
|
|
31
|
-
"prepack": "tsc"
|
|
32
|
-
},
|
|
33
29
|
"bin": {
|
|
34
30
|
"gaunt-sloth-assistant": "cli.js",
|
|
35
31
|
"gaunt-sloth": "cli.js",
|
|
@@ -37,17 +33,19 @@
|
|
|
37
33
|
"gth": "cli.js"
|
|
38
34
|
},
|
|
39
35
|
"dependencies": {
|
|
40
|
-
"@gaunt-sloth/agent": "2.0.0-alpha.0",
|
|
41
|
-
"@gaunt-sloth/core": "2.0.0-alpha.0",
|
|
42
|
-
"@gaunt-sloth/review": "2.0.0-alpha.0",
|
|
43
36
|
"@langchain/anthropic": "^1.5.0",
|
|
44
37
|
"@langchain/core": "^1.2.0",
|
|
45
38
|
"@langchain/deepseek": "^1.1.1",
|
|
46
39
|
"@langchain/google": "^0.2.0",
|
|
47
40
|
"@langchain/groq": "^1.3.0",
|
|
41
|
+
"@langchain/langgraph": "^1.4.4",
|
|
48
42
|
"@langchain/openai": "^1.5.1",
|
|
49
43
|
"@langchain/xai": "^1.4.1",
|
|
50
|
-
"commander": "^15.0.0"
|
|
44
|
+
"commander": "^15.0.0",
|
|
45
|
+
"zod": "^3.25.0 || ^4.0.0",
|
|
46
|
+
"@gaunt-sloth/agent": "2.0.0-alpha.2",
|
|
47
|
+
"@gaunt-sloth/review": "2.0.0-alpha.2",
|
|
48
|
+
"@gaunt-sloth/core": "2.0.0-alpha.2"
|
|
51
49
|
},
|
|
52
50
|
"optionalDependencies": {
|
|
53
51
|
"chalk": "^5.6.2",
|
|
@@ -75,5 +73,8 @@
|
|
|
75
73
|
],
|
|
76
74
|
"publishConfig": {
|
|
77
75
|
"tag": "alpha"
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "tsc"
|
|
78
79
|
}
|
|
79
|
-
}
|
|
80
|
+
}
|